标签本地化C#

时间:2016-03-30 12:41:47

标签: c# localization label translation

我有一个Windows Form,我希望翻译localization。我知道如何使用界面执行此操作,但不知道如何使用代码。 例如,我有label

Label la = new Label();
la.Text = "Hello world";
this.panel1.Controls.Add(la);

我想写一个转义,所以我会这样:

For French : la.Text = "Bonjour tout le monde";
For English : la.Text = "Hello world";

有可能吗?

1 个答案:

答案 0 :(得分:1)

使用资源文件。把所有的字符串放入其中。然后在你的代码中使用它们:

la.Text = Resources.FrenchLaText;