Translation issues in KUnitConversion::Currency

John Layt johnlayt at googlemail.com
Wed Dec 2 22:23:39 GMT 2009


On Tuesday 01 December 2009 08:16:06 Petri Damstén wrote:

> Yes, and I think that SI units like i18nc("mass unit symbol", "kg") should
>  not be translated either?

Not sure about that, I'll check with the translators, but I think they do get 
translated.  The ISO Currency Codes are designed as a data interchange 
standard and need to stay constant, hence why they are not normally 
translated.  I'd guess the SI unit abbreviations being in wider user are 
likely to have local versions, e.g. I don't know if Arabic speakers would 
still use kg?  I'll check.

> I think they should still be case sensitive. Mg and mg are different units.
> But it's true that there's no need for multiple versions. Lower casing can
>  be handled in runner. Runner now first tries to find perfect match and
>  then startsWith match that can result multiple hits. If startsWith is
> CaseInsensitive it should work.

Cool.  So keep only those with the correct case, remove any duplicates with 
'incorrect' case, and let runner do the work?  Makes sense to me.

e.g. "schilling;schillings;ATS;ats;austria" => 
"schilling;schillings;ATS;Austria"

> What other classes need changing (if not talking about SI units)?

None now,  as they have no repeated lowercase values, unlike currency.

I'm no expert on measurements, but I think I have found some other problems.

timeunit.cpp:

julian year => Julian year


temperature.cpp

celsiuses and fahrenheits are definitely not real words and should be removed, 
and I don't think  delisles, reaumurs and romers are either.  newtons I don't 
think is right in this context.

celsius => Celsius
fahrenheit => Fahrenheit
rankine => Rankine
delisle => Delisle
newton => Newton
reaumur => Reamur
romer => Romer

I think it should be:
"%1 Rankine" => "%1 degree Rankine"
"%1 Rankines" => "%1 degrees Rankine"
And an extra synonym "Ra"?


velocity.cpp

beaufort => Beaufort

"%1 beauforts" => "Force %1 on the Beaufort scale" or just "Force %1"
(I've never heard it used as a unit, it's a scale like Celsius)

"%1 speed of light" doesn't quite seem right to me. How is this used in 
practice, given nothing is faster than the speed of light so the value will be 
between 0 and 1?  For example I think I've only seen 0.99c written as "0.99 of 
the speed of light" or "0.99 the speed of light" or "99% of the speed of 
light"?  Not sure.


I can ask for exemptions for these if you agree.

> So this could be:
>     i18nc("unit synonyms for matching user input",
>           "rand;rands;%1;%2;%3",
>           "ZAR",
>           KGlobal::locale()->countryCodeToName("za"),
>           KCurrencyCode::currencyCodeToName("ZAR"))

Even better :-)

> This leaves "South Africa Rands" unmatched though.

Well, the current match string is "rand;rands;ZAR;zar;south africa", so I'm 
not sure how "South Africa Rands" would currently match to that but not the 
new "rand;rands;ZAR;South Africa;South African Rand"?

(Actally rands is one of the incorrect plurals, it should only ever be rand 
:-)

Cheers!

John.




More information about the kde-core-devel mailing list