Multilanguage Support

A

Aftab Alam

Hello All
I wanted to know that how can I build an application which takes arabic or
urdu input
I mean when I type something in my applications edit box it writes arabic.
please do let me know about a good tutorial regarding multilanguage support
in dot net applicaitons

Regards
Muhammad Aftab Alam
 
C

Cor

Hello Aftab,
The walkthrough with multilanguage and vb.net looks if it's made by someone
who does not know much about languages.
But using more languages in vb.net is terrible easy.
You choose in the properties from the forms you use the language you want to
use.
Then you can enter the textfield from language and it comes in the resx
files.
When you change for another language, you can enter the other languages
control by control.
Arabic and Urdu is there too.
Cor
 
J

Jay B. Harlow [MVP - Outlook]

Kevin,
Add a .resx file to your project as an embedded resource. Then use the
System.Resources.ResourceManager object to retrieve the strings.

For each language you will need its own .resx.

strings.resx
strings.de.resx
strings.de-DE.resx

http://msdn.microsoft.com/library/d...n-us/vbcon/html/vboriInternationalization.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vboriUsingResources.asp

http://msdn.microsoft.com/library/d...localization_using_the__net_framework_sdk.asp

Note: I don't have a working sample handy.

Hope this helps
Jay
 
C

Cor

Kevin,
Maybe the same for me with your message.
I do not know what for a user important language dependable string can be in
a class, while for a form I gave the answer.
Cor
 
K

Kevin A.

I do not know what for a user important language dependable string can be
in
a class, while for a form I gave the answer.

For example, a class can have a string that has to be displayed in a message
box,
or strings that have to replace the text already in a control.


Kevin
 
C

Cor

Kevin,
That is the same as by instance changing a color from a control.
There are programmers who use the Ide to put a control on a form and there
are who write everything themselves.
We are talking about the first ones now.
The set the first color at design time with the Ide.
When they need to change a color in a control on runtime, they will use
code.
So what is the different with changing a text in a control. You have the
tools for it.
Cor
 
K

Kevin A.

So what is the different with changing a text in a control. You have the
tools for it.

Another example: you have a label that has to display a textual description
of
some speed. Depending on the speed it can display "Slow", "Little slow",
"Average", "Good", "Very good", "Perfect". The best solution to implement
this is to place the label on the form without any text, and assign the text
in
your code. The code should do something like this:

Select Case speed
Case Is < 10
label.Text = "Slow"
Case 11 To 25
label.Text = "Little slow"
Case 26 To 50
label.Text = "Average"
Case 51 To 80
label.Text = "Good"
Case 81 To 110
label.Text = "Very good"
Case Is > 110
label.Text = "Perfect"
End Select

To add multilanguage support to this application, you would need more than
just the IDE and the form's Language property.
You would have to create .resx files for each language/culture and access
them
programmaticly with a RecourceManager object, like Jay B. Harlow said in
this
thread.



Kevin
 
J

Jay B. Harlow [MVP - Outlook]

Kevin,
A couple of more examples, that I intend on using in my project, are:
- Localized Descriptions for the property browser, where you inherit from
System.ComponentModel.DescriptionAttribute, localizing the text for display
in the Property window. CategoryAttribute has a similar ability.

- Localized 'categories', effectively a localized enum like class. Think of
enums on steroids ;-)

Even normal enums, you may want to localize if you display the text names to
a user.

Just a thought
Jay
 
C

Cor

Kevin,
What is the difference with a colour
But the question was to help with a simple start. That I tried.
And I did not mention the resx editor, because when you start with that I
think that most people do like me, stop immediately.
I myself prefer a XML file. That I can reach with the xmldocument.
But that is maybe because I know that well and then it is easy to use.
The benefit from VB.net is that you are not obliged to do things in one way.
But beneath is an example from your question.
(And when you put that in XML it is really easy when you make the language
your first tag)
Cor

Your example can be:
Dim Language As InputLanguage = InputLanguage.DefaultInputLanguage
if language.substring(2) = "en" then
Select Case speed
Case Is < 10
label.Text = "Slow"
Case 11 To 25
label.Text = "Little slow"
Case 26 To 50
label.Text = "Average"
Case 51 To 80
label.Text = "Good"
Case 81 To 110
label.Text = "Very good"
Case Is > 110
label.Text = "Perfect"
End Select
Elseif Language.substrint(2)="kr" then
..........................
 

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