aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorFilip Komar <filip@mageia.org>2014-03-16 21:39:10 +0000
committerFilip Komar <filip@mageia.org>2014-03-16 21:39:10 +0000
commit735324e68f267359a834cefdeb107a415080c6b9 (patch)
tree8f4574e2ebb38c4ea56fb2424ec57b524f4f9dac /tools
parentde07ef83d4ceb206a30d7bf6dbab6323bc0b02b1 (diff)
downloadwww-735324e68f267359a834cefdeb107a415080c6b9.tar
www-735324e68f267359a834cefdeb107a415080c6b9.tar.gz
www-735324e68f267359a834cefdeb107a415080c6b9.tar.bz2
www-735324e68f267359a834cefdeb107a415080c6b9.tar.xz
www-735324e68f267359a834cefdeb107a415080c6b9.zip
page about/code-of-conduct converted to gettext + charset bugfix
Diffstat (limited to 'tools')
-rw-r--r--tools/extract2gettext.php2
-rwxr-xr-xtools/rebuild_gettext_catalogs.sh19
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