Enhance transport mode handling by adding localized labels and updating related components in MapRegionsView and BranchView

This commit is contained in:
Torsten Schulz (local)
2025-12-09 11:53:56 +01:00
parent 71c62cf5e8
commit 25d7c70058
4 changed files with 43 additions and 11 deletions

View File

@@ -13,8 +13,13 @@
"statusbar": {
"age": "Alter",
"wealth": "Vermögen",
"health": "Gesundheit",
"events": "Ereignisse",
"vehicleType": "Transportmittel",
"mode": "Art",
"modes": {
"land": "Land",
"water": "Wasser",
"unknown": "Unbekannt"
},
"relationship": "Beziehung",
"children": "Kinder",
"children_unbaptised": "ungetaufte Kinder"
@@ -351,6 +356,11 @@
"status": "Status",
"actions": "Aktionen"
},
"modes": {
"land": "Land",
"water": "Wasser",
"unknown": "Unbekannt"
},
"speed": {
"1": "Langsam",
"2": "Mittel",

View File

@@ -23,13 +23,18 @@
"transport": {
"waiting": "Transport waiting"
,
"speed": {
"1": "Slow",
"2": "Medium",
"3": "Fast",
"4": "Very fast",
"unknown": "Unknown"
}
"modes": {
"land": "Land",
"water": "Water",
"unknown": "Unknown"
},
"speed": {
"1": "Slow",
"2": "Medium",
"3": "Fast",
"4": "Very fast",
"unknown": "Unknown"
}
},
"random_event": {
"windfall": {

View File

@@ -199,7 +199,7 @@
<tr v-for="c in connections" :key="c.id">
<td>{{ regionName(c.sourceRegionId) }}</td>
<td>{{ regionName(c.targetRegionId) }}</td>
<td>{{ c.transportMode }}</td>
<td>{{ modeLabel(c.transportMode) }}</td>
<td>{{ c.distance }}</td>
<td>
<button class="btn btn-secondary" @click="deleteConnection(c.id)">
@@ -259,6 +259,14 @@ export default {
this.mapWidth = bounds.width;
this.mapHeight = bounds.height;
},
modeLabel(mode) {
if (!mode) return '';
const key = String(mode);
const tKey = `falukant.branch.transport.modes.${key}`;
const translated = this.$t(tKey);
if (!translated || translated === tKey) return mode;
return translated;
},
async loadRegions() {
try {
const { data } = await apiClient.get('/api/admin/falukant/regions');

View File

@@ -102,7 +102,7 @@
</td>
<td>{{ v.type.capacity }}</td>
<td>{{ conditionLabel(v.condition) }}</td>
<td>{{ v.type.transportMode }}</td>
<td>{{ transportModeLabel(v.type.transportMode) }}</td>
<td>{{ speedLabel(v.type.speed) }}</td>
<td>{{ formatDateTime(v.availableFrom) }}</td>
<td>
@@ -611,6 +611,15 @@ export default {
return translated;
},
transportModeLabel(mode) {
if (!mode) return '';
const key = String(mode);
const tKey = `falukant.branch.transport.modes.${key}`;
const translated = this.$t(tKey);
if (!translated || translated === tKey) return mode;
return translated;
},
async loadVehicles() {
if (!this.selectedBranch) return;
try {