Skip to content

Commit

Permalink
Ensure that all the new enketo screens are i18n-ized
Browse files Browse the repository at this point in the history
Which includes adding a few additional entries to the i18n file
Everything except the actual survey now shows up properly.
The survey shows up in english first, and the user needs to select Spanish

Let's fix that in a subsequent commit

Note that we had to use a span sometimes to translate to avoid
weird formatting issues
e-mission/e-mission-docs#732 (comment)
  • Loading branch information
shankari committed Jun 1, 2022
1 parent 71cfa7b commit 297680d
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 40 deletions.
10 changes: 9 additions & 1 deletion www/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"control":{
"profile": "Profile",
"edit-demographics": "Edit Demographics",
"username": "Username {{usernamedata}}",
"tracking": "Tracking",
"app-status": "App Status",
"medium-accuracy": "Medium accuracy",
Expand Down Expand Up @@ -155,6 +156,7 @@
"distance": "Distance",
"time": "Time",
"mode": "Mode",
"replaces": "Replaces",
"purpose": "Purpose",
"survey": "Details",
"unlabeled": "All Unlabeled",
Expand All @@ -174,6 +176,7 @@
"select-replaced-mode-scroll": "Replaces (👇 for more)",
"select-purpose-scroll": "Purpose (👇 for more)",
"list-pick-a-date": "Pick a date"
"no-trips-today": "No trips recorded on this day"
},

"new_label_tour": {
Expand Down Expand Up @@ -405,6 +408,11 @@
"prev-survey-found": "Found previous survey response",
"use-prior-response": "Use prior response",
"edit-response": "Edit response",
"move-on": "Move on"
"move-on": "Move on",
"survey": "Survey",
"save": "Save",
"next": "Next",
"powered-by": "Powered by",
"dismiss": "Dismiss"
}
}
32 changes: 0 additions & 32 deletions www/templates/survey/enketo/content.html

This file was deleted.

6 changes: 3 additions & 3 deletions www/templates/survey/enketo/form-base.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
mother application. The HTML markup can be changed as well.
-->
<a href="#" class="previous-page disabled" style="position:absolute; left: 10px; bottom: 40px;">Back</a>
<button id="validate-form" class="btn btn-primary" ng-click="enketoSurvey.validateAndSave()" style="width:200px; margin-left: calc(50% - 100px);">Save</button>
<a href="#survey-paper" class="btn btn-primary next-page disabled" style="width: 200px; margin-left: calc(50% - 100px)" ng-click="enketoSurvey.onNext()">Next</a>
<button id="validate-form" class="btn btn-primary" ng-click="enketoSurvey.validateAndSave()" style="width:200px; margin-left: calc(50% - 100px);" translate>{{'.save'}}</button>
<a href="#survey-paper" class="btn btn-primary next-page disabled" style="width: 200px; margin-left: calc(50% - 100px)" ng-click="enketoSurvey.onNext()" translate>{{'.next'}}</a>

<div class="enketo-power" style="margin-bottom: 30px;">Powered by <a href="http://enketo.org" title="enketo.org website"><img src="templates/survey/enketo/enketo_bare_150x56.png" alt="enketo logo" /></a> </div>
<div class="enketo-power" style="margin-bottom: 30px;"><span translate>{{'.powered-by'}}</span> <a href="http://enketo.org" title="enketo.org website"><img src="templates/survey/enketo/enketo_bare_150x56.png" alt="enketo logo" /></a> </div>
<div class="form-footer__jump-nav" style="display: flex; flex-direction: row;">
<a href="#" class="btn btn-default disabled first-page" style="flex: 1; border-radius: 0;">Return to Beginning</a>
<a href="#" class="btn btn-default disabled last-page" style="flex: 1; border-radius: 0;">Go to End</a>
Expand Down
2 changes: 1 addition & 1 deletion www/templates/survey/enketo/inline.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<ion-content class="enketo-plugin overflow-scroll">
<ion-content class="enketo-plugin overflow-scroll" translate-namespace="survey">

<div ng-if="existingSurvey">
<!-- If there is an existing survey, we want to ask the user whether they want to use it-->
Expand Down
6 changes: 3 additions & 3 deletions www/templates/survey/enketo/modal.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<ion-modal-view>
<ion-modal-view translate-namespace="survey">
<ion-header-bar class="bar bar-header">
<h1 class="title">Survey</h1>
<h1 class="title" translate>{{'.survey'}}</h1>
<button
class="button button-clear button-positive"
ng-click="enketoSurvey.hide()"
ng-show="!enketoSurvey.disableDismiss"
>Dismiss</button>
><span translate>{{ '.dismiss' }}</span></button>
</ion-header-bar>
<ion-content class="enketo-plugin overflow-scroll">
<ng-include src="'templates/survey/enketo/form-base.html'"></ng-include>
Expand Down

0 comments on commit 297680d

Please sign in to comment.