diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/extract2gettext.php | 2 | ||||
-rwxr-xr-x | tools/rebuild_gettext_catalogs.sh | 19 |
2 files changed, 17 insertions, 4 deletions
diff --git a/tools/extract2gettext.php b/tools/extract2gettext.php index 55f841a0f..a140195c3 100644 --- a/tools/extract2gettext.php +++ b/tools/extract2gettext.php @@ -107,7 +107,7 @@ foreach ($strings as $domain => $strs) { $f[] = '"Language-Team: LANGUAGE <LL@li.org>\n"'; $f[] = '"Language: \n"'; $f[] = '"MIME-Version: 1.0\n"'; - $f[] = '"Content-Type: text/plain; charset=CHARSET\n"'; + $f[] = '"Content-Type: text/plain; charset=UTF-8\n"'; // CHARSET $f[] = '"Content-Transfer-Encoding: 8bit\n"'; $f[] = ''; diff --git a/tools/rebuild_gettext_catalogs.sh b/tools/rebuild_gettext_catalogs.sh index 50e3331b0..6de1bf567 100755 --- a/tools/rebuild_gettext_catalogs.sh +++ b/tools/rebuild_gettext_catalogs.sh @@ -26,7 +26,12 @@ do errors[$php_source]=$php_error_level if [ -f ./langs/en/$resource.pot ]; then # msgmerge check of generated pot file msgmerge --quiet --no-wrap ./langs/en/$resource.pot ./langs/en/$resource.pot > ./langs/en/$resource.tmp - if [ -f ./langs/en/$resource.copy ]; then + msgmerge_error_level=$? # catch msgmerge error level + if [ $msgmerge_error_level -gt 0 ]; then # on failure stop the process for this resource + errors[$php_source]=$msgmerge_error_level + rm ./langs/en/$resource.tmp + fi + if [ -f ./langs/en/$resource.copy ] && [ -f ./langs/en/$resource.tmp ]; then diff --ignore-matching-lines='^"POT-Creation-Date:' ./langs/en/$resource.tmp ./langs/en/$resource.copy if [ $? -eq 1 ]; then # there are differences errors[$php_source]=0 @@ -38,8 +43,16 @@ do mv ./langs/en/$resource.copy ./langs/en/$resource.pot difference=none fi - else - mv ./langs/en/$resource.tmp ./langs/en/$resource.pot + else # diff not possible + if [ -f ./langs/en/$resource.tmp ]; then + mv ./langs/en/$resource.tmp ./langs/en/$resource.pot + else + rm ./langs/en/$resource.pot + if [ -f ./langs/en/$resource.copy ]; then + mv ./langs/en/$resource.copy ./langs/en/$resource.pot + difference=none + fi + fi fi for directory in ./langs/* do |