openGeeksLab / codenameone

Automatically exported from code.google.com/p/codenameone
0 stars 0 forks source link

Localization shortcoming with dynamic content #1358

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
The localization support has shortcomings.

For the Label component one can set the shouldLocalize to prevent localization 
from taking place. But there are components which are derived from Label and 
where developers usually do not get in touch with an instance.
This is the case with the Form title. One might want to show dynamic content 
there based on a user entry.
I do not like the idea that something that is entered by the user then gets 
localized by accident.

Please fix that. For the meantime I will use localization keys which cannot be 
possibly entered by the user. That also means that I am not able to use the 
Codename One Designer for editing the localization properties.

Original issue reported on code.google.com by Stefan.A...@gmail.com on 17 Feb 2015 at 1:33

GoogleCodeExporter commented 8 years ago
Do you have a suggestion on how to workaround that?
In the case of the title you can prevent localization using getTitleComponent().

Original comment by shai.almog on 18 Feb 2015 at 8:21

GoogleCodeExporter commented 8 years ago
How about the MultiButton component? What would You do there?
And how would You handle Form commands, which are implemented as Button and 
derive from Label?

No, I don't have a suggestion other than to add shouldLocalize to composite 
components. It is your concept. I wouldn't have done it that way.

It would probably be a good idea if composite components had a factory for 
component instantiation which one could then use to customize things. If the 
Form component had such a feature one could, for example, define the icon 
location and set shouldLocalize and the like.

Original comment by Stefan.A...@gmail.com on 18 Feb 2015 at 10:15