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



commit 7785f96f05a587e7fce7fbf491a21d82f5f6f749
Author: Jehan <jehan girinstud io>
Date:   Mon Mar 28 20:57:33 2022 +0200

    build, po-windows-installer: add ability to leave translator comments.
    
    Similar to the change I pushed to gimp-help repository:
    
    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).
    
    There were already a bunch of comments in the setup.isl.in file (though
    not showing in the po files until now). I checked if they seemed
    relevant, fixed some, completed others, duplicated the ones which match
    several strings, etc.
    
    (This improvement to allow comments for translators in the installer po
    files was requested by Piotr Drąg on the gnome-i18n mailing list)

 build/windows/installer/lang/Makefile.am           |  9 +++
 build/windows/installer/lang/meson.build           | 11 ++-
 .../installer/lang/{setup.isl.in => setup.isl.ini} | 83 ++++++++++++++++------
 po-windows-installer/POTFILES.in                   |  2 +-
 4 files changed, 80 insertions(+), 25 deletions(-)
---
diff --git a/build/windows/installer/lang/Makefile.am b/build/windows/installer/lang/Makefile.am
index 40aee2547e..1293fa3dd0 100644
--- a/build/windows/installer/lang/Makefile.am
+++ b/build/windows/installer/lang/Makefile.am
@@ -60,9 +60,18 @@ stamp-isl: setup.isl Makefile.am
        done &&                                                                         \
        echo timestamp > stamp-isl
 
+# * setup.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 ';').
+# * setup.isl.in is in the actual .isl format except for the gettext
+#   underscoring.
+# * setup.isl is in the .isl format but mixing all languages.
 setup.isl: setup.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
 
+setup.isl.in: setup.isl.ini Makefile.am
+       $(AM_V_GEN) sed 's/^#/;/' $< > $@
+
 all-local: $(stamp_files)
 
 clean-local:
