Home All Groups Group Topic Archive Search About

Multilanguage support?

Author
21 Feb 2006 1:58 PM
kovac
I create first a form and set the labels and buttons with Russian language.
Then I put following properties on the form:

Language = English
Localizable = True

Now I put the labels and buttons in English. In this moment, I have two
resource files: one for Russian (MyForm.resx) and one for English
(MyForm.en.resx).
If I start my application now, everything will showing on Russian. This is
good so.
And if I want to change the language, I try to do this:
I set CurrentCulture and CurrentUICulture in the New() prozedure of my form
to English,

    Public Sub New()
        ' Set the culture and UI culture before
        ' the call to InitializeComponent.
        System.Threading.Thread.CurrentThread.CurrentCulture = New
System.Globalization.CultureInfo("en-US")
        System.Threading.Thread.CurrentThread.CurrentUICulture = New
System.Globalization.CultureInfo("en")

        ' This call is required by the Windows Form Designer.
        InitializeComponent()

        ' Add any initialization after the InitializeComponent() call.

    End Sub


But it does not work! What do I make wrong?

How can I change the default language of the application?
Is that possibly at the runtime or only by starting of the application?


Thanks for info

Regards
Kovac

Author
21 Feb 2006 2:11 PM
guy
hi Kovac
try putting your code in the Form Load instead of the New

also check out this link - read the bit about the MUI - that may be of help
too
http://msdn2.microsoft.com/en-us/library/y99d1cd3.aspx

cheers

--guy--



Show quoteHide quote
"kovac" wrote:

>
> I create first a form and set the labels and buttons with Russian language.
> Then I put following properties on the form:
>
> Language = English
> Localizable = True
>
> Now I put the labels and buttons in English. In this moment, I have two
> resource files: one for Russian (MyForm.resx) and one for English
> (MyForm.en.resx).
> If I start my application now, everything will showing on Russian. This is
> good so.
> And if I want to change the language, I try to do this:
> I set CurrentCulture and CurrentUICulture in the New() prozedure of my form
> to English,
>
>     Public Sub New()
>         ' Set the culture and UI culture before
>         ' the call to InitializeComponent.
>         System.Threading.Thread.CurrentThread.CurrentCulture = New
> System.Globalization.CultureInfo("en-US")
>         System.Threading.Thread.CurrentThread.CurrentUICulture = New
> System.Globalization.CultureInfo("en")
>
>         ' This call is required by the Windows Form Designer.
>         InitializeComponent()
>
>         ' Add any initialization after the InitializeComponent() call.
>
>     End Sub
>
>
> But it does not work! What do I make wrong?
>
> How can I change the default language of the application?
> Is that possibly at the runtime or only by starting of the application?
>
>
> Thanks for info
>
> Regards
> Kovac