c# - Why won't my code change my website's Current Culture? -


i've got website needs localizing, have achieved automatically, setting culture auto in web.config , using resx files translation, i'd customer able change website's translation manually backup.

i have form on textbox multiple language choices, choice posted controller per following code

[allowanonymous]         [httppost]         public actionresult selectlanguage(loginviewmodel model)         {             switch (request["lang"])             {                 case "english":                    cultureinfo.currentculture=new cultureinfo("en-gb");                     cultureinfo.currentuiculture = new cultureinfo("en-gb");                     break;                 case "french":                     cultureinfo.currentculture = new cultureinfo("fr-fr");                     cultureinfo.currentuiculture = new cultureinfo("fr-fr");                     break;                }             var currentculture = cultureinfo.currentculture;             return redirecttoaction("index");          } 

the problem while currentculture , currentuiculture change, pages remain untranslated however,if change manually in web.config, site translates perfectly!

is there i'm missing here?

thanks in advance =]

update existing answers involving use of initializeculture aren't valid afaik events in webpages naturally aren't available in mvc


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -