Skip to content

Instantly share code, notes, and snippets.

@arman-hpp
Created August 27, 2019 04:58
Show Gist options
  • Save arman-hpp/fb161009b2ceb780e1f3cf2dd1b092b2 to your computer and use it in GitHub Desktop.
Save arman-hpp/fb161009b2ceb780e1f3cf2dd1b092b2 to your computer and use it in GitHub Desktop.
CultureTest
private void button1_Click(object sender, EventArgs e)
{
// Declare a Resource Manager instance.
ResourceManager LocRM = new ResourceManager("CultureTest.Language", typeof(Form1).Assembly);
// Assign the string for the "strMessage" key to a message box.
MessageBox.Show(LocRM.GetString("Hello"));
}
private void button2_Click(object sender, EventArgs e)
{
Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US");
}
private void button3_Click(object sender, EventArgs e)
{
Thread.CurrentThread.CurrentUICulture = new CultureInfo("fa-IR");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment