neuronalbit
neuronalbit

Reputation: 360

Multiple Language Support in WP8 app

For my WP8 app i want to provide support for several languages. For this I'm currently using *.resw files in order to store language specific text for needed xaml elements. I also defined the default language (en-US) within the *.appxmanifest.

Regarding my project's file organization, I created several language files used for different groups of information, e.g. button context ("AppBarButtons.resw") or pivot header ("PivotHeader.resw").

But now I'm not quite sure if this is the best solution. What would be if there are elements on different pages, all with the same x:Uid property?

So my question is, should i stick to this solution or shall I create a language file for each page individually, and how can I let the user choose a specific language (only if available for this app of course) programmatically?

Upvotes: 1

Views: 80

Answers (1)

Stuart Smith
Stuart Smith

Reputation: 2051

Create only one .resw file per language. Creating one per form is going to become a very difficult solution to maintain over time, especially if you share terms between forms. Also use the x:Uid notation in the xaml when possible this makes life so much easier. I found the following video from Microsoft on languages in windows phone to be quite helpful ...

http://channel9.msdn.com/Series/Building-Apps-for-Windows-Phone-8-1/08

If wanting to use the same translations such as in the app bar save button for example: the XAML would look like as follows...

<AppBarButton x:Uid="AppBarSave" Label=""  Icon="Save" Click="AppBarButtonSave_Click"/> 

The resource file would like like the following:

enter image description here

Upvotes: 1

Related Questions