Skip to content

Commit

Permalink
Add .upper class and use it for text transformation to minimize i18n …
Browse files Browse the repository at this point in the history
…churn

Towards #1587
  • Loading branch information
eloquence committed Aug 14, 2019
1 parent 064de4a commit 0cc9bc7
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions securedrop/journalist_templates/_confirmation_modal.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<a href="#close" title="{{ gettext('Close') }}" class="close">X</a>
<h2>{{ modal_data.modal_header }}</h2>
<p>{{ modal_data.modal_body }}</p>
<a href="#close" id="{{ modal_data.cancel_id }}" title="{{ gettext('Cancel') }}" class="btn">{{ gettext('CANCEL') }}</a>
<button type="submit" id="{{ modal_data.submit_id }}" name="action" value="delete" class="{{ modal_data.submit_btn_type }}">{{ modal_data.submit_btn_text }}</button>
<a href="#close" id="{{ modal_data.cancel_id }}" title="{{ gettext('Cancel') }}" class="btn upper">{{ gettext('Cancel') }}</a>
<button type="submit" id="{{ modal_data.submit_id }}" name="action" value="delete" class="{{ modal_data.submit_btn_type }} upper">{{ modal_data.submit_btn_text }}</button>
</div>
</div>
2 changes: 1 addition & 1 deletion securedrop/journalist_templates/col.html
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ <h3>{{ gettext('Reply') }}</h3>
"cancel_id": "cancel-collection-deletions",
"submit_id": "delete-collection-button",
"submit_btn_type": "danger",
"submit_btn_text": gettext('DELETE')
"submit_btn_text": gettext('Delete')
}
%}
{% include '_confirmation_modal.html' %}
Expand Down
2 changes: 1 addition & 1 deletion securedrop/journalist_templates/edit_account.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ <h2>{{ gettext('Reset Password') }}</h2>
<br>
<span id="password" class="password">{{ password }}</span>
</p>
<button type="submit" id="reset-password"><i class="fas fa-sync"></i> {% filter upper %}{{ gettext('Reset Password') }}{% endfilter %}</button>
<button type="submit" id="reset-password" class="upper"><i class="fas fa-sync"></i> {{ gettext('Reset Password') }}</button>
</form>

<hr class="no-line">
Expand Down
2 changes: 1 addition & 1 deletion securedrop/journalist_templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ <h1><span class="headline">{{ gettext('Sources') }}</span></h1>
"cancel_id": "cancel-collections-deletions",
"submit_id": "delete-collections",
"submit_btn_type": "danger",
"submit_btn_text": gettext('DELETE')
"submit_btn_text": gettext('Delete')
}
%}
{% include '_confirmation_modal.html' %}
Expand Down
3 changes: 3 additions & 0 deletions securedrop/sass/_base.sass
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@
@import "modules/footer"
// Form validation error - text to help users correct errors
@import "modules/form-validation-error"
// Text transformation class to minimize i18n churn for capitalization changes
@import "modules/upper"

=base_rules
// LIBRARIES
Expand Down Expand Up @@ -147,3 +149,4 @@
+regenerate-codename-button
+footer
+form-validation-error
+upper
3 changes: 3 additions & 0 deletions securedrop/sass/modules/_upper.sass
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
=upper
.upper
text-transform: uppercase

0 comments on commit 0cc9bc7

Please sign in to comment.