After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 683710 - Make Windows installer strings translatable in po files
Make Windows installer strings translatable in po files
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Internationalisation
git master
Other Windows
: Normal enhancement
: 2.10
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2012-09-10 10:09 UTC by Claude Paroz
Modified: 2017-12-24 21:49 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Claude Paroz 2012-09-10 10:09:41 UTC
Currently, to translate Windows installer strings, you have to create a build/windows/installer/lang/<lang>.setup.isl. It would be nice if those strings could be integrated in the normal po files (intltool does support ini files, AFAIK).
Comment 1 Claude Paroz 2012-09-10 10:19:16 UTC
I just realize those installer files are no longer in master. What happened to them?
Comment 2 Michael Schumacher 2012-09-10 14:12:59 UTC
They have never been added to master, just the gimp-2-8 branch.
Comment 3 Claude Paroz 2012-09-10 14:23:09 UTC
If this is going to be merged to master one day, the bug still stands, otherwise you can close it as obsolete.
Comment 4 Michael Schumacher 2012-09-10 14:41:34 UTC
I'm pretty sure this will be added to master (not necessarily merged). 

It would be useful if you could point out any examples of intltool usage for ini files.
Comment 5 Claude Paroz 2012-09-10 15:15:28 UTC
Some examples with GNOME packages: Rhythmbox/totem plugins descriptions, Evince backends descriptions, etc.

I'm far from being an expert in build tools, but basically the step are:

* Rename the translatable file to .in and mark translatable keys with a leading underscore.
* Put the .in file in POTFILES.in with a [type: gettext/ini] prefix.
* Add some Makefile magic, something like this:

