locked
Internationlization problem Error with neutral culture

    Question

  • 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: 

    Source File: C:\Inetpub\wwwroot\Travelnext1\Global.asax.vb    Line: 46

    Stack Trace:

    [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

     

    Wednesday, August 30, 2006 9:44 AM