Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions docs/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,36 @@ If you wish to use localizations/translations, simply add
...
]

Alternatively, if you do not want to add ``rest_framework_simplejwt`` to
``INSTALLED_APPS``, you can enable translations by adding its locale directory to
``LOCALE_PATHS`` in your ``settings.py``:

.. code-block:: python

import os
from rest_framework_simplejwt import __file__ as simplejwt_file

LOCALE_PATHS = [
os.path.join(os.path.dirname(simplejwt_file), 'locale'),
]

In order for per-request language selection (via the ``Accept-Language`` header)
to work in views and error responses, ensure Django's ``LocaleMiddleware`` is
enabled and appears after ``SessionMiddleware`` and before ``CommonMiddleware``:

.. code-block:: python

MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]


Usage
-----
Expand Down
Binary file modified rest_framework_simplejwt/locale/es_CL/LC_MESSAGES/django.mo
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ msgstr "jti"

#: token_blacklist/admin.py:85
msgid "user"
msgstr "Usuario"
msgstr "usuario"

#: token_blacklist/admin.py:91
msgid "created at"
Expand Down
Binary file modified rest_framework_simplejwt/locale/fa/LC_MESSAGES/django.mo
Binary file not shown.
8 changes: 4 additions & 4 deletions rest_framework_simplejwt/locale/fa/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ msgstr "توکن در لیست سیاه قرار گرفته است"
msgid ""
"The '{}' setting has been removed. Please refer to '{}' for available "
"settings."
msgstr "تنظیمات '{}' حذف شده است. لطفاً به '{}' برای تنظیمات موجود مراجعه کنید."
msgstr "تنظیمات '{}' حذف شده است. لطفا به '{}' برای تنظیمات موجود مراجعه کنید."

#: token_blacklist/admin.py:79
msgid "jti"
Expand Down Expand Up @@ -122,16 +122,16 @@ msgstr "توکن برای %(user)s (%(jti)s)"

#: token_blacklist/models.py:45
msgid "Blacklisted Token"
msgstr "توکن لیست سیاه شده"
msgstr "توکن در لیست سیاه"

#: token_blacklist/models.py:46
msgid "Blacklisted Tokens"
msgstr "توکن‌های لیست سیاه شده"
msgstr "توکن‌های لیست سیاه"

#: token_blacklist/models.py:57
#, python-format
msgid "Blacklisted token for %(user)s"
msgstr "توکن لیست سیاه شده برای %(user)s"
msgstr "توکن لیست سیاه برای %(user)s"

#: tokens.py:53
msgid "Cannot create token with no type or lifetime"
Expand Down
Binary file modified rest_framework_simplejwt/locale/fa_IR/LC_MESSAGES/django.mo
Binary file not shown.
10 changes: 5 additions & 5 deletions rest_framework_simplejwt/locale/fa_IR/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ msgstr "هیچ اکانت فعالی برای اطلاعات داده شده ی

#: serializers.py:109 serializers.py:179
msgid "No active account found for the given token."
msgstr "هیچ اکانت فعالی برای توکن داده شده یافت نشد"
msgstr "هیچ اکانت فعالی برای این توکن یافت نشد"

#: serializers.py:245 tokens.py:280
msgid "Token is blacklisted"
msgstr "توکن به لیست سیاه رفته است"
msgstr "توکن در لیست سیاه قرار گرفته است"

#: settings.py:74
msgid ""
Expand Down Expand Up @@ -130,19 +130,19 @@ msgstr "توکن لیست سیاه برای %(user)s"

#: tokens.py:53
msgid "Cannot create token with no type or lifetime"
msgstr "توکن بدون هیچ نوع و طول عمر قابل ساخت نیست"
msgstr "توکن بدون نوع یا طول عمر قابل ایجاد نیست"

#: tokens.py:127
msgid "Token has no id"
msgstr "توکن id ندارد"

#: tokens.py:139
msgid "Token has no type"
msgstr "توکن نوع ندارد"
msgstr "توکن نوعی ندارد"

#: tokens.py:142
msgid "Token has wrong type"
msgstr "توکن نوع اشتباهی دارد"
msgstr "توکن دارای نوع نادرستی است"

#: tokens.py:201
msgid "Token has no '{}' claim"
Expand Down
Binary file modified rest_framework_simplejwt/locale/fr/LC_MESSAGES/django.mo
Binary file not shown.
2 changes: 1 addition & 1 deletion rest_framework_simplejwt/locale/fr/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ msgstr "jti"

#: token_blacklist/admin.py:85
msgid "user"
msgstr "Utilisateur"
msgstr "utilisateur"

#: token_blacklist/admin.py:91
msgid "created at"
Expand Down
Binary file modified rest_framework_simplejwt/locale/nl_NL/LC_MESSAGES/django.mo
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ msgstr "Gebruiker is inactief"

#: backends.py:90
msgid "Unrecognized algorithm type '{}'"
msgstr "Niet herkend algoritme type '{}"
msgstr "Niet herkend algoritme type '{}'"

#: backends.py:96
msgid "You must have cryptography installed to use {}."
Expand Down
Loading