fix: tłumaczenia alertów

This commit is contained in:
2023-08-23 23:04:04 +02:00
parent c1c01c496a
commit d7c1f8c5b4
4 changed files with 17 additions and 8 deletions
+6 -2
View File
@@ -18,7 +18,9 @@
<select v-model="categoryRules" @change="randomizeTrainNumber()">
<option :value="null" disabled>{{ $t('numgen.train-category') }}</option>
<option v-for="(rules, category) in genData.categories" :value="rules">{{ $t(`numgen.categories.${category}`) }}</option>
<option v-for="(rules, category) in genData.categories" :value="rules">
{{ $t(`numgen.categories.${category}`) }}
</option>
</select>
</div>
@@ -47,9 +49,11 @@
<script setup lang="ts">
import { Ref, ref } from 'vue';
import { useI18n } from 'vue-i18n';
import genData from '../../constants/numberGeneratorData.json';
const i18n = useI18n();
type RegionName = keyof typeof genData.regionNumbers;
const beginRegionName = ref(null) as Ref<RegionName | null>;
@@ -61,7 +65,7 @@ const trainNumber = ref(null) as Ref<string | null>;
const copyNumber = () => {
if (trainNumber.value) {
navigator.clipboard.writeText(trainNumber.value);
alert('Skopiowano numer do schowka!');
alert(i18n.t('numgen.alert'));
}
};
+3 -6
View File
@@ -247,7 +247,7 @@ export default defineComponent({
navigator.clipboard.writeText(this.stockString);
setTimeout(() => {
alert('Pociąg został skopiowany do schowka!');
alert(this.$t('stocklist.alert-copied'));
}, 20);
},
@@ -350,16 +350,13 @@ export default defineComponent({
},
downloadStock() {
if (this.store.stockList.length == 0) return alert('Lista pojazdów jest pusta!');
if (this.store.stockList.length == 0) return alert(this.$t('stocklist.alert-empty'));
const defaultName = `${this.store.chosenRealStockName || this.store.stockList[0].type} ${
this.store.totalMass
}t; ${this.store.totalLength}m; vmax ${this.store.maxStockSpeed}`;
const fileName = prompt(
'Nazwij plik, a następnie pobierz do folderu Presets (Dokumenty/TTSK/TrainDriver2):',
defaultName
);
const fileName = prompt(this.$t('stocklist.prompt-file'), defaultName);
if (!fileName) return;
+4
View File
@@ -47,6 +47,9 @@
},
"stocklist": {
"title": "STOCK EDITOR",
"alert-copied": "The rolling stock has been copied to your clipboard!",
"alert-empty": "Lista pojazdów jest pusta!",
"prompt-file": "Name a file and download it to the Presets folder (Documents/TTSK/TrainDriver2):",
"vehicle-no": "VEHICLE NO.",
"no-vehicle-chosen": "NO VEHICLE CHOSEN",
"action-move-up": "MOVE UP",
@@ -88,6 +91,7 @@
},
"numgen": {
"title": "TRAIN NUMBER GENERATOR",
"alert": "The number has been copied to your clipboard!",
"start-region": "Beginning construction region",
"end-region": "Terminating construction region",
"train-category": "Train category",
+4
View File
@@ -47,6 +47,9 @@
},
"stocklist": {
"title": "EDYTOR SKŁADU",
"alert-copied": "Skład został skopiowany do twojego schowka!",
"alert-empty": "Lista pojazdów jest pusta!",
"prompt-file": "Nazwij plik, a następnie pobierz do folderu Presets (Dokumenty/TTSK/TrainDriver2):",
"vehicle-no": "POJAZD NR",
"no-vehicle-chosen": "NIE WYBRANO POJAZDU",
"action-move-up": "PRZENIEŚ WYŻEJ",
@@ -88,6 +91,7 @@
},
"numgen": {
"title": "GENERATOR NUMERU POCIĄGU",
"alert": "Numer został skopiowany do twojego schowka!",
"start-region": "Początkowy obszar konstrukcyjny",
"end-region": "Końcowy obszar konstrukcyjny",
"train-category": "Kategoria pociągu",