Skip to content

Commit

Permalink
Translation setup attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
Coolthulhu committed Sep 28, 2020
1 parent e914aaf commit 44aa6dc
Show file tree
Hide file tree
Showing 5 changed files with 1,258 additions and 3,641 deletions.
8 changes: 4 additions & 4 deletions lang/compile_mo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@ then
# but due to a libintl bug (https://savannah.gnu.org/bugs/index.php?58006),
# gettext would be extremely slow on MinGW targets if we do not compile
# a .mo file.
msgen lang/po/cataclysm-dda.pot --output-file=${f}
msgen lang/po/cataclysm-bn.pot --output-file=${f}
fi
mkdir -p $LOCALE_DIR/${n}/LC_MESSAGES
msgfmt -f -o $LOCALE_DIR/${n}/LC_MESSAGES/cataclysm-dda.mo ${f}
msgfmt -f -o $LOCALE_DIR/${n}/LC_MESSAGES/cataclysm-bn.mo ${f}
done
else
# if nothing specified, compile .mo file for every .po file in lang/po
# English is special: see comments above
msgen lang/po/cataclysm-dda.pot --output-file=lang/po/en.po
msgen lang/po/cataclysm-bn.pot --output-file=lang/po/en.po
for f in lang/po/*.po
do
n=`basename $f .po`
mkdir -p $LOCALE_DIR/${n}/LC_MESSAGES
msgfmt -f -o $LOCALE_DIR/${n}/LC_MESSAGES/cataclysm-dda.mo ${f}
msgfmt -f -o $LOCALE_DIR/${n}/LC_MESSAGES/cataclysm-bn.mo ${f}
done
fi
1 change: 1 addition & 0 deletions lang/extract_json_strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ def warning_supressed(filename):
"uncraft",
"vehicle_group",
"vehicle_placement",
"WORLD_OPTION",
}

# these objects can have their strings automatically extracted.
Expand Down
8 changes: 4 additions & 4 deletions lang/merge_po.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,19 @@ then
done
fi

# merge lang/po/cataclysm-dda.pot with .po file for each specified language
# merge lang/po/cataclysm-bn.pot with .po file for each specified language
if [ $# -gt 0 ]
then
for n in $@
do
echo "updating lang/po/${n}.po"
msgmerge --sort-by-file --no-fuzzy-matching lang/po/${n}.po lang/po/cataclysm-dda.pot | msgattrib --sort-by-file --no-obsolete -o lang/po/${n}.po
msgmerge --sort-by-file --no-fuzzy-matching lang/po/${n}.po lang/po/cataclysm-bn.pot | msgattrib --sort-by-file --no-obsolete -o lang/po/${n}.po
done
# otherwise merge lang/po/cataclysm-dda.pot with all .po files in lang/po
# otherwise merge lang/po/cataclysm-bn.pot with all .po files in lang/po
else
for f in lang/po/*.po
do
echo "updating $f"
msgmerge --sort-by-file --no-fuzzy-matching $f lang/po/cataclysm-dda.pot | msgattrib --sort-by-file --no-obsolete -o $f
msgmerge --sort-by-file --no-fuzzy-matching $f lang/po/cataclysm-bn.pot | msgattrib --sort-by-file --no-obsolete -o $f
done
fi

0 comments on commit 44aa6dc

Please sign in to comment.