Is there any built-in tool to support multilanguage applications in WinRT? For instance I have few buttons with text content “Add”, “Remove”, “Edit” in english and it should be “Dodaj”, “Usun”, “Edytuj” and so on in polish. Can I automatically set this text to user language? (and how to automatically detect user language?). I could use language model and bind buttons content to ViewModel property but isn’t there exist better way to do it?
Is there any built-in tool to support multilanguage applications in WinRT? For instance I
Share
This is well supported, and MS have a very good sample here: http://code.msdn.microsoft.com/windowsapps/Application-resources-and-cd0c6eaa
Setting the text of “static” content using the x:uid doesn’t work if the elements are databound. For example you have an observable collection in your view model containing username view models and you try and do the following (pseudo code!!):-
The text that should set the first textbox (based on the uid ByUser) won’t get set. I work around this by wrapping up the
ResourceLoaderin a Globalisation Service and passing this into my “UsersName” view model, I would then expose a property called ByUserText, and bind on that. Not ideal, hopefully this will get fixed.The only other thing you will need to use a globalisation service for is things like message boxes etc.
This is the globalisation service I pass around:-