forked from flareteam/flare-engine
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
regenerate_po.sh: Add --no-merge flag to skip doing msgmerge
- Loading branch information
Showing
1 changed file
with
28 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,44 @@ | ||
#!/bin/sh | ||
# Run this script in the language directory to update the pot and all *.po files | ||
|
||
DO_MERGE=true | ||
for i in "$@"; do | ||
if [ "$i" == "--no-merge" ]; then | ||
DO_MERGE=false | ||
fi | ||
done | ||
|
||
# For the engine | ||
# To generate the appropriate .pot file, you need to run the following command from the languages directory: | ||
if [ -e engine.pot ] ; then | ||
xgettext --keyword=get -o engine.pot ../../../src/*.cpp | ||
echo "Generating engine.pot" | ||
|
||
# xgettext doesn't allow defining a charset, but we want UTF-8 across the board | ||
sed -i "s/charset=CHARSET/charset=UTF-8/" engine.pot | ||
xgettext --keyword=get -o engine.pot ../../../src/*.cpp | ||
|
||
# To update existing .po files, you need to run the following command from the languages directory: | ||
# msgmerge -U -N <name_of_.po_file> <name_of_.pot_file> | ||
# xgettext doesn't allow defining a charset, but we want UTF-8 across the board | ||
sed -i "s/charset=CHARSET/charset=UTF-8/" engine.pot | ||
|
||
for f in $(ls engine.*.po) ; do | ||
echo "Processing $f" | ||
msgmerge -U -N $f engine.pot | ||
done | ||
if [ $DO_MERGE = true ]; then | ||
# To update existing .po files, you need to run the following command from the languages directory: | ||
# msgmerge -U -N <name_of_.po_file> <name_of_.pot_file> | ||
|
||
for f in $(ls engine.*.po) ; do | ||
echo "Processing $f" | ||
msgmerge -U -N --backup=none $f engine.pot | ||
done | ||
fi | ||
fi | ||
|
||
if [ -e data.pot ] ; then | ||
echo "Generating data.pot" | ||
|
||
# For mods: | ||
./xgettext.py | ||
|
||
for f in $(ls data.*.po) ; do | ||
echo "Processing $f" | ||
msgmerge -U -N $f data.pot | ||
done | ||
if [ $DO_MERGE = true ]; then | ||
for f in $(ls data.*.po) ; do | ||
echo "Processing $f" | ||
msgmerge -U -N --backup=none $f data.pot | ||
done | ||
fi | ||
fi |