Just to answer my one question:
You have to get the Navigation View, on that useI can now translate my whole application with one button press: buttons, lists, placeholders, ect.Code:.getNavigationBar().titleComponent.getTitle() /setTitle('')
Just to answer my one question:
You have to get the Navigation View, on that useI can now translate my whole application with one button press: buttons, lists, placeholders, ect.Code:.getNavigationBar().titleComponent.getTitle() /setTitle('')
that's great, but can you provide maybe simple more detailed example (newbie level) for this all together ...
Would you please elaborate a little bit?
Where you put your localization code?
At creation time?
Before render?
After render?
At which level?
Top views or each component is responsible of its own localization?
I'm starting a new application and I want at least two languages support (english and spanish) so any help you can give me will be appreciated.
Regards.
UI: Sencha Architect / ExtJS 4 - 6
Server side: JEE / EJB 3.x / CDI / JPA 2.x/ JAX-RS / JasperReports
Application Server: WildFly / Weblogic
Databases: Oracle / MySQL / DB2 / Firebird
If you like my answer please vote!
Every component has a translation "key", typical the text. I will take this key look in my translation store (jsonp loaded at the start) if the store has the key I will replace the translation "key" with the value/text from the store for the given language code.
If it is a dynamic translation I will look it op when I create the component etc. none loaded buttons or titles.
getTranslation(key).
So I will do this for every component in the application. Its fast and works perfectly.
I hope this helps, let me know if I need to explain some things a little more.
I was thinking on traverse the config object or the dom looking for fieldLabel, column items and any localizable property and look for the localizable value in a (key, value) object and if found set the value.
What I still dont know at which moment do this: beforeRender, afterRender, override initComponent, etc.
In which event/method you do the localization?
Thanks.
UI: Sencha Architect / ExtJS 4 - 6
Server side: JEE / EJB 3.x / CDI / JPA 2.x/ JAX-RS / JasperReports
Application Server: WildFly / Weblogic
Databases: Oracle / MySQL / DB2 / Firebird
If you like my answer please vote!
Never mind.
I been experimenting today and crafting a singleton class "Localizer" which receives an instantiated container (window for example) and looks for localizable properties on each children and if appropiate text found is replaced "a la gettext".
What I still dont decided is the way I should get and store the translatation text and if I should design my application in english or spanish since english text are normally shorter than any other language.
Regards.
UI: Sencha Architect / ExtJS 4 - 6
Server side: JEE / EJB 3.x / CDI / JPA 2.x/ JAX-RS / JasperReports
Application Server: WildFly / Weblogic
Databases: Oracle / MySQL / DB2 / Firebird
If you like my answer please vote!
I use "activate".
But I could use another but I have to be sure that some of the components are rendered.
I'm attaching a project which is my current test bed for Localizer class.
Is work in progress but I'm attaching so any interested can test it and make suggestions.
The concept is simple: to localize a component you just call Localizer.localize(component, locale). The class looks for localized strings in "locales" property and if is not loaded tries to load it synchronously from ./app/locale/<code>.json. Then for each component in the container looks for localizable properties and for each one looks for the equivalent.
I used gettext port for Delphi a few years ago so to easy the localization of messages inside code, Localizer class creates a global function called _().
I start to figure out how to get localizable values from project's metadata files then generate a file or database table to be used for translation.
Regards.
PD: Tried to upload XDA file but allways loader says "invalid file".
UI: Sencha Architect / ExtJS 4 - 6
Server side: JEE / EJB 3.x / CDI / JPA 2.x/ JAX-RS / JasperReports
Application Server: WildFly / Weblogic
Databases: Oracle / MySQL / DB2 / Firebird
If you like my answer please vote!
sorry we know for now you have to zip up xda files. Going to put in a request to get these on the white list.
Phil Strong
@philstrong