mirror of
https://github.com/Spythere/pojazdownik.git
synced 2026-05-03 11:45:34 +00:00
fix: tłumaczenia alertów
This commit is contained in:
@@ -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'));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user