Specify the current localization information in the project file <project_name>. csproj:
<Propertygroup>
<Uiculture> en-US </uiculture>
</Propertygroup>
Rebuild Will Generate debug \ en-US \ <project_name>. Resources. dll
You need to use X: UID to set a unique identifier for each uielement:
<Button X: uid = "btntest"> test localization </button>
You can use the tool to generate automatically:
Msbuild/T: updateuid <project_name>. csproj
Generate a localized text file for the current language-<project_name>. Resources. CVS:
Locbaml/parse en-US \ <project_name>. Resources. dll
Manually modify and save it as a text file in the target language-<Project_name>. Resources. Chinese. CVS
Create directory: Debug \ ZH-CN
Create the target language library-ZH-CN \ <project_name>. Resources. dll:
Locbaml/generate en-US \ <project_name>. Resources. dll
/Trans: <project_name> .resources.french.csv
/Cul: ZH-CN
/Out: ZH-CN
Localized changesCode: UsingSystem. Threading;
UsingSystem.
PublicMyccapp ()
{
Cultureinfo CI = new cultureinfo ("ZH-CN ");
Thread. currentthread. currentculture = CI;
Thread. currentthread. currentuiculture = CI;
}
Note:
Locbaml tool sample (download) (compilation required. After compilation, copy the EXE file to the bin \ DEBUG directory)
Culture name (view)
Pai_^ supplement:
After writing the essay, I saw an articleArticle, The content is surprisingly similar (localization in WPF), and it is more concise and easy to understand than I wrote, Khan!
Suddenly: the innovation of technology followers was originally an imitation. Khan, we were the same, yeah!
Tomorrow, I will change my mind to an artist. I will first design a big profile picture for myself and mount it to the Internet with the post "True Originality: Self-blind painting ". Pai_^