Login

Tag "localeurl"

Snippet List

Multilingual site based on domain - not accept header and django_session

On our site [Fornebuklinikken - A cosmetic surgeon in Norway](http://www.fornebuklinikken.no) we also have a domain [http://fornebuklinikken.com](http://www.fornebuklinikken.no) which should be using the 'en' language. We didn't wan't to use the standard locale lib, and wrote our own middleware which lookups the correct language corresponding to the domain (.no or .com) Any questions? Contact me on herman.schistad (at) gmail.com

  • internationalization
  • middleware
  • multilingual
  • locale
  • domain
  • localeurl
Read More

Localeurl sitemap

Example of using django localeurl with sitemaps. Create sitemap instance for each combination of the sitemap section and language. In your sitemap class create method ` def location(self, obj): return chlocale(obj.get_absolute_url(), self.language) ` or inherit it from LocaleurlSitemap class.

  • localeurl
  • sitemap
Read More

2 snippets posted so far.