Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Help with localization problem with multi language

0 views
Skip to first unread message

venky

unread,
May 21, 2002, 10:50:39 AM5/21/02
to
Hi All:
I am not able to display this properly... I am missing
all the special French characters like the special (e),
etc

my IE Language setting is set to French and English.
French is on top (fr-FR)

My res files are generated as fp.resources and fp.fr-
FR.resources
The res file for english (fp.txt) reads
Year=year
Listen=listen
French=french

The one for french (fp.fr-FR.txt) reads
Year=année
Listen=écoutez
French=français


Here is my code
global.asax
---------
Sub Application_Start(ByVal sender As Object, ByVal e As
EventArgs)

' Fires when the application is started

Application("RM") =
ResourceManager.CreateFileBasedResourceManager("fp", _

Server.MapPath("resources") _

+ Path.DirectorySeparatorChar, _

Nothing)

End Sub

Sub Application_BeginRequest(ByVal sender As Object,
ByVal e As EventArgs)

' Fires at the beginning of each request

' For each request initialize the culture values with the

' user language as specified by the browser.

Try

Thread.CurrentThread.CurrentCulture =
CultureInfo.CreateSpecificCulture(Request.UserLanguages
(0))

Catch

' provide fallback for not supported languages.

Thread.CurrentThread.CurrentCulture = New CultureInfo("en-
US")

End Try

Thread.CurrentThread.CurrentUICulture =
Thread.CurrentThread.CurrentCulture

Application("ci") =
Thread.CurrentThread.CurrentUICulture.Name

End Sub

-----

my webform1.asx code

Private Sub Page_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load

Response.Write("current culture info : " & Application
("ci"))

'Put user code to initialize the page here

Dim rm As ResourceManager

' Get the ResourceManager from the Application object.

rm = Application("RM")

TextBox1.Text = rm.GetString("Year",
Thread.CurrentThread.CurrentUICulture)

Label1.Text = rm.GetString("French",
Thread.CurrentThread.CurrentUICulture)

End Sub

--------

my output

current culture info : fr-FR
franais
anne

PLease note the missing french characters ...

Thierry Huguet

unread,
May 21, 2002, 12:47:22 PM5/21/02
to
outside of the resource file ontext, can you display accentued characters
(such "année") into a label string ?

If you created your resource file outside of VS.NET ide, you have to save
the file in Unicode or UTF8 codage.
and do you check what was the encoding value into the Web.config file ?
--
Thierry HUGUET
Microsoft FRANCE

--------
"venky" <venk...@hotmail.com> a écrit dans le message de news:
599b01c200d6$df8e6e10$9be62ecf@tkmsftngxa03...

0 new messages