This is my first experience using the ResourceManager to localize UI
elements. I have created a culture neutral .resx, a German (de) .resx, and
an English (en) .resx. My goal is to initially test this to make sure that
it pulls the correct strings based on the local culture. To do this, I
changed my regional options to German, however it still shows the English
version when I run.

Is this a correct testbed for this, or is there something more/different
that needs to be done? It seems like, although I've changed the regional
settings in the control panel, it still senses the culture as English.

Re: ResourceManager testbed by Patrick

Patrick
Wed Apr 20 04:17:59 CDT 2005

Hi Chuck,

Could you please add some code of how you retrieve the string.

Regards,

Patrick

"Chuck Shuhler" <Chuck Shuhler@discussions.microsoft.com> wrote in message
news:83F2A104-2177-4619-AC6E-7DA4585683E0@microsoft.com...
> This is my first experience using the ResourceManager to localize UI
> elements. I have created a culture neutral .resx, a German (de) .resx,
> and
> an English (en) .resx. My goal is to initially test this to make sure
> that
> it pulls the correct strings based on the local culture. To do this, I
> changed my regional options to German, however it still shows the English
> version when I run.
>
> Is this a correct testbed for this, or is there something more/different
> that needs to be done? It seems like, although I've changed the regional
> settings in the control panel, it still senses the culture as English.



Re: ResourceManager testbed by ChuckShuhler

ChuckShuhler
Wed Apr 20 08:13:01 CDT 2005

Patrick,

The initial declaration instances a static resource manager for the class
library as follows:

private static ResourceManager resources = null;

public static ResourceManager Resources
{
get
{
if (resources == null)
{
resources = new ResourceManager("ASNDATA.StringTable",
Assembly.GetExecutingAssembly());
}
return resources;
}
}

When requesting a string from the table, the following code is invoked:

string message;

message = <DLL Namespace (Name changed to protect the
innocent)>.Data.Internal.Resources.GetString("MESSAGE_QUEUE_EMPTY");

Where MESSAGE_QUEUE_EMPTY is a tag in the string table.

Now, I have a default resource, English resource, and German resource, and
for testing purposes, I've made the string in each .resx corresponding to
this tag different. When the string is retrieved, regardless of the regional
settings, the English satellite assembly is loaded and used.
----------------------------------------------------------------------------------


"Patrick" wrote:

> Hi Chuck,
>
> Could you please add some code of how you retrieve the string.
>
> Regards,
>
> Patrick
>
> "Chuck Shuhler" <Chuck Shuhler@discussions.microsoft.com> wrote in message
> news:83F2A104-2177-4619-AC6E-7DA4585683E0@microsoft.com...
> > This is my first experience using the ResourceManager to localize UI
> > elements. I have created a culture neutral .resx, a German (de) .resx,
> > and
> > an English (en) .resx. My goal is to initially test this to make sure
> > that
> > it pulls the correct strings based on the local culture. To do this, I
> > changed my regional options to German, however it still shows the English
> > version when I run.
> >
> > Is this a correct testbed for this, or is there something more/different
> > that needs to be done? It seems like, although I've changed the regional
> > settings in the control panel, it still senses the culture as English.
>
>
>

Re: ResourceManager testbed by jmaguero_vodafone

jmaguero_vodafone
Wed Apr 20 13:23:01 CDT 2005

Hello, Chuck,

Try writing the following:

System.Threading.Thread.CurrentThread.CurrentUICulture =3D New =
System.Globalization.CultureInfo("de-DE")

Regards.


"Chuck Shuhler" <Chuck Shuhler@discussions.microsoft.com> escribi=C3=B3 =
en el mensaje news:83F2A104-2177-4619-AC6E-7DA4585683E0@microsoft.com...
| This is my first experience using the ResourceManager to localize UI=20
| elements. I have created a culture neutral .resx, a German (de) =
.resx, and=20
| an English (en) .resx. My goal is to initially test this to make sure =
that=20
| it pulls the correct strings based on the local culture. To do this, =
I=20
| changed my regional options to German, however it still shows the =
English=20
| version when I run.
|=20
| Is this a correct testbed for this, or is there something =
more/different=20
| that needs to be done? It seems like, although I've changed the =
regional=20
| settings in the control panel, it still senses the culture as English.

Re: ResourceManager testbed by Patrick

Patrick
Thu Apr 21 03:11:03 CDT 2005

Hi Chuck,

When calling GetString you should specify the desired culture.
E.g. GetString("MESSAGE_QUEUE_EMPTY", Thread.CurrentThread.CurrentCulture);

Then when changing the regional, your language goes along.

Regards,

Patrick

"Chuck Shuhler" <ChuckShuhler@discussions.microsoft.com> wrote in message
news:8641AB04-F0C2-4DF9-9AFA-B2D33A8D4E8B@microsoft.com...
> Patrick,
>
> The initial declaration instances a static resource manager for the class
> library as follows:
>
> private static ResourceManager resources = null;
>
> public static ResourceManager Resources
> {
> get
> {
> if (resources == null)
> {
> resources = new ResourceManager("ASNDATA.StringTable",
> Assembly.GetExecutingAssembly());
> }
> return resources;
> }
> }
>
> When requesting a string from the table, the following code is invoked:
>
> string message;
>
> message = <DLL Namespace (Name changed to protect the
> innocent)>.Data.Internal.Resources.GetString("MESSAGE_QUEUE_EMPTY");
>
> Where MESSAGE_QUEUE_EMPTY is a tag in the string table.
>
> Now, I have a default resource, English resource, and German resource, and
> for testing purposes, I've made the string in each .resx corresponding to
> this tag different. When the string is retrieved, regardless of the
> regional
> settings, the English satellite assembly is loaded and used.
> ----------------------------------------------------------------------------------
>
>
> "Patrick" wrote:
>
>> Hi Chuck,
>>
>> Could you please add some code of how you retrieve the string.
>>
>> Regards,
>>
>> Patrick
>>
>> "Chuck Shuhler" <Chuck Shuhler@discussions.microsoft.com> wrote in
>> message
>> news:83F2A104-2177-4619-AC6E-7DA4585683E0@microsoft.com...
>> > This is my first experience using the ResourceManager to localize UI
>> > elements. I have created a culture neutral .resx, a German (de) .resx,
>> > and
>> > an English (en) .resx. My goal is to initially test this to make sure
>> > that
>> > it pulls the correct strings based on the local culture. To do this, I
>> > changed my regional options to German, however it still shows the
>> > English
>> > version when I run.
>> >
>> > Is this a correct testbed for this, or is there something
>> > more/different
>> > that needs to be done? It seems like, although I've changed the
>> > regional
>> > settings in the control panel, it still senses the culture as English.
>>
>>
>>



Re: ResourceManager testbed by ChuckShuhler

ChuckShuhler
Thu Apr 21 08:18:04 CDT 2005

Yahtzee!

That worked like a champ. Many thanks.