• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1229
  • Last Modified:

Multi Language Applications.

Hi, I'm using VB.NET 2010 (VS.NET 2010), WinForms. Has anyone found an easy way to create multi-language applications, whereby you don't have to change the Text property of each of your labels one-by-one? In other words, I'd like to create a label for 3 languages. Perhaps English, Spanish and French. I'd like to be able to allow the user to select his/her language of preference. So, if they select Spanish from a global options screen, then all the labels on each Form would switch to Spanish (not the data, just the labels). I'm sure there is some sort of database in  the background that will contains all the translations for each label, but I'd like to see how others have handled this matter (short of writing 3 different applications).

Thanks,
Fulano
0
Mr_Fulano
Asked:
Mr_Fulano
  • 4
  • 2
2 Solutions
 
Kalpesh ChhatralaSoftware ConsultantCommented:
0
 
Mr_FulanoAuthor Commented:
Hi Emereau, your solution is what I was looking for, but it doesn't seem to work with VB2010. Once I get to step (Adding a new supported language), the process changes. Your approach does not work.

Any thoughts?

Thanks,
Fulano
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
Mr_FulanoAuthor Commented:
Hi kalpesh2804, the same that I mentioned to Emereau goes for your suggestion. I think VB2010 is different than what we had in earlier editions of VB.NET. The approach here did not work for me. Any thoughts?

Thanks,
Fulano
0
 
Mr_FulanoAuthor Commented:
OK...I think I figured it out. There are some differences in the way it behaves from earlier versions and in 2010. I realized that you have to actually change the values of the text properties for the resource file to be created, otherwise it never gets created. Below is the code that goes in the code behind.

Thanks for both your help,
Fulano
Imports System.Globalization
Imports System.Threading
Imports System.Resources

Public Class Form1
    Public Sub New()
        MyBase.New()
        System.Threading.Thread.CurrentThread.CurrentUICulture = New CultureInfo("es") 'Spanish
        'System.Threading.Thread.CurrentThread.CurrentUICulture = New CultureInfo("en") 'English (which was my Form's default language).

        ' This call is required by the designer.
        InitializeComponent()

        ' Add any initialization after the InitializeComponent() call.

    End Sub


End Class

Open in new window

0
 
Mr_FulanoAuthor Commented:
Both solutions helped me find an ultimate solution. Thanks for your help.
0
 
Éric MoreauSenior .Net ConsultantCommented:
it changed a bit.

-create your interface and set the values for your default language
-set your form's Localizable property to true
-set the form's Language property to the language you want to support.
-set the text values of any controls (labels, buttons, ...) to the new language
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now