mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-13 17:50:59 +00:00
chore(driver): locale & typings improvements
This commit is contained in:
@@ -49,7 +49,7 @@
|
||||
<div class="cargo-warnings" v-if="Object.values(cargoWarnings).length > 0">
|
||||
<hr class="divider" />
|
||||
|
||||
<h3>{{ t('analysis.warnings.title') }}</h3>
|
||||
<h3>{{ t('analysis.warnings-title') }}</h3>
|
||||
|
||||
<div class="warnings-container">
|
||||
<div
|
||||
@@ -64,7 +64,7 @@
|
||||
|
||||
<div class="cargo-warnings no-warnings" v-else>
|
||||
<hr class="divider" />
|
||||
{{ t('analysis.warnings.no-warnings') }}
|
||||
{{ t('analysis.no-warnings') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -86,6 +86,9 @@ import { useI18n } from 'vue-i18n';
|
||||
import { Train } from '../../typings/common';
|
||||
import rulesJSON from '../../data/trainNumberRules.json';
|
||||
import { useApiStore } from '../../store/apiStore';
|
||||
import { analysis } from '../../locales/pl.json';
|
||||
|
||||
type AnalysisKey = keyof typeof analysis.warnings;
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
@@ -128,33 +131,22 @@ const cargoWarnings = computed(() => {
|
||||
stockList.forEach((stockVehicle) => {
|
||||
const [vehicleName, vehicleCargo] = stockVehicle.split(':');
|
||||
|
||||
let warningsKey: AnalysisKey | null = null;
|
||||
|
||||
if (/^WB117/.test(vehicleName)) {
|
||||
if (vehicleCargo) {
|
||||
// warnings.add('twr-un1965');
|
||||
warnings['zags-loaded-twr'] = (warnings['zags-loaded-twr'] || 0) + 1;
|
||||
} else {
|
||||
// warnings.add('tn-un1965');
|
||||
warnings['zags-empty-tn'] = (warnings['zags-empty-tn'] || 0) + 1;
|
||||
}
|
||||
warningsKey = vehicleCargo ? 'zags-loaded-twr' : 'zags-empty-tn';
|
||||
} else if (/^445Rb/.test(vehicleName)) {
|
||||
if (vehicleCargo) {
|
||||
// warnings.add(vehicleCargo ? 'tn-un1202' : 'tn-un1202-empty');
|
||||
warnings['zans-loaded-tn'] = (warnings['zans-loaded-tn'] || 0) + 1;
|
||||
} else {
|
||||
// warnings.add(vehicleCargo ? 'tn-un1202' : 'tn-un1202-empty');
|
||||
warnings['zans-empty-tn'] = (warnings['zans-empty-tn'] || 0) + 1;
|
||||
}
|
||||
warningsKey = vehicleCargo ? 'zans-loaded-tn' : 'zans-empty-tn';
|
||||
} else if (/^EDK80/.test(vehicleName)) {
|
||||
// warnings.add('pn-edk80');
|
||||
warnings['edk80-all-pn'] = (warnings['edk80-all-pn'] || 0) + 1;
|
||||
warningsKey = 'edk80-all-pn';
|
||||
} else if (/^wt_20/.test(vehicleCargo)) {
|
||||
warningsKey = 'innofreight-all-pn';
|
||||
} else if (/^(tank|vehicles_01|truck)/.test(vehicleCargo)) {
|
||||
warningsKey = 'military-all-pn';
|
||||
}
|
||||
|
||||
if (/^wt_20/.test(vehicleCargo)) {
|
||||
warnings['innofreight-all-pn'] = (warnings['innofreight-all-pn'] || 0) + 1;
|
||||
}
|
||||
|
||||
if (/^(tank|vehicles_01|truck)/.test(vehicleCargo)) {
|
||||
warnings['military-all-pn'] = (warnings['military-all-pn'] || 0) + 1;
|
||||
if (warningsKey) {
|
||||
warnings[warningsKey] = (warnings[warningsKey] || 0) + 1;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
+5
-6
@@ -441,7 +441,7 @@
|
||||
},
|
||||
|
||||
"analysis": {
|
||||
"button-show": "ANALYSIS & STOCK",
|
||||
"button-show": "STOCK INFORMATION",
|
||||
"number-info": "will be automatically updated to the current train number chosen in the simulator after the analysis is sent in the chat.",
|
||||
|
||||
"stock-copy": "COPY CURRENT STOCK",
|
||||
@@ -461,18 +461,17 @@
|
||||
"empty": "No propositions available for the chosen category! :/"
|
||||
},
|
||||
|
||||
"warnings": {
|
||||
"title": "Additional cargo warnings:",
|
||||
"warnings-title": "Additional cargo warnings:",
|
||||
"no-warnings": "No additional cargo warnings",
|
||||
|
||||
"warnings": {
|
||||
"zags-loaded-twr": "TWR: 23UN1965, {0}x Zags",
|
||||
"zags-empty-tn": "TN: 23UN1965, {0}x Zags (empty)",
|
||||
"zans-loaded-tn": "TN: 33UN1202, {0}x Zans",
|
||||
"zans-empty-tn": "TN: 33UN1202, {0}x Zans (empty)",
|
||||
"military-all-pn": "PN: military transport",
|
||||
"edk80-all-pn": "PN: EDK80 railway crane",
|
||||
"innofreight-all-pn": "PN: Innofreight C45 (exceeded gauge)",
|
||||
|
||||
"no-warnings": "No additional cargo warnings"
|
||||
"innofreight-all-pn": "PN: Innofreight C45 (exceeded gauge)"
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
+5
-5
@@ -431,7 +431,7 @@
|
||||
},
|
||||
|
||||
"analysis": {
|
||||
"button-show": "ANALIZA I SKŁAD",
|
||||
"button-show": "INFORMACJE O SKŁADZIE",
|
||||
"number-info": "zostanie automatycznie zaktualizowany na obecny numer wybrany w symulatorze po wysłaniu wiadomości na czacie.",
|
||||
"title": "Treść analizy:",
|
||||
|
||||
@@ -453,17 +453,17 @@
|
||||
"empty": "Brak propozycji dla wybranej kategorii!"
|
||||
},
|
||||
|
||||
"warnings-title": "Dodatkowe uwagi przewozowe:",
|
||||
"no-warnings": "Brak dodatkowych uwag przewozowych",
|
||||
|
||||
"warnings": {
|
||||
"title": "Dodatkowe uwagi przewozowe:",
|
||||
"zags-loaded-twr": "TWR: 23UN1965, {0}x Zags",
|
||||
"zags-empty-tn": "TN: 23UN1965, {0}x Zags (próżne)",
|
||||
"zans-loaded-tn": "TN: 33UN1202, {0}x Zans",
|
||||
"zans-empty-tn": "TN: 33UN1202, {0}x Zans (próżne)",
|
||||
"military-all-pn": "PN: transport wojskowy",
|
||||
"edk80-all-pn": "PN: żuraw kolejowy EDK80",
|
||||
"innofreight-all-pn": "PN: Innofreight C45 (przekroczona skrajnia)",
|
||||
|
||||
"no-warnings": "Brak dodatkowych uwag przewozowych"
|
||||
"innofreight-all-pn": "PN: Innofreight C45 (przekroczona skrajnia)"
|
||||
}
|
||||
},
|
||||
"train-stats": {
|
||||
|
||||
Reference in New Issue
Block a user