Translation issues in KUnitConversion::Currency
John Layt
johnlayt at googlemail.com
Mon Nov 30 19:58:16 GMT 2009
Hi,
It's been raised on the i18n mailing list that there are some problems with
the translatable strings in the KUnitConversion::Currency class. I've been
asked to help fix these, which has led me to a couple of other things I think
need fixing.
1) A number of currency units have incorrect plural forms, e.g. latss,
litass, yuans, etc. I will be fixing these to the most common en_US usage.
2) None of the country names are correctly capitalised, e.g. french francs,
australian dollars, etc. I will be fixing these.
3) At least one of the country names is not in English, e.g. brasilia. I will
be fixing these.
4) The "unit description in list" is somewhat inconsistent, with some
descriptions including the country name and some not.
The new KCurrencyCode class in kdecore provides a standard name that will be
consistent throughout KDE and will save on translations.
Will it be OK to replace the lines like:
i18nc("unit description in lists", "new zealand dollars")
with
KCurrencyCode::currencyCodeToName("NZD")
which will return a standard format and translated name like:
"New Zealand Dollar"
5) Is it necessary to translate the "currency unit symbols" themselves, e.g.
"USD"?
These are ISO international standard codes and I have never seen them used
translated, and the ISO website specifically mentions about their not being
good for localisation as a problem (hence the numeric form of the code). In
KSpread and KMyMoney they are translatable but no KDE language has ever
translated them.
In particular, I don't think the conversion rate lookup from the ECB download
will work if the codes are translated?
Is it OK to remove the translation on these?
6) The unit synonyms for matching are repeated in various upper, mixed and
lower case forms, e.g. "NZD;nzd;New Zealand;new zealand".
Wouldn't it be better to have just a single lowercase version of each synonym,
and when attempting to match in UnitCategory just .toLower() the users input?
It will save the translators some work, and be more efficient.
Of course , that might cause problems for other unit types, e.g. Mb vs MB?
We'd need to OK this point with the translators first, it may have to wait for
4.5 as it's not a real error and would need changing in all the other
conversion unit classes as well, and I only have the OK to change the Currency
ones.
I can also replace having the country name directly in the synonym list with
the existing translations from KLocale, i.e. replace:
i18nc("unit synonyms for matching user input", "rand;zar;south africa")
with something like
i18nc("unit synonyms for matching user input", "rand;zar;%1",
KGlobal::locale()->countryCodeToName("za"))
and if the Currency Codes are untranslated then
i18nc("unit synonyms for matching user input", "rand;%1;%2", "zar",
KGlobal::locale()->countryCodeToName("za"))
I think that's all for now :-)
Cheers!
John.
P.S. In 4.5 I hope to add currency unit names (dollar, dollars, etc) and fancy
money formatting to KCurrencyCode, so long term that's even fewer translations
needed.
More information about the kde-core-devel
mailing list