summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f997864)
raw | patch | inline | side by side (parent: f997864)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 21 Jan 2008 15:04:43 +0000 (15:04 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 21 Jan 2008 15:04:43 +0000 (15:04 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8524 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/update-gosa | patch | blob | history | |
gosa-core/update-locale | patch | blob | history |
diff --git a/gosa-core/update-gosa b/gosa-core/update-gosa
index a50368d3792f323deca5b3e62c65730ee76e1258..89b83232d80e7426496901c994c88cf9b6946396 100755 (executable)
--- a/gosa-core/update-gosa
+++ b/gosa-core/update-gosa
#!/usr/bin/php5
<?php
-define ("LOCALE_DIR", "/home/cajus/Projekte/gosa/trunk/gosa-all/gosa/locale");
+define ("LOCALE_DIR", dirname(__FILE__)."/locale");
define ("PLUGSTATE_DIR", "/tmp/gosa");
function print_usage()
index b388bb106435192797651e51cb440db1096b9997..32ab55b2abc8544c7f24c76b55aa1fee7dd07896 100755 (executable)
--- a/gosa-core/update-locale
+++ b/gosa-core/update-locale
done
echo "Extracting languages..."
- [ -f locale/messages.po ] && rm locale/messages.po
- find . -name '*.[ctpi][ophn][nlpc]' | xgettext -f - --keyword=must -d Domain -L PHP -n -o locale/messages.po
+ [ -f locale/${l_path}messages.po ] && rm locale/${l_path}messages.po
+ find . -name '*.[ctpi][ophn][nlpc]' | xgettext -f - --keyword=must -d Domain -L PHP -n -o locale/${l_path}messages.po
echo "Merging po files with existing ones"
error=0
- for f in locale/??/LC_MESSAGES; do
- [[ "$f" == "locale/??/LC_MESSAGES" ]] && break
+ for f in locale/${l_path}??/LC_MESSAGES; do
+ [[ "$f" == "locale/${l_path}??/LC_MESSAGES" ]] && break
echo -n "* merging $f/messages.po: "
- [ -f $f/messages.po ] && msgmerge $f/messages.po locale/messages.po --output-file=$f/messages.po.new &> /dev/null
+ [ -f $f/messages.po ] && msgmerge $f/messages.po locale/${l_path}messages.po --output-file=$f/messages.po.new &> /dev/null
# Do an extra check for dummy dir 'locale/en/LC_MESSAGES'
if [ $? -ne 0 ]; then
- [ "$f" == "locale/en/LC_MESSAGES" ] && $TRUE
+ [ "$f" == "locale/${l_path}en/LC_MESSAGES" ] && $TRUE
fi
if [ $? -eq 0 ]; then
done
echo "Copying new po files, making backups..."
- find . -name messages.po | while read f; do
+ find locale/${l_path} -name messages.po | while read f; do
if [ -f $ORIG/$f ]; then
mv $ORIG/$f $ORIG/$f.orig
fi
- echo $f | grep -q "locale/messages.po"
+ echo $f | grep -q "locale/${l_path}messages.po"
if [ $? -ne 0 ]; then
echo "* replaced $ORIG/$f"
cp $f.new $ORIG/$f
# MAIN
#
GENERATE=0
-COMPILE=0
ASSUME_Y=0
while getopts ":gyh" opt
do
y) ASSUME_Y=1;
;;
h|--help)
- echo "Usage: $(basename $0) [-g] [-y]"
+ echo "Usage: $(basename $0) [-g] [-y] method"
+ echo " method can be 'core' or 'plugin'"
echo " -g extract strings from GOsa and generate po files"
echo " -y assume yes"
exit 1
done
shift $(($OPTIND - 1))
+# Check method
+if [ "$1" != "plugin" -a "$1" != "core" ]; then
+ echo "Need explicit method 'core' or 'plugin' to create locale."
+ exit 1
+fi
+if [ "$1" == "plugin" ]; then
+ l_path=""
+else
+ l_path="core/"
+fi
+
# Default to generate
-if [ $GENERATE -eq 0 -a $COMPILE -eq 0 ]; then
+if [ $GENERATE -eq 0 ]; then
GENERATE=1
fi