diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2013-07-11 21:31:02 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2013-07-11 21:31:02 -0500 |
commit | 37693913f0f15d339388ffe89cfce74c2ba4350d (patch) | |
tree | 8612f1f59f6560278a9dba5cf05832f1ebb9bf31 /updatepo | |
parent | d40da5242554e36f1c52a1ba6eb4d74da8cc3c28 (diff) | |
download | experimental-37693913f0f15d339388ffe89cfce74c2ba4350d.tar.gz experimental-37693913f0f15d339388ffe89cfce74c2ba4350d.zip |
Add experimental script to update po files in a module from the latest source file contents
Diffstat (limited to 'updatepo')
-rwxr-xr-x | updatepo/update_translation_lines | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/updatepo/update_translation_lines b/updatepo/update_translation_lines new file mode 100755 index 0000000..8c3c0e1 --- /dev/null +++ b/updatepo/update_translation_lines @@ -0,0 +1,22 @@ +#!/bin/bash + +if [[ $1 == "" ]]; then + THISSCRIPT=$(readlink -f $0) + + if [[ ! -e "$THISSCRIPT" ]]; then + echo "Unable to find myself! Exiting..." + exit 1 + fi + + find . -type f -iname "*.po" -exec $THISSCRIPT {} \; + exit 0 +else + # Originally from Stack Overflow + # http://stackoverflow.com/a/7497395 + # Tweaked by Timothy Pearson <kb9vqf@pearsoncomputing.net> for TDE + echo '' > messages.po # xgettext needs that file, and we need it empty + find . -type f -iname "*.cpp" -o -type f -iname "*.cc" | xgettext --keyword=i18n --keyword=i18nM --keyword=i18nP:1,2 -j -f - + msgmerge -N $1 messages.po > new.po + mv new.po $1 + rm messages.po +fi |