Introduction
The recent project to localize in the Silverlight 2 application was thought to be a very simple process, but it didn't occur when it was twists, but the results were pretty good. The requirement is this, when the user first visits, the default is English, when the user chooses a display language, the record is local, the next time users visit directly show the language you have selected. Now I have recorded the whole process of realization and I hope it will help.
Preparatory work
We found that the ResourceManager class was provided in Silverlight 2, which means that it can be implemented through a resource file, first creating a folder in the Silverlight project, named Resources, Add a resource file Strings.resx and add a few values, as shown in the following figure:
The file will be the default resource file, setting access modifier to public, and it will generate the Strings.Designer.cs file, as shown in the following illustration:
Now create a few other language resource files, such as Chinese, French, Norwegian, and so on, note that the name of the resource file is made up of strings+ language and culture, the code for each language file, you can consult MSDN.
The access modifier for these other files is set to No Code generation. With these previous preparations, the implementation is followed.