Cyrillic characters in MessageBox class of Sencha Touch

久未见 提交于 2019-12-13 02:15:50

问题


I am working with different languages with the Sencha Touch framework, and translating MessageBox buttons to different languages, I have added it and it is working but with the russian I am having problems, instead of appears the correct translation appears "???" doesn´t detect correctly the translation with special characters. Any clue?


回答1:


Yes, I am working with UTF8 charset, but I have solved this issue receiving the labels from the backend here the code:

 var language = 'RU', //sent from the backend
            overWriting = Ext.MessageBox.YESNO;
        switch (language) {
            case "RU" :
                var b = Ext.MessageBox;

                Ext.apply(b, {
                    YES: {text: 'russian text YES', itemId: 'yes', ui: 'action'},
                    NO: {text:'russian text NO', itemId: 'no'}
                });

                Ext.apply(b, {
                    YESNO: [b.NO, b.YES]
                });
                overWriting = b.YESNO;
                break;
}


来源:https://stackoverflow.com/questions/31564533/cyrillic-characters-in-messagebox-class-of-sencha-touch

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!