diff --git a/build/windows/installer/lang/meson.build b/build/windows/installer/lang/meson.build
index 7940e3cf6a..de0e920138 100644
--- a/build/windows/installer/lang/meson.build
+++ b/build/windows/installer/lang/meson.build
@@ -1,5 +1,14 @@
+isl_in_input = custom_target('setup.isl.in',
+  input : 'setup.isl.ini',
+  output: 'setup.isl.in',
+  capture: true,
+  command: [
+    'sed', 's/^#/;/', '@INPUT@',
+  ]
+)
+
 isl_input = custom_target('setup.isl',
-  input : 'setup.isl.in',
+  input : isl_in_input,
   output: 'setup.isl',
   command: [
     intltool_merge,
diff --git a/build/windows/installer/lang/setup.isl.in b/build/windows/installer/lang/setup.isl.ini
similarity index 70%
rename from build/windows/installer/lang/setup.isl.in
rename to build/windows/installer/lang/setup.isl.ini
index ba00bbe7c7..32210db885 100644
--- a/build/windows/installer/lang/setup.isl.in
+++ b/build/windows/installer/lang/setup.isl.ini
@@ -1,21 +1,24 @@
-; to generate the language-specific .setup.isl files,
-; configure with --enable-windows-installer, and run make.
+# to generate the language-specific .setup.isl files,
+# configure with --enable-windows-installer, and run make.
 
 [Messages]
-;InfoBefore page is used instead of license page because the GPL only concerns distribution, not use, and as 
such doesn't have to be accepted
+# InfoBefore page is used instead of license page because the GPL only concerns distribution, not use, and 
as such doesn't have to be accepted
+
 _WizardInfoBefore=License Agreement
 _AboutSetupNote=Setup built by Jernej Simonèiè, jernej-gimp ena si
 _WinVersionTooLowError=This version of GIMP requires Windows 7, or a newer version of Windows.
 _WindowsVersionNotSupported=This version of GIMP requires Windows 7, or a newer version of Windows.
 
 [CustomMessages]
-;shown before the wizard starts on development versions of GIMP
+# Shown before the wizard starts on development versions of GIMP
 _DevelopmentWarningTitle=Development version
+# Shown before the wizard starts on development versions of GIMP
 _DevelopmentWarning=This is a development version of GIMP where some features may not be finished, or it may 
be unstable.%nThis version of GIMP is not intended for day-to-day work as it may be unstable, and you could 
lose your work.%nIf you encounter any problems, first verify that they haven't already been fixed in GIT 
before you contact the developers or report it in GIMP 
gitlab:%n_https://gitlab.gnome.org/GNOME/gimp/issues%n%nDo you wish to continue with installation anyway?
 _DevelopmentButtonContinue=&Continue
 _DevelopmentButtonExit=Exit
 
-;XPSP3Recommended=Warning: you are running an unsupported version of Windows. Please update to at least 
Windows XP with Service Pack 3 before reporting any problems.
+#XPSP3Recommended=Warning: you are running an unsupported version of Windows. Please update to at least 
Windows XP with Service Pack 3 before reporting any problems.
+
 _SSERequired=This version of GIMP requires a processor that supports SSE instructions.
 
 _Require32BPPTitle=Display settings problem
@@ -27,85 +30,119 @@ _InstallOrCustomize=GIMP is now ready to be installed. Click the Install now but
 _Install=&Install
 _Customize=&Customize
 
-;setup types
+# Setup types
 _TypeCompact=Compact installation
+# Setup types
 _TypeCustom=Custom installation
+# Setup types
 _TypeFull=Full installation
 
-;text above component description
+# Text above component description
 _ComponentsDescription=Description
-;components
+# Components
 _ComponentsGimp=GIMP
+# Components
 _ComponentsGimpDescription=GIMP and all default plug-ins
+# Components
 _ComponentsDeps=Run-time libraries
+# Components
 _ComponentsDepsDescription=Run-time libraries used by GIMP, including GTK+ Run-time Environment
+# Components
 _ComponentsDebug=Debug symbols
+# Components
 _ComponentsDebugDescription=Include information to help with debugging GIMP
+# Components
 _ComponentsGtkWimp=MS-Windows engine for GTK+
+# Components
 _ComponentsGtkWimpDescription=Native Windows look for GIMP
+# Components
 _ComponentsCompat=Support for old plug-ins
+# Components
 _ComponentsCompatDescription=Install libraries needed by old third-party plug-ins
+# Components
 _ComponentsTranslations=Translations
+# Components
 _ComponentsTranslationsDescription=Translations
+# Components
 _ComponentsPython=Python scripting
+# Components
 _ComponentsPythonDescription=Allows you to use GIMP plugins written in Python scripting language.
+# Components
 _ComponentsLua=Lua scripting
+# Components
 _ComponentsLuaDescription=Allows you to use GIMP plugins written in Lua scripting language.
+# Components
 _ComponentsMyPaint=MyPaint brushes
+# Components
 _ComponentsMyPaintDescription=Install the default set of MyPaint brushes
+# Components
 _ComponentsGhostscript=PostScript support
+# Components
 _ComponentsGhostscriptDescription=Allow GIMP to load PostScript files
-;only when installing on x64 Windows
+# Components, only when installing on x64 Windows
 _ComponentsGimp32=Support for 32-bit plug-ins
+# Compoments, only when installing on x64 Windows
 _ComponentsGimp32Description=Include files necessary for using 32-bit plug-ins.%nRequired for Python support.
 
-;additional installation tasks
+# Additional installation tasks
 _AdditionalIcons=Additional icons:
+# Additional installation tasks
 _AdditionalIconsDesktop=Create a &desktop icon
+# Additional installation tasks
 _AdditionalIconsQuickLaunch=Create a &Quick Launch icon
 
 _RemoveOldGIMP=Remove previous GIMP version
 
-;%1 is replaced by file name; these messages should never appear (unless user runs out of disk space at the 
exact right moment)
+# %1 is replaced by file name; this message should never appear (unless user runs out of disk space at the 
exact right moment)
 _ErrorChangingEnviron=There was a problem updating GIMP's environment in %1. If you get any errors loading 
the plug-ins, try uninstalling and re-installing GIMP.
+# This message should never appear (unless user runs out of disk space at the exact right moment)
 _ErrorExtractingTemp=Error extracting temporary data.
+# This message should never appear (unless user runs out of disk space at the exact right moment)
 _ErrorUpdatingPython=Error updating Python interpreter info.
+# This message should never appear (unless user runs out of disk space at the exact right moment)
 _ErrorUpdatingMyPaint=Error updating MyPaint brushes info.
+# %1 is replaced by file name; this message should never appear (unless user runs out of disk space at the 
exact right moment)
 _ErrorReadingGimpRC=There was an error updating %1.
