Hybrid View
-
15 Nov 2012 2:38 AM #1
Unanswered: How to localize Yesno button in Ext 4.1 ?
Unanswered: How to localize Yesno button in Ext 4.1 ?
I want to localize the yes no text of button in extjs 4.1. I tried to change ext-lang-xx.js file but it doesn't work. Any suggestions please?
-
15 Nov 2012 3:24 AM #2
Yes and No buttons for which component?
-
15 Nov 2012 4:07 AM #3Sencha - Community Support Team
- Join Date
- May 2012
- Location
- Istanbul
- Posts
- 1,331
- Vote Rating
- 76
- Answers
- 124
sword-it.com, Sencha Developer House in Turkey - Istanbul University Technopark Suite 204.
-
15 Nov 2012 4:32 AM #4
I have this message.
I want to localize the yes, no, cancel of buttons. I have modified the ext-lang-xx.js file by adding this:Code:Ext.Msg.show({ title: "test", msg: "test", buttons: Ext.MessageBox.YESNOCANCEL, closable: true, fn: function( ){ } });
But the change isnot reflected in the message box buttons. How can I resolve this?Code:Ext.MessageBox.msgButtons['cancel'].text = "test"; Ext.MessageBox.msgButtons['yes'].text = "test"; Ext.MessageBox.msgButtons['no'].text = "test";
-
15 Nov 2012 4:53 AM #5
the way you are doing it is working in ExtJS 4.0.7 but not in 4.1.x. Change like this:
Code:// Add this to your locale file; remove the lines which you have posted above! they were meant to be removed for ExtJS 4.1.x if(Ext.MessageBox){ Ext.MessageBox.buttonText = { ok : "TestOK", cancel : "TestCancel", yes : "TestYes", no : "TestNo" }; } // Now you can create a message box like this in your app: Ext.Msg.show({ title:'Messagebox Title', msg: 'Are you sure want to delete?', buttons: Ext.Msg.YESNOCANCEL });
-
15 Nov 2012 5:00 AM #6
the locale file has the following comments:
Because of an earlier issue, the following 4 lines were added below these comments (which are no longer needed for ExtJS 4.1.x:// 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)
Code: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;


Reply With Quote