shubham shishodia
shubham shishodia

Reputation: 9

Updating a specific resource in a .NET assembly without rebuilding the whole project

I'm working on a .NET project and have encountered a scenario where i need to update a specific resource in a satellite assembly for the Japanese('ja-JP') culture without rebuilding the entire project. Here are the details:

  1. Current Setup:
  1. Issue:
  1. Steps Taken:
  1. What I'm seeking:

Please provide a detailed walkthrough or explanation of the process, as I'm relatively new to working with satellite assemblies.

The source code:

string cultures = "ja-JP";
CultureInfo newCulture = new CultureInfo(cultures[cultureNdx]);
Thread.CurrentThread.CurrentCulture = newCulture;
Thread.CurrentThread.CurrentUICulture = newCulture;
ResourceManager rm = new ResourceManager("Example.Greeting",
                                      typeof(Example).Assembly);
string greeting = String.Format("The current culture is {0}.\n{1}",
                              Thread.CurrentThread.CurrentUICulture.Name,
                               rm.GetString("HelloString")); // HelloString is the key in resx
MessageBox.Show(greeting);

Upvotes: 0

Views: 100

Answers (0)

Related Questions