I have several files

enter image description here

To whom i appeal

Properties.strings.(строка) 

How to get Properties.strings. (String) specifying the string key?

Ie if I have there for example the string English, then typing GetLocalizationString ("English") so that I get Properties.strings.English if it is

  • So enumerate (enum) the available languages ​​and in the GetLocalizationString method transfer the desired language, where there will be swith-case or if \ else if \ else depending on the language - LiptonDev

1 answer 1

You can use the GetString method of the GetString class, passing the key of the string to the first parameter, and the necessary culture to the second parameter:

 var ruCulture = new CultureInfo("ru-RU"); var ruString = Properties.strings.ResourceManager.GetString("someString", ruCulture); // strings.ru-RU.resx 

If you call GetString with one argument, then the string will be taken from the resource of the culture specified by the current in Thread.CurrentThread.CurrentUICulture

 var someString = Properties.strings.ResourceManager.GetString("someString"); // strings.resx 

If the string is not found for the culture you specify, then it will be taken from the default resource (resx without language extension)