jjbgf / eventbooking

Django webapp which allows to submit required date to attend an event.
GNU General Public License v2.0
0 stars 0 forks source link

Localization for german #15

Open numberpi opened 9 years ago

numberpi commented 9 years ago

Quick and dirty hard coded in constructor or i18n

samuelstein commented 9 years ago

works fine. but would be nice to change language via url. see: http://machakux.appspot.com/blog/17010/django_using_i18n_patterns_and_locale_switcher

numberpi commented 9 years ago

also see to change via url: https://docs.djangoproject.com/en/1.7/topics/i18n/translation/#url-internationalization

numberpi commented 9 years ago

important for model fields translations http://docs.djangoproject.com/en/dev/topics/i18n/internationalization/#lazy-translation

numberpi commented 9 years ago

Cannot fix localization problem: Models and Form is in german, but bootstrap widgets are still in english

image

Caused by:

image

The DateWidget seems to use what was set in settings.py to LANGUAGE_CODE. And not what is set in Accep-languages Request-header...

After some tests: When form-class is loaded and the DateTime Widget is initialized, translation.get_language() is "en_us", but when the client request is parsed, translation.get_language() is "de".