[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Localization in VB.net

Posted on 2004-10-13
6
Medium Priority
?
6,435 Views
Last Modified: 2010-04-21
I need to write a winforms app that is going to be distributed in 3 languages,
so ALL the text in my app should be in those 3 languages. What is the best way to approach this.

Somehow I would like one solution that I want to build in either of the 3 languages
0
Comment
Question by:RonaldBiemans
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 7

Expert Comment

by:J_Mak
ID: 12295647
It would all begin with Inheritnace.... each form that you create with one language must have similar charateristics with those in another language. So the best way to start off is to create forms that have common properties with all 3 languages. The customised forms for a certain language then inherit from the parent form and change it as it sees fit. Have constants for all 3 so that when you build (like for labels, text boxes, etc), it can choose from either. It is much more complicated than this, but this would be a start.
0
 
LVL 6

Accepted Solution

by:
etmendz earned 800 total points
ID: 12295802
I have two ways in mind:

1) You can use resources which is inherent to .Net since v1.0. Easiest to maintain and deploy. Read more from the following articles:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpqstart/html/cpsmpnetsamples-howtoresources.asp
http://samples.gotdotnet.com/quickstart/aspplus/default.aspx?url=%2fquickstart%2fhowto%2fdoc%2fuseresources.aspx
http://www.c-sharpcorner.com/Code/2004/Jan/GloblizationInDotNEt.asp

2) You can also use a database that supports unicode data. Then use the database to store a list of keys and translated values. On application startup or when the language setting is changed, you can (re)load the labels/messages to a global collection/dictionary. Note that there are some memory overhead here...

Choose the approach you are comfortable with.

Have fun...
0
 
LVL 18

Assisted Solution

by:armoghan
armoghan earned 800 total points
ID: 12295845
I dont get it exectly. It seems simple.

why dont you just make the Localizable property of the Forms true and Language = XYZ for different forms and make different Resx file, they will be kept in different DLLs so that they can be loaded when the language is changed.
If you want to chnage the language at runtime,
Instead of insitalizing all the components in initilizeComponents make a custom method which takes language as an argument, So when you, lets say, chnage the language from the menu, a listener will be attached to all the forms and that it called and they initialzie the components again in different languages,

0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 14

Assisted Solution

by:ptakja
ptakja earned 400 total points
ID: 12296655
armoghan is right, (and that is the best way to go) but that only covers the form UI elements. There are still error messages, text displayed in message boxes, status bar messages, etc...for that you would need to add a resource file (one for each language) that has key/value pairs in it.

In your code you create an instance of a ResourceManager object which gives you access to the resource file.

By default, your app will attempt to run under the language Windows is running in. If you don't have resources for that language (and you haven't set up your forms to run in that language (as armoghan suggests)) you need to provide a fallback to some default language.

The book "Programming Microsoft Visual Basic .NET" by Franceso Balena has an excellent chapter on localization and the new things that came with .NET to make this much simpler than it used to be with VB6.

Good luck!
0
 
LVL 18

Expert Comment

by:armoghan
ID: 12319161
Thanx.
Glad to help the person on number 1 :)
0
 
LVL 7

Expert Comment

by:Inteqam
ID: 31365748
what about lookup tables? or should i also use resources?
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question