Last post Sep 06, 2006 04:42 AM by s3ns
Aug 29, 2006 07:53 AM|s3ns|LINK
i 've got two ressource files (in my App_GlobalResources folder):
Captions.resx -> standard holds the english captions
Captions.de.resx -> german captions
they got linked to my controls by the IDE like this:
<...control tag Text="<%$ Resources:Captions, ltStatus %>" />
ltStatus would be the key of this value
i'm doing the following in my page_load:
if (m_sParams[(int)eParams.FilterLanguage] == "0") //deutsch
Thread.CurrentThread.CurrentCulture = new CultureInfo("de-DE");
Thread.CurrentThread.CurrentUICulture = new CultureInfo("de-DE");
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US");
//Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-US");
//Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo("en-US");
The Problem is: the language does not switch back from german
if english is selected and he takes the standard ressource file it displays correctly
then i switch to german and it's displayed in german
BUT if i try to switch back to english it stays GERMAN
where is my mistake??
Aug 29, 2006 11:23 PM|Gordon-Freeman|LINK
Aug 30, 2006 08:43 AM|s3ns|LINK
in debug mode it jumps into the right path so it does switch to the "right" culture
i think that there is something wrong in:
naming of the ressource - files ??
or maybe the cultures i am setting??
when i am setting the culture to en-US and there is no
Captions.en.resx does it take the standard file automatically??
i tested this thing like that:
the var that holds the language value was hardcoded
first time to 1 so it "switches" to standard -> english - OK
second time to 0 so it switches to german - OK
third time i hardcoded the var back to 1 so it should take
the standard file again but it didn't
each test i started in debug mode and stopped
the whole thing afterwards
Aug 30, 2006 09:18 PM|Gordon-Freeman|LINK
Sep 01, 2006 05:52 AM|s3ns|LINK
ok, what should my ressource files look like then??
and to what cultures do i have to switch??
de-DE for the german captions
and which culture if i want the standard file to be taken ??
Sep 06, 2006 04:42 AM|s3ns|LINK