22 Feb 2012 1:12 PM #1
The application I am developing for my work should be in 12 different languages.
So every button, tabbutton..... Has its own "text" depending on the language selected on the first view.
How do I solve this in the designer?
23 Feb 2012 10:31 AM #2
We plan to add multi lang support further in the road map. We don't support it directly as of yetPhil Strong
23 Feb 2012 10:38 AM #3
Any good advise? I did it in ST1 by having a object for every language, like danish.hello world give "hej".
But I don't see how I could set a text property to something else then a String in the Designer?
24 Feb 2012 9:09 AM #4
Would have to be done after the fact outside of designer. You could use Designer to do it in one language and then use favorite text editor and find/replace tactics to replace the strings with objectsPhil Strong
24 Feb 2012 11:04 AM #5
My deadline is soon so I have to figure this out. If no one has any sugestions I might post my solution here. Language selection will be essential for many of our apps.
24 Feb 2012 6:27 PM #6
- Join Date
- May 2010
- Guatemala, Central America
- Vote Rating
I been thinking on such issue and the only solution you have is to write some sort of interceptor on constructor and/or initComponent() which read language resource, traverse the DOM tree and replace properties (label, title, etc.) of already instantiated views.
Regards.UI: Sencha Architect 3.x / ExtJS 4 & 5
Server side: JEE / EJB 3.x / CDI / JPA 2.x/ JAX-RS / JasperReports
Application Server: Glassfish / WildFly
Databases: Oracle / DB2 / MySQL / Firebird
If you like my answer please vote!
28 Feb 2012 9:26 AM #7
We need to be able to offer users customisable literals for everything.
So what we've done so far is to define a function in launch() like window.myapp.t() which takes a string argument and returns the corresponding string from an associative array defined in a localisation js file included earlier. So every time you need a literal (eg a label) you put myapp.t('thisform.thislabel')
I'd be interested to hear better suggestions and look forward to Sencha fully supporting translations.
28 Feb 2012 9:56 AM #8
28 Feb 2012 7:58 PM #9
No you can't do this in Designer.
you could do something clever like set all the components you need localized to a special cls like localizeMe and a 2nd cls to $localizeIndex.
then you could have a script that traverses the dom on application launch looking for all components that have .localizeMe and you could use the $whatever to lookup the correct text depending on localization. Include a different resource file depending on language.
2 Mar 2012 3:02 AM #10
Its going great with this feature. I just have one problem, Navigation View Title.
I would like to change the title on the toolbar title. But if i change config.title = foo; It will not be visible.
There is not set and get. What can i do?