Skip to content

Commit 1177d4c

Browse files
committed
Fix example in docs for translatable scopes
Since `_()` is evaluated at import time the translation would always be the default translation of the Django installation as of process startup time. With `ugettext_lazy` evaluation is delayed until the translated strings are forced to strings in the template, so the current language of the request will be used.
1 parent b1eb3ae commit 1177d4c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/sections/scopesclaims.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ Somewhere in your Django ``settings.py``::
8282

8383
Inside your oidc_provider_settings.py file add the following class::
8484

85-
from django.utils.translation import ugettext as _
85+
from django.utils.translation import ugettext_lazy as _
8686
from oidc_provider.lib.claims import ScopeClaims
8787

8888
class CustomScopeClaims(ScopeClaims):

0 commit comments

Comments
 (0)