Skip to content

Commit

Permalink
✨ Multilingualism (#383) (#392)
Browse files Browse the repository at this point in the history
Parent issue: sequentech/meta#122

Co-authored-by: Félix Robles <[email protected]>
  • Loading branch information
edulix and Findeton authored Sep 6, 2023
1 parent dfe89ad commit 3ae390e
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ <h4 class="modal-title">
ng-i18next="avAdmin.ballotBox.modals.writeTallySheet.electionTitleLabel">
</label>
<div class="col-xs-5 value-label">
{{tallySheet.title}}
{{tallySheet | customI18n : 'title'}}
</div>
</div>

Expand All @@ -90,7 +90,7 @@ <h4 class="modal-title">
<!-- for each question -->
<div class="row" ng-repeat="question in tallySheet.questions">
<p class="question-title">
{{$index+1}}: {{question.title}}
{{$index+1}}: {{question | customI18n : 'title'}}
</p>

<!-- review number of blank votes -->
Expand Down Expand Up @@ -124,7 +124,7 @@ <h4 class="modal-title">
<div class="form-group">
<label
class="col-xs-5 control-label">
{{answer.text}}:
{{answer | customI18n : 'text'}}:
</label>
<div class="col-xs-5 value-label">
{{answer.num_votes}}
Expand Down
12 changes: 6 additions & 6 deletions avAdmin/admin-directives/ballot-box/write-tally-sheet-modal.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ <h4 class="modal-title">
ng-i18next="avAdmin.ballotBox.modals.writeTallySheet.electionTitleLabel">
</label>
<div class="col-xs-5 value-label">
{{tallySheet.title}}
{{tallySheet | customI18n : 'title'}}
</div>
</div>
</div>
Expand All @@ -92,7 +92,7 @@ <h4 class="modal-title">
<!-- for each question -->
<div class="row" ng-repeat="question in tallySheet.questions">
<p class="question-title">
{{$index+1}}: {{question.title}}
{{$index+1}}: {{question | customI18n : 'title'}}
</p>

<!-- enter number of blank votes -->
Expand Down Expand Up @@ -141,7 +141,7 @@ <h4 class="modal-title">
<label
for="q{{qIndex}}a{$index}}TotalCount"
class="col-xs-5 control-label">
{{answer.text}}:
{{answer | customI18n : 'text'}}:
</label>
<div class="col-xs-5">
<input
Expand Down Expand Up @@ -263,7 +263,7 @@ <h4 class="modal-title">
ng-i18next="avAdmin.ballotBox.modals.writeTallySheet.electionTitleLabel">
</label>
<div class="col-xs-5 value-label">
{{tallySheet.title}}
{{tallySheet | customI18n : 'title'}}
</div>
</div>
</div>
Expand All @@ -272,7 +272,7 @@ <h4 class="modal-title">
<!-- for each question -->
<div class="row" ng-repeat="question in tallySheet.questions">
<p class="question-title">
{{$index+1}}: {{question.title}}
{{$index+1}}: {{question | customI18n : 'title'}}
</p>

<!-- review number of blank votes -->
Expand Down Expand Up @@ -306,7 +306,7 @@ <h4 class="modal-title">
<div class="form-group">
<label
class="col-xs-5 control-label">
{{answer.text}}:
{{answer | customI18n : 'text'}}:
</label>
<div class="col-xs-5 value-label">
{{answer.num_votes}}
Expand Down
6 changes: 3 additions & 3 deletions avAdmin/admin-directives/create/create.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,18 @@ <h2>
</div>

<div ng-repeat="election in elections">
<h3 ng-i18next>[i18next]({'title': election.title, 'index': $index+1})avAdmin.basic.title.labelH3</h3>
<h3 ng-i18next>[i18next]({'title': (election | customI18n : 'title'), 'index': $index+1})avAdmin.basic.title.labelH3</h3>
<table class="table table-bordered table-striped">
<tr>
<th ng-i18next> avAdmin.basic.description.label </th>
<td ng-bind="election.description | htmlToText | truncate:150"></td>
<td ng-bind="election | customI18n : 'description' | htmlToText | truncate:150"></td>
</tr>
<tr>
<th ng-i18next> avAdmin.sidebar.questions </th>
<td>
<ol>
<li ng-repeat="q in election.questions">
<p>{{q.title|truncate:'50'}}</p>
<p>{{q | customI18n : 'title' |truncate:'50'}}</p>
<p ng-i18next>[html:i18next]({'num_answers': q.answers.length, 'min': q.min, 'max': q.max, 'num_winners': q.num_winners, tally_method: q.tally_type, shuffle_all_options: q.extra_options.shuffle_all_options, shuffle_categories: q.extra_options.shuffle_categories})avAdmin.basic.questionOptionsSummary</p>
</li>
</ol>
Expand Down
6 changes: 3 additions & 3 deletions avAdmin/admin-directives/dashboard/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<span>
<h2>
<span ng-i18next>avAdmin.sidebar.dashboard</span>
<span class="text-gray-light" ng-if="election.title">{{election.title | truncate:45}}</span>
<span class="text-gray-light" ng-if="election.title || election.title_i18n">{{election | customI18n : 'title' | truncate:45}}</span>
</h2>
</span>
</div>
Expand Down Expand Up @@ -337,7 +337,7 @@ <h2 ng-if="resultsElection.results.questions" ng-cloak>
<div class="well question-result" ng-repeat="q in resultsElection.results.questions">
<div class="row">
<div class="col-md-7">
<h2 class="question-title" ng-bind-html="q.title"></h2>
<h2 class="question-title" ng-bind-html="q | customI18n : 'title'"></h2>
</div>
<div class="col-md-5">
<dl class="dl-horizontal">
Expand Down Expand Up @@ -375,7 +375,7 @@ <h2 class="question-title" ng-bind-html="q.title"></h2>
<tr ng-repeat="an in q.answers|orderBy:'-total_count'">
<td>{{ $index + 1 }}</td>
<td>
<span ng-bind-html="an.text"></span>
<span ng-bind-html="an | customI18n : 'text'"></span>
<span
ng-if="isWriteInResult(an)"
ng-i18next="avAdmin.dashboard.writeInResults">
Expand Down
4 changes: 4 additions & 0 deletions avAdmin/admin-directives/dashboard/send-auth-codes-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ angular
'SendAuthCodesModal',
function(
$scope,
$filter,
$modalInstance,
SendMsg,
ConfigService,
Expand All @@ -34,6 +35,9 @@ angular
$scope.user_ids = user_ids;
$scope.steps = SendMsg.steps;
$scope.censusConfig = SendMsg.censusConfig;
$scope.censusConfig.msg = $filter('customI18n')($scope.censusConfig, 'msg');
$scope.censusConfig.html_message = $filter('customI18n')($scope.censusConfig, 'html_message');
$scope.censusConfig.subject = $filter('customI18n')($scope.censusConfig, 'subject');
$scope.helpurl = ConfigService.helpUrl;
$scope.allowHtmlEmails = ConfigService.allowHtmlEmails;
$scope.showFilter = !user_ids;
Expand Down
12 changes: 6 additions & 6 deletions avAdmin/admin-directives/elections/elections.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ <h2 ng-i18next>
</td>
<td class="td-7">
<a ng-click="loadDraft()">
<strong>{{ draft.title }}</strong>
<strong>{{ draft | customI18n : 'title' }}</strong>
<div
ng-bind="draft.description | htmlToText | truncate:150">
ng-bind="draft | customI18n : 'description' | htmlToText | truncate:150">
</div>
</a>
</td>
Expand Down Expand Up @@ -120,9 +120,9 @@ <h2 ng-i18next>
</td>
<td class="main td-7">
<a ui-sref="admin.dashboard({id: election.id})">
<strong>{{ election.title }}</strong>
<strong>{{ election | customI18n : 'title' }}</strong>
<div
ng-bind="election.description | htmlToText | truncate:150">
ng-bind="election | customI18n : 'description' | htmlToText | truncate:150">
</div>
</a>
<!-- children elections-->
Expand All @@ -140,9 +140,9 @@ <h2 ng-i18next>
</td>
<td class="td-6">
<a ui-sref="admin.dashboard({id: childElection.id})">
<strong>{{ childElection.title }}</strong>
<strong>{{ childElection | customI18n : 'title' }}</strong>
<div
ng-bind="childElection.description | htmlToText | truncate:150">
ng-bind="childElection | customI18n : 'description' | htmlToText | truncate:150">
</div>
</a>
</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<span ng-if="current.title" ng-i18next="avAdmin.sidebar.currentel">
</span>
<span class="label label-success">
{{ current.title|truncate:20 }}
{{ current | customI18n : 'title' |truncate:20 }}
</span>
</a>
</li>
Expand Down

0 comments on commit 3ae390e

Please sign in to comment.