Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / June 2008

Tip: Looking for answers? Try searching our database.

Localization tutorial?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David Thielen - 27 Oct 2007 05:54 GMT
Hi;

Is there a good url somewhere that walks through how to localize the
resources in a C# forms app?

Signature

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

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

Brendon Bezuidenhout - 28 Oct 2007 14:13 GMT
Heya David,

I've always found CodeProject to be full of useful info (even for things I'm
not looking for haha) - try this link[1]; it should do what you need
PERFECTLY from the little you said.

[1]http://www.codeproject.com/dotnet/Localization.asp

Regards,
Brendon

> Hi;
>
> Is there a good url somewhere that walks through how to localize the
> resources in a C# forms app?
Linda Liu[MSFT] - 29 Oct 2007 05:41 GMT
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.
David Thielen - 29 Oct 2007 18:24 GMT
Is there a way to do this where the form controls use the resx file? 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?

Signature

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

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

> Hi Dave,
>
[quoted text clipped - 30 lines]
>  
> This posting is provided "AS IS" with no warranties, and confers no rights.
Linda Liu[MSFT] - 30 Oct 2007 10:28 GMT
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
David Thielen - 30 Oct 2007 18:52 GMT
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?

Signature

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

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

> Hi Dave,
>
[quoted text clipped - 12 lines]
> Linda Liu
> Microsoft Online Community Support
Linda Liu[MSFT] - 31 Oct 2007 10:05 GMT
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
David Thielen - 31 Oct 2007 16:56 GMT
Bingo - exactly what I needed. thanks.

Signature

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

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

> Hi Dave,
>
[quoted text clipped - 46 lines]
> Linda Liu
> Microsoft Online Community Support
sunny - 01 Nov 2007 03:36 GMT
> Bingo - exactly what I needed. thanks.
>
[quoted text clipped - 56 lines]
>
> - 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
Lilian - 17 Jan 2008 13:58 GMT
A few precision for beginners like me not to search too long :

> 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
[quoted text clipped - 3 lines]
>
> 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
[quoted text clipped - 5 lines]
> /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.
mohan-m - 28 Jun 2008 05:27 GMT
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

> Hi Dave,
>
[quoted text clipped - 46 lines]
> Linda Liu
> Microsoft Online Community Support

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.