@@ -51,9 +53,11 @@ import styleMixin from '../../../mixins/styleMixin';
import StationStatusBadge from '../../Global/StationStatusBadge.vue';
import { ActiveScenery } from '../../../typings/common';
import { useApiStore } from '../../../store/apiStore';
+import FlagIcon from '../../Global/FlagIcon.vue';
export default defineComponent({
mixins: [styleMixin, dateMixin, routerMixin],
+ components: { StationStatusBadge, FlagIcon },
data() {
return {
@@ -66,8 +70,7 @@ export default defineComponent({
type: Object as PropType
,
required: false
}
- },
- components: { StationStatusBadge }
+ }
});
diff --git a/src/components/StationsView/StationTable.vue b/src/components/StationsView/StationTable.vue
index 3109b8f..6f20a2f 100644
--- a/src/components/StationsView/StationTable.vue
+++ b/src/components/StationsView/StationTable.vue
@@ -146,6 +146,14 @@
+
+
+ |
+
({
@@ -495,6 +505,10 @@ thead th {
width: 12em;
}
+ &.dispatcher-lang {
+ width: 6em;
+ }
+
&.dispatcher-lvl {
width: 6em;
}
diff --git a/src/components/StationsView/typings.ts b/src/components/StationsView/typings.ts
index 545980c..889a803 100644
--- a/src/components/StationsView/typings.ts
+++ b/src/components/StationsView/typings.ts
@@ -10,6 +10,7 @@ export const headIds = [
'min-lvl',
'status',
'dispatcher',
+ 'dispatcher-lang',
'dispatcher-lvl',
'routes-single',
'routes-double',
diff --git a/src/components/StationsView/utils.ts b/src/components/StationsView/utils.ts
index 8fa7278..f280939 100644
--- a/src/components/StationsView/utils.ts
+++ b/src/components/StationsView/utils.ts
@@ -210,6 +210,11 @@ export const sortStations = (a: Station, b: Station, sorter: ActiveSorter) => {
diff = (a.onlineInfo?.dispatcherExp || 0) - (b.onlineInfo?.dispatcherExp || 0);
break;
+ case 'dispatcher-lang':
+ diff =
+ (a.onlineInfo?.dispatcherLanguageId ?? -1) - (b.onlineInfo?.dispatcherLanguageId ?? -1);
+ break;
+
case 'routes-single':
diff =
(a.generalInfo?.routes.single.filter((r) => !r.hidden && !r.isInternal).length ?? -1) -
diff --git a/src/components/TrainsView/TrainInfo.vue b/src/components/TrainsView/TrainInfo.vue
index bca5787..ea1f551 100644
--- a/src/components/TrainsView/TrainInfo.vue
+++ b/src/components/TrainsView/TrainInfo.vue
@@ -66,6 +66,10 @@
{{ train.driverName }}
+
+
+
+
@@ -199,10 +203,11 @@ import trainInfoMixin from '../../mixins/trainInfoMixin';
import trainCategoryMixin from '../../mixins/trainCategoryMixin';
import ProgressBar from '../Global/ProgressBar.vue';
import StockList from '../Global/StockList.vue';
+import FlagIcon from '../Global/FlagIcon.vue';
export default defineComponent({
mixins: [trainInfoMixin, styleMixin, trainCategoryMixin],
- components: { ProgressBar, StockList },
+ components: { ProgressBar, StockList, FlagIcon },
props: {
train: {
diff --git a/src/locales/en.json b/src/locales/en.json
index afcda10..735f1c5 100644
--- a/src/locales/en.json
+++ b/src/locales/en.json
@@ -337,6 +337,7 @@
"min-lvl": "Scenery\nlevel",
"status": "Status",
"dispatcher": "Dispatcher",
+ "dispatcher-lang": "Language",
"dispatcher-lvl": "Dispatcher\nlevel",
"routes-single": "1-track\nroutes",
"routes-double": "2-track\nroutes",
diff --git a/src/locales/pl.json b/src/locales/pl.json
index bd4006d..5d0f90e 100644
--- a/src/locales/pl.json
+++ b/src/locales/pl.json
@@ -334,6 +334,7 @@
"min-lvl": "Poziom\nscenerii",
"status": "Status",
"dispatcher": "Dyżurny",
+ "dispatcher-lang": "Język",
"dispatcher-lvl": "Poziom\ndyżurnego",
"routes-single": "Szlaki\n1-torowe",
"routes-double": "Szlaki\n2-torowe",
diff --git a/src/store/mainStore.ts b/src/store/mainStore.ts
index 5d62f5a..357b671 100644
--- a/src/store/mainStore.ts
+++ b/src/store/mainStore.ts
@@ -87,6 +87,7 @@ export const useMainStore = defineStore('mainStore', {
online: Boolean(train.online),
driverId: train.driverId,
driverName: train.driverName,
+ driverLanguageId: train.driverLanguageId,
currentStationName: train.currentStationName,
currentStationHash: train.currentStationHash,
connectedTrack: train.connectedTrack,
@@ -258,6 +259,7 @@ export const useMainStore = defineStore('mainStore', {
dispatcherIsSupporter: false,
dispatcherStatus: Status.ActiveDispatcher.FREE,
dispatcherTimestamp: -1,
+ dispatcherLanguageId: -1,
isOnline: false,
@@ -304,6 +306,7 @@ export const useMainStore = defineStore('mainStore', {
dispatcherIsSupporter: scenery.dispatcherIsSupporter,
dispatcherStatus: scenery.dispatcherStatus,
dispatcherTimestamp: dispatcherTimestamp,
+ dispatcherLanguageId: scenery.dispatcherLanguageId,
isOnline: scenery.isOnline == 1,
diff --git a/src/typings/api.ts b/src/typings/api.ts
index 2bccda7..60ea024 100644
--- a/src/typings/api.ts
+++ b/src/typings/api.ts
@@ -38,6 +38,7 @@ export namespace API {
dispatcherLevel: number | null;
dispatcherRate: number;
dispatcherIsSupporter: boolean;
+ dispatcherLanguageId: number | null;
dispatcherStatus?: number;
isOnline: boolean;
lastOnlineTimestamp: number;
@@ -114,6 +115,7 @@ export namespace API {
dispatcherId: number;
dispatcherName: string;
dispatcherIsSupporter: boolean;
+ dispatcherLanguageId: number;
stationName: string;
stationHash: string;
region: string;
@@ -152,6 +154,7 @@ export namespace API {
driverId: number;
driverIsSupporter: boolean;
driverLevel?: number;
+ driverLanguageId: number;
currentStationName: string;
currentStationHash?: string;
@@ -221,6 +224,7 @@ export namespace API {
driverName: string;
driverLevel: number | null;
driverIsSupporter: boolean;
+ driverLanguageId: number | null;
route: string;
twr: number;
diff --git a/src/typings/common.ts b/src/typings/common.ts
index 5f95d17..79af5d1 100644
--- a/src/typings/common.ts
+++ b/src/typings/common.ts
@@ -60,6 +60,7 @@ export interface Train {
distance: number;
connectedTrack: string;
driverId: number;
+ driverLanguageId: number;
trainNo: number;
driverName: string;
driverLevel: number;
@@ -162,6 +163,7 @@ export interface ActiveScenery {
dispatcherIsSupporter: boolean;
dispatcherStatus: Status.ActiveDispatcher | number;
dispatcherTimestamp: number | null;
+ dispatcherLanguageId: number;
isOnline: boolean;
stationTrains: Train[];
scheduledTrains: CheckpointTrain[];
diff --git a/src/utils/languageUtils.ts b/src/utils/languageUtils.ts
new file mode 100644
index 0000000..3a99447
--- /dev/null
+++ b/src/utils/languageUtils.ts
@@ -0,0 +1,5 @@
+export const languageFlagNames = ['pl', 'en', 'de', 'cz', 'sk', 'ru', 'se', 'ua', 'it'];
+
+export function getLanguageNameById(languageId: number) {
+ return languageFlagNames[languageId] ?? 'pl';
+}
diff --git a/src/views/StationsView.vue b/src/views/StationsView.vue
index 033bea3..834f049 100644
--- a/src/views/StationsView.vue
+++ b/src/views/StationsView.vue
@@ -29,10 +29,7 @@
data-tooltip-type="HtmlTooltip"
:data-tooltip-content="`${$t('app.language-tooltip-content')}`"
>
-
+
({
|