Re: Generate different querysets depending of the website language

2016-03-30 Thread Mathieu Poussin
Hello. I have been doing some tests, here are my results : The Django default language (fallback) is in Spanish in all case No IgnoreHTTPLanguageMiddleware Browser having English has priority URL specified language in Spanish /es/ -> Translated blocks in Spanish -> Language related DB queries

Re: Generate different querysets depending of the website language

2016-03-27 Thread Daniel Chimeno
Hello again, In that case, I would double-check the middleware process and settings in your project. One reason could be your are placing LocaleMiddleware after your ForceDefaultLanguage, so https://github.com/django/django/blob/master/django/middleware/locale.py#L26 is setting the default

Re: Generate different querysets depending of the website language

2016-03-27 Thread Mathieu Poussin
Thanks for the tips about the translation module, in my case, I think it would be better to keep managing it the way I do as each models have complex relation with other models that are only bound to a specific language of the model (Like tags, comments, steps (This is about recipes), etc. I

Re: Generate different querysets depending of the website language

2016-03-26 Thread Daniel Chimeno
Hello, If you are able to change the schema I would suggest you to use modeltranslation [https://github.com/deschler/django-modeltranslation], also the source code of that app can help you in order to take an specific approach to your project. About the URL's, if you use i18urls, it has

Generate different querysets depending of the website language

2016-03-26 Thread Mathieu Poussin
Hello, I have an issue, I am creating a website that will be available in many languages, sharing the same database. Most models have a "language" attribute that is the 2 letters from the language code (en, es, fr, etc.). I am trying to find a way to show the correct content per language. I