Closed marspd closed 8 years ago
I haven't heard of there being anything special with ru
.
A couple of things to try before delving too far:
locale/fr
to locale/ru
Hi Martin Thanks for the very quick response and the fix. It was indeed a problem with my language files and is now fixed.
HI Guys I've used your excellent code and have my site working with multiple languages (English, French, German and Spanish). However, I also want to work with Russian but for some reason the language will not work.
When the language is chosen from the menu I run the following code on my MVC site
` public ActionResult SetLanguage(string langtag, string returnUrl) { // If valid 'langtag' passed. i18n.LanguageTag lt = i18n.LanguageTag.GetCachedInstance(langtag); if (lt.CultureInfo != null) { // Set persistent cookie in the client to remember the language choice. Response.Cookies.Add(new HttpCookie("i18n.langtag") { Value = lt.ToString(), HttpOnly = true, Expires = DateTime.UtcNow.AddYears(1) }); } // Otherwise...delete any 'language' cookie in the client. else { var cookie = Response.Cookies["i18n.langtag"]; if (cookie != null) { cookie.Value = null; cookie.Expires = DateTime.UtcNow.AddMonths(-1); } } // Update PAL setting so that new language is reflected in any URL patched in the // response (Late URL Localization). i18n.HttpContextExtensions.SetPrincipalAppLanguageForRequest(HttpContext, lt);
I've checked the context and the language 'ru' is placed in element 0 or the items array. However, on the next request I check for the language with the following code
var language = this.HttpContext.GetPrincipalAppLanguageForRequest().GetLanguage();
and this works fine for all the languages other than Russian.
If I look in the context items array 'i18n.UserLanguages' element 0 has been replaced with 'en' for English.
I've checked that the cookie is being saved and the correct cookie language value is being passed on the request.
Any ideas what the issue might be please?
Regards Paul