Localization tutorial?

L

Linda Liu[MSFT]

Hi Dave,

You may refer to the following MSDN document for a walkthrough on how to
localize a WinForm appliation:

'Walkthrough: Localizing Windows Forms'
http://msdn2.microsoft.com/en-us/library/y99d1cd3(VS.80).aspx

Hope this helps.
If you have any question, please feel free to let me know.

Sincerely,
Linda Liu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
L

Linda Liu[MSFT]

Hi Dave,
Is there a way to do this where the form controls use the resx file?

Sorry that I don't understand your question exactly. Could you please
explain more?
And to have ti create the resx files with all the needed string entries
so we can then just go in to those files and translate the text?

Yes, we have to create .resx files to contain all texts that need to be
localized.

Sincerely,
Linda Liu
Microsoft Online Community Support
 
G

Guest

Hi;

What I would like is, for my existing Form app which has all the english
text entered directly into the forms to do the following (like how ASP.NET
does it):
1) Click some command and it would create myapp_en_us.resx with all the
english text for my forms. And all the forms would be changed to pull the
text from myapp_*.resx.
2) Copy myapp_en_us.resx to myapp_de.resx.
3) Give just the myapp_de.resx to our German translator.
4) The file is translated.
5) We rebuild with the additional resx file and we now run in German as well
as English.

Can this be done?

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 
L

Linda Liu[MSFT]

Hi Dave,

Thank you for your reply!

Yes, what you expected can be done definitely.

In fact, the best practice of localizing a WinForm application is like the
following:

1. Use VS IDE to create WinForms in the application and make each form
localizable, i.e. set the Localizable property of the form to true and
build the WinForm application project.

2. When you want the application support another culture later, you can use
Windows Forms Resource Editor(Winres.exe) to edit the .resx files, e.g.
Form1.resx. Translate the resource text into another language, e.g. German,
and save this resx file in German culture, which produces a Form1.de.resx
file in the same folder where the Form1.resx resides.

3. Use Resgen.exe tool to convert Form1.de.resx file to
ProjectNamespace.Form1.de.resources file(Note, the .resources file should
have a full name so that the resource could be accessed by the executable
later). For example, type the following command in the VS2005 command
prompt:

Resgen Form1.de.resx WindowsApplication1.Form1.de.resources

4. Bind all .resources files for a specified culture into a statellite
assembly using AL.exe tool. For example, you create Form1.de.resources and
Form2.de.resources files, then you need to bind both the two *.de.resources
files into a statellite assembly for the culture German. For example, type
the following command in the VS2005 command prompt:

AL /t:lib /embed:WindowsApplication1.Form1.de.resources
/embed:WindowsApplication1.Form2.de.resources /culture:de
/out:WindowsApplication1.resources.dll

5. Copy the generated satellite assembly
'WindowsApplication1.resources.dll' into a subdirectory named 'de' under
the folder that the executable resides.

As you can see, we needn't re-compile the existing WinForm application
project to support another culture.

Hope this helps.
If you have any question, please feel free to let me know.

Sincerely,
Linda Liu
Microsoft Online Community Support
 
S

sunny

Bingo - exactly what I needed. thanks.

--
thanks - dave
david_at_windward_dot_nethttp://www.windwardreports.com

Cubicle Wars -http://www.windwardreports.com/film.htm


















- Show quoted text -

Hey guys
localisation does not work when assembly key file is added. please
help!!! see the code below

code:
assembly.cs
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile(@"..\..\Key\Key.snk")]
[assembly: AssemblyKeyName("")]


localisation:
private void LoadLocalizedText(ResourceManager rm)
{
this.NewString = rm.GetString("NewString");



}


the above code works in visual studio 2005 (.net 2.0 ... not sure of
visual studio 2003)....
i definately need to add the keyfile in the assembly and can not move
to visual studio 2005...

i am using borland devloper studio 2006 and .net1.1


i have been asking for help in
http://newsgroups.borland.com/cgi-bin/dnewsweb?cmd=xover&group=borlan...
but its not going anywhere :(((( cryingout loud


Please have a look at my test app http://rapidshare.com/files/65203000/testapp.zip
and try to compile it in borland developer studio 2006. The satellite
assembly will not be strongly named when assemblykey file is used. I
am pretty muich struck with it and don't know where to go from
here...
please help as i can not move to vs.net or .net 2.0.


please help
sunny
 
L

Lilian

A few precision for beginners like me not to search too long :

Linda Liu said:
2. When you want the application support another culture later, you can use
Windows Forms Resource Editor(Winres.exe) to edit the .resx files

This tool can be found in the .NET Framework 2.0 SDK shortcuts folder
("Start" menu).
It is labeled "Windows Resource Localization Editor".
3. Use Resgen.exe tool to convert Form1.de.resx file to
ProjectNamespace.Form1.de.resources file(Note, the .resources file should
have a full name so that the resource could be accessed by the executable
later). For example, type the following command in the VS2005 command
prompt:

Resgen Form1.de.resx WindowsApplication1.Form1.de.resources

To run this command first open the command prompt from another shortcut in
the .NET Framework 2.0 SDK named "SDK Command Prompt".
Otherwise the "resgen" command may not be known (PATH problem).
4. Bind all .resources files for a specified culture into a statellite
assembly using AL.exe tool. For example, you create Form1.de.resources and
Form2.de.resources files, then you need to bind both the two *.de.resources
files into a statellite assembly for the culture German. For example, type
the following command in the VS2005 command prompt:

AL /t:lib /embed:WindowsApplication1.Form1.de.resources
/embed:WindowsApplication1.Form2.de.resources /culture:de
/out:WindowsApplication1.resources.dll

This command should also be executed from the SDL prompt.
Hope this helps.
If you have any question, please feel free to let me know.

Sincerely,
Linda Liu
Microsoft Online Community Support

It helped a lot thank you !
I just regret this cannot be a simpler from the IDE without having to mess
in the shell.

Best regards.
 
M

mohan-m

Can this process be used for Asian Languages as long I have the fonts and
culure correctly set.? Is the .resx files any different since they may have
Unicode strings.?
I would like to create the .resx files from a list of strings which are in a
file.
Thanks
Mohan Mistry
 

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