如何本地化 Metro MessageBox 按钮

How to localize Metro MessageBox buttons

我需要本地化 Metro MessageBox buttons

我已经尝试过以下代码,但它不起作用。

有什么建议吗?

System.Globalization.CultureInfo cultureInfo = new System.Globalization.CultureInfo("es-UY");

Application.CurrentCulture = cultureInfo;

var dialogResult = MetroMessageBox.Show(this, "Are you sure to localize buttons?", this.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Question);

这个问题根本没有记录。

但最后我找到了解决方案。

  1. Take a look at the MetroFramework.Demo project. It has Localization folder.
  2. Copy this folder to you Visual Studio project and include into project.
  3. Create folder using two letters for instance let's use es (Spanish).
  4. Copy and paste MetroMessageBoxControl.xml file from de folder to the new es folder and apply Build Action attribute for this file like Embedded Resource.
  5. In place you need just change culture of your app to Spanish.

有效!