all groups > dotnet internationalization > january 2006 >
You're in the

dotnet internationalization

group:

resx files and localization


resx files and localization gabriel
1/30/2006 7:03:33 PM
dotnet internationalization:
greetings,

I am developping a windows form app and trying my hand at i18n.

private ResourceManager messages ;
public Form1()
{
CultureInfo frenchCulture = new CultureInfo("fr-FR");
Thread.CurrentThread.CurrentCulture = frenchCulture;
this.InitializeComponent();
this.messages = new ResourceManager("galeryMaker.messages" ,
Assembly.GetExecutingAssembly());


//Will correctly extract the ERR_DIR_BUSY msg from
galeryMaker.messages.fr-FR.resx
string test = messages.GetString("ERR_DIR_BUSY", frenchCulture);

// Will fail
string test = messages.GetString("ERR_DIR_BUSY");


....
}


My question is this : why do I have to define the culture I want to use
in the getString method if I have defined it in the
Thread.CurrentThread.CurrentCulture reference ???

Visual studio is 2003.

Re: resx files and localization Mihai N.
1/30/2006 10:21:24 PM
[quoted text, click to view]

You have to set Thread.CurrentThread.CurrentUICulture
Strings is about UICulture, UICulture is about formatting
time/date/numbers/etc.


--
Mihai Nita [Microsoft MVP, Windows - SDK]
http://www.mihai-nita.net
------------------------------------------
Re: resx files and localization gabriel
2/2/2006 8:48:18 PM
[quoted text, click to view]
AddThis Social Bookmark Button