[ghelda-devel] [23] Change the translation update script name |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/ghelda-devel Archives
]
Revision: 23
Author: odyx
Date: 2009-04-27 17:36:37 +0200 (Mon, 27 Apr 2009)
Log Message:
-----------
Change the translation update script name
Added Paths:
-----------
trunk/update_l10n.sh
Added: trunk/update_l10n.sh
===================================================================
--- trunk/update_l10n.sh (rev 0)
+++ trunk/update_l10n.sh 2009-04-27 15:36:37 UTC (rev 23)
@@ -0,0 +1,69 @@
+#!/bin/sh
+
+ #
+ # Ghelda - Gestion Hiérarchisée En Ligne D'Adresses
+ # - Online Hierarchical Handling Of Adresses
+ #
+ # Copyright (C) 2008 Didier Raboud
+ #
+ # This program is free software: you can redistribute it and/or modify
+ # it under the terms of the GNU Affero General Public License as published by
+ # the Free Software Foundation, either version 3 of the License, or
+ # (at your option) any later version.
+ #
+ # This program is distributed in the hope that it will be useful,
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ # GNU Affero General Public License for more details.
+ #
+ # You should have received a copy of the GNU Affero General Public License
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
+ #
+
+LOCALE_FOLDER=locale
+TEMPLATES_FOLDER=$LOCALE_FOLDER/templates
+# Gettext domain
+DOMAIN="g_core"
+# Build command line options
+OPTIONS="--language=php --force-po --keyword=T_ngettext:1,2 --keyword=T_ --from-code=UTF-8 --output=$TEMPLATES_FOLDER/$DOMAIN.pot --join-existing"
+# Languages
+#LANGUAGES="fr_FR.UTF-8"
+LANGUAGES=`ls $LOCALE_FOLDER/ | grep '\.'`
+
+# Delete old file
+rm -f $TEMPLATES_FOLDER/$DOMAIN.pot
+touch $TEMPLATES_FOLDER/$DOMAIN.pot
+# Extract strings
+find . -iname \*.php ! -path "*plugins/*" -type f -exec xgettext $OPTIONS --output=$TEMPLATES_FOLDER/$DOMAIN.pot {} \;
+
+echo " --- core ---"
+for currentLang in $LANGUAGES
+do
+ langPOs=$LOCALE_FOLDER/$currentLang/LC_MESSAGES/$DOMAIN
+ echo $currentLang
+ touch $langPOs.po
+ msgmerge --update $langPOs.po $TEMPLATES_FOLDER/$DOMAIN.pot
+ msgfmt --statistics $langPOs.po -o $langPOs.mo
+done
+# Get list of plugins
+PLUGINS=`ls plugins/ | grep .php$ | sed s/.php//g`
+
+for plugin in $PLUGINS
+do
+ echo " --- $plugin ---"
+ DOMAIN=$plugin
+ # Delete old file
+ rm -f $TEMPLATES_FOLDER/$DOMAIN.pot
+ touch $TEMPLATES_FOLDER/$DOMAIN.pot
+ # Extract strings
+ find . -iname \*.php -path "*plugins/$plugin*" -type f -exec xgettext $OPTIONS --output=$TEMPLATES_FOLDER/$DOMAIN.pot {} \;
+
+ for currentLang in $LANGUAGES
+ do
+ langPOs=$LOCALE_FOLDER/$currentLang/LC_MESSAGES/$DOMAIN
+ echo $currentLang
+ touch $langPOs.po
+ msgmerge --update $langPOs.po $TEMPLATES_FOLDER/$DOMAIN.pot
+ msgfmt --statistics $langPOs.po -o $langPOs.mo
+ done
+done
Property changes on: trunk/update_l10n.sh
___________________________________________________________________
Name: svn:executable
+ *