PDA

View Full Version : howto localize MVC application.



sekaijin
2 Dec 2011, 6:15 AM
HI
How to translate an MVC application?

I tried to download the file "ext-lang-fr.js" after "ext-debug.js"
But an exception is thrown because Ext.view is not defined.
in effent Ext.Loader support component after.

I tried on onReady but again fails the assessment for the same reason.

I tried the method "launch" of the application without success

The problem is that if I support the local after the launch of my application, the "view" components are defined, but the view is created in English.
If I load the local before the launch of the application view is not yet defined but component not

how to load the components in the language of the user.

I tried to use ext-all-debug instead of ext-debug since all components are well defined before loading the local and launch the application.
but then MVC does not work.

A + JYT

mitchellsimoens
2 Dec 2011, 8:31 AM
The way that the locale files do it is just an override. There usually are if statements to check to make sure the class is present and then it will execute an override. Not my favorite way of locale so I created a simplistic means of it: https://github.com/mitchellsimoens/Ext.LocaleManager

sekaijin
3 Dec 2011, 3:21 AM
Hello and thank you.

I just have a look at "Ext.LocaleManager" but I'm not sure that answers my question.

I'll take a closer look. My problem is not locating my components but those of "Ext.core"

such as how to schedule a "DatePicker" either in the language of the user.

For this purpose in view I add a DateField
Ext.Loader support the DateField component but it is in English.
{
xtype: 'DateField'
fieldLabel: lm.get ('fields.dateofbirth') ',
name: 'dob'
allowBlank: false
}

The label is well translated but the DatePicker?
This would require that the local file to be loaded outside of Ext I can not commprendre how.
ExtJS locale file assumes that all ExtJS components are set out with the MVC pattern is not the case.


I will study Ext.LocaleManager.
A+JYT
PS: sorry for my approximative english