Re: How to build the multi-language application?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



"YXQ" <YXQ@xxxxxxxxxxxxxxxxxxxxxxxxx> schreef in bericht
news:5685F194-9D94-4668-B201-E15A4229741C@xxxxxxxxxxxxxxxx
Thank you, where can find the samples?

"Herfried K. Wagner [MVP]" wrote:

"yxq" <gayxq@xxxxxxx> schrieb:
I want to build the multi-language application with the xml file, how
to
do? could anyone tell a sample?

Why not use 'My.Resources' and custom "Resources.<culture name>.resx"
files
(which will be compiled and embedded automatically when building the
project)?

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>


Short description on how I do it, this could help for a start :
- I add a resource file for each language, for instance English.Resx,
Dutch.Resx, etc....

- I add all components which do have a Text property, such as labels for
instance... but you can also add standard strings to use in msgboxes...
Example : in Resource File : column Name "btnAdd" (this is the same in
all resource files),
value "Add..." of course different value in other languages.

- Some code then in a separate module to open the resource file and read it
Declaration :
'Application Language
Public rm As Resources.ResourceManager

'Function
Public Function getRMValue(ByVal strValue As String)
Dim strLanguage As String

If IsNothing(rm) Then
'Get system language
strLanguage =
System.Globalization.CultureInfo.CurrentCulture.ToString.ToUpper.Substring(0,
2)

'Set resource manager
If strLanguage = "EN" Then
rm = My.Resources.English.ResourceManager
Else
rm = My.Resources.Dutch.ResourceManager
End If
End If

getRMValue = rm.GetString(strValue)
End Function

- In the forms :
btnAdd.text = getRMValue("btnAdd")

Hope this helps a bit
Phil


.



Relevant Pages

  • RE: Multi-languages
    ... I have developed a few globalized apps and I usually have the display ... retrieve these from the resource file via the Resource Manager when the ... For string that are databased, ie. things that fill list boxes etc, I have a ... that language. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: translate menu in resource file
    ... can i translate the whole menu using resource file? ... i want to have menu language of my program in two different ... how to tell in menu editor to use a string from string ...
    (microsoft.public.vb.general.discussion)
  • Re: translate menu in resource file
    ... "Andy Smirala" wrote in message ... i want to have menu language of my program in two different language, ... how to tell in menu editor to use a string from string table in resource file. ...
    (microsoft.public.vb.general.discussion)
  • Re: Dealing with foreign languages
    ... > languages, and VB will pull out the string for the correct language using ... > language in the Resource File will be used. ... you can install all of them and store their filenames ...
    (microsoft.public.vb.general.discussion)
  • Re: Operator overloading in C
    ... All development of C as an independent language has ... making any changes or improvements to the standard ... The lack of a counted string data structure, ... Pointers can't be used for arg1 or arg2. ...
    (comp.std.c)