0

I am using sencha touch 2.3 and I am using the plug-in locale to change my page's language.

Whatever is included in the view of the page gets changed using the locale plug-in but lets say I want to alert some text depending on the language then how do i do it.

Ext.Msg.confirm(
            "Application Update",
            "This application has just successfully been updated to the latest version. Reload now?",
            function(buttonId) {
                if (buttonId === 'yes') {
                    window.location.reload();
                }

So the above alert box I want to change the text "Application Update" & "This application has been updated etc etc"

So how do I do it using Ux.locale.Manager

Nick Div
  • 5,338
  • 12
  • 65
  • 127

1 Answers1

1

I couldn't get Ux.locale.Manager to do it dynamically, so instead I used i18next library.

Basically, you will load your translation like this: i18n.t('common.back');

Where common.back is a json resource.

Also check out this post.

Tha Leang
  • 3,070
  • 1
  • 16
  • 14
  • Thanks for your answer, but I was able to change the text using Ux.locale.Manager.get(key) to change the text. But I learned something new from your article. Upvoted. – Nick Div Jun 04 '14 at 15:23