From 87c56c7c1d4a1af6e6a4dd0c3fdc133608edde88 Mon Sep 17 00:00:00 2001 From: Lauri Nurmi Date: Sat, 23 Jan 2021 23:11:06 +0200 Subject: [PATCH 1/2] Do not sort content of generated POT files alphabetically Sorting is discouraged even by the GNU gettext documentation: https://www.gnu.org/software/gettext/manual/html_node/xgettext-Invocation.html#Output-details Alphabetical order means related messages that are close to each other in a source file are likely to be far far away from each other in the .po file that a translator works on. Sorting was added in ea8849aaf6 (updated to use msgmerge, 2000-03-07) --- locale/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locale/Makefile b/locale/Makefile index c195a0bb84..96dc0baa00 100644 --- a/locale/Makefile +++ b/locale/Makefile @@ -17,7 +17,7 @@ XGETTEXT=xgettext XARGS=xargs # common xgettext args: C++ syntax, use the specified macro names as markers -XGETTEXT_ARGS=-C -k_ -kwxPLURAL:1,2 -kwxTRANSLATE -kwxGetTranslation --add-comments=TRANSLATORS: -s -j +XGETTEXT_ARGS=-C -k_ -kwxPLURAL:1,2 -kwxTRANSLATE -kwxGetTranslation --add-comments=TRANSLATORS: -j # implicit rules %.mo: %.po From 232d1c11560605708e13c18e0014f2ca8d6e5523 Mon Sep 17 00:00:00 2001 From: Lauri Nurmi Date: Sat, 23 Jan 2021 23:11:13 +0200 Subject: [PATCH 2/2] Feed sorted output to xargs when generating wxstd.pot The `find' command isn't generally guaranteed to output filenames in particular order, and without sorting, the resulting .pot from identical input files could have its source line comment entries in different order depending on what OS and filesystem it was generated on. Co-authored-by: VZ --- locale/Makefile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/locale/Makefile b/locale/Makefile index 96dc0baa00..1645da416a 100644 --- a/locale/Makefile +++ b/locale/Makefile @@ -32,9 +32,7 @@ $(foreach lang,$(WX_LINGUAS_UPDATE),$(lang).po): wxstd.pot wxstd.pot: touch $@ - find ../include -name "*.h" | $(XARGS) $(XGETTEXT) $(XGETTEXT_ARGS) -o wxstd.pot - find ../src -name "*.cpp" | $(XARGS) $(XGETTEXT) $(XGETTEXT_ARGS) -o wxstd.pot - find ../src -name "*.mm" | $(XARGS) $(XGETTEXT) $(XGETTEXT_ARGS) -o wxstd.pot + (find ../include -name "*.h"; find ../src -name "*.cpp"; find ../src -name "*.mm") | LC_COLLATE=C sort | $(XARGS) $(XGETTEXT) $(XGETTEXT_ARGS) -o wxstd.pot allpo: force-update @-for t in $(WX_LINGUAS_UPDATE); do $(MAKE) $$t.po; done