Groups | Blog | Home
all groups > dotnet internationalization > november 2005 >

dotnet internationalization : Localizing Menu Items - Help


Krishnan
11/28/2005 6:13:43 PM
Hi,

The norm in .Net seems to be keying the name of the control in the resource
file for a value in the particular language. For e.g., if cmdOpen is a
commad button, then:

MyResource.en-us.resx will contain:
key value
---- -------
cmdOpen.Text Open

and, MyResource.fr-FR.resx will contain:
key value
---- ------
cmdOpen.Text Ouvrez

However, this depends on accessing the "Name" property of the control at
runtime. Menus do not expose the name property. What is the thumb rule to
localize menus in dot net?

TIA
Krishnan

GarrMc NO[at]SPAM online.microsoft.com
12/6/2005 12:24:21 AM
Hi Krishnan. If I understand your question correctly, you want to localize
the Text value for menu items in your WinForms application.

The easiest way to do this is to simply mark the Localizable property for
the form as True, change the target language in the Language property, and
then edit the menu items on the form. When you load the resulting RESX file
in the resource editor, it should show each menu name as you describe below
(e.g., fileToolStripMenuItem.Text | &File). This is how it works for Visual
Studio 2005, though the mechanics are the same for Visual Studio .NET 2003.

Cheers,
Garrett McGowan [MSFT Developer International]

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
--------------------
[quoted text, click to view]
Krishnan
12/7/2005 11:24:18 AM
Thanks.

Krishnan
[quoted text, click to view]

AddThis Social Bookmark Button