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
Post a Comment