• Welcome to DictionaryForMids Forum.
 

Smal bug

Started by jn0101, 01. June 2010, 13:08:15

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jn0101

See here

This is for "Esperanto-Czech", 320827 bytes.

I suspect the string
   <string name="file_size">%1$,.2f %2$s</string>
is somehow causing trouble.

I always get it when unit is kilobytes.
I never get it when unit is megabytes.

axin

Thanks for the report!

This is an Android 1.6 device with en-US locale using DfM with Esperanto UI, yes?
Does Esperanto use , or . as decimal separator, e.g. 5,31 or 5.31? I guess the bug is not related to KB, MB,... but to the number of digits before the decimal separator. If Esperanto uses . for separation, we just delete the , in file_size. If not... hmm...

-Achim

jn0101

Esperanto and Danish uses (like most european countries) the , to seperate the fraction from the whole part.
What shoud the pattern be, in this case?

Probably a lot of translators will have missed this...

axin

Some more investigations into that problem:

The docs changed as the Android SDK developed:
- http://www.androidside.com/docs/docs1.5/reference/java/util/Formatter.html: flag , stands for "Use a comma in place of a decimal if the locale requires it."
- http://developer.android.com/reference/java/util/Formatter.html: does not mention this anymore

Some tests on Emulator with en-US system default locale:
- Android 1.5, da UI locale: "%1$.2f" gives 123.45, "%1$,.2f" gives 1,2,3.45
- Android 1.6, da UI locale: "%1$.2f" gives 123,45, "%1$,.2f" gives 123,45
- Android 1.6, eo UI locale: "%1$.2f" gives 123.45, "%1$,.2f" gives 1,2,3.45
- Android 2.0, eo UI locale: "%1$.2f" gives 123.45, "%1$,.2f" gives 1,2,3.45

It looks like the behaviour is always wrong when there is a comma (I guess this has once been working with some older version of the SDK), so as an intermediate solution I'll remove the comma from file_size for all languages. Danish and other European versions will then use the comma instead of the point, but unsupported locales like Esperanto will fall back to some default locale for formatting numbers (en-US on my system), consequently those locales will be using the point as decimal separator.
This way is definitely not perfect, but better than before, yes?

What struck me most was that no one else experienced this problem. Normally I'd expect many forum posts describing the problem...

-Achim

jn0101

Cool you found out Achim!

Yes, seems a good idea.

In general I think you can assume that noone are using 1.5 anymore (but 1.6 yes).

Jacob

axin