Enhance vehicle speed display by adding localized labels in DirectorInfo, SaleSection, and BranchView components
This commit is contained in:
@@ -103,7 +103,7 @@
|
||||
<td>{{ v.type.capacity }}</td>
|
||||
<td>{{ conditionLabel(v.condition) }}</td>
|
||||
<td>{{ v.type.transportMode }}</td>
|
||||
<td>{{ v.type.speed }}</td>
|
||||
<td>{{ speedLabel(v.type.speed) }}</td>
|
||||
<td>{{ formatDateTime(v.availableFrom) }}</td>
|
||||
<td>
|
||||
<span v-if="v.status === 'travelling'">
|
||||
@@ -601,6 +601,16 @@ export default {
|
||||
return 'Unbekannt';
|
||||
},
|
||||
|
||||
speedLabel(value) {
|
||||
// Expect numeric speeds 1..4; provide localized labels as fallback to raw value
|
||||
const key = value == null ? 'unknown' : String(value);
|
||||
const tKey = `falukant.branch.transport.speed.${key}`;
|
||||
const translated = this.$t(tKey);
|
||||
// If translation returns the key (no translation found), fall back to the numeric value
|
||||
if (!translated || translated === tKey) return value;
|
||||
return translated;
|
||||
},
|
||||
|
||||
async loadVehicles() {
|
||||
if (!this.selectedBranch) return;
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user