I am getting the default browser language like this
Dim strLanguage As
String
strLanguage = Request.UserLanguages(0)
Thread.CurrentThread.CurrentCulture = New CultureInfo(strLanguage)
Thread.CurrentThread.CurrentUICulture = New CultureInfo(strLanguage)
Dim c As CultureInfo =
New CultureInfo(strLanguage)
Thread.CurrentThread.CurrentCulture = c
Thread.CurrentThread.CurrentUICulture = c
So when i select a neutral culture like "sv" for swedish it displays the following error.I am doin in .Net2003.Can I get a solution( other than choosing a language like sv-fr.....)
Error is as shown below
Culture "sv" is a neutral culture. It can not be used in formatting and parsing and therefore cannot be set as the thread's current culture.
Description:
An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NotSupportedException: Culture "sv" is a neutral culture. It can not be used in formatting and parsing and therefore cannot be set as the thread's current culture.
Source Error:
Line 44: Dim strLanguage As String
Line 45: strLanguage = Request.UserLanguages(0)
Line 46: Thread.CurrentThread.CurrentCulture = New CultureInfo(strLanguage)
Line 47: Thread.CurrentThread.CurrentUICulture = New CultureInfo(strLanguage)
Line 48:
[NotSupportedException: Culture "sv" is a neutral culture. It can not be used in formatting and parsing and therefore cannot be set as the thread's current culture.]
System.Globalization.CultureInfo.CheckNeutral(CultureInfo culture) +110
System.Threading.Thread.set_CurrentCulture(CultureInfo value) +17
Travelnext.Global.Application_BeginRequest(Object sender, EventArgs e) in C:\Inetpub\wwwroot\Travelnext1\Global.asax.vb:46
System.Web.SyncEventExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute() +60
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +87
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573
So when i select a neutral culture like "sv" for swedish it displays the following error.I am doin in .Net2003.Can I get a solution( other than choosing a language like sv-fr.....)
None
0 Points
3 Posts
Internationlization problem.........Error with neutral culture
Sep 02, 2006 07:40 AM|mathewk_03|LINK
Hi all ,
I am getting the default browser language like this
Dim strLanguage As String
strLanguage = Request.UserLanguages(0)
Thread.CurrentThread.CurrentCulture = New CultureInfo(strLanguage)
Thread.CurrentThread.CurrentUICulture = New CultureInfo(strLanguage)
Dim c As CultureInfo = New CultureInfo(strLanguage)
Thread.CurrentThread.CurrentCulture = c
Thread.CurrentThread.CurrentUICulture = c
So when i select a neutral culture like "sv" for swedish it displays the following error.I am doin in .Net2003.Can I get a solution( other than choosing a language like sv-fr.....)
Error is as shown below
Culture "sv" is a neutral culture. It can not be used in formatting and parsing and therefore cannot be set as the thread's current culture.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NotSupportedException: Culture "sv" is a neutral culture. It can not be used in formatting and parsing and therefore cannot be set as the thread's current culture.
Source Error:
Source File: C:\Inetpub\wwwroot\Travelnext1\Global.asax.vb Line: 46
Stack Trace:
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573
So when i select a neutral culture like "sv" for swedish it displays the following error.I am doin in .Net2003.Can I get a solution( other than choosing a language like sv-fr.....)
Can anyone please get me a help regarding this
Contributor
2369 Points
908 Posts
Re: Internationlization problem.........Error with neutral culture
Sep 04, 2006 09:18 AM|Gordon-Freeman|LINK
Hi~ Maybe you can try CultureInfo.CreateSpecificCulture, which accepts neutral culture~
None
0 Points
3 Posts
Re: Internationlization problem.........Error with neutral culture
Sep 06, 2006 02:45 AM|mathewk_03|LINK
This also give me an error