Skip to content

Commit

Permalink
Add {{#i18n}} tags in more places (#451)
Browse files Browse the repository at this point in the history
Some parts of some templates seem to have previously escaped attention,
especially placeholder, data-tooltip and aria-label attributes. Besides
those, there were some changes that were added in parallel on develop,
as well as a few pieces where alternative orthography or sentence
structure of other languages needed to be taken into account.
  • Loading branch information
jgonggrijp committed Mar 15, 2022
1 parent 7af7b78 commit e440981
Show file tree
Hide file tree
Showing 12 changed files with 109 additions and 37 deletions.
20 changes: 17 additions & 3 deletions frontend/src/feedback/feedback-template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,24 @@
<div class="field">
<label class="label">{{#i18n 'subject'}}Subject{{/i18n}}</label>
<div class="control">
<input name="subject" class="input" type="text" name="title" placeholder="About READ-IT">
<input
name="subject"
class="input"
type="text"
name="title"
placeholder="{{#i18n 'about_readit'}}About READ-IT{{/i18n}}"
>
</div>
</div>

<div class="field">
<div class="control">
<label class="label">{{#i18n 'feedback'}}Feedback{{/i18n}}</label>
<textarea name="feedback" class="textarea" placeholder="e.g. I love READ-IT!"></textarea>
<textarea
name="feedback"
class="textarea"
placeholder="{{#i18n 'feedback_placeholder'}}e.g. I love READ-IT!{{/i18n}}"
></textarea>
</div>
</div>

Expand All @@ -52,4 +62,8 @@
</form>

</div>
<button type=button class="modal-close is-large" aria-label="close"></button>
<button
type=button
class="modal-close is-large"
aria-label="{{#i18n 'close'}}close{{/i18n}}"
></button>
17 changes: 9 additions & 8 deletions frontend/src/landing/landing-template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,24 @@
</h1>
<div class="card sources">
<div class="card-content">
<p class="title">Sources</p>
<p class="subtitle">You uploaded {{userSources}} of {{totalSources}} sources.</p>
<p class="title">{{#i18n 'sources'}}Sources{{/i18n}}</p>
<p class="subtitle">{{#i18n 'sources_tally'}}You uploaded {{userSources}} of {{totalSources}} sources.{{/i18n}}</p>
</div>
<div class="card-footer">
<a href="explore/sources/mine" class="card-footer-item user-sources">View your sources</a>
<a href="explore/sources" class="card-footer-item user-sources">Explore sources</a>
<a href="explore/sources/mine" class="card-footer-item user-sources">{{#i18n 'view_sources'}}View your sources{{/i18n}}</a>
<a href="explore/sources" class="card-footer-item user-sources">{{#i18n 'explore_sources'}}Explore sources{{/i18n}}</a>
</div>
</div>
<div class="card items">
<div class="card-content">
<p class="title">Items</p>
<p class="title">{{#i18n 'items'}}Items{{/i18n}}</p>
<p class="subtitle">
You created {{userItems}} of {{totalItems}} items.</p>
{{#i18n 'items_tally'}}You created {{userItems}} of {{totalItems}} items.{{/i18n}}
</p>
</div>
<div class="card-footer">
<a href="explore/items/mine" class="card-footer-item user-items">View your items</a>
<a href="explore/items" class="card-footer-item user-items">Explore items</a>
<a href="explore/items/mine" class="card-footer-item user-items">{{#i18n 'view_items'}}View your items{{/i18n}}</a>
<a href="explore/items" class="card-footer-item user-items">{{#i18n 'explore_items'}}Explore items{{/i18n}}</a>
</div>
</div>
</div>
17 changes: 13 additions & 4 deletions frontend/src/menu/menu-template.hbs
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
<nav class="navbar" role="navigation" aria-label="main navigation">
<nav
class="navbar"
role="navigation"
aria-label="{{#i18n 'main_navigation'}}main navigation{{/i18n}}"
>
<div class="container">
<div class="navbar-brand">
<a class="navbar-item" href="/">
<img src="{{static 'image/read-it-logo-med-colour-no-letters.png'}}" alt="Read-It">
</a>
<a role="button" class="navbar-burger burger" aria-label="menu" aria-expanded="false"
data-target="navbarMenu">
<a
role="button"
class="navbar-burger burger"
aria-label="{{#i18n 'menu'}}menu{{/i18n}}"
aria-expanded="false"
data-target="navbarMenu"
>
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
Expand Down Expand Up @@ -47,7 +56,7 @@
</div>
</div>
{{#if uploadSources}}
<a class="navbar-item tooltip is-tooltip-left"
<a class="navbar-item tooltip is-tooltip-left"
data-tooltip="{{#i18n 'upload_tooltip'}}Upload reading testimonies for annotation{{/i18n}}" href="/upload">
<span class="icon-text">
<span class="icon is-small has-text-primary">
Expand Down
9 changes: 6 additions & 3 deletions frontend/src/notfound404/notfound-template.hbs
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<figure class="image notfound">
<img src="{{static 'image/404.svg'}}" alt="404 Not Found">
<img
src="{{static 'image/404.svg'}}"
alt="{{#i18n 'not_found_alt'}}404 Not Found{{/i18n}}"
>
</figure>
<p>
<p>{{{#i18n 'not_found_text'}}}
Oops, this page doesn't seem to exist.
You can <a onclick="history.back()">go back</a>,
visit <a href="/landing">Landing</a> or <a href="/search">Search</a>,
or report a problem to the maintainers.
</p>
{{{/i18n}}}</p>
18 changes: 15 additions & 3 deletions frontend/src/pagination/pagination-template.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<nav class="pagination is-centered" role="navigation" aria-label="pagination">
<nav
class="pagination is-centered"
role="navigation"
aria-label="{{#i18n 'pagination'}}pagination{{/i18n}}"
>
<a class="pagination-previous">
<i class="fas fa-chevron-left"></i>
</a>
Expand All @@ -8,7 +12,11 @@
<ul class="pagination-list">
{{#if showPaginationLinks.start}}
<li>
<a id="page-first" class="pagination-link" aria-label="Goto page 1">1</a>
<a
id="page-first"
class="pagination-link"
aria-label="{{#i18n 'to_first_page'}}Go to page 1{{/i18n}}"
>1</a>
</li>
{{/if}}
{{#if showPaginationLinks.ellipsisStart}}
Expand All @@ -34,7 +42,11 @@
{{/if}}
{{#if showPaginationLinks.end}}
<li>
<a id="page-last" class="pagination-link" aria-label="Goto last page">{{totalPages}}</a>
<a
id="page-last"
class="pagination-link"
aria-label="{{#i18n 'to_last_page'}}Go to last page{{/i18n}}"
>{{totalPages}}</a>
</li>
{{/if}}
</ul>
Expand Down
16 changes: 12 additions & 4 deletions frontend/src/panel-annotation/annotation-template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@
<article class="item-section has-mt-10">
<div class="item-section-header" id="btnRelItems">
<p>{{#i18n 'related_items_title'}}Related items{{/i18n}}</p>
<span class="icon is-large has-text-primary tooltip is-tooltip-left" data-tooltip="Open related items">
<span
class="icon is-large has-text-primary tooltip is-tooltip-left"
data-tooltip="{{#i18n 'open_related'}}Open related items{{/i18n}}"
>
<i class="fas fa-arrow-circle-right"></i>
</span>
</div>
Expand All @@ -61,16 +64,21 @@
{{else}}
{{#i18n 'annotations_title'}}Annotations{{/i18n}}
{{/if}}</p>
<span class="icon is-large has-text-primary tooltip is-tooltip-left" data-tooltip="Open annotations">
<span
class="icon is-large has-text-primary tooltip is-tooltip-left"
data-tooltip="{{#i18n 'open_annotations'}}Open annotations{{/i18n}}"
>
<i class="fas fa-arrow-circle-right"></i>
</span>
</div>
</article>
<article class="item-section has-mt-10">
<div class="item-section-header" id="btnExtResources">
<p>{{#i18n 'external_resources_title'}}External resources{{/i18n}}</p>
<span class="icon is-large has-text-primary tooltip is-tooltip-left"
data-tooltip="Open external resources">
<span
class="icon is-large has-text-primary tooltip is-tooltip-left"
data-tooltip="{{#i18n 'open_external'}}Open external resources{{/i18n}}"
>
<i class="fas fa-arrow-circle-right"></i>
</span>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
{{/unless}}
{{#each properties}}
<p>
<b>{{@key}}: </b>{{this}}
<b>{{@key}}{{#i18n 'interpunction.colon'}}: {{/i18n}}</b>{{this}}
</p>
{{/each}}
6 changes: 3 additions & 3 deletions frontend/src/panel-source/source-metadata-template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

</div>
<div class="panel-footer buttons is-right">{{#userIsOwner}}
<button type=button class="button btn-delete is-danger">Delete source</button>
<button type=reset class="button btn-cancel">Cancel</button>
<button type=button class="button btn-edit">Edit</button>
<button type=button class="button btn-delete is-danger">{{#i18n 'delete_source'}}Delete source{{/i18n}}</button>
<button type=reset class="button btn-cancel">{{#i18n 'cancel'}}Cancel{{/i18n}}</button>
<button type=button class="button btn-edit">{{#i18n 'edit'}}Edit{{/i18n}}</button>
{{/userIsOwner}}</div>
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<form class="box is-narrow-modal-form">
{{#if isConfirmed}}
<h3 class="title is-3">{{#i18n 'confirmation_complete'}}Confirmation complete{{/i18n}}</h3>
<p>{{#i18n 'sign_up_thanks'}}Thank you for signing up. You can now {{/i18n}}<a href='search'>{{#i18n 'login'}}login{{/i18n}}</a></p>
<p>{{#i18n 'sign_up_thanks_before_link'}}Thank you for signing up. You can now {{/i18n}}<a href='search'>{{#i18n 'sign_up_thanks_link'}}login{{/i18n}}</a>{{#i18n 'sign_up_thanks_after_link'}}.{{/i18n}}</p>
{{/if}}

{{#if wasNotFound}}
Expand Down
24 changes: 21 additions & 3 deletions frontend/src/registration/registration-template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,14 @@
<div class="field">
<label class="label">{{#i18n 'username'}}Username{{/i18n}}</label>
<div class="control">
<input name="username" class="input" type="text" name="title" placeholder="Username" required>
<input
name="username"
class="input"
type="text"
name="title"
placeholder="{{#i18n 'username'}}Username{{/i18n}}"
required
>
</div>
</div>

Expand All @@ -29,13 +36,24 @@
<div class="field">
<div class="control">
<label class="label">{{#i18n 'password'}}Password{{/i18n}}</label>
<input name="password1" id="password" class="input" type="password" placeholder="Password">
<input
name="password1"
id="password"
class="input"
type="password"
placeholder="{{#i18n 'password'}}Password{{/i18n}}"
>
</div>
</div>

<div class="field">
<div class="control">
<input name="password2" class="input" type="password" placeholder="Repeat password">
<input
name="password2"
class="input"
type="password"
placeholder="{{#i18n 'repeat_password'}}Repeat password{{/i18n}}"
>
</div>
</div>

Expand Down
13 changes: 10 additions & 3 deletions frontend/src/search-box/searchbox-template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,20 @@
<a class="button is-info"
href="https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-simple-query-string-query.html#simple-query-string-syntax"
target="_blank">
<span class="icon is-small tooltip is-tooltip-top" data-tooltip="View documentation of search operators">
<span
class="icon is-small tooltip is-tooltip-top"
data-tooltip="{{#i18n 'view_operator_docs'}}View documentation of search operators{{/i18n}}"
>
<i class="fas fa-question" aria-hidden="true"></i>
</span>
</a>
</div>
<div class="control is-expanded">
<input class="input" type="text" placeholder="Search our database">
<input
class="input"
type="text"
placeholder="{{#i18n 'search_database'}}Search our database{{/i18n}}"
>
</div>
<div class="dropdown is-hoverable">
<div class="dropdown-trigger">
Expand All @@ -35,4 +42,4 @@
</span>
</a>
</div>
</div>
</div>
2 changes: 1 addition & 1 deletion frontend/src/semantic-search/semantic-search-template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
name=label
maxlength=100
value="{{label}}"
placeholder="optional label for reference"
placeholder="{{#i18n 'optional_label_placeholder'}}optional label for reference{{/i18n}}"
class="input"
>
</div>
Expand Down

0 comments on commit e440981

Please sign in to comment.