Translate Plinth web interface into user's preferred language
Translation of Plinth Web Interface is achieved with the help of LocaleMiddleWare
. For detailed information on how we achieved, please check https://docs.djangoproject.com/en/1.10/topics/i18n/translation/#how-django-discovers-language-preference.
Summary of PR:
- For Anonymous User: Form to select their preferred language.
-
For Known User
- Creation of new model named
UserProfile
to accommodate the user's attributes not supported by django's default User model. This design decision is based on the documenation https://docs.djangoproject.com/en/2.0/topics/auth/customizing/#extending-django-s-default-user. For now the created UserProfile have preferred_language attribute to track a known user's language preference. - Updatation of user create form, user update form to accommodate preferred language selection.
- Creation of new model named
- Set necessary variables (as described in the how-django-discovers-language-preference) to translate web interface