Set other language

  • Thread starter Thread starter Volker Gruber
  • Start date Start date
V

Volker Gruber

Hello,

how i can use other recource files for multilanguage applications?
I have tried it with Threading.Thread.CurrentThread.CultureInfo
but this property does not supported under CF.

How i can change the language?

Thanks
Volker
 
Ive posted it somewhere, but here it goes again:
------------------------------------------------------

'U can get more Locale IDs searching for LCID in the vs.net msdn
Friend Enum LCID
PORTUGUESE = &H416 'PT_BR
ENGLISH = &H409 'EN_US
End Enum

<System.Runtime.InteropServices.DllImport("coredll.dll")> _
Private Shared Function SetUserDefaultLCID(ByVal Locale As LCID) As
Boolean
End Function

<System.Runtime.InteropServices.DllImport("coredll.dll")> _
Private Shared Function GetSystemDefaultLCID() As LCID
End Function

Friend Shared Function MudaLinguagem(ByVal vLang As LCID) As Boolean
Return SetUserDefaultLCID(vLang)
End Function

Friend Shared Function PegaLinguagem() As LCID
Return GetSystemDefaultLCID()
End Function
 
Volker,

you could use System.Globalization.CultureInfo.CurrentUICulture property to
query the current culture. This one is also used by the ResourceManager when
loading resources.

I don't know what exactly you're trying to do ... Do you want to set the
language (region) ? Or do you want to know how your application could
support multiple languages by resource files (satellite assemblies) ?

Greets, Christian
 
Hello Christian Schwarz!
you could use System.Globalization.CultureInfo.CurrentUICulture property to
query the current culture. This one is also used by the ResourceManager when
loading resources.

I don't know what exactly you're trying to do ... Do you want to set the
language (region) ? Or do you want to know how your application could
support multiple languages by resource files (satellite assemblies) ?

I have create a Form. On this Form i have changed the Language Proerty.
In Windows Applications i can set the cultureInfo in Sub Main Method like
following code:

Shared Sub Main()
Dim cInfo As New CultureInfo("en-GB")
Thread.CurrentThread.CultureInfo = cInfo
Thread.CurrentThread.uiCulture = cInfo
Application.Run(new Form1)
End Sub

After this, the Application will load the satellite assembly. This art of
using
recource files doesn´t support under CF. How i can set the language un
CF?

Cheers
Volker
 
Hello Volker,
After this, the Application will load the satellite assembly. This art of
using
recource files doesn´t support under CF. How i can set the language un
CF?

Satellite assemblies do exist under CF, at least I use them. Simply add a
new resource file to your project with the name "<your form's
name>.<language[-country]>.resx". So if your form is called "MainForm" and
you want to create a satellite assembly for spain language and spain country
the resource file's name would be "MainForm.es-ES.resx". Then you have to
add all resources which are different from the neutral culture. After
compilation there should exist a sub-directory "es-ES" which contains your
satellite assembly.

Greets, Christian
 
Yah, if u spent a little time reading the post i sent u, you should realize
how to do it using API in ppc2002/03.
 
Back
Top