diff --git a/public/images/flags/cz.svg b/public/images/flags/cz.svg new file mode 100644 index 0000000..7913de3 --- /dev/null +++ b/public/images/flags/cz.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/public/images/flags/de.svg b/public/images/flags/de.svg new file mode 100644 index 0000000..71aa2d2 --- /dev/null +++ b/public/images/flags/de.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/public/images/flags/en.svg b/public/images/flags/en.svg new file mode 100644 index 0000000..7991383 --- /dev/null +++ b/public/images/flags/en.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/public/images/flags/it.svg b/public/images/flags/it.svg new file mode 100644 index 0000000..20a8bfd --- /dev/null +++ b/public/images/flags/it.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/public/images/flags/pl.svg b/public/images/flags/pl.svg new file mode 100644 index 0000000..0fa5145 --- /dev/null +++ b/public/images/flags/pl.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/public/images/flags/ru.svg b/public/images/flags/ru.svg new file mode 100644 index 0000000..cf24301 --- /dev/null +++ b/public/images/flags/ru.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/public/images/flags/se.svg b/public/images/flags/se.svg new file mode 100644 index 0000000..8ba745a --- /dev/null +++ b/public/images/flags/se.svg @@ -0,0 +1,4 @@ + + + + diff --git a/public/images/flags/sk.svg b/public/images/flags/sk.svg new file mode 100644 index 0000000..676018e --- /dev/null +++ b/public/images/flags/sk.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/public/images/flags/ua.svg b/public/images/flags/ua.svg new file mode 100644 index 0000000..a339eb1 --- /dev/null +++ b/public/images/flags/ua.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/components/StationsView/StationTable.vue b/src/components/StationsView/StationTable.vue index 3109b8f..cde1365 100644 --- a/src/components/StationsView/StationTable.vue +++ b/src/components/StationsView/StationTable.vue @@ -146,6 +146,14 @@ + + user flag + + ({ headIconsIds, headIds, - getChangedFilters + getChangedFilters, + getLanguageNameById }), setup() { @@ -495,6 +505,10 @@ thead th { width: 12em; } + &.dispatcher-lang { + width: 6em; + } + &.dispatcher-lvl { width: 6em; } @@ -604,6 +618,13 @@ tbody tr { } } +.station-dispatcher-lang { + img { + max-width: 2em; + vertical-align: middle; + } +} + .station-level { span { background-color: #888; 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/TrainsView/TrainInfo.vue b/src/components/TrainsView/TrainInfo.vue index bca5787..bc39d5d 100644 --- a/src/components/TrainsView/TrainInfo.vue +++ b/src/components/TrainsView/TrainInfo.vue @@ -66,6 +66,13 @@ {{ train.driverName }} + +
+ user flag +
@@ -199,6 +206,7 @@ import trainInfoMixin from '../../mixins/trainInfoMixin'; import trainCategoryMixin from '../../mixins/trainCategoryMixin'; import ProgressBar from '../Global/ProgressBar.vue'; import StockList from '../Global/StockList.vue'; +import { getLanguageNameById } from '../../utils/languageUtils'; export default defineComponent({ mixins: [trainInfoMixin, styleMixin, trainCategoryMixin], @@ -217,7 +225,8 @@ export default defineComponent({ data() { return { store: useMainStore(), - apiStore: useApiStore() + apiStore: useApiStore(), + getLanguageNameById }; }, @@ -290,6 +299,11 @@ export default defineComponent({ vertical-align: text-bottom; } +.train-language-flag img { + width: 1.5em; + vertical-align: text-bottom; +} + .timetable-id { color: #d2d2d2; } 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..f725da9 100644 --- a/src/typings/api.ts +++ b/src/typings/api.ts @@ -114,6 +114,7 @@ export namespace API { dispatcherId: number; dispatcherName: string; dispatcherIsSupporter: boolean; + dispatcherLanguageId: number; stationName: string; stationHash: string; region: string; @@ -152,6 +153,7 @@ export namespace API { driverId: number; driverIsSupporter: boolean; driverLevel?: number; + driverLanguageId: number; currentStationName: string; currentStationHash?: string; 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'; +}