[gimp-help] build, po-windows-installer: add ability to leave translator comments.



commit 6ace6f8180d48307f22a212e1d86a1a39d56df48
Author: Jehan <jehan girinstud io>
Date:   Mon Mar 28 17:37:14 2022 +0200

    build, po-windows-installer: add ability to leave translator comments.
    
    intltool-extract does not consider the `;` isl-syntax comments because
    we tell it it is in the ini format. So let's have our source in actual
    ini format (POTFILES does not like to look for translated strings in
    constructed files, only from source files), then create the .isl files
    from it in 3 steps (first, transform the comments in isl format; then
    merge all language in a single .isl file; last generate one .isl per
    language).
    
    Finally add some comments to explain what %1 and %2 are replaced with
    (this was asked by Piotr Drąg on the gnome-i18n mailing list).
    
    (cherry picked from commit 6f65e7b407c4ed92c79bfd2bdafef7182bc81886)

 build/windows/installer/lang/Makefile.am                   |  9 +++++++++
 build/windows/installer/lang/{help.isl.in => help.isl.ini} | 12 +++++++++---
 po-windows-installer/POTFILES.in                           |  2 +-
 3 files changed, 19 insertions(+), 4 deletions(-)
---
diff --git a/build/windows/installer/lang/Makefile.am b/build/windows/installer/lang/Makefile.am
index 7d66ea4c4..0a387ac61 100644
--- a/build/windows/installer/lang/Makefile.am
+++ b/build/windows/installer/lang/Makefile.am
@@ -25,9 +25,18 @@ stamp-isl: help.isl Makefile.am
        sed '/^\w\+'"$$prefix"'=/{s/\(.\)'"$$prefix"'/\1/;n};/^\w.*=/d' $<  >> "$$isl" &&       \
        echo timestamp > stamp-isl
 
+# * help.isl.ini is used by intltool-extract to extract the localizable
+#   strings. We needed to use the ini syntax for leaving comments to
+#   translators (with '#' instead of ';').
+# * help.isl.in is in the actual .isl format except for the gettext
+#   underscoring.
+# * help.isl is in the .isl format but mixing all languages.
 help.isl: help.isl.in $(wildcard $(top_srcdir)/po-windows-installer/*.po) Makefile.am
        $(AM_V_GEN) $(INTLTOOL_MERGE) $(top_srcdir)/po-windows-installer $< $(@) -d -u -c 
$(top_builddir)/po-windows-installer/.intltool-merge-cache
 
+help.isl.in: help.isl.ini Makefile.am
+       $(AM_V_GEN) sed 's/^#/;/' $< > $@
+
 all-local: $(stamp_files)
 
 clean-local:
diff --git a/build/windows/installer/lang/help.isl.in b/build/windows/installer/lang/help.isl.ini
similarity index 58%
rename from build/windows/installer/lang/help.isl.in
rename to build/windows/installer/lang/help.isl.ini
index f5bf466bb..dafea061f 100644
--- a/build/windows/installer/lang/help.isl.in
+++ b/build/windows/installer/lang/help.isl.ini
@@ -1,10 +1,16 @@
-;[Messages]
-;WelcomeLabel1=Welcome to the GIMP Help Setup Wizard
+#[Messages]
+#WelcomeLabel1=Welcome to the GIMP Help Setup Wizard
 
 [CustomMessages]
 _GimpHelp=GIMP Help
 _MissingParameters=Parameter /INSTALL requires parameters /DIR and /ALLUSERS or /CURRENTUSER.
+
+# TRANSLATORS: %1 is the localized "GIMP Help" and %2 is the minimum version (which will be major.minor, 
e.g. "2.10").
 _NoGimpInstallsFound=No suitable GIMP installations were found. %1 can only be installed when GIMP %2 is 
already present.
-;DirNotGimp=GIMP does not appear to be installed in the selected directory. Continue anyway?
+
 _SelectGimpInstallsCaption=Multiple GIMP installations were found
+
+# TRANSLATORS: %1 is replaced by the localized "GIMP Help".
 _SelectGimpInstallsDescription=Select all installs for which you want to install %1
+
+#DirNotGimp=GIMP does not appear to be installed in the selected directory. Continue anyway?
diff --git a/po-windows-installer/POTFILES.in b/po-windows-installer/POTFILES.in
index 2c30ea02f..06456ebdd 100644
--- a/po-windows-installer/POTFILES.in
+++ b/po-windows-installer/POTFILES.in
@@ -3,4 +3,4 @@
 
 [encoding: UTF-8]
 
-[type: gettext/ini] build/windows/installer/lang/help.isl.in
+[type: gettext/ini] build/windows/installer/lang/help.isl.ini


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]