Help regarding localization.

A

archana

Hi all,

I am having confusion regarding localization in .net.

I have one form on which i have some labels and button. After designing
that form what i did is set localization property of form to true and i
set language as french.

But still it is not changing caption of controls which are there in
form.

What should i do to make all content of all controls of form to french.

If anyone can shed some light on it then it will be really beneficial
for me.

thanks in advance.
 
M

Michael Brown

I am having confusion regarding localization in .net.
I have one form on which i have some labels and button. After designing
that form what i did is set localization property of form to true and i
set language as french.

But still it is not changing caption of controls which are there in
form.

What should i do to make all content of all controls of form to french.

If anyone can shed some light on it then it will be really beneficial
for me.

thanks in advance.

It doesn't translate it for you automatically. Read up on "satellite
assemblies" for complete details.
 
A

archana

hi,

thanks for your reply.

Let me explain in brief what i want.

I created one console application and one resx file. Then from this
resx file i generated another resource file with language as german.

then i generated resource file for this using resgen and then created
resource dll using al.exe

when i add this dll to bin folder and get message from this resource
file it is working properly.

But now here my problems start.

I have one windows application with some controls. What i did is i set
localization property of form to true and language as german. After
doing that file with name 'Form1.de.resx' is automatically generated.
But when i try to find out data of this resource file it is not showing
me anything. what i am expecting is it should alleast show me resources
which are there in original file i.e 'Form1.resx'

Can you tell me why this is happening. If i am wrong please correct me.

Thanks in advance.
 
M

Michael Brown

I created one console application and one resx file. Then from this
resx file i generated another resource file with language as german.

then i generated resource file for this using resgen and then created
resource dll using al.exe

when i add this dll to bin folder and get message from this resource
file it is working properly.

But now here my problems start.

I have one windows application with some controls. What i did is i set
localization property of form to true and language as german. After
doing that file with name 'Form1.de.resx' is automatically generated.
But when i try to find out data of this resource file it is not showing
me anything. what i am expecting is it should alleast show me resources
which are there in original file i.e 'Form1.resx'

Can you tell me why this is happening. If i am wrong please correct me.

Please elaborate when you say "it is not showing me anything what (sic) i am
expecting ...". Presumably you mean at runtime (not build time). If you're
following the standard model for using satellite assemblies (probably),
you'll end up with one version of "<YourAppName>.resources.dll" for each
language you're supporting (after compiling your app). You'll find each
version in its own language directory so in your case look for it under a
"de" folder normally found under the "bin" directory off your program's main
(source) folder. This file will contain all embedded German resources for
your app including your "Form1.de.resx" file (stored in the ".dll" as
"<YourDefaultNamespace>.Form1.de.resources"). When you distribute your app,
you simply create a "de" subfolder under the main folder containing your
app's main ".exe" and copy the German version of
"<YourAppName>.resources.dll" to this directory. When the form is loaded, it
will then (normally) appear in German on a German version of Windows but for
any other version you normally have to invoke the following on the thread
that creates the form *prior* to loading the form (otherwise the OS's
default language will be used - note that you have to do this even in your
debug version which may be the problem you're experiencing):

Thread.CurrentThread.CurrentUICulture = new CultureInfo("de");

The form will now load in German.

Hope that helps.
 
A

archana

Hi,
thanks for your reply.

basically my form1.resx has some controls and some strings.
When i change languate to german it has created new resx file with name
form1.de.resx but with no data in it. what i am expecting is it will
contains same resources as that of form1.resx which is not happening.

If i am wrong then please correct me

Thanks.
 
M

Michael Brown

Hi,
thanks for your reply.

basically my form1.resx has some controls and some strings.
When i change languate to german it has created new resx file with name
form1.de.resx but with no data in it. what i am expecting is it will
contains same resources as that of form1.resx which is not happening.

If i am wrong then please correct me

It won't contain everything that's in "form1.resx" itself, only those
properties that you've explicitly changed into German (text strings only
typically). The entire form can basically be re-created using "form1.resx"
itself so "form1.de.resx" will be just a tiny subset of this normally
(containing German changes only). You need not worry about these details
however. The system will find everything it needs for you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top