PDA

View Full Version : How to reset 'Yes' to '确定' for Ext.Msg.confirm



ms_dn
12 Feb 2012, 11:17 PM
How to reset the button text from 'Yes' to '确定' for Ext.Msg.confirm? I did Ext.window.MessageBox.buttonText.yes = '确定', it can't work.

Another issue: I want to change the button text 'Update' to a Chinese character for Ext.grid.plugin.RowEditing, how i can do it?

Any help is appricated!

Farish
12 Feb 2012, 11:39 PM
For row editing plugin, you can use:


Ext.grid.RowEditor.prototype.saveBtnText = "What you want here";

ms_dn
13 Feb 2012, 6:04 PM
Farish, thank you! It works.

For the reset the button text from 'Yes' to '确定' for Ext.Msg.confirm, anyone any thoughts? Thanks ahead!

Farish
16 Feb 2012, 3:33 AM
I found this code in one of the locale files. May be this can be helpful for you:

if(Ext.MessageBox){
Ext.MessageBox.buttonText = {
ok : "OK",
cancel : "Abbrechen",
yes : "Ja",
no : "Nein"
};

// As of 4.0.4, setting the buttonText above does not take effect properly. This should be removable in 4.1.0
// (see issue EXTJSIV-3909)
Ext.MessageBox.msgButtons['ok'].text = Ext.MessageBox.buttonText.ok;
Ext.MessageBox.msgButtons['cancel'].text = Ext.MessageBox.buttonText.cancel;
Ext.MessageBox.msgButtons['yes'].text = Ext.MessageBox.buttonText.yes;
Ext.MessageBox.msgButtons['no'].text = Ext.MessageBox.buttonText.no;
}

yAdEs
18 Feb 2012, 10:22 PM
Have you import "ext-lang-zh_CN.js"?

JTM
3 Oct 2012, 9:44 AM
Was this issue resolved for other locales? Although the release notes for 4.0.7 proclaim this to be fixed, that does not seem to be the case for me.