mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 21:38:13 +00:00
chore(profile): added i18n translation bindings & pl locale keys
This commit is contained in:
@@ -59,7 +59,7 @@
|
||||
{{ entry.value.trainCategoryCode }} {{ entry.value.trainNo }}
|
||||
</b>
|
||||
<b class="text--grayed" v-if="entry.type == 'IssuedTimetable'">
|
||||
dla: {{ entry.value.driverName }}
|
||||
{{ ' ' }} {{ t('profile.list.for') }}: {{ entry.value.driverName }}
|
||||
</b>
|
||||
{{ ' ' }}
|
||||
<b>{{ entry.value.route.replace('|', ' > ') }}</b>
|
||||
@@ -72,7 +72,7 @@
|
||||
<b class="text--primary">{{ entry.value.stationName }}</b>
|
||||
{{ ' - ' }}
|
||||
<b>
|
||||
<span v-if="entry.value.isOnline">od </span>
|
||||
<span v-if="entry.value.isOnline">{{ t('profile.list.since') }}: </span>
|
||||
<span>{{
|
||||
humanizeDuration(
|
||||
(entry.value.timestampTo || Date.now()) - entry.value.timestampFrom
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<section class="profile-recent-stats">
|
||||
<h3 class="stats-header">STATYSTYKI AKTYWNOŚCI (30 OSTATNICH DNI)</h3>
|
||||
<h3 class="stats-header">{{ t('profile.recent-stats.header') }}</h3>
|
||||
|
||||
<div class="month-stats-box">
|
||||
<div class="month-stat">
|
||||
@@ -8,7 +8,7 @@
|
||||
<div>
|
||||
<h3 class="text--primary">{{ playerInfo.driverStatsLastMonth.countAll }}</h3>
|
||||
</div>
|
||||
<div>ROZKŁADÓW JAZDY</div>
|
||||
<div>{{ t('profile.recent-stats.timetables') }}</div>
|
||||
</div>
|
||||
|
||||
<div class="month-stat">
|
||||
@@ -18,7 +18,7 @@
|
||||
{{ playerInfo.driverStatsLastMonth.currentDistanceTotal?.toFixed(2) || 0 }}
|
||||
</h3>
|
||||
</div>
|
||||
<div>POKONANYCH KILOMETRÓW</div>
|
||||
<div>{{ t('profile.recent-stats.distance') }}</div>
|
||||
</div>
|
||||
|
||||
<div class="month-stat">
|
||||
@@ -28,7 +28,7 @@
|
||||
{{ playerInfo.dispatcherStatsLastMonth.services?.count || 0 }}
|
||||
</h3>
|
||||
</div>
|
||||
<div>SŁUŻB DYŻURNEGO</div>
|
||||
<div>{{ t('profile.recent-stats.duties') }}</div>
|
||||
</div>
|
||||
|
||||
<div class="month-stat">
|
||||
@@ -38,7 +38,7 @@
|
||||
{{ playerInfo.dispatcherStatsLastMonth.issuedTimetables?.count || 0 }}
|
||||
</h3>
|
||||
</div>
|
||||
<div>WYSTAWIONYCH ROZKŁADÓW</div>
|
||||
<div>{{ t('profile.recent-stats.created-timetables') }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@@ -47,8 +47,11 @@
|
||||
<script lang="ts" setup>
|
||||
import { PropType } from 'vue';
|
||||
import { API } from '../../typings/api';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
const props = defineProps({
|
||||
const { t } = useI18n();
|
||||
|
||||
defineProps({
|
||||
playerInfo: {
|
||||
type: Object as PropType<API.PlayerInfo.Data>,
|
||||
required: true
|
||||
|
||||
+26
-22
@@ -29,7 +29,7 @@
|
||||
playerInfo.driverStats.driverLevel > 1 ? playerInfo.driverStats.driverLevel : 'L'
|
||||
}}
|
||||
</span>
|
||||
MASZYNISTA
|
||||
{{ t('profile.stats.driver') }}
|
||||
</div>
|
||||
|
||||
<div class="badge-container" v-if="playerInfo.dispatcherStats.dispatcherLevel != null">
|
||||
@@ -43,14 +43,14 @@
|
||||
: 'L'
|
||||
}}
|
||||
</span>
|
||||
DYŻURNY RUCHU
|
||||
{{ t('profile.stats.dispatcher') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="info-activity" v-if="playerInfo.currentActivity.dispatcher.length > 0">
|
||||
<b class="text--primary">ONLINE JAKO DR:</b>
|
||||
<b class="text--primary">{{ t('profile.online-as-dispatcher') }}</b>
|
||||
{{
|
||||
playerInfo.currentActivity.dispatcher
|
||||
.map((d) => `${d.stationName} (${d.stationHash})`)
|
||||
@@ -62,8 +62,8 @@
|
||||
class="info-activity"
|
||||
v-if="playerInfo.currentActivity.driver && playerInfo.currentActivity.driver.length > 0"
|
||||
>
|
||||
<b>ONLINE JAKO MASZYNISTA:</b>
|
||||
{{ playerInfo.currentActivity.driver.trainNo }} na scenerii
|
||||
<b>{{ t('profile.online-as-driver') }}</b>
|
||||
{{ playerInfo.currentActivity.driver.trainNo }} {{ t('profile.on-scenery') }}
|
||||
{{ playerInfo.currentActivity.driver.currentStationName }}
|
||||
</div>
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
<div class="player-stats">
|
||||
<div class="stats-driver">
|
||||
<img src="/images/icon-train.svg" width="35" alt="train icon" />
|
||||
<h3>STATYSTYKI MASZYNISTY</h3>
|
||||
<h3>{{ t('profile.stats.header-driver') }}</h3>
|
||||
<hr />
|
||||
|
||||
<div v-if="playerInfo.driverStats.countAll > 0">
|
||||
@@ -89,7 +89,7 @@
|
||||
)
|
||||
}}%)
|
||||
</b>
|
||||
- wypełnione rozkłady jazdy
|
||||
- {{ t('profile.stats.fulfilled-timetables') }}
|
||||
</div>
|
||||
<div>
|
||||
<b class="text--primary">
|
||||
@@ -102,7 +102,7 @@
|
||||
)
|
||||
}}%)
|
||||
</b>
|
||||
- zatwierdzony kilometraż w RJ
|
||||
- {{ t('profile.stats.route-distance') }}
|
||||
</div>
|
||||
<div>
|
||||
<b class="text--primary">
|
||||
@@ -115,22 +115,22 @@
|
||||
)
|
||||
}}%)
|
||||
</b>
|
||||
- potwierdzonych stacji w RJ
|
||||
- {{ t('profile.stats.confirmed-stops') }}
|
||||
</div>
|
||||
<div>
|
||||
<b class="text--primary">{{ playerInfo.driverStats.routeDistanceMax || 0 }}km</b> -
|
||||
najdłuższy rozkład jazdy
|
||||
{{ t('profile.stats.longest-timetable') }}
|
||||
</div>
|
||||
<div>
|
||||
<b class="text--primary">
|
||||
{{ playerInfo.driverStats.routeDistanceAvg?.toFixed(2) || 0 }}km
|
||||
</b>
|
||||
- średnia długość wszystkich rozkładów
|
||||
- {{ t('profile.stats.avg-timetable-length') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="text--grayed" v-else>
|
||||
Ten użytkownik nie posiada statystyk maszynisty zarejestrowanych przez Stacjownik!
|
||||
{{ t('profile.stats.no-timetable-stats') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -139,41 +139,41 @@
|
||||
v-if="playerInfo.dispatcherStats && playerInfo.dispatcherStats.services?.count"
|
||||
>
|
||||
<img src="/images/icon-user.svg" width="35" alt="user icon" />
|
||||
<h3>STATYSTYKI DYŻURNEGO RUCHU</h3>
|
||||
<h3>{{ t('profile.stats.header-dispatcher') }}</h3>
|
||||
<hr />
|
||||
|
||||
<div>
|
||||
<b class="text--primary">{{ playerInfo.dispatcherStats.services.count }}</b> - służby jako
|
||||
dyżurny ruchu
|
||||
<b class="text--primary">{{ playerInfo.dispatcherStats.services.count }}</b> -
|
||||
{{ t('profile.stats.duties-count') }}
|
||||
</div>
|
||||
<div>
|
||||
<b class="text--primary">{{
|
||||
humanizeDuration(playerInfo.dispatcherStats.services.durationMax)
|
||||
}}</b>
|
||||
- najdłuższa służba
|
||||
- {{ t('profile.stats.longest-duty') }}
|
||||
</div>
|
||||
|
||||
<div v-if="playerInfo.dispatcherStats.issuedTimetables">
|
||||
<div>
|
||||
<b class="text--primary">{{ playerInfo.dispatcherStats.issuedTimetables.count }}</b>
|
||||
- wystawione RJ jako dyżurny ruchu
|
||||
- {{ t('profile.stats.created-timetables-count') }}
|
||||
</div>
|
||||
<div>
|
||||
<b class="text--primary">
|
||||
{{ playerInfo.dispatcherStats.issuedTimetables.distanceMax }}km
|
||||
</b>
|
||||
- najdłuższy wystawiony RJ
|
||||
- {{ t('profile.stats.longest-created-timetable') }}
|
||||
</div>
|
||||
<div>
|
||||
<b class="text--primary">
|
||||
{{ playerInfo.dispatcherStats.issuedTimetables.distanceSum.toFixed(2) }}km
|
||||
</b>
|
||||
- suma długości wystawionych RJ
|
||||
- {{ t('profile.stats.created-timetables-length-sum') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="text--grayed" v-else>
|
||||
Ten dyżurny nie wystawił jeszcze żadnego rozkładu jazdy
|
||||
{{ t('profile.stats.no-dispatcher-stats') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -187,10 +187,13 @@ import { calculateExpStyles } from '../../composables/badge';
|
||||
import { getCountPercentage } from '../../utils/calcUtils';
|
||||
import { humanizeDuration } from '../../composables/time';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
const route = useRoute();
|
||||
|
||||
const props = defineProps({
|
||||
defineProps({
|
||||
playerInfo: {
|
||||
type: Object as PropType<API.PlayerInfo.Data>,
|
||||
required: true
|
||||
@@ -248,9 +251,10 @@ const props = defineProps({
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
gap: 0.25em;
|
||||
|
||||
font-weight: bold;
|
||||
|
||||
& > .level-badge {
|
||||
font-size: 1.15em;
|
||||
}
|
||||
Reference in New Issue
Block a user