Switching language on Windows 8 Store App (WinJS)
Using the Multilingual App Toolkit for Visual Studio is a great way to quickly make your app available across many different languages, and make it much more attractive to foreign users.
But, you do get tempted, as I did, to click every box, and upload every language from Arabic to Zimbabwean, but then, my app got rejected because my screenshots were in English.
Sure you can go into control panel, switch your language, and restart the app, in the simulator, but for 20-30 languages, it takes aaaages… So I came up with a bit of javascript that switches the app language every 3 seconds, so that you get time to take a screenshot of each language.
var iLangPointer = 0;
function CycleLanguages() {
var supportedLangs = [“ar”, “cs-CZ”, “da-DK”, “de”, “el-GR”, “es”, “et-EE”, “fi-FI”, “fr”, “hu-HU”,
“it”, “ja-JP”, “ko-KR”, “lt-LT”, “lv-LV”, “nb-NO”, “nl”, “pl-PL”, “pt”,
“ru-RU”, “sv”, “zh-Hans”];
Windows.Globalization.ApplicationLanguages.primaryLanguageOverride = supportedLangs[iLangPointer];
WinJS.Resources.processAll();
WinJS.Resources.processAll();
iLangPointer++;
if (iLangPointer >= supportedLangs.length) iLangPointer = 0;
}
Then, this is called from WinJS.UI.Pages.define {ready: … with
setInterval(CycleLanguages, 3000);
And it saves hours of work!
The App is a free download (for now), you can download it here:
http://apps.microsoft.com/windows/en-gb/app/wine-search/65894548-5b19-47a6-b262-641540e5bb5f