Skip to content

Commit 22ee559

Browse files
committed
i18n
1 parent 81c156d commit 22ee559

File tree

6 files changed

+98
-61
lines changed

6 files changed

+98
-61
lines changed

src/components/ActivityEditor.vue

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
<sidebar></sidebar>
55
<v-app-bar color="indigo" dark fixed app>
66
<v-app-bar-nav-icon @click.stop="toggleSidebar()"></v-app-bar-nav-icon>
7-
<v-app-bar-title v-if="!saved">Nuova Attività {{prefix}} {{activity.name}}</v-app-bar-title>
8-
<v-app-bar-title v-else>Modifica Attività {{prefix}} {{activity.name}}</v-app-bar-title>
7+
<v-app-bar-title v-if="!saved">{{ $t("message.activity_new") }} {{prefix}} {{activity.name}}</v-app-bar-title>
8+
<v-app-bar-title v-else>{{ $t("message.activity_modify") }} {{prefix}} {{activity.name}}</v-app-bar-title>
99
<v-spacer></v-spacer>
1010
<v-btn text @click="save()">
1111
<v-icon>save</v-icon>
12-
Salva
12+
{{ $t("message.save") }}
1313
</v-btn>
1414
<v-tabs slot="extension" v-model="tab" centered slider-color="white">
1515
<v-tab v-for="item in tabs" :key="item">
@@ -26,10 +26,10 @@
2626
<v-flex xs12 md6 offset-md3>
2727
<p style="text-align: left">
2828
<v-alert :value="true" type="info" style="font-size:16px">
29-
Qui puoi creare o modificare una attività, definendo come dovrà apparire allo studente che dovrà utilizzarla per scrivere programmi. Ricorda che l'attività andrà poi <b> avviata </b> (Menù Attività -> Apri) per poterne fare effettivamente uso.
29+
{{ $t("message.activity_tip_1") }}
3030
</v-alert>
3131
</p>
32-
<h3 class="text-xs-left">Dati Attività </h3>
32+
<h3 class="text-xs-left">{{ $t("message.activity_data") }} </h3>
3333
<v-card>
3434
<v-form class="cardContent">
3535
<v-text-field v-model="activity.name" label="Nome" required></v-text-field>
@@ -38,7 +38,7 @@
3838
</v-form>
3939
</v-card>
4040
<br><br>
41-
<h3 class="text-xs-left">Tipografia </h3>
41+
<h3 class="text-xs-left">{{ $t("message.activity_typography") }} </h3>
4242
<v-card>
4343
<div class="cardContent">
4444
<!--
@@ -58,7 +58,7 @@
5858
</div>
5959
</v-card>
6060
<br><br>
61-
<h3 class="text-xs-left">Carattere tipografico dell'interfaccia</h3>
61+
<h3 class="text-xs-left">{{ $t("message.activity_typography_font_ui") }} </h3>
6262
<v-card>
6363
<div class="cardContent">
6464
<span v-bind:style="bodyUIstyleObj">Lorem ipsum dolor sit amet</span>
@@ -73,7 +73,7 @@
7373
</div>
7474
</v-card>
7575
<br><br>
76-
<h3 class="text-xs-left">Carattere tipografico del codice (valori, editor di codice)</h3>
76+
<h3 class="text-xs-left">{{ $t("message.activity_typography_font_editor") }}</h3>
7777
<v-card>
7878
<div class="cardContent">
7979
<span v-bind:style="codeUIstyleObj">function life() { return 42; }</span>
@@ -99,7 +99,6 @@
9999
<v-card>
100100
<div class="cardContent">
101101
<v-layout row wrap>
102-
103102
<v-flex>
104103
<v-checkbox v-model="availableViews" label="Programmazione a Blocchi" value="blockly"></v-checkbox>
105104
</v-flex>
@@ -109,7 +108,6 @@
109108
<v-flex>
110109
<v-checkbox v-model="availableViews" label="Visuale di Esecuzione" value="runtime"></v-checkbox>
111110
</v-flex>
112-
113111
<v-switch :label="`Permetti di visualizzare il codice generato`" v-model="capsSwitch"></v-switch>
114112
</v-layout>
115113
</div>
@@ -142,7 +140,7 @@
142140
<v-container grid-list-md text-xs-center>
143141
<v-flex xs12 md8 offset-md2>
144142
<v-flex>
145-
<h3> Anteprima Toolbar </h3>
143+
<h3> {{ $t("message.activity_toolbar_preview") }} </h3>
146144
<v-app-bar>
147145
<v-app-bar-nav-icon v-if="activity.drawerEnabled"></v-app-bar-nav-icon>
148146
<v-app-bar-title v-if="activity.showName">{{ activity.name || "Nome Attività"}}</v-app-bar-title>
@@ -159,15 +157,15 @@
159157
<v-switch label="Icona menù laterale" v-model="activity.drawerEnabled"></v-switch>
160158
<v-switch label="Nome Attività" v-model="activity.showName"></v-switch>
161159
<br>
162-
<h3> Modifica Pulsanti </h3>
160+
<h3> {{ $t("message.activity_toolbar_buttons") }} </h3>
163161
<v-btn @click="addButton()" outlined color="green">
164-
<v-icon>add</v-icon> Aggiungi
162+
<v-icon>add</v-icon> {{ $t("message.activity_toolbar_buttons_add") }}
165163
</v-btn>
166164
<v-btn @click="restoreDefaults()" outlined color="blue">
167-
<v-icon>undo</v-icon> Predefiniti
165+
<v-icon>undo</v-icon> {{ $t("message.activity_toolbar_buttons_predefined") }}
168166
</v-btn>
169167
<v-btn @click="removeAll()" outlined color="red">
170-
<v-icon>clear</v-icon> Rimuovi tutti
168+
<v-icon>clear</v-icon> {{ $t("message.activity_toolbar_buttons_remove_all") }}
171169
</v-btn>
172170
<br><br>
173171
<div v-for="button, i in activity.buttons" :key="button.id">
@@ -178,20 +176,20 @@
178176
</h3>
179177
<v-card>
180178
<div class="cardContent">
181-
<span class="grey--text text--darken-2" v-if="button.notErasable"> "Esegui" non può essere eliminato </span>
179+
<span class="grey--text text--darken-2" v-if="button.notErasable"> {{ $t("message.activity_toolbar_buttons_cannot_remove_run") }} </span>
182180
<v-text-field v-model="button.label" label="Etichetta"></v-text-field>
183181
<v-select v-model="button.action" :items="actions" label="Azione" :disabled="button.notErasable">
184182
</v-select>
185183
<v-select :items="textColors" v-model="button.colorText" label="Colore testo"></v-select>
186184
<v-layout row wrap>
187185
<v-flex xs4 style="text-align: left">
188-
<span style="vertical-align: 55%"> Colore Pulsante &nbsp;&nbsp;</span>
186+
<span style="vertical-align: 55%"> {{ $t("message.activity_toolbar_buttons_color") }} &nbsp;&nbsp;</span>
189187
<div style="display:inline-block">
190188
<swatches popover-to="left" v-model="button.colorBtn"></swatches>
191189
</div>
192190
</v-flex>
193191
<v-flex xs4 style="text-align: left">
194-
Icona &nbsp;&nbsp; <v-btn style="margin:0" large text @click="b=i; iconPicker=true;" color="black">
192+
{{ $t("message.activity_toolbar_buttons_icon") }} <v-btn style="margin:0" large text @click="b=i; iconPicker=true;" color="black">
195193
<v-icon large color="black">{{ button.icon }}</v-icon>
196194
</v-btn>
197195
</v-flex>
@@ -211,7 +209,7 @@
211209
</v-container>
212210
<v-dialog v-model="iconPicker" max-width="600px">
213211
<v-card>
214-
<v-card-title class="headline">Seleziona icona</v-card-title>
212+
<v-card-title class="headline">{{ $t("message.activity_toolbar_buttons_icon_select") }}</v-card-title>
215213
<v-card-text>
216214
<v-container>
217215
<v-layout row wrap>
@@ -239,7 +237,7 @@
239237
<v-layout row wrap>
240238
<!-- Column A -->
241239
<v-flex xs12 md6 offset-md3>
242-
<h3 class="text-xs-left">Viste</h3>
240+
<h3 class="text-xs-left">{{ $t("message.activity_views") }}</h3>
243241
<v-card>
244242
<v-form class="cardContent">
245243
<v-switch label="Camera" v-model="activity.exec.camera"></v-switch>