+# %1 is replaced by file name; this message should never appear (unless user runs out of disk space at the 
exact right moment)
 _ErrorUpdatingGimpRC=There was an error updating GIMP's configuration file %1.
 
-;displayed in Explorer's right-click menu
+# Displayed in Explorer's right-click menu
 _OpenWithGimp=Edit with GIMP
 
-;file associations page
+# File associations page
 _SelectAssociationsCaption=Select file associations
+# File associations page
 _SelectAssociationsExtensions=Extensions:
+# File associations page
 _SelectAssociationsInfo1=Select the file types you wish to associate with GIMP
+# File associations page
 _SelectAssociationsInfo2=This will make selected files open in GIMP when you double-click them in Explorer.
+# File associations page
 _SelectAssociationsSelectAll=Select &All
+# File associations page
 _SelectAssociationsUnselectAll=Unselect &All
+# File associations page
 _SelectAssociationsSelectUnused=Select &Unused
 
-;shown on summary screen just before starting the install
+# Shown on summary screen just before starting the install
 _ReadyMemoAssociations=File types to associate with GIMP:
 
 _RemovingOldVersion=Removing previous version of GIMP:
-;%1 = version, %2 = installation directory
-;ran uninstaller, but it returned an error, or didn't remove everything
+# %1 = version, %2 = installation directory; ran uninstaller, but it returned an error, or didn't remove 
everything
 _RemovingOldVersionFailed=GIMP %1 cannot be installed over your currently installed GIMP version, and the 
automatic uninstall of old version has failed.%n%nPlease remove the previous version of GIMP yourself before 
installing this version in %2, or choose a Custom install, and select a different installation folder.%n%nThe 
Setup will now exit.
-;couldn't find an uninstaller, or found several uninstallers
+# %1 = version, %2 = installation directory; couldn't find an uninstaller, or found several uninstallers
 _RemovingOldVersionCantUninstall=GIMP %1 cannot be installed over your currently installed GIMP version, and 
Setup couldn't determine how to remove the old version automatically.%n%nPlease remove the previous version 
of GIMP and any add-ons yourself before installing this version in %2, or choose a Custom install, and select 
a different installation folder.%n%nThe Setup will now exit.
 
 _RebootRequiredFirst=Previous GIMP version was removed successfully, but Windows has to be restarted before 
the Setup can continue.%n%nAfter restarting your computer, Setup will continue next time an administrator 
logs in.
 
-;displayed if restart settings couldn't be read, or if the setup couldn't re-run itself
+# Displayed if restart settings couldn't be read, or if the setup couldn't re-run itself
 _ErrorRestartingSetup=There was an error restarting the Setup. (%1)
 
 _RemovingOldFiles=Cleaning up old files...
 
-;displayed while the files are being extracted; note the capitalisation!
+# Displayed while the files are being extracted; note the capitalisation!
 _Billboard1=Remember: GIMP is Free Software.%n%nPlease visit
-;www.gimp.org (displayed between Billboard1 and Billboard2)
+# www.gimp.org (displayed between Billboard1 and Billboard2)
 _Billboard2=for free updates.
 
 _SettingUpAssociations=Setting up file associations...
@@ -114,13 +151,13 @@ _SettingUpMyPaint=Setting up MyPaint brushes...
 _SettingUpEnvironment=Setting up GIMP environment...
 _SettingUpGimpRC=Setting up GIMP configuration for 32-bit plug-in support...
 
-;displayed on last page
+# Displayed on last page
 _LaunchGimp=Launch GIMP
 
-;shown during uninstall when removing add-ons
+# Shown during uninstall when removing add-ons
 _UninstallingAddOnCaption=Removing add-on
 
 _InternalError=Internal error (%1).
 
-;used by installer for add-ons (currently only help)
+# Used by installer for add-ons (currently only help)
 _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 eb416b25ef..0532c29bd1 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/setup.isl.in
+[type: gettext/ini] build/windows/installer/lang/setup.isl.ini


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