Firefox sends wrong language code -- how can I catch this?

Last post 01-28-2008 5:41 PM by Motley. 4 replies.

Sort Posts:

  • Firefox sends wrong language code -- how can I catch this?

    01-24-2008, 5:11 AM
    • Loading...
    • pbb
    • Joined on 08-19-2005, 11:29 AM
    • Trondheim, Norway
    • Posts 35

    Hi all,

    I am trying to localize a website for Nynorsk (nn-NO, which is the second official language in Norway). The problem is, while Internet Explorer sends the right code, Firefox (most current version) only sends "nn".

    ASP.NET's internal internationalization routines don't accept this. Creating a /App_GlobalResources/Resource.nn.resx file throws a compilation error (CS0101: The namespace 'Resources' already contains a definition for 'Resource'), and querying Thread.CurrentThread.CurrentCulture.Name inside InitializeCulture() even returns "nb-NO" (Bokmål, which is Norway's primary official language).

    Does anybody know how to handle this? Is there a way I can catch the "nn" before it is converted into "nb-NO" by ASP.NET, so that I can properly transform it into "nn-NO"?

    Thanks, Peter

  • Re: Firefox sends wrong language code -- how can I catch this?

    01-24-2008, 7:01 AM
    • Loading...
    • pbb
    • Joined on 08-19-2005, 11:29 AM
    • Trondheim, Norway
    • Posts 35

    Ok, it's not only Firefox. Opera even goes as far as sending "no-nyn" as language code, which is also not understood by ASP.NET. This seems like a pretty significant problem,but I can't find any information about it on internet...

    Anybody who can help me?

     

    Filed under: ,
  • Re: Firefox sends wrong language code -- how can I catch this?

    01-25-2008, 3:10 AM

    hi,

     Check if firefox support "nb-NO" culture or  not .

    Go to Firefox  - Tools - Options - Languages- choose- and check in the dropdown list.

    I think Firefox doesn't support  "nb-NO"  culture

     Thanks,

    Satish

  • Re: Firefox sends wrong language code -- how can I catch this?

    01-25-2008, 6:46 AM
    • Loading...
    • pbb
    • Joined on 08-19-2005, 11:29 AM
    • Trondheim, Norway
    • Posts 35

    Firefox supports both Bokmål (nb-no in ASP.NET) and Nynorks (nn-no in ASP.NET), but calls them just "nb" and "nn" respectively...

    Both of these (nb and nn) are interpreted as Bokmål by ASP.NET.

  • Re: Firefox sends wrong language code -- how can I catch this?

    01-28-2008, 5:41 PM
    Answer
    • Loading...
    • Motley
    • Joined on 10-14-2005, 1:26 PM
    • West Chicago, IL
    • Posts 2,296
    • TrustedFriends-MVPs

    Yes, you can create a custom base page.  In that page, override the InitializeCulture subroutine, and you have complete access to the request object at the point, and can set the culture to anything you want.

    Then have all your other pages inherit from that page instead of System.UI.Page.

    However, in ASP.NET the parent culture of "nb-NO" is "no" which is the generic norweign culture.  Therefore the fallback rules for nb-NO would be: nb-NO -> no -> website default.

    I'm afraid I'm not well versed enough in norweign or the relationships of the primary/secondary languages used there to be of much help.

Page 1 of 1 (5 items)
Microsoft Communities
Page view counter