-
2 May 2012 12:33 AM #1
[4.1] Adding buttonText config to Ext.Msg.show adds the translated buttons
[4.1] Adding buttonText config to Ext.Msg.show adds the translated buttons
REQUIRED INFORMATION
Ext version tested:- Ext 4.1
- FF12 (firebug 1.9.1 installed)
- Chrome 18
- XHTML 1.0 Transitional
- When adding translations to the Ext.Msg.show method with the "buttonText" config, it adds the buttons that are translated instead of using the "buttons" config..
Code:Ext.Msg.show ({ msg: "message", title: "title", buttons: Ext.MessageBox.OKCANCEL, icon: Ext.MessageBox.ERROR, buttonText : { ok : "OK", cancel : "Annuler", yes : "Oui", no :"No" } });
The result that was expected:- A message box with OK and CANCEL buttons.
- A message box with OK, CANCEL, YES and NO buttons.
Additional CSS used:- only default ext-all.css
- Win7
-
3 May 2012 6:53 AM #2
Up !
Got exactly the same bug !
Have anyone of the team seen that post ??
Cheers
-
15 Jun 2012 7:14 AM #3
Please try the following:
Scott.Code:Ext.onReady(function() { var messageBox = Ext.create('Ext.window.MessageBox', { buttonText: { ok : "OK", cancel : "Annuler", yes: 'Oui', no: 'Non' } }); messageBox.show({ title: "A Title", msg: 'A Message', buttons: Ext.Msg.YESNO, icon: Ext.MessageBox.WARNING }); });
-
15 Jun 2012 7:19 AM #4
Hi Scott,
Thanks it works but.. is my test case wrong ?
-
15 Jun 2012 7:23 AM #5
I would have to research this. I believe there is a quirk that allows your approach to fail.
Scott.
-
15 Jun 2012 10:17 PM #6
This is actually the intended behaviour. It allows you to pass custom button text for a particular instance.
If you want to override them globally, you can use:
Code:Ext.MessageBox.buttonText = { ok: "Foo", cancel: "Bar", yes: "Baz", no: "Bleh" };Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
Looks like we can't reproduce the issue or there's a problem in the test case provided.


Reply With Quote