%.myinifile: %.myinifile.in
	$(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache

and add appropriate files to CLEANFILES, DISTCLEANFILES and EXTRA_DIST.
Comment 6 Jernej Simončič 2012-09-28 22:25:31 UTC
Is there any documentation about this? The file extension doesn't really matter, but I don't understand this part: "mark translatable keys with a leading underscore" - leading underscore where? At the key name, or in the value? Some of the key names can't be changed as that'd require a recompile of Inno Setup, and render all existing translations incompatible.

Another thing is that the files have to use the correct locale-specific encoding (such as Windows-1252) - this unfortunately can't be changed.
Comment 7 Piotr Drąg 2012-09-28 22:35:19 UTC
Maybe you could switch the Windows installer to NSIS? Pidgin is using it quite successfully, and they have strings from it in po files.
Comment 8 Jernej Simončič 2012-09-28 22:45:20 UTC
And maybe GIMP could switch to assembler (IOW: not going to happen, at least not while I maintain the installer). While NSIS has it's good points, and I do use it for certain projects, it's not something I'm willing to use for something as complex as the GIMP installer.
Comment 9 Claude Paroz 2012-09-29 07:09:23 UTC
(In reply to comment #6)
> but I don't understand this part: "mark translatable keys with a
> leading underscore" - leading underscore where?

Example:
WizardInfoBefore=License Agreement -> _WizardInfoBefore=License Agreement

When intltool merges the translation with the po file, he strips this underscore, so the final file doesn't have it.

> Another thing is that the files have to use the correct locale-specific
> encoding (such as Windows-1252) - this unfortunately can't be changed.

The encoding conversion should probably be added in the Makefile and applied to the merged file (iconv -f utf-8 -t windows-1252).
Comment 10 Jehan 2013-07-28 15:07:56 UTC
That's interesting. I'll have a look at this.
Comment 11 Jehan 2015-06-07 14:36:06 UTC
I know I'm repeating myself over various bug reports, but could we have a doc of how to build the Windows installer in our repo?
We have files, all right. But even as GIMP devs, we are totally in the dark in how they are used to make the finale installer.

Making installer files translatable through po files is no problem at all. That's a breeze. I've done these kind of things in the past: making random files (from format which are not meant to be used with gettext by design) translatable anyway through gettext. But actually I don't even want to try if I can't test myself the result. And for this, I need to know how the windows installers are built.
Comment 12 Jernej Simončič 2015-06-08 19:09:27 UTC
Building the installer is a bit involved, but if you just want to test the translation, it's easy. First, you have to install Inno Setup 5.5 Unicode from the QuickStart Pack <http://jrsoftware.org/isdl.php#qsp>.

The way the script is set up, if you compile it from the Inno Setup IDE, it'll automatically create a dummy setup with no files included, but all other functionality preserved, which should be sufficient for testing the translations.

If you want to build an actual GIMP installer, you should first build and make install 32 and 64-bit GIMP versions (each to it's own directory), then compile the install script from command line like this:

iscc.exe -DVERSION="2.8.14" -DGIMP_DIR32="x:\path\gimp32" -DGIMP_DIR64="x:\path\gimp64" -DDEPS_DIR32="x:\path\gtk32" -DDEPS_DIR64="x:\path\gtk64" -DPY_DIR="x:\path\python32" gimp3264.iss

The defines are as follows:
GIMP_DIR32/GIMP_DIR64: directory created by make install for 32/64-bit GIMP (same directory as used with --prefix parameter to configure)
DEPS_DIR32/DEPS_DIR64: directory that contains all of GIMP's dependencies (but not GIMP itself)
PY_DIR: directory with 32-bit Python 2.7 installation (which includes PyGTK+)
Comment 13 Ell 2017-12-24 21:49:52 UTC
Fixed in master:

commit f1070f4c80919f1da20c47d5f7d48a4073d71f0b
Author: Ell <ell_se@yahoo.com>
Date:   Sun Dec 24 15:34:04 2017 -0500

    build: use intltool for Windows installer translations
    
    Use intltool for managing the translations for the Windows
    installer, instead of manually maintaining the translated message
    files.
    
    The message files are generated in the source directory, under
    build/windows/installer/lang, as part of the build, and can be
    subsequently used to build the installer, as before.

 Makefile.am                                       |  59 ++++++++++++------------
 README.i18n                                       |  13 +++---
 build/windows/Makefile.am                         |   3 ++
 build/windows/installer/.gitignore                |  10 +++--
 build/windows/installer/Makefile.am               |   2 +
 build/windows/installer/lang/.gitignore           |   5 +++
 build/windows/installer/lang/Makefile.am          |  41 +++++++++++++++++
 build/windows/installer/lang/ca.setup.isl         | 113 ----------------------------------------------
 build/windows/installer/lang/da.setup.isl         | 113 ----------------------------------------------
 build/windows/installer/lang/de.setup.isl         | 113 ----------------------------------------------
 build/windows/installer/lang/en.setup.isl         | 112 ---------------------------------------------
 build/windows/installer/lang/es.setup.isl         | 113 ----------------------------------------------
 build/windows/installer/lang/fr.setup.isl         | 113 ----------------------------------------------
 build/windows/installer/lang/hu.setup.isl         | 113 ----------------------------------------------
 build/windows/installer/lang/it.setup.isl         | 113 ----------------------------------------------
 build/windows/installer/lang/nl.setup.isl         | 113 ----------------------------------------------
 build/windows/installer/lang/pl.setup.isl         | 113 ----------------------------------------------
 build/windows/installer/lang/pt_BR.setup.isl      | 113 ----------------------------------------------
 build/windows/installer/lang/ru.setup.isl         | 113 ----------------------------------------------
 build/windows/installer/lang/setup.isl.desktop.in | 114 ++++++++++++++++++++++++++++++++++++++++++++++
 build/windows/installer/lang/sl.setup.isl         | 105 -------------------------------------------
 configure.ac                                      |   6 ++-
 po-windows-installer/.gitignore                   |  10 +++++
 po-windows-installer/LINGUAS                      |  13 ++++++
 po-windows-installer/Makefile.in.in               | 232 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 po-windows-installer/POTFILES.in                  |   6 +++
 po-windows-installer/POTFILES.skip                |  13 ++++++
 po-windows-installer/ca.po                        | 275 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 po-windows-installer/da.po                        | 275 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 po-windows-installer/de.po                        | 275 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 po-windows-installer/es.po                        | 275 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 po-windows-installer/fr.po                        | 275 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 po-windows-installer/hu.po                        | 275 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 po-windows-installer/it.po                        | 275 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 po-windows-installer/nl.po                        | 275 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 po-windows-installer/pl.po                        | 275 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 po-windows-installer/pt_BR.po                     | 275 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 po-windows-installer/ru.po                        | 275 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 po-windows-installer/sl.po                        | 275 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 39 files changed, 3787 insertions(+), 1500 deletions(-)