Skip to content

Commit

Permalink
Merge pull request #386 from rkuerbitz/patch-1
Browse files Browse the repository at this point in the history
Update README.md
  • Loading branch information
turquoiseowl authored Apr 26, 2019
2 parents 0ff1870 + 7547bcd commit a76406e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,22 @@ URL localization can be disabled by setting the scheme to ```i18n.UrlLocalizatio
}
```

Without URL localization, i18n will rely on the cookie "i18n.langtag" to determine the current language for each request. This means that the language change/setting feature on your site should change the cookie and set the new PrincipalAppLanguage:

```
HttpCookie c = new HttpCookie("i18n.langtag") {
Value = Request.QueryString("newLanguage"),
HttpOnly = true,
Expires = DateTime.UtcNow.AddYears(1)
};
Response.Cookies.Add(c);
i18n.ILanguageTag p = default(i18n.ILanguageTag);
p = i18n.LanguageTag.GetCachedInstance(Request.QueryString("newLanguage"));
i18n.HttpContextExtensions.SetPrincipalAppLanguageForRequest(this.Context, p);
```

If you are experiencing problems with static content, maybe also related to browser caching and are having trouble getting the rules for URL exclusion in the following paragraphs to work, the Void scheme might we worth looking into. Please see [Issue #385](https://github.com/turquoiseowl/i18n/issues/385).

#### Exclude URLs from being localized

URLs to non-internationalized resources need not be localized. Typically, there
Expand Down

0 comments on commit a76406e

Please sign in to comment.