mirror of
https://github.com/Spythere/pojazdownik.git
synced 2026-05-03 19:48:11 +00:00
fix: tłumaczenia alertów
This commit is contained in:
@@ -18,7 +18,9 @@
|
|||||||
|
|
||||||
<select v-model="categoryRules" @change="randomizeTrainNumber()">
|
<select v-model="categoryRules" @change="randomizeTrainNumber()">
|
||||||
<option :value="null" disabled>{{ $t('numgen.train-category') }}</option>
|
<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>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -47,9 +49,11 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { Ref, ref } from 'vue';
|
import { Ref, ref } from 'vue';
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
import genData from '../../constants/numberGeneratorData.json';
|
import genData from '../../constants/numberGeneratorData.json';
|
||||||
|
|
||||||
|
const i18n = useI18n();
|
||||||
type RegionName = keyof typeof genData.regionNumbers;
|
type RegionName = keyof typeof genData.regionNumbers;
|
||||||
|
|
||||||
const beginRegionName = ref(null) as Ref<RegionName | null>;
|
const beginRegionName = ref(null) as Ref<RegionName | null>;
|
||||||
@@ -61,7 +65,7 @@ const trainNumber = ref(null) as Ref<string | null>;
|
|||||||
const copyNumber = () => {
|
const copyNumber = () => {
|
||||||
if (trainNumber.value) {
|
if (trainNumber.value) {
|
||||||
navigator.clipboard.writeText(trainNumber.value);
|
navigator.clipboard.writeText(trainNumber.value);
|
||||||
alert('Skopiowano numer do schowka!');
|
alert(i18n.t('numgen.alert'));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -247,7 +247,7 @@ export default defineComponent({
|
|||||||
navigator.clipboard.writeText(this.stockString);
|
navigator.clipboard.writeText(this.stockString);
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
alert('Pociąg został skopiowany do schowka!');
|
alert(this.$t('stocklist.alert-copied'));
|
||||||
}, 20);
|
}, 20);
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -350,16 +350,13 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
|
|
||||||
downloadStock() {
|
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} ${
|
const defaultName = `${this.store.chosenRealStockName || this.store.stockList[0].type} ${
|
||||||
this.store.totalMass
|
this.store.totalMass
|
||||||
}t; ${this.store.totalLength}m; vmax ${this.store.maxStockSpeed}`;
|
}t; ${this.store.totalLength}m; vmax ${this.store.maxStockSpeed}`;
|
||||||
|
|
||||||
const fileName = prompt(
|
const fileName = prompt(this.$t('stocklist.prompt-file'), defaultName);
|
||||||
'Nazwij plik, a następnie pobierz do folderu Presets (Dokumenty/TTSK/TrainDriver2):',
|
|
||||||
defaultName
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!fileName) return;
|
if (!fileName) return;
|
||||||
|
|
||||||
|
|||||||
@@ -47,6 +47,9 @@
|
|||||||
},
|
},
|
||||||
"stocklist": {
|
"stocklist": {
|
||||||
"title": "STOCK EDITOR",
|
"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.",
|
"vehicle-no": "VEHICLE NO.",
|
||||||
"no-vehicle-chosen": "NO VEHICLE CHOSEN",
|
"no-vehicle-chosen": "NO VEHICLE CHOSEN",
|
||||||
"action-move-up": "MOVE UP",
|
"action-move-up": "MOVE UP",
|
||||||
@@ -88,6 +91,7 @@
|
|||||||
},
|
},
|
||||||
"numgen": {
|
"numgen": {
|
||||||
"title": "TRAIN NUMBER GENERATOR",
|
"title": "TRAIN NUMBER GENERATOR",
|
||||||
|
"alert": "The number has been copied to your clipboard!",
|
||||||
"start-region": "Beginning construction region",
|
"start-region": "Beginning construction region",
|
||||||
"end-region": "Terminating construction region",
|
"end-region": "Terminating construction region",
|
||||||
"train-category": "Train category",
|
"train-category": "Train category",
|
||||||
|
|||||||
@@ -47,6 +47,9 @@
|
|||||||
},
|
},
|
||||||
"stocklist": {
|
"stocklist": {
|
||||||
"title": "EDYTOR SKŁADU",
|
"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",
|
"vehicle-no": "POJAZD NR",
|
||||||
"no-vehicle-chosen": "NIE WYBRANO POJAZDU",
|
"no-vehicle-chosen": "NIE WYBRANO POJAZDU",
|
||||||
"action-move-up": "PRZENIEŚ WYŻEJ",
|
"action-move-up": "PRZENIEŚ WYŻEJ",
|
||||||
@@ -88,6 +91,7 @@
|
|||||||
},
|
},
|
||||||
"numgen": {
|
"numgen": {
|
||||||
"title": "GENERATOR NUMERU POCIĄGU",
|
"title": "GENERATOR NUMERU POCIĄGU",
|
||||||
|
"alert": "Numer został skopiowany do twojego schowka!",
|
||||||
"start-region": "Początkowy obszar konstrukcyjny",
|
"start-region": "Początkowy obszar konstrukcyjny",
|
||||||
"end-region": "Końcowy obszar konstrukcyjny",
|
"end-region": "Końcowy obszar konstrukcyjny",
|
||||||
"train-category": "Kategoria pociągu",
|
"train-category": "Kategoria pociągu",
|
||||||
|
|||||||
Reference in New Issue
Block a user