Skip to content

Commit

Permalink
Use internationalization for tutorial texts
Browse files Browse the repository at this point in the history
  • Loading branch information
frozenhelium committed Oct 9, 2024
1 parent 267a964 commit dabd424
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 13 deletions.
2 changes: 2 additions & 0 deletions src/components/CompareProjectTask.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export default defineComponent({
<h2 v-show="isHovering">{{ $t('compareProject.before') }}</h2>
</v-overlay>
<image-tile
v-if="task.url"
:url="task.url"
:spinner="true"
:maxSize="$vuetify.display.smAndDown ? '35vh' : '65vh'"
Expand All @@ -75,6 +76,7 @@ export default defineComponent({
<h2 v-show="isHovering">{{ $t('compareProject.after') }}</h2>
</v-overlay>
<image-tile
v-if="task.urlB"
:url="task.urlB"
:spinner="true"
:maxSize="$vuetify.display.smAndDown ? '35vh' : '80vh'"
Expand Down
4 changes: 2 additions & 2 deletions src/components/CompareProjectTutorial.vue
Original file line number Diff line number Diff line change
Expand Up @@ -219,12 +219,12 @@ export default defineComponent({
v-if="userAttempts > 1 && !answeredCorrectly && !answersRevealed"
@click="showAnswer"
>
Show answer
{{ $t('projectTutorial.showAnswer') }}
</v-btn>
<v-btn
v-if="!hasCompletedAllTasks && answeredCorrectly" @click="nextTask"
>
Next task
{{ $t('projectTutorial.nextTask') }}
</v-btn>
</template>
</v-alert>
Expand Down
4 changes: 2 additions & 2 deletions src/components/FindProjectTutorial.vue
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,10 @@ export default defineComponent({
v-if="userAttempts > 1 && !answeredCorrectly && !answersRevealed"
@click="showAnswer"
>
Show answer
{{ $t('projectTutorial.showAnswer') }}
</v-btn>
<v-btn v-if="!hasCompletedAllTasks && answeredCorrectly" @click="nextTask">
Next task
{{ $t('projectTutorial.nextTask') }}
</v-btn>
</template>
</v-alert>
Expand Down
13 changes: 10 additions & 3 deletions src/components/ProjectInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,21 @@ export default defineComponent({
<v-dialog v-model="dialog" height="calc(100% - 32px)" max-height="100vh" width="calc(100% - 32px)" max-width="1024" persistent>
<v-card class="pa-2" height="100%">
<v-tabs v-model="activeTab">
<v-tab :text="$t('projectInstructions.howToContribute')" value="instructions"></v-tab>
<v-tab
:text="$t('projectInstructions.howToContribute')"
value="instructions"
/>
<v-tab
v-for="(page, index) in informationPages"
:text="page.title"
:value="index"
:key="page.pageNumber"
></v-tab>
<v-tab v:if="hasTutorialSlot" value="tutorial">Tutorial</v-tab>
/>
<v-tab
v:if="hasTutorialSlot"
value="tutorial"
:text="$t('projectInstructions.tutorial')"
/>
</v-tabs>
<v-divider />
<v-tabs-window v-model="activeTab" style="height: 100%; overflow-y: auto">
Expand Down
6 changes: 3 additions & 3 deletions src/components/TutorialCompletionCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ export default defineComponent({
mdi-check-circle
</v-icon>
<v-card-title>
You're ready to start MapSwiping!
{{ $t('projectTutorial.completionTitle') }}
</v-card-title>
<v-card-text class="tutorial-completion-description">
You're now equipped with all you need to contribute to humanitarian mapping using the app. You can come back anytime for refresher.
{{ $t('projectTutorial.completionDescription') }}
</v-card-text>
<v-btn @click="$emit('onStartMappingClick')">
Start mapping
{{ $t('projectTutorial.startMapping') }}
</v-btn>
</v-card>
</template>
Expand Down
4 changes: 2 additions & 2 deletions src/components/ValidateProjectTutorial.vue
Original file line number Diff line number Diff line change
Expand Up @@ -234,12 +234,12 @@ export default defineComponent({
v-if="userAttempts > 1 && !answeredCorrectly && !answersRevealed"
@click="showAnswer"
>
Show answer
{{ $t('projectTutorial.showAnswer') }}
</v-btn>
<v-btn
v-if="!hasCompletedAllTasks && answeredCorrectly" @click="nextTask"
>
Next task
{{ $t('projectTutorial.nextTask') }}
</v-btn>
</template>
</v-alert>
Expand Down
10 changes: 9 additions & 1 deletion src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@
"toggleOpacityInstruction": "For a clearer view of the underlying imagery, toggle the opacity of the overlay",
"useButtonsToNavigate": "Use buttons to navigate",
"whereIamTitle": "Where am I mapping?",
"whereIamInstruction": "Open a map of where you are currently contributing"
"whereIamInstruction": "Open a map of where you are currently contributing",
"tutorial": "Tutorial"
},
"findProjectInstructions": {
"classifyTitle": "Click or tap to classify",
Expand Down Expand Up @@ -202,5 +203,12 @@
"drawNewFeature": "Draw new features",
"modifyFeature": "Modify features",
"deleteFeature": "Delete features"
},
"projectTutorial": {
"showAnswer": "Show answer",
"nextTask": "Next task",
"completionTitle": "You're ready to start MapSwiping!",
"completionDescription": "You're now equipped with all you need to contribute to humanitarian mapping using the app. You can come back anytime for refresher.",
"startMapping": "Start mapping"
}
}

0 comments on commit dabd424

Please sign in to comment.