Skip to content

Commit

Permalink
traslate: Show disabled save button reason more prominently
Browse files Browse the repository at this point in the history
Tooltip is not really a good place for this as people do not notice it
and it is typically not accessible on touch devices.

Fixes WeblateOrg#10165
  • Loading branch information
nijel committed Oct 12, 2023
1 parent 0df9af9 commit 18f9c91
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions docs/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Not yet released.
* Show plural form examples more prominently.
* Highlight whitespace in :ref:`machine-translation`.
* Faster comment and component removal.
* Show disabled save button reason more prominently.

**Bug fixes**

Expand Down
10 changes: 7 additions & 3 deletions weblate/templates/translate.html
Original file line number Diff line number Diff line change
Expand Up @@ -188,16 +188,20 @@ <h4 class="panel-title">
</div>
{% endif %}
{% endwith %}
{% if locked %}
<p class="text-danger">{% trans "This translation is currently locked." %}</p>
{% elif not user_can_translate and not user_can_edit_flags %}
<p class="text-danger">{{ user_can_translate.reason }}</p>
{% elif not user_can_translate and user_can_edit_flags and not unit.translation.component.is_glossary %}
<p class="text-danger">{% trans "Insufficient privileges for saving translations." %}</p>
{% endif %}
<button class="btn btn-primary" type="submit" name="save" tabindex="150"
{% if locked %}
disabled="disabled"
title="{% trans "This translation is currently locked." %}"
{% elif not user_can_translate and not user_can_edit_flags %}
disabled="disabled"
title="{{ user_can_translate.reason }}"
{% elif not user_can_translate and user_can_edit_flags and not unit.translation.component.is_glossary %}
disabled="disabled"
title="{% trans "Insufficient privileges for saving translations." %}"
{% endif %}
> {% trans "Save and continue" %}</button>

Expand Down

0 comments on commit 18f9c91

Please sign in to comment.