Setting Custom Language Settings RRS feed

  • Question

  • User83354550 posted


     I am working on my first project using ASP.Net and have the requirement for the website to be available in both English (default) and Welsh. People living in Wales are unlikely to have their browser default language set to any other then en-uk.

    I have a web form set up which has its labels etc tied to the relevant resource file item and the culture/global culture set to auto. What would be the best way of switching the resource file being used? Users will specify the language choice upon entering the site this then needs to be globaly set.

    Not after a solution - just pointing in the right direction.

     Thanks in advance!

    Thursday, December 14, 2006 7:50 AM

All replies

  • User371668647 posted
    You'll need to set the culture on the Thread to the desired culture since you're not really going to use the built-in browser sniffing.
    Thursday, December 14, 2006 10:09 AM
  • User83354550 posted

    Thanks for this, I have tried coding it to set the culture but get an error back stating the culture is neutrol and cannot be parsed etc etc.

    Any idea? The code is placed in the page_load event for testing it - is this correct?

     Thanks for your help.

    Thursday, December 14, 2006 10:42 AM
  • User371668647 posted
    Which culture are you trying to set it to?
    Thursday, December 14, 2006 10:48 AM
  • User83354550 posted

    Ha, right now this is the thing - you may be able to suggest a whole better way of going about this.

    The secondary language I require is Welsh but as far as I can tell, this is not a standard language option. I have been testing it using a language setting which I know wont be required (i.e. Zulu) this wouldn't work so I have tried with French only to recieve the same error. I though it wouldn't matter as long as my entries in my resource file are the valid values....

    Thursday, December 14, 2006 11:00 AM
  • User371668647 posted
    There are some language codes that are sort of reserved and tagged as "neutral" and it sounds like that's what you're running into...
    Thursday, December 14, 2006 1:06 PM