mirror of
https://github.com/friendica/friendica
synced 2024-12-23 00:00:21 +00:00
fix merge function of util/run_xgettext.sh
This commit is contained in:
parent
d35b13fb58
commit
1a8ea8ba14
2 changed files with 11 additions and 16 deletions
|
@ -82,11 +82,11 @@ Xgettext and .po workflow
|
|||
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"
|
||||
|
|
|
@ -30,18 +30,6 @@ F9KVERSION=$(sed -n "s/.*'FRIENDICA_VERSION'.*'\([0-9.]*\)'.*/\1/p" ../../boot.p
|
|||
|
||||
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.."
|
||||
|
@ -50,7 +38,7 @@ for f in $(find "$FINDSTARTDIR" $FINDOPTS -name "*.php" -type f)
|
|||
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
|
||||
|
@ -75,4 +63,11 @@ else
|
|||
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."
|
||||
|
|
Loading…
Reference in a new issue