aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorFilip Komar <filip@mageia.org>2014-03-09 20:17:02 +0000
committerFilip Komar <filip@mageia.org>2014-03-09 20:17:02 +0000
commitdb044d313042734d341ff1b22c50d8867176a0d0 (patch)
treeb396ac2ff0fecce86a303e67a775fb2eed5b1233 /tools
parent860178e777d469b751c4f09e5009345aa7599a27 (diff)
downloadwww-db044d313042734d341ff1b22c50d8867176a0d0.tar
www-db044d313042734d341ff1b22c50d8867176a0d0.tar.gz
www-db044d313042734d341ff1b22c50d8867176a0d0.tar.bz2
www-db044d313042734d341ff1b22c50d8867176a0d0.tar.xz
www-db044d313042734d341ff1b22c50d8867176a0d0.zip
about/reports page first migrated to gettext system + small bugfix of toolchain needed
Diffstat (limited to 'tools')
-rw-r--r--tools/extract2gettext.php4
-rwxr-xr-xtools/rebuild_gettext_catalogs.sh2
-rw-r--r--tools/translated_converter.py2
3 files changed, 5 insertions, 3 deletions
diff --git a/tools/extract2gettext.php b/tools/extract2gettext.php
index 424bb9172..8eff15de0 100644
--- a/tools/extract2gettext.php
+++ b/tools/extract2gettext.php
@@ -70,7 +70,7 @@ foreach ($out as $str) {
if (preg_match_all('/\_(g|r)\(\'(.+)\'/imU', $arr, $reg)) { // i=PCRE_CASELESS, m=PCRE_MULTILINE, U=PCRE_UNGREEDY
foreach ($reg[2] as $found) {
$found = str_replace('_apostrophe_', '\'', $found);
- $strings[$domain][$found][] = $file . ' +' . $line;
+ $strings[$domain][$found][] = '/web/' . $file . ' +' . $line;
}
}
else {
@@ -87,7 +87,7 @@ foreach ($strings as $domain => $strs) {
$f[] = '# This file is distributed under the same license as';
$f[] = '# the content of the corresponding web page(s).';
$f[] = '#';
- $f[] = sprintf('# Generated by extract2gettext.php on %s', $cur_date = date('Y m d H:i:sO'));
+ $f[] = sprintf('# Generated by extract2gettext.php on %s', $cur_date = date('Y-m-d H:i:sO'));
$f[] = sprintf('# Domain: %s', $domain);
$f[] = '#';
$f[] = '# include translation strings from:';
diff --git a/tools/rebuild_gettext_catalogs.sh b/tools/rebuild_gettext_catalogs.sh
index 8460eb40b..27c5115d3 100755
--- a/tools/rebuild_gettext_catalogs.sh
+++ b/tools/rebuild_gettext_catalogs.sh
@@ -40,8 +40,10 @@ do
fi
fi
if [ -f $directory/$resource.po ]; 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/)
msgmerge --update --quiet $directory/$resource.po ./langs/en/$resource.pot
msgmerge_error_level=$? # catch msgmerge error level
+# msgfmt --statistics --verbose -c $directory/$resource.po -o /dev/null # usefull for debuging (msgctxt "/web/en/ or msgctxt "en/)
if [ $msgmerge_error_level -gt 0 ]; then
error=60
error_in_source=$directory/$resource
diff --git a/tools/translated_converter.py b/tools/translated_converter.py
index 2bdf61ceb..58e9d9bb5 100644
--- a/tools/translated_converter.py
+++ b/tools/translated_converter.py
@@ -39,7 +39,7 @@ for langfile in glob.glob(file_mask):
nofilename = langfile.replace(filename + '.','')
language = nofilename.replace('.lang','')
#open lang file
- text = open(langfile,"r").read()
+ text = open(langfile,"r").read()+"\n"
#Remove trailing spaces from lines
spaces=' {1,}\n'
spattern=re.compile(spaces,re.DOTALL)