Skip to content

Commit

Permalink
[UserBundle] Add missing translations on user section (#265)
Browse files Browse the repository at this point in the history
  • Loading branch information
DumitracheAdrian authored May 13, 2024
1 parent fb084f9 commit e4eb0bf
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ draw_user:
password-expired:
explanation: 'Password is expired, it was updated too long ago.'

button:
request_password_change: 'Request password change'

flash:
password_change_requested:
success: 'Password change requested successfully for user %user%.'
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@
</li>
<li class="user-footer">
<div class="pull-left">
<a href="{{ _profile_uri }}" class="btn btn-default btn-flat"><i class="fas fa-user"></i> Profile</a>
<a href="{{ _profile_uri }}" class="btn btn-default btn-flat">
<i class="fas fa-user"></i> {{ 'header.button.profile' | trans([], 'DrawUserBundle') }}
</a>
</div>
<div class="pull-right">
<a href="{{ url('admin_logout') }}" class="btn btn-default btn-flat"><i class="fas fa-sign-out-alt"></i> Logout</a>
<a href="{{ url('admin_logout') }}" class="btn btn-default btn-flat">
<i class="fas fa-sign-out-alt"></i> {{ 'header.button.logout' | trans([], 'DrawUserBundle') }}
</a>
</div>
</li>
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<li>
<a class="sonata-action-element" href="{{ admin.generateObjectUrl('disable-2fa', object) }}">
<i class="fas fa-ban"></i></i><i class="fas fa-fingerprint"></i>
Disable 2FA
<i class="fas fa-ban"></i><i class="fas fa-fingerprint"></i>
{{ 'admin.button.disable_2fa' | trans([], 'DrawUserBundle') }}
</a>
</li>
</li>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<li>
<a class="sonata-action-element" href="{{ admin.generateObjectUrl('enable-2fa', object) }}">
<i class="fas fa-fingerprint"></i>
Enable 2FA
{{ 'admin.button.enable_2fa' | trans([], 'DrawUserBundle') }}
</a>
</li>
{% endif %}
{% endif %}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<li>
<a class="sonata-action-element" href="{{ admin.generateObjectUrl('request_password_change', object) }}">
<i class="fa fa-user-shield"></i>
{{ 'draw_user.button.request_password_change'|trans({}, 'SonataAdminBundle') }}
{{ 'admin.button.request_password_change' | trans([], 'DrawUserBundle') }}
</a>
</li>
{% endif %}
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
and object.isLocked()
and admin.id(object) is not null
and admin.hasAccess('unlock', object)
and admin.hasRoute('unlock') %}
and admin.hasRoute('unlock')
%}
<li>
<a class="sonata-action-element" href="{{ admin.generateObjectUrl('unlock', object) }}">
<i class="fas fa-unlock"></i>
Unlock for 24h
{{ 'admin.button.unlock_for_24h' | trans([], 'DrawUserBundle') }}
</a>
</li>
{% endif %}
{% endif %}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div class="col-md-6">
<div class="box box-primary">
<div class="box-header">
<h1>{{ 'form.enable_2fa.header' | trans([], 'DrawUserBundle') |raw }}</h1>
<h1>{{ 'form.enable_2fa.header' | trans([], 'DrawUserBundle') | raw }}</h1>
</div>
<div class="box-body">
<div class="row">
Expand All @@ -26,4 +26,4 @@
</div>
</div>
</div>
{% endblock %}
{% endblock %}
10 changes: 10 additions & 0 deletions packages/user-bundle/Resources/translations/DrawUserBundle.en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,13 @@ admin:
2fa_enabled: '2FA enabled'
form:
2fa_enabled: '2FA enabled'
button:
enable_2fa: 'Enable 2FA'
disable_2fa: 'Disable 2FA'
unlock_for_24h: 'Unlock for 24h'
request_password_change: 'Request password change'

header:
button:
profile: 'Profile'
logout: 'Logout'

0 comments on commit e4eb0bf

Please sign in to comment.