misc: disambiguate some translations (#69677)
This commit is contained in:
parent
67e3f154f4
commit
39d76eca57
|
@ -15,7 +15,7 @@
|
|||
<p>{% blocktrans %}Do you want to remove admin role {{ child }}?{% endblocktrans %}</p>
|
||||
{% endblock %}
|
||||
<div class="buttons">
|
||||
<button>{% trans "Remove" %}</button>
|
||||
<button>{% trans "Remove" context "withdraw" %}</button>
|
||||
<a class="cancel" href="..">{% trans "Cancel" %}</a>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<p>{% blocktrans %}Do you want to remove admin user {{ user }}?{% endblocktrans %}</p>
|
||||
{% endblock %}
|
||||
<div class="buttons">
|
||||
<button>{% trans "Remove" %}</button>
|
||||
<button>{% trans "Remove" context "withdraw" %}</button>
|
||||
<a class="cancel" href="..">{% trans "Cancel" %}</a>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -22,8 +22,8 @@ class Migration(migrations.Migration):
|
|||
'id',
|
||||
models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True),
|
||||
),
|
||||
('created', models.DateTimeField(auto_now_add=True, verbose_name='created')),
|
||||
('modified', models.DateTimeField(auto_now=True, verbose_name='modified')),
|
||||
('created', models.DateTimeField(auto_now_add=True, verbose_name='creation date')),
|
||||
('modified', models.DateTimeField(auto_now=True, verbose_name='last modification date')),
|
||||
('sub', models.CharField(unique=True, max_length=256, verbose_name='sub')),
|
||||
],
|
||||
),
|
||||
|
@ -49,8 +49,8 @@ class Migration(migrations.Migration):
|
|||
'idtoken_claim',
|
||||
models.BooleanField(blank=True, default=False, verbose_name='idtoken claim'),
|
||||
),
|
||||
('created', models.DateTimeField(auto_now_add=True, verbose_name='created')),
|
||||
('modified', models.DateTimeField(auto_now=True, verbose_name='modified')),
|
||||
('created', models.DateTimeField(auto_now_add=True, verbose_name='creation date')),
|
||||
('modified', models.DateTimeField(auto_now=True, verbose_name='last modification date')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Claim',
|
||||
|
@ -117,8 +117,8 @@ class Migration(migrations.Migration):
|
|||
'max_auth_age',
|
||||
models.PositiveIntegerField(null=True, verbose_name='max authentication age', blank=True),
|
||||
),
|
||||
('created', models.DateTimeField(auto_now_add=True, verbose_name='created')),
|
||||
('modified', models.DateTimeField(auto_now=True, verbose_name='modified')),
|
||||
('created', models.DateTimeField(auto_now_add=True, verbose_name='creation date')),
|
||||
('modified', models.DateTimeField(auto_now=True, verbose_name='last modification date')),
|
||||
(
|
||||
'ou',
|
||||
models.ForeignKey(
|
||||
|
|
|
@ -23,6 +23,7 @@ from django.core.exceptions import ValidationError
|
|||
from django.db import models
|
||||
from django.shortcuts import render
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from django.utils.translation import pgettext_lazy
|
||||
from jwcrypto.jwk import InvalidJWKValue, JWKSet
|
||||
|
||||
from authentic2.a2_rbac.utils import get_default_ou
|
||||
|
@ -92,7 +93,11 @@ class OIDCProvider(BaseAuthenticator):
|
|||
token_revocation_endpoint = models.URLField(
|
||||
max_length=128, blank=True, null=True, verbose_name=_('token revocation endpoint')
|
||||
)
|
||||
scopes = models.CharField(max_length=128, blank=True, verbose_name=_('scopes'))
|
||||
scopes = models.CharField(
|
||||
max_length=128,
|
||||
blank=True,
|
||||
verbose_name=pgettext_lazy('add english name between parenthesis', 'scopes'),
|
||||
)
|
||||
jwkset_json = JSONField(
|
||||
verbose_name=_('JSON WebKey set'), null=True, blank=True, validators=[validate_jwkset]
|
||||
)
|
||||
|
@ -112,8 +117,8 @@ class OIDCProvider(BaseAuthenticator):
|
|||
)
|
||||
|
||||
# metadata
|
||||
created = models.DateTimeField(verbose_name=_('created'), auto_now_add=True)
|
||||
modified = models.DateTimeField(verbose_name=_('modified'), auto_now=True)
|
||||
created = models.DateTimeField(verbose_name=_('creation date'), auto_now_add=True)
|
||||
modified = models.DateTimeField(verbose_name=_('last modification date'), auto_now=True)
|
||||
|
||||
objects = managers.OIDCProviderManager()
|
||||
|
||||
|
@ -248,8 +253,8 @@ class OIDCClaimMapping(AuthenticatorRelatedObjectBase):
|
|||
)
|
||||
required = models.BooleanField(blank=True, default=False, verbose_name=_('required'))
|
||||
idtoken_claim = models.BooleanField(verbose_name=_('idtoken claim'), default=False, blank=True)
|
||||
created = models.DateTimeField(verbose_name=_('created'), auto_now_add=True)
|
||||
modified = models.DateTimeField(verbose_name=_('modified'), auto_now=True)
|
||||
created = models.DateTimeField(verbose_name=_('creation date'), auto_now_add=True)
|
||||
modified = models.DateTimeField(verbose_name=_('last modification date'), auto_now=True)
|
||||
|
||||
objects = managers.OIDCClaimMappingManager()
|
||||
|
||||
|
@ -287,8 +292,8 @@ class OIDCClaimMapping(AuthenticatorRelatedObjectBase):
|
|||
|
||||
|
||||
class OIDCAccount(models.Model):
|
||||
created = models.DateTimeField(verbose_name=_('created'), auto_now_add=True)
|
||||
modified = models.DateTimeField(verbose_name=_('modified'), auto_now=True)
|
||||
created = models.DateTimeField(verbose_name=_('creation date'), auto_now_add=True)
|
||||
modified = models.DateTimeField(verbose_name=_('last modification date'), auto_now=True)
|
||||
provider = models.ForeignKey(
|
||||
to='OIDCProvider', verbose_name=_('provider'), related_name='accounts', on_delete=models.CASCADE
|
||||
)
|
||||
|
|
|
@ -41,7 +41,7 @@ class Migration(migrations.Migration):
|
|||
models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True),
|
||||
),
|
||||
('name', models.CharField(max_length=128, verbose_name='attribute name', blank=True)),
|
||||
('value', models.CharField(max_length=128, verbose_name='attribute value', blank=True)),
|
||||
('value', models.CharField(max_length=128, verbose_name='value of attribute', blank=True)),
|
||||
('scopes', models.CharField(max_length=128, verbose_name='attribute scopes', blank=True)),
|
||||
(
|
||||
'client',
|
||||
|
|
|
@ -25,6 +25,7 @@ from django.core.validators import URLValidator
|
|||
from django.db import models
|
||||
from django.utils.timezone import now
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from django.utils.translation import pgettext_lazy
|
||||
|
||||
from authentic2.a2_rbac.models import OrganizationalUnit
|
||||
from authentic2.custom_user.models import Profile
|
||||
|
@ -317,9 +318,9 @@ class OIDCCode(SessionMixin, models.Model):
|
|||
profile = models.ForeignKey(
|
||||
to=Profile, verbose_name=_('user selected profile'), null=True, on_delete=models.CASCADE
|
||||
)
|
||||
scopes = models.TextField(verbose_name=_('scopes'))
|
||||
scopes = models.TextField(verbose_name=pgettext_lazy('add english name between parenthesis', 'scopes'))
|
||||
state = models.TextField(null=True, verbose_name=_('state'))
|
||||
nonce = models.TextField(null=True, verbose_name=_('nonce'))
|
||||
nonce = models.TextField(null=True, verbose_name='nonce')
|
||||
redirect_uri = models.TextField(verbose_name=_('redirect URI'), validators=[URLValidator()])
|
||||
session_key = models.CharField(verbose_name=_('session key'), max_length=128)
|
||||
auth_time = models.DateTimeField(verbose_name=_('auth time'))
|
||||
|
@ -400,7 +401,7 @@ GenericRelation(
|
|||
class OIDCClaim(models.Model):
|
||||
client = models.ForeignKey(to=OIDCClient, verbose_name=_('client'), on_delete=models.CASCADE)
|
||||
name = models.CharField(max_length=128, blank=True, verbose_name=_('attribute name'))
|
||||
value = models.CharField(max_length=128, blank=True, verbose_name=_('attribute value'))
|
||||
value = models.CharField(max_length=128, blank=True, verbose_name=_('value of attribute'))
|
||||
scopes = models.CharField(max_length=128, blank=True, verbose_name=_('attribute scopes'))
|
||||
|
||||
def __str__(self):
|
||||
|
|
|
@ -22,7 +22,7 @@ from django.contrib.contenttypes.fields import GenericForeignKey
|
|||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.db import models
|
||||
from django.db.models.query import Prefetch, Q
|
||||
from django.utils.translation import gettext
|
||||
from django.utils.translation import gettext, pgettext_lazy
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from model_utils.managers import QueryManager
|
||||
|
||||
|
@ -418,9 +418,9 @@ class PermissionMixin(models.Model):
|
|||
return backends.DjangoRBACBackend().ous_with_perm(self, perm, queryset=queryset)
|
||||
|
||||
|
||||
ADMIN_OP = Operation.register(name=_('Management'), slug='admin')
|
||||
CHANGE_OP = Operation.register(name=_('Change'), slug='change')
|
||||
DELETE_OP = Operation.register(name=_('Delete'), slug='delete')
|
||||
ADD_OP = Operation.register(name=_('Add'), slug='add')
|
||||
VIEW_OP = Operation.register(name=_('View'), slug='view')
|
||||
SEARCH_OP = Operation.register(name=_('Search'), slug='search')
|
||||
ADMIN_OP = Operation.register(name=pgettext_lazy('permission', 'Management'), slug='admin')
|
||||
CHANGE_OP = Operation.register(name=pgettext_lazy('permission', 'Change'), slug='change')
|
||||
DELETE_OP = Operation.register(name=pgettext_lazy('permission', 'Delete'), slug='delete')
|
||||
ADD_OP = Operation.register(name=pgettext_lazy('permission', 'Add'), slug='add')
|
||||
VIEW_OP = Operation.register(name=pgettext_lazy('permission', 'View'), slug='view')
|
||||
SEARCH_OP = Operation.register(name=pgettext_lazy('permission', 'Search'), slug='search')
|
||||
|
|
|
@ -115,8 +115,8 @@ def test_authenticators_oidc(app, superuser, ou1, ou2):
|
|||
provider = OIDCProvider.objects.filter(slug='test', ou=get_default_ou()).get()
|
||||
resp = app.get(provider.get_absolute_url())
|
||||
assert 'extra-actions-menu-opener' in resp.text
|
||||
assert 'Created: April 19, 2022, 2 p.m.' in resp.text
|
||||
assert 'Modified: April 19, 2022, 2 p.m.' in resp.text
|
||||
assert 'Creation date: April 19, 2022, 2 p.m.' in resp.text
|
||||
assert 'Last modification date: April 19, 2022, 2 p.m.' in resp.text
|
||||
assert 'Issuer' not in resp.text
|
||||
|
||||
assert 'Enable' not in resp.text
|
||||
|
|
Loading…
Reference in New Issue