Inside the language tag we have all the classes (xaml pages) with the various controls and properties that need to be set
class name="MainPage" Title="Main Page"
control name="textBlockPageTitle" Text="MY APPLICATION"
Obviously it's easier to look at the code than to explain it. I also use a singleton class to share the XDoc, loaded from the xaml language, between various pages of the project and also to "translate" the pages.

There are still some problems with the ApplicationBar as there is no way to get a reference to the MenuItem using the name (when you debug the property doesn't even exist). I think it's a problem/missing feauture of the CTP. The solution I've adopted is to add a control name that doesn't exist on the page "AppBarMenuItem" that has 2 attributes Index and Text. This way I use the index to set the text of the MenuItem
control name="AppBarMenuItem" Index="1" Text="First"
The sample attached to this post is a project with 2 pages. If you need more details or you think it's useful please let me know
MultilanguageApp.rar
NAMASTE
This comment has been removed by a blog administrator.
ReplyDeleteHi,
ReplyDeleteIs this still the best solution? or did you change it?
There is an updated version:
ReplyDeletehttp://sviluppomobile.blogspot.com/2010/10/wp7-multi-language-v2.html