PDA

View Full Version : Translating the RowEditing plugin



Pacos
19 Dec 2011, 8:31 AM
Hi,

I'm willing to translate the text content of the RowEditing plugin (mainly buttons' text) to french. So I added this to my ext-lang-fr.js :


if(Ext.grid.plugin.RowEditing){
Ext.apply(Ext.grid.plugin.RowEditing.prototype, {
saveBtnText : "OK",
cancelBtnText: "Annuler",
errorsText: "Erreurs"
});
}

And I load this file in my index.html. Other menus, titles, etc. are translated, but not the RowEditing plugin buttons.

So, I looked through the DOM with Firebug, and saw that the text properties were correctly set in French.
What did I miss ? Does this has something to do with the use of a Loader ?

As usual, thanks in advance for your precious help ! I'll provide additionnal code of informations if needed.

mitchellsimoens
19 Dec 2011, 10:35 AM
Have you tried to set a breakpoint on initEditor in RowEditing to see if they are used in the Editor?

Pacos
21 Dec 2011, 12:47 AM
Thanks for the tip !

In fact, it appeared that I wasn't applying the new text values to the right object : it was Ext.grid.RowEditor that needed to be translated, not Ext.grid.plugin.RowEditing.

For the record, here is the code that needs to be added to the locale file :


if(Ext.grid.RowEditor){
Ext.apply(Ext.grid.RowEditor.prototype, {
saveBtnText : "OK",
cancelBtnText: "Annuler",
errorsText: "Erreurs"
});
}