build: consider all translation keywords for C++

And document which aprts are still missing.
The keyword list is are copied from make_pot.sh.
Sorting by file helps keeping future PO(T) update diffs small'ish
and is also done in wangqr’s PO-file update procedure. (POT file
generation also sorts, but by preapplying `LC_ALL=C sort` to the
file list instead of using xgettext’s sorting option.)

Without this, meson’s aegisub-pot missed the majority of translatable
strings from C++ sources. While this brings the target much closerto
make_pot.sh, the remaining strings aren't straigthforward to integrate
unfortunately. At the time of writing meson has no support for iss files
and make_pot.sh uses custom logic to select only specific strings
from Lua and JSON files.

Even after this commit, POT updates should
thus still continue to use make_pot.sh.
This commit is contained in:
Oneric 2023-04-22 21:21:40 +02:00
parent 8c35b1d642
commit 5c00368e85
2 changed files with 12 additions and 1 deletions

View File

@ -13,7 +13,8 @@ maybe_append() {
}
find ../src ../src/command -name \*.cpp -o -name \*.h \
| xgettext --files-from=- -o - --c++ -k_ -kSTR_MENU -kSTR_DISP -kSTR_HELP -kfmt_tl -kfmt_plural:2,3 -kwxT -kwxPLURAL:1,2 \
| xgettext --files-from=- -o - --c++ --sort-by-file \
-k_ -kSTR_MENU -kSTR_DISP -kSTR_HELP -kfmt_tl -kfmt_plural:2,3 -kwxT -kwxPLURAL:1,2 \
| sed 's/SOME DESCRIPTIVE TITLE./Aegisub 3.2/' \
| sed 's/YEAR/2005-2014/' \
| sed "s/THE PACKAGE'S COPYRIGHT HOLDER/Rodrigo Braz Monteiro, Niels Martin Hansen, Thomas Goyne et. al./" \

View File

@ -1,4 +1,14 @@
i18n = import('i18n')
# This is currently busted on OSX
# and incomplete on any platform.
# It misses translatable strings not directly found in either
# C++ source, desktop or appdata file. This affects strings
# of the Windows installer (iss), from Lua scripts and JSON files.
# Until a solution is found, POT updates should continue to use make_pot.sh.
i18n.gettext('aegisub',
args: [
'-k_', '-kSTR_MENU', '-kSTR_DISP', '-kSTR_HELP', '-kwxT',
'-kfmt_tl', '-kfmt_plural:2,3', '-kwxPLURAL:1,2',
'--sort-by-file'
],
install_dir: localedir)