Multi Language Applications.

Posted on 2011-04-29
Last Modified: 2012-05-11
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).

Question by:Mr_Fulano
    LVL 16

    Assisted Solution

    by:Kalpesh Chhatrala
    LVL 69

    Accepted Solution


    Author Comment

    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?


    Author Comment

    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?


    Author Comment

    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,
    Imports System.Globalization
    Imports System.Threading
    Imports System.Resources
    Public Class Form1
        Public Sub 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.
            ' Add any initialization after the InitializeComponent() call.
        End Sub
    End Class

    Open in new window


    Author Closing Comment

    Both solutions helped me find an ultimate solution. Thanks for your help.
    LVL 69

    Expert Comment

    by:Éric Moreau
    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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    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…
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    This video discusses moving either the default database or any database to a new volume.

    779 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

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now