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 118391 - Long currency names untranslated
Long currency names untranslated
Status: RESOLVED FIXED
Product: GnuCash
Classification: Other
Component: Translations
git-master
Other Windows
: Normal enhancement
: ---
Assigned To: gnucash-documentation-maint
gnucash-documentation-maint
Depends on: 617660
Blocks:
 
 
Reported: 2003-07-26 22:47 UTC by Lorenzo Cappelletti
Modified: 2018-06-29 20:35 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
0001-Adjust-in-iso-4217-currencies.scm-fullnames-to-confo.patch (29.73 KB, patch)
2010-05-06 23:54 UTC, Frank H. Ellenberger
committed Details | Review
0001-Resize-currency-dropdown-list.patch (87.63 KB, patch)
2010-05-18 10:49 UTC, Frank H. Ellenberger
committed Details | Review
Add isocodes to Windows build (2.93 KB, patch)
2010-07-08 15:37 UTC, Tao Wang
committed Details | Review
0001-Put-isocodes-in-README.dependencies-to-inform-packet.patch (1.55 KB, patch)
2010-09-17 00:44 UTC, Frank H. Ellenberger
committed Details | Review

Description Lorenzo Cappelletti 2003-07-26 22:47:55 UTC
The long name for DEM is always displayed as "German Mark" even though in a 
German environment this should rather be displayed in the German words 
"Deutsche Mark".
Comment 1 Christian Stimming 2003-07-28 21:32:02 UTC
... and this of course applies to all long currency names 
in any locale. DEM is just an example. The infrastructure 
for currency name translation has to be created from 
scratch.
Comment 2 Derek Atkins 2003-08-11 03:12:46 UTC
Linas may have committed something to HEAD to deal with this.
Comment 3 Christian Stimming 2006-01-27 16:40:02 UTC
Good news: We might get the translations of all these currency names for free by using the "iso-codes" project: http://alioth.debian.org/projects/pkg-isocodes

Also interesting might be ICU: http://icu.sourceforge.net/ and http://www.ibm.com/software/globalization/icu/
Comment 5 Tao Wang 2010-04-23 08:55:01 UTC
Is that possible let iso-4217-currencies.scm belong to seperate .po file? just like "gnucash-glossary", it's "gnucash-currencies", but it will be used during the runtime. I don't know whether it is possible a program can use 2 po file at same time.

If we can treat the iso-4217 currencies' name seperately, we can write a simple script to convert existing iso-4217 po files to gnucash project, and use them, without translators of gnucash involved in. And it will not broke "string freeze".

And, actually, iso-4217 currencies is very different from the strings in the existing po file. It's a set of string which belong to a standard, and there is a seperate translators working on it. 

And translators of gnucash actually can do nothing but merge them. For each time iso-4217 translations updated, all translators have to update there po. It should not let translators do it. It should be done automatically. 

To do that, make iso-4217 to a seperate po file, will make everything much easier. Just copy existing iso-4217 translations to a specific location, such as po/currencies, And use a script to manipulate those file to gnucash, or maybe there is not even necessary to do the manipulate.
Comment 6 Christian Stimming 2010-04-23 15:02:19 UTC
We might just re-use the translations from iso_4217 by using 

 const char* translation = dgettext("iso_4217", currencyname);

which means we load those translations from the iso_4217 domain. This would indeed directly work on a Linux system where this package is installed.

For windows, we would have to ensure to download and package the iso_4217 translations into our installer, but even that should be possible. In other words, we might indeed not include it in our gnucash.pot template. I'll continue to work on that over the weekend.
Comment 7 Frank H. Ellenberger 2010-05-06 23:54:30 UTC
Created attachment 160478 [details] [review]
0001-Adjust-in-iso-4217-currencies.scm-fullnames-to-confo.patch

Christian, thanks for Changeset 19058.

Attached is the adjustment of iso-4217-currencies.scm, so that full names conform to iso-codes-3.3. I am not really happy with this solution, but it is better than nothing. 

Caveats:
In the current version we loose partial information:
a) country names; eventually we should add another column derived from the first 2 Letters of the Code, to get them also over iso-codes.

b) obsolete status - ok, we can get that better using the new columns;

c) there is an update problem e.g. until the end of the last year, the official name of TRY was "New Turkish Lira", but then "New" was dropped. Eventually it would be better, to lookup names used in iso-codes by searching /usr/share/xml/iso-codes/iso_4217.xml insted of again and again adjust the list to a more recent version of iso-codes.

d) Errors in iso-codes-3.3:
Wrong Naming
SDD Pound!=Dinar

Wrong Translation
BRE (duplicate string)
MGF != MY

Obious Missing Translations
ADF
BOV
CDF
CLF
COU
CUC
MGA
TMT
UZS
SDR (de:SZR)
ZWL

Missing Code
YUM

So, could somebody test the patch against a more recent version of iso-codes?

