chore: translations

This commit is contained in:
2024-09-01 16:07:40 +02:00
parent cfe188d0dc
commit bed79ed2d0
3 changed files with 45 additions and 12 deletions
+2 -1
View File
@@ -407,9 +407,10 @@
"driver-return-link": "GO BACK", "driver-return-link": "GO BACK",
"driver-not-found-header": "Train not found! :/", "driver-not-found-header": "Train not found! :/",
"driver-not-found-desc-1": "This train has already been terminated or it's offline.", "driver-not-found-desc-1": "This train has already been terminated, changed its number or is offline.",
"driver-not-found-desc-2": "You can browse timetable history in the", "driver-not-found-desc-2": "You can browse timetable history in the",
"driver-not-found-journal": "TIMETABLES JOURNAL", "driver-not-found-journal": "TIMETABLES JOURNAL",
"driver-not-found-others": "Player {driver} is online as:",
"driver-not-found-return": "GO BACK TO THE MAIN SITE" "driver-not-found-return": "GO BACK TO THE MAIN SITE"
}, },
"train-stats": { "train-stats": {
+2 -1
View File
@@ -393,9 +393,10 @@
"driver-return-link": "POWRÓT", "driver-return-link": "POWRÓT",
"driver-not-found-header": "Nie znaleziono pociągu! :/", "driver-not-found-header": "Nie znaleziono pociągu! :/",
"driver-not-found-desc-1": "Ten pociąg prawdopodobnie zakończył już swój bieg lub jest offline.", "driver-not-found-desc-1": "Ten pociąg prawdopodobnie zakończył już swój bieg, zmienił numer lub jest offline.",
"driver-not-found-desc-2": "Historię rozkładów jazdy możesz przejrzeć w", "driver-not-found-desc-2": "Historię rozkładów jazdy możesz przejrzeć w",
"driver-not-found-journal": "DZIENNIKU RJ", "driver-not-found-journal": "DZIENNIKU RJ",
"driver-not-found-others": "Gracz {driver} jest online jako:",
"driver-not-found-return": "WRÓĆ NA STRONĘ GŁÓWNĄ" "driver-not-found-return": "WRÓĆ NA STRONĘ GŁÓWNĄ"
}, },
"train-stats": { "train-stats": {
+41 -10
View File
@@ -31,7 +31,8 @@
<div v-else class="driver-not-found"> <div v-else class="driver-not-found">
<h2>&olcross; {{ $t('trains.driver-not-found-header') }}</h2> <h2>&olcross; {{ $t('trains.driver-not-found-header') }}</h2>
<p>
<p class="text--grayed">
{{ $t('trains.driver-not-found-desc-1') }} <br /> {{ $t('trains.driver-not-found-desc-1') }} <br />
{{ $t('trains.driver-not-found-desc-2') }} {{ $t('trains.driver-not-found-desc-2') }}
<router-link to="/journal/timetables" <router-link to="/journal/timetables"
@@ -39,25 +40,44 @@
>! >!
</p> </p>
<router-link to="/">&lt;&lt; {{ $t('trains.driver-not-found-return') }}</router-link> <p v-if="props.trainId && otherDriverTrains.length > 0">
<i18n-t keypath="trains.driver-not-found-others">
<template v-slot:driver>
<b>{{ otherDriverTrains[0].driverName }}</b>
</template>
</i18n-t>
</p>
<div class="other-driver-trains">
<template v-for="(train, i) in otherDriverTrains">
<router-link :to="`/driver?trainId=${train.id}`">
{{ train.trainNo }}
| {{ regionsJSON.find((r) => r.id == train.region)?.name ?? 'PL1' }}
</router-link>
</template>
</div>
<div style="margin-top: 1em">
<router-link to="/">&lt;&lt; {{ $t('trains.driver-not-found-return') }}</router-link>
</div>
</div> </div>
</div> </div>
</section> </section>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { computed, onActivated, onMounted, useAttrs } from 'vue'; import { computed } from 'vue';
import TrainInfo from '../components/TrainsView/TrainInfo.vue'; import TrainInfo from '../components/TrainsView/TrainInfo.vue';
import TrainSchedule from '../components/TrainsView/TrainSchedule.vue'; import TrainSchedule from '../components/TrainsView/TrainSchedule.vue';
import Loading from '../components/Global/Loading.vue'; import Loading from '../components/Global/Loading.vue';
import { useMainStore } from '../store/mainStore'; import { useMainStore } from '../store/mainStore';
import { useApiStore } from '../store/apiStore'; import { useApiStore } from '../store/apiStore';
import { Status } from '../typings/common'; import { Status } from '../typings/common';
import { regions as regionsJSON } from '../data/options.json';
const props = defineProps({ const props = defineProps({
trainId: { trainId: {
type: String, type: String
required: true
}, },
modalId: { modalId: {
@@ -72,8 +92,12 @@ const chosenTrain = computed(() =>
mainStore.trainList.find((train) => train.id == props.trainId || train.modalId == props.modalId) mainStore.trainList.find((train) => train.id == props.trainId || train.modalId == props.modalId)
); );
onActivated(() => { const otherDriverTrains = computed(() => {
console.log(); return mainStore.trainList.filter(
(train) =>
train.driverId == Number(props.trainId?.split('|')[0]) &&
(train.timetableData || train.online || train.lastSeen >= Date.now() - 60000)
);
}); });
</script> </script>
@@ -86,7 +110,7 @@ $viewBgCol: #1a1a1a;
margin: 0 auto; margin: 0 auto;
padding: 1em 0; padding: 1em 0;
max-width: 2000px; max-width: 2000px;
min-height: 95vh; min-height: calc(100vh - 7em);
} }
.actions { .actions {
@@ -115,10 +139,10 @@ $viewBgCol: #1a1a1a;
background-color: $viewBgCol; background-color: $viewBgCol;
text-align: center; text-align: center;
padding: 1em; padding: 1em;
border-radius: 0.5em 0.5em;
p { p {
padding: 1em 0; padding: 0.5em 0;
color: #aaa;
} }
a { a {
@@ -127,6 +151,13 @@ $viewBgCol: #1a1a1a;
} }
} }
.other-driver-trains {
display: flex;
justify-content: center;
flex-wrap: wrap;
gap: 0.5em;
}
@include smallScreen { @include smallScreen {
.actions > a > span.hidable { .actions > a > span.hidable {
display: none; display: none;