From 82e9760ff40019ce91b38df5fb182f385b7225f1 Mon Sep 17 00:00:00 2001 From: Ix <39010759+ix-56h@users.noreply.github.com> Date: Sat, 10 Jul 2021 12:16:38 +0200 Subject: [PATCH] Initial Home page --- Internationalization.md | 58 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 Internationalization.md diff --git a/Internationalization.md b/Internationalization.md new file mode 100644 index 0000000..c7b8f9d --- /dev/null +++ b/Internationalization.md @@ -0,0 +1,58 @@ +# Internationalization + +Internationalization configuration in `settings.py` : + +```python +# Internationalization +# https://docs.djangoproject.com/en/2.2/topics/i18n/ + +LANGUAGE_CODE = 'en-us' + +LANGUAGE_COOKIE_NAME = 'django_language' + +USE_I18N = True + +LANGUAGES = ( + ('en', _("English")), + ('de', _('German')), + ('fr', _('French')), + ('ru', _('Russian')), +) + +``` +`LANGUAGES` list of languages supported. + + +## Locale directory + +All lang files where traductions is stored are located into `locale/`. + +For translations, edit file `locale/[lang]/django.po` : + +```python + +#: accounts/templates/accounts/edit.html:44 +msgid "Connected accounts" +msgstr "" + +#: accounts/templates/accounts/edit.html:51 +msgid "Disconnect Discord" +msgstr "" + +``` + +For all `messages`, we have a list of `path to files` containing this `message` and line number. + +Edit `msgstr` with the translated string. + + +## Compile `messages` + +Run this command : + +```bash +manage.py compilemessages +``` + +## Contributing +Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.