BTW: did you add iso-code to the dependencies?

P.S. From the german POV, it would be nice, if the drop down list would be ~50% wider.
Comment 8 Christian Stimming 2010-05-07 07:51:21 UTC
(In reply to comment #7)
> Attached is the adjustment of iso-4217-currencies.scm, so that full names
> conform to iso-codes-3.3. I am not really happy with this solution, but it is
> better than nothing. 

Thanks for the patch. Indeed, I thought the same: We loose some of our original information, but at least we gain translations of 80%-90% of the cases for free.

> Caveats:
> In the current version we loose partial information:
> a) country names; eventually we should add another column derived from the
> first 2 Letters of the Code, to get them also over iso-codes.

Well, there is no one-by-one mapping of currencies and countries. http://www.iso.org/iso/support/currency_codes_list-1.htm It is rather a 1:N mapping - one currency, many countries. Clearly we would need another table to express that relation; IMHO this information cannot be entered in our current structure. But we're free to change the structure.

> b) obsolete status - ok, we can get that better using the new columns;

Yes. We should copy the data over from /usr/share/xml/iso-codes/iso_4217.xml

> c) there is an update problem e.g. until the end of the last year, the official
> name of TRY was "New Turkish Lira", but then "New" was dropped. Eventually it
> would be better, to lookup names used in iso-codes by searching
> /usr/share/xml/iso-codes/iso_4217.xml insted of again and again adjust the list
> to a more recent version of iso-codes.

I think we should completely revamp the gnucash structure here. We should use iso-codes/iso_4217.xml as basis with the currency mnemonic as key, and then add more tables with additional information if we have it.
- One table with iso_4217 currency: mnemonic, number, long name, whether it is historical-only, date_withdrawn.
- Next table: currency mnemonic, smallest fraction
- Next table: country code, currency mnemonic (where one currency may appear in many countries)

> Wrong Translation
> BRE (duplicate string)
> MGF != MY

That's a wrong *German* translation?

> BTW: did you add iso-code to the dependencies?

It's an optional dependency, but yes, it should be added and more importantly it should be added to the windows installer.

> P.S. From the german POV, it would be nice, if the drop down list would be ~50%
> wider.

Sure. Patch...?
Comment 9 Frank H. Ellenberger 2010-05-18 10:49:44 UTC
Created attachment 161332 [details] [review]
0001-Resize-currency-dropdown-list.patch

My first steps in glade. ;-)

I used glade 3, which created the file in a somewhat different way -
let me know, if that is a problem.
Comment 10 Christian Stimming 2010-05-19 11:38:21 UTC
Comment on attachment 161332 [details] [review]
0001-Resize-currency-dropdown-list.patch

The change is (most probably) fine.

Re glade-3: I'd suggest you could file one commit which only contains the conversion glade2 -> glade3, and a second commit with the actual changes. But in this case the single patch is probably fine as well.
Comment 11 Frank H. Ellenberger 2010-05-20 23:18:42 UTC
gedit bug 150535 
a) shows some interesting approaches, e.g. epiphany should have some useful code [see also http://mail.gnome.org/archives/desktop-devel-list/2005-March/msg00149.html ff]
b) says iso-code was targeted as dependecy for gnome 2.10

Re Comment 8:
If the first letter is != "X", the first 2 letters are the country code / tld. Special less known countries have unique currency names like lek, kwanza ...
I assume, it would be helpful, at least in the drop down list, to add the country name, if the string contains no space.

iso_4217.xml contains BRE 2x, so the first (=older, wrong) is fetched. It seems to be a typo, but affects all translations.

MGF malegassy (creol from Madagascar) != MY Malaysia is a wrong de-translation In both cases we should check newer versions, if it is fixed.

> should be added to the windows installer
and MacOS, I assume.
Comment 12 Frank H. Ellenberger 2010-05-22 00:56:34 UTC
There is a from iso-codes drived package isoquery git://git.debian.org/~toddy/isoquery.git . It shows how to query the xml files.

BTW git://git.debian.org/git/iso-codes/iso-codes.git most errors mentioned above are fixed.
Comment 13 Tao Wang 2010-05-27 15:11:30 UTC
I saw the localized translation for the 'long currency names' in the currency droplist. It works on my Ubuntu, thank you.

But, the I cannot make it work on Windows. I don't know why. I download the 'iso-codes-3.16.tar.bz2', './configure' and 'make install' to a specific location, then moved everything in share/locale to c:\program files\gnucash\share\locale. So, gnucash-bin.exe should be able to find those iso_4217.mo in locale/xx_XX/LC_MESSAGES/.

Why it still not work, all long currency names in the droplist is English. Did I missed anything?
Comment 14 Christian Stimming 2010-06-03 20:05:53 UTC
Comment on attachment 161332 [details] [review]
0001-Resize-currency-dropdown-list.patch

