From 5c00368e8583ee06011c5af5bf4552139b82ae85 Mon Sep 17 00:00:00 2001 From: Oneric Date: Sat, 22 Apr 2023 21:21:40 +0200 Subject: [PATCH] build: consider all translation keywords for C++ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- po/make_pot.sh | 3 ++- po/meson.build | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/po/make_pot.sh b/po/make_pot.sh index e91fb98d1..da9748c41 100755 --- a/po/make_pot.sh +++ b/po/make_pot.sh @@ -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./" \ diff --git a/po/meson.build b/po/meson.build index 5aae381d1..668f7ffac 100644 --- a/po/meson.build +++ b/po/meson.build @@ -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)