This script runs xgettext on source tree, extracting strings from t() and tt()
functions, and creates a util/messages.po file.
- % cd util; ./run_xgettext.sh ../view/{language}/messages.po
-
- Replace {language} with the language you are working on - e.g. 'es', 'fr', 'de', etc.
+ $ cd util; ./run_xgettext.sh
2. copy util/messages.po to view/<langauage>/messages.po
+ Replace <language> with the language you are working on - e.g. 'es', 'fr', 'de', etc.
+
3. open view/<langauage>/messages.po with a text editor and fill in infos in
"Last-Translator: FULL NAME <EMAIL@ADDRESS>"
"Language-Team: LANGUAGE <LL@li.org>\n"
echo "Friendica version $F9KVERSION"
-OPTS=
-
-#if [ "" != "$1" ]
-#then
-# OUTFILE="$(readlink -f ${FULLPATH}/$1)"
-# if [ -e "$OUTFILE" ]
-# then
-# echo "join extracted strings"
-# OPTS="-j"
-# fi
-#fi
-
KEYWORDS="-k -kt -ktt:1,2"
echo "extract strings to $OUTFILE.."
do
if [ ! -d "$f" ]
then
- xgettext $KEYWORDS $OPTS -j -o "$OUTFILE" --from-code=UTF-8 "$f"
+ xgettext $KEYWORDS -j -o "$OUTFILE" --from-code=UTF-8 "$f"
sed -i "s/CHARSET/UTF-8/g" "$OUTFILE"
fi
done
sed -i "s/^\"Plural-Forms.*$//g" "$OUTFILE"
fi
+if [ "" != "$1" -a "$ADDONMODE" == "" ]
+then
+ UPDATEFILE="$(readlink -f ${FULLPATH}/$1)"
+ echo "merging new strings to $UPDATEFILE.."
+ msgmerge -U $OUTFILE $UPDATEFILE
+fi
+
echo "done."