r19225, thanks a lot!
Comment 15 Tao Wang 2010-06-21 13:41:35 UTC
Could anyone tell me what should I do to make this works under Windows system? I tried copied the iso_4217.mo to locale/zh_CN/LC_MESSAGES/, but it doesn't work. What should I do next? Thanks.
Comment 16 Tao Wang 2010-07-08 15:37:22 UTC
Created attachment 165488 [details] [review]
Add isocodes to Windows build

This patch add isocodes support for Windows build. It automatically download, build, install and packaging the isocodes.

Currently, the patch will not make Windows build show the locale long currencies name. But it make the isocode available on Windows. Since the long currencies names are already shown on Linux, I think it should not far to make it happen on Windows too, especially the isocode will be available after this patch.
Comment 17 Frank H. Ellenberger 2010-09-17 00:44:10 UTC
Created attachment 170449 [details] [review]
0001-Put-isocodes-in-README.dependencies-to-inform-packet.patch

To inform the package maintainers, I reworked the Libraries/Deps section of README.dependencies.

 1. Link to more up to date http://wiki.gnucash.org/wiki/Dependencies
 2. Introduce Structure:
    required, alternatives, optional, at runtime suggested
 3. Add webkit and isocodes
Comment 18 John Ralls 2010-09-17 02:36:35 UTC
Is this set up as a dependency in configure?
Comment 19 Christian Stimming 2010-09-17 06:36:32 UTC
(In reply to comment #18)
> Is this set up as a dependency in configure?

No. It is not a compile-time dependency, so configure doesn't need to check it and it should stay this way.

It's a pure optional run-time dependency, i.e. if it is installed, gettext will pick up the translations from there, but if it is not installed, gettext just returns the untranslated currency names.
Comment 20 Christian Stimming 2010-09-21 18:25:31 UTC
Comment on attachment 170449 [details] [review]
0001-Put-isocodes-in-README.dependencies-to-inform-packet.patch

r19597, thanks!
Comment 21 Geert Janssens 2010-10-11 11:39:20 UTC
This bug is targeted for milestone 2.3.x and is still open. From reading the bug's history, it's not really clear to me why it is still open.

Can you quickly summarize what is still missing to close it ?
Comment 22 Christian Stimming 2010-10-15 21:40:07 UTC
Comment #16 said: "Currently, the patch will not make Windows build show the locale long currencies name." In other words, our C code is fine, only on Windows our installer and/or our rest of the installed infrastructure doesn't pick up the isocodes translation domain correctly.

Once our Windows installation uses this as well, this bug is fixed on all platforms.
Comment 23 John Ralls 2010-10-23 23:14:58 UTC
It is now. I just added it to the OSX build and bundle. ;-)
Comment 24 Christian Stimming 2010-11-14 13:19:56 UTC
Removing milestone: While it would be nice-to-have, there's no requirement to do this for this milestone, and apparently nobody feels able to debug that part.
Comment 25 John Ralls 2010-11-14 17:04:50 UTC
There isn't any debugging needed. Somebody who's interested in the Win32 build needs to add the iso-codes package to the distribution. Should be a 5-minute job. (That's what it took me on OSX, including testing.)
Comment 26 Christian Stimming 2010-11-14 19:40:10 UTC
(In reply to comment #25)
> There isn't any debugging needed. Somebody who's interested in the Win32 build
> needs to add the iso-codes package to the distribution.

No, that's not the issue. The iso-codes package *has* been added to the win32 installer in r19369 in July. So it is already there. However, Comment #16 said: "Currently, the patch will not make Windows build show the
locale long currencies name." In other words, our C code is fine, only on
Windows our installer and/or our rest of the installed infrastructure doesn't
pick up the isocodes translation domain correctly.
Comment 27 Geert Janssens 2016-03-22 22:30:41 UTC
I have just pushed a commit which I hope will fix this problem. It occurred to me gnucash on Windows may not be finding the translation files for the iso_currencies, so I have added a line to explicitly tell gnucash where to look.

I'll check tomorrow's nightly build to verify if my theory is right.

While the problem was only reported on Windows (and not reproducible on linux), the fix is platform independent.

@John, can you test if my change is not messing things up on the OS X build ? Thank you.
Comment 28 John Ralls 2016-03-23 00:20:35 UTC
Works fine on OSX.
Comment 29 Geert Janssens 2016-03-23 20:47:06 UTC
Unfortunately it doesn't work at all on Windows. Worse even it causes the windows binary to crash each time translated currency names are queried.

Back to the drawing board...
Comment 30 John Ralls 2018-04-14 19:22:48 UTC
New build system, new windows support system, now Geert's patch works. This is fixed for 3.1.
Comment 31 Geert Janssens 2018-04-16 17:56:56 UTC
Yay!
Comment 32 John Ralls 2018-06-29 20:35:35 UTC
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=118391. Please update any external references or bookmarks.