I want to use localization in my project so I'm using ".resx" files.
I have two files "StringRes.resx" and "StringRes.fr.resx". As you can guess, I want that all the messages of my app change according to the CultureInfo of the user.
But when I do this :
public MainWindow()
{
Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo("fr");
InitializeComponent();
}
It doesn't change anything when I do :
Console.WriteLine(StringRes.FirstName);
Indeed, it's always the string in StringRes which is displayed and not the string from StringRes.fr
The both are in the same namespace.
Thank you for any help.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…