diff options
author | Filip Komar <filip@mageia.org> | 2014-03-13 21:28:06 +0000 |
---|---|---|
committer | Filip Komar <filip@mageia.org> | 2014-03-13 21:28:06 +0000 |
commit | 981aa2995e5c7f2d271a4a680568ff22a396fd2d (patch) | |
tree | 9fe5196548ed178949b8c1f193b86bf5c5a047be /tools | |
parent | 709b49c6c3d017c47765a5304b4aa59d49a50698 (diff) | |
download | www-981aa2995e5c7f2d271a4a680568ff22a396fd2d.tar www-981aa2995e5c7f2d271a4a680568ff22a396fd2d.tar.gz www-981aa2995e5c7f2d271a4a680568ff22a396fd2d.tar.bz2 www-981aa2995e5c7f2d271a4a680568ff22a396fd2d.tar.xz www-981aa2995e5c7f2d271a4a680568ff22a396fd2d.zip |
page community converted to gettext + bug fix (sorry for nonatomic commit)
Diffstat (limited to 'tools')
-rw-r--r-- | tools/extract2gettext.php | 2 | ||||
-rwxr-xr-x | tools/rebuild_gettext_catalogs.sh | 4 | ||||
-rw-r--r-- | tools/translated_converter.py | 2 |
3 files changed, 5 insertions, 3 deletions
diff --git a/tools/extract2gettext.php b/tools/extract2gettext.php index 1cbdb3a17..55f841a0f 100644 --- a/tools/extract2gettext.php +++ b/tools/extract2gettext.php @@ -113,7 +113,7 @@ foreach ($strings as $domain => $strs) { foreach ($strs as $str => $info) { $str = str_replace(array("\'", '"'), array("'", '\"'), $str); - $f[] = sprintf('msgctxt "%s"', $info[0]); + $f[] = sprintf('#: "%s"', $info[0]); // location of string in the source (#: reference...) $f[] = 'msgid "' . $str . '"'; $f[] = 'msgstr ""'; $f[] = ''; diff --git a/tools/rebuild_gettext_catalogs.sh b/tools/rebuild_gettext_catalogs.sh index afe8564af..50e3331b0 100755 --- a/tools/rebuild_gettext_catalogs.sh +++ b/tools/rebuild_gettext_catalogs.sh @@ -16,6 +16,7 @@ fi for resource in "${!resources[@]}" do + difference= if [ -f ./langs/en/$resource.pot ]; then # do a temporary copy cp ./langs/en/$resource.pot ./langs/en/$resource.copy fi @@ -30,6 +31,7 @@ do if [ $? -eq 1 ]; then # there are differences errors[$php_source]=0 mv ./langs/en/$resource.tmp ./langs/en/$resource.pot + echo Changes in ./langs/en/$resource.pot else # Cleanup as there are no changes in $resource errors[$php_source]=5 rm ./langs/en/$resource.tmp @@ -54,7 +56,7 @@ do fi if [ -f $directory/$resource.po ] && [ -z $difference ]; then # update po file if it exists # msgfmt --statistics --verbose -c $directory/$resource.po -o /dev/null # usefull for debuging (msgctxt "/web/en/ or msgctxt "en/) - echo merging $directory + echo merging $directory/$resource.po msgmerge --quiet --no-wrap $directory/$resource.po ./langs/en/$resource.pot > $directory/$resource.tmp msgmerge_error_level=$? # catch msgmerge error level mv $directory/$resource.tmp $directory/$resource.po diff --git a/tools/translated_converter.py b/tools/translated_converter.py index 58e9d9bb5..6418ababd 100644 --- a/tools/translated_converter.py +++ b/tools/translated_converter.py @@ -74,7 +74,7 @@ for langfile in glob.glob(file_mask): # Strip ';' from msgid message_id = message_id.lstrip(';') potentry = polib.POEntry( - msgctxt = message_comment, +# msgctxt = message_comment, msgid = message_id.decode('utf-8'), msgstr = message_str.decode('utf-8'), occurrences=[(langfile,'')] |