0

I have a two resource files in my windows service for the purpose of localization (English and French). These resource files contain messages that I want to show the user after the service completes its task. The language in which I want to show these messages come from database (en/fr). I'm using CurrentCulture and CurrentUICulture to set the languages.

 Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(language);
 Thread.CurrentThread.CurrentUICulture = new CultureInfo(language);

If I run the service in DEBUG mode the language sets fine and if I set to en I get the messages in English and if I set it to fr I get the messages in French. But after installing the service (vs setup project) all the messages I get are in English whether I set it to en or fr

Are there any other settings for localization?

Rida Iftikhar
  • 186
  • 3
  • 16
  • How did you get the localized strings? By default `ResourceManager` uses the satellite assemblies for every language – Pavel Anikhouski Dec 18 '19 at 14:26
  • @PavelAnikhouski I get the strings by `ResourceFileName.ResourceKeyName`. The access modifier for both files is set to `Public`. I also tried using the `ResourceManager.GetString()`, it didn't work either. – Rida Iftikhar Dec 19 '19 at 05:40
  • Found the answer here: https://stackoverflow.com/questions/6999835/localizing-windows-service. Windows Service can't find the satellite assembly, it needs to be registered in GAC. – Rida Iftikhar Dec 19 '19 at 12:25

0 Answers0