src/components/ActivityList.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
<v-layout row wrap>
1212
<!-- Column A -->
1313
<v-flex xs12 md6 offset-md3>
14-
<h3 class="text-xs-left">Lista Attività</h3>
14+
<h3 class="text-xs-left">{{ $t("message.activity_list") }}</h3>
1515
<p style="text-align: left">
1616
<v-alert :value="true" type="info" style="font-size:16px">
17-
Qui puoi avviare un'attività salvata, cliccando sul suo nome.<br>
17+
{{ $t("message.activity_tip_1") }}<br>
1818
L'icona <v-icon class="white--text">delete</v-icon> ti permette di eliminarla, mentre cliccando su <v-icon class="white--text">edit</v-icon> puoi modificarla.
1919
</v-alert>
2020
</p>

src/components/Control.vue

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,13 @@
6060
<v-flex xs12 sm12>
6161
<br><br><br>
6262
<v-btn large color="blue-grey darken-1" v-on:click="ttsdialog = true" class="controlBtn" :disabled="!ttsBtnEnabled">
63-
Pronuncia
63+
{{ $t("message.control_speak") }}
6464
<v-icon>chat_bubble_outline</v-icon>
6565
</v-btn>
6666
</v-flex>
6767
<v-flex xs12 sm12>
6868
<v-btn large color="blue-grey darken-1" class="controlBtn" v-on:click="takePhoto()" :disabled="!photoBtnEnabled">
69-
Scatta foto
69+
{{ $t("message.control_photo_take") }}
7070
<v-icon dark>camera_alt</v-icon>
7171
</v-btn>
7272
</v-flex>
@@ -78,7 +78,7 @@
7878
</v-flex>
7979
<v-flex xs12 sm12>
8080
<v-btn large color="blue-grey darken-1" class="controlBtn" to="/gallery">
81-
Galleria
81+
{{ $t("message.control_photo_gallery") }}
8282
<v-icon dark>photo_library</v-icon>
8383
</v-btn>
8484
</v-flex>
@@ -90,28 +90,28 @@
9090
</template>
9191
<template v-else>
9292
<br>
93-
In attesa che CoderBot torni online...<br>
93+
{{ $t("message.coderbot_offline_1") }}<br>
9494
<v-icon large>signal_wifi_off</v-icon>
9595
</template>
9696
</v-main>
9797
<v-snackbar v-model="snackbar">
9898
{{ snackText }}
9999
<v-btn color="pink" text @click="snackbar = false">
100-
Chiudi
100+
{{ $t("message.close") }}
101101
</v-btn>
102102
</v-snackbar>
103103
<v-dialog v-model="ttsdialog" width="600px">
104104
<v-card>
105105
<v-card-title>
106-
<span class="headline">Text to Speech</span>
106+
<span class="headline">{{ $t("message.gallery_empty") }}</span>
107107
</v-card-title>
108108
<v-card-text>
109-
<v-text-field v-model="ttstext" label="Frase da pronunciare" solo></v-text-field>
109+
<v-text-field v-model="ttstext" label="$t('message.control_text_to_speech')" solo></v-text-field>
110110
</v-card-text>
111111
<v-card-actions>
112112
<v-spacer></v-spacer>
113-
<v-btn color="gray darken-1" text="text" @click="ttsdialog=false">Annulla</v-btn>
114-
<v-btn color="green darken-1" text="text" @click="say()">Pronuncia</v-btn>
113+
<v-btn color="gray darken-1" text="text" @click="ttsdialog=false">{{ $t("message.cancel") }}</v-btn>
114+
<v-btn color="green darken-1" text="text" @click="say()">{{ $t("message.control_speak") }}</v-btn>
115115
</v-card-actions>
116116
</v-card>
117117
</v-dialog>
@@ -120,6 +120,8 @@
120120
<script>
121121
import sidebar from '../components/Sidebar';
122122
123+
console.log(process.env.CB_ENDPOINT + process.env.APIv1);
124+
123125
export default {
124126
components: { sidebar },
125127
name: 'Control',
@@ -131,7 +133,7 @@ export default {
131133
.then(() => {
132134
this.ttsBtnEnabled = false;
133135
this.ttsdialog = false;
134-
this.snackText = 'Sto pronunciando';
136+
this.snackText = this.$i18n.t('message.control_speaking');
135137
this.snackbar = true;
136138
setTimeout(() => {
137139
this.ttsBtnEnabled = true;
@@ -143,7 +145,7 @@ export default {
143145
const axios = this.$axios;
144146
axios.get(`${CBv1}/bot`, { params: { cmd: 'take_photo' } })
145147
.then(() => {
146-
this.snackText = 'Foto scattata';
148+
this.snackText = this.$i18n.t('message.control_photo_taken');
147149
this.snackbar = true;
148150
this.photoBtnEnabled = false;
149151
setTimeout(() => {
@@ -158,7 +160,7 @@ export default {
158160
.then(() => {
159161
this.ttsBtnEnabled = false;
160162
this.ttsdialog = false;
161-
this.snackText = 'Nota in riproduzione';
163+
this.snackText = this.$i18n.t('message.control_sount_playing');
162164
this.snackbar = true;
163165
setTimeout(() => {
164166
this.ttsBtnEnabled = true;
@@ -175,10 +177,10 @@ export default {
175177
const axios = this.$axios;
176178
axios.get(`${CBv1}/bot`, { params: { cmd: 'video_rec' } })
177179
.then(() => {
178-
this.snackText = 'Registrazione Avviata';
180+
this.snackText = this.$i18n.t('message.control_video_rec_started');
179181
this.snackbar = true;
180182
this.photoBtnEnabled = false;
181-
this.videoBtn.text = 'Ferma registrazione video';
183+
this.videoBtn.text = this.$i18n.t('message.control_video_rec_started');
182184
this.videoBtn.icon = 'stop';
183185
this.videoBtn.action = 'stop';
184186
});
@@ -188,13 +190,13 @@ export default {
188190
const axios = this.$axios;
189191
axios.get(`${CBv1}/bot`, { params: { cmd: 'video_stop' } })
190192
.then(() => {
191-
this.snackText = 'Registrazione terminata';
193+
this.snackText = this.$i18n.t('message.control_video_rec_stopped');
192194
this.snackbar = true;
193195
this.videoBtn.enabled = false;
194196
this.videoBtn.action = 'record';
195197
setTimeout(() => {
196198
this.videoBtn.enabled = true;
197-
this.videoBtn.text = 'Registra Video';
199+
this.videoBtn.text = this.$i18n.t('message.control_video_rec');
198200
this.videoBtn.icon = 'videocam';
199201
this.photoBtnEnabled = true;
200202
}, 1000);
@@ -206,7 +208,7 @@ export default {
206208
axios.get(`${CB}/status`)
207209
.then((response) => {
208210
if (this.status == 0 && response.status) {
209-
this.snackText = 'CoderBot è tornato online';
211+
this.snackText = this.$i18n.t('message.coderbot_online');
210212
this.snackbar = true;
211213
}
212214
@@ -219,7 +221,7 @@ export default {
219221
console.log(error);
220222
221223
if (this.status) {
222-
this.snackText = 'CoderBot irrangiungibile';
224+
this.snackText = this.$i18n.t('message.coderbot_offline_2');
223225
this.snackbar = true;
224226
}
225227
this.status = 0;
@@ -316,7 +318,7 @@ export default {
316318
ttsBtnEnabled: true,
317319
photoBtnEnabled: true,
318320
videoBtn: {
319-
text: 'Registra Video',
321+
text: this.$i18n.t('message.control_video_rec'),
320322
icon: 'videocam',
321323
enabled: 'true',
322324
action: 'record',

src/components/Gallery.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
<sidebar></sidebar>
55
<v-app-bar color="indigo" dark fixed app>
66
<v-app-bar-nav-icon @click.stop="toggleSidebar()"></v-app-bar-nav-icon>
7-
<v-app-bar-title>Galleria</v-app-bar-title>
7+
<v-app-bar-title>{{ $t("message.gallery_title") }}</v-app-bar-title>
88
</v-app-bar>
99
<v-main>
1010
<v-layout>
1111
<v-flex xs12 sm8 offset-sm2>
1212
<template v-if="photos.length == 0">
1313
<br>
14-
<h3>Galleria vuota!</h3>
14+
<h3>{{ $t("message.gallery_empty") }}</h3>
1515
</template>
1616
<template v-else>
1717
<v-card>

0 commit comments

Comments
 (0)