Skip to content

Commit d5ef719

Browse files
authored
Merge pull request #989 from mbm-OR/bugfix/Fix-TrainCarOperations-crash-locales
Fix: TrainCarOperations-crashes-locales
2 parents c3fcdaa + 32a9961 commit d5ef719

File tree

11 files changed

+228
-44
lines changed

11 files changed

+228
-44
lines changed

Source/Locales/RunActivity/cs.po

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,6 @@ msgctxt "PowerSupply"
133133
msgid "On ongoing"
134134
msgstr "Běží"
135135

136-
#. Context: PowerSupply
137-
#: ../../RunActivity/Common/Scripting/PowerSupply/AbstractPowerSupply.cs:81
138-
msgctxt "PowerSupply"
139-
msgid "On"
140-
msgstr "Zap"
141-
142136
#. Context: Pantograph
143137
#: ../../RunActivity/Common/Scripting/PowerSupply/AbstractPowerSupply.cs:86
144138
msgctxt "Pantograph"
@@ -584,12 +578,6 @@ msgstr "Strojvedoucí"
584578
msgid "Auxiliary power"
585579
msgstr "Pomocný výkon"
586580

587-
#. Context: PowerSupply
588-
#: ../../RunActivity/RollingStock/MSTSElectricLocomotive.cs:322
589-
msgctxt "PowerSupply"
590-
msgid "Power"
591-
msgstr "Výkon"
592-
593581
#: ../../RunActivity/RollingStock/MSTSSteamLocomotive.cs:1573
594582
#: ../../RunActivity/Viewer3D/RollingStock/MSTSSteamLocomotiveViewer.cs:203
595583
msgid "Scoop broken because activated outside through"
@@ -3225,3 +3213,28 @@ msgstr "Spotř."
32253213
#~ msgctxt "Labels"
32263214
#~ msgid "none"
32273215
#~ msgstr "není"
3216+
3217+
#. Context: DieselEngine
3218+
msgctxt "DieselEngine"
3219+
msgid "Engine"
3220+
msgstr "Lokomotiva"
3221+
3222+
#. Context: PowerSupply
3223+
msgctxt "PowerSupply"
3224+
msgid "On"
3225+
msgstr "Zap"
3226+
3227+
#. Context: PowerSupply
3228+
msgctxt "PowerSupply"
3229+
msgid "Power"
3230+
msgstr "Výkon"
3231+
3232+
#. Context: DieselEngine
3233+
msgctxt "DieselEngine"
3234+
msgid "Running"
3235+
msgstr "Motor běží"
3236+
3237+
#. Context: DieselEngine
3238+
msgctxt "DieselEngine"
3239+
msgid "Stopped"
3240+
msgstr "Motor zastaven"

Source/Locales/RunActivity/da.po

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,6 @@ msgctxt "PowerSupply"
9696
msgid "On ongoing"
9797
msgstr "Starter op"
9898

99-
#. Context: PowerSupply
100-
#: ../../RunActivity/Common/Scripting/PowerSupply/AbstractPowerSupply.cs:81
101-
msgctxt "PowerSupply"
102-
msgid "On"
103-
msgstr "Til"
104-
10599
#. Context: Pantograph
106100
#: ../../RunActivity/Common/Scripting/PowerSupply/AbstractPowerSupply.cs:86
107101
msgctxt "Pantograph"
@@ -549,12 +543,6 @@ msgstr "Fører"
549543
msgid "Auxiliary power"
550544
msgstr "Ekstra effekt"
551545

552-
#. Context: PowerSupply
553-
#: ../../RunActivity/RollingStock/MSTSElectricLocomotive.cs:322
554-
msgctxt "PowerSupply"
555-
msgid "Power"
556-
msgstr "Effekt"
557-
558546
#: ../../RunActivity/RollingStock/MSTSSteamLocomotive.cs:1366
559547
msgid "Tender coal supply is empty. Your loco will fail."
560548
msgstr "Kulvognen er tom. Dit lokomotiv vil fejle."
@@ -2896,3 +2884,28 @@ msgstr ""
28962884
#~ msgctxt "Labels"
28972885
#~ msgid "none"
28982886
#~ msgstr "ingen"
2887+
2888+
#. Context: DieselEngine
2889+
msgctxt "DieselEngine"
2890+
msgid "Engine"
2891+
msgstr "Motor"
2892+
2893+
#. Context: PowerSupply
2894+
msgctxt "PowerSupply"
2895+
msgid "On"
2896+
msgstr "Til"
2897+
2898+
#. Context: PowerSupply
2899+
msgctxt "PowerSupply"
2900+
msgid "Power"
2901+
msgstr "Effekt"
2902+
2903+
#. Context: DieselEngine
2904+
msgctxt "DieselEngine"
2905+
msgid "Running"
2906+
msgstr "Kører"
2907+
2908+
#. Context: DieselEngine
2909+
msgctxt "DieselEngine"
2910+
msgid "Stopped"
2911+
msgstr "Stoppet"

Source/Locales/RunActivity/de.po

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4118,3 +4118,28 @@ msgstr "Fluss"
41184118
#~ msgctxt "Switch"
41194119
#~ msgid "change"
41204120
#~ msgstr "stellen"
4121+
4122+
#. Context: DieselEngine
4123+
msgctxt "DieselEngine"
4124+
msgid "Engine"
4125+
msgstr "Motor"
4126+
4127+
#. Context: PowerSupply
4128+
msgctxt "PowerSupply"
4129+
msgid "On"
4130+
msgstr "An"
4131+
4132+
#. Context: PowerSupply
4133+
msgctxt "PowerSupply"
4134+
msgid "Power"
4135+
msgstr "Strom"
4136+
4137+
#. Context: DieselEngine
4138+
msgctxt "DieselEngine"
4139+
msgid "Running"
4140+
msgstr "An"
4141+
4142+
#. Context: DieselEngine
4143+
msgctxt "DieselEngine"
4144+
msgid "Stopped"
4145+
msgstr "Aus"

Source/Locales/RunActivity/fr.po

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3225,3 +3225,28 @@ msgstr "Débit"
32253225
#, csharp-format
32263226
#~ msgid "filtered by {0:F0}"
32273227
#~ msgstr "filtré par {0:F0}"
3228+
3229+
#. Context: DieselEngine
3230+
msgctxt "DieselEngine"
3231+
msgid "Engine"
3232+
msgstr "Moteur"
3233+
3234+
#. Context: PowerSupply
3235+
msgctxt "PowerSupply"
3236+
msgid "On"
3237+
msgstr "Actif"
3238+
3239+
#. Context: PowerSupply
3240+
msgctxt "PowerSupply"
3241+
msgid "Power"
3242+
msgstr "Puissance"
3243+
3244+
#. Context: DieselEngine
3245+
msgctxt "DieselEngine"
3246+
msgid "Running"
3247+
msgstr "En marche"
3248+
3249+
#. Context: DieselEngine
3250+
msgctxt "DieselEngine"
3251+
msgid "Stopped"
3252+
msgstr "Arrêté"

Source/Locales/RunActivity/hu.po

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4993,3 +4993,28 @@ msgstr "Fogyaszt."
49934993

49944994
#~ msgid "Coupler overloaded"
49954995
#~ msgstr "Vonókészülék túlterhelve"
4996+
4997+
#. Context: DieselEngine
4998+
msgctxt "DieselEngine"
4999+
msgid "Engine"
5000+
msgstr "Gép"
5001+
5002+
#. Context: PowerSupply
5003+
msgctxt "PowerSupply"
5004+
msgid "On"
5005+
msgstr "Van"
5006+
5007+
#. Context: PowerSupply
5008+
msgctxt "PowerSupply"
5009+
msgid "Power"
5010+
msgstr "Feszültség"
5011+
5012+
#. Context: DieselEngine
5013+
msgctxt "DieselEngine"
5014+
msgid "Running"
5015+
msgstr "Üzemben"
5016+
5017+
#. Context: DieselEngine
5018+
msgctxt "DieselEngine"
5019+
msgid "Stopped"
5020+
msgstr "Leállítva"

Source/Locales/RunActivity/it.po

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3973,3 +3973,28 @@ msgstr ""
39733973
#~ msgctxt "Labels"
39743974
#~ msgid "none"
39753975
#~ msgstr "nessuno"
3976+
3977+
#. Context: DieselEngine
3978+
msgctxt "DieselEngine"
3979+
msgid "Engine"
3980+
msgstr "Motore"
3981+
3982+
#. Context: PowerSupply
3983+
msgctxt "PowerSupply"
3984+
msgid "On"
3985+
msgstr "Accesa"
3986+
3987+
#. Context: PowerSupply
3988+
msgctxt "PowerSupply"
3989+
msgid "Power"
3990+
msgstr "Alimentazione"
3991+
3992+
#. Context: DieselEngine
3993+
msgctxt "DieselEngine"
3994+
msgid "Running"
3995+
msgstr "In funzione"
3996+
3997+
#. Context: DieselEngine
3998+
msgctxt "DieselEngine"
3999+
msgid "Stopped"
4000+
msgstr "Spento"

Source/Locales/RunActivity/pt-BR.po

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1506,3 +1506,23 @@ msgstr "O furo está quebrado, não é possível reabastecer"
15061506
#: ../../RunActivity/Viewer3D/RollingStock/MSTSSteamLocomotiveViewer.cs:230
15071507
msgid "Scoop broken because activated outside through"
15081508
msgstr "Scoop quebrado porque ativado do lado de fora"
1509+
1510+
#. Context: DieselEngine
1511+
msgctxt "DieselEngine"
1512+
msgid "Engine"
1513+
msgstr "Motor"
1514+
1515+
#. Context: PowerSupply
1516+
msgctxt "PowerSupply"
1517+
msgid "On"
1518+
msgstr "Ligada"
1519+
1520+
#. Context: DieselEngine
1521+
msgctxt "DieselEngine"
1522+
msgid "Running"
1523+
msgstr "Trabalhando"
1524+
1525+
#. Context: DieselEngine
1526+
msgctxt "DieselEngine"
1527+
msgid "Stopped"
1528+
msgstr "Parado"

Source/Locales/RunActivity/ru.po

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3814,3 +3814,28 @@ msgstr "Bak."
38143814
#~ msgctxt "Coupler"
38153815
#~ msgid "Push"
38163816
#~ msgstr "Растян"
3817+
3818+
#. Context: DieselEngine
3819+
msgctxt "DieselEngine"
3820+
msgid "Engine"
3821+
msgstr "ДВС"
3822+
3823+
#. Context: PowerSupply
3824+
msgctxt "PowerSupply"
3825+
msgid "Power"
3826+
msgstr "Напряж"
3827+
3828+
#. Context: PowerSupply
3829+
msgctxt "PowerSupply"
3830+
msgid "On"
3831+
msgstr "Вкл"
3832+
3833+
#. Context: DieselEngine
3834+
msgctxt "DieselEngine"
3835+
msgid "Running"
3836+
msgstr "Работает"
3837+
3838+
#. Context: DieselEngine
3839+
msgctxt "DieselEngine"
3840+
msgid "Stopped"
3841+
msgstr "Заглушен"

Source/Locales/RunActivity/zh-CN.po

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,6 @@ msgctxt "PowerSupply"
9797
msgid "On ongoing"
9898
msgstr "正在进行"
9999

100-
#. Context: PowerSupply
101-
#: ../../RunActivity/Common/Scripting/PowerSupply/AbstractPowerSupply.cs:81
102-
msgctxt "PowerSupply"
103-
msgid "On"
104-
msgstr "打开"
105-
106100
#. Context: Pantograph
107101
#: ../../RunActivity/Common/Scripting/PowerSupply/AbstractPowerSupply.cs:86
108102
msgctxt "Pantograph"
@@ -546,12 +540,6 @@ msgstr "司机"
546540
msgid "Auxiliary power"
547541
msgstr "辅助动力"
548542

549-
#. Context: PowerSupply
550-
#: ../../RunActivity/RollingStock/MSTSElectricLocomotive.cs:322
551-
msgctxt "PowerSupply"
552-
msgid "Power"
553-
msgstr "电力"
554-
555543
#: ../../RunActivity/RollingStock/MSTSSteamLocomotive.cs:1411
556544
msgid "Tender coal supply is empty. Your loco will fail."
557545
msgstr "煤水车没有煤了"
@@ -2835,3 +2823,28 @@ msgstr "流动"
28352823

28362824
#~ msgid "successfully"
28372825
#~ msgstr "成功"
2826+
2827+
#. Context: DieselEngine
2828+
msgctxt "DieselEngine"
2829+
msgid "Engine"
2830+
msgstr "柴油机"
2831+
2832+
#. Context: PowerSupply
2833+
msgctxt "PowerSupply"
2834+
msgid "On"
2835+
msgstr "打开"
2836+
2837+
#. Context: PowerSupply
2838+
msgctxt "PowerSupply"
2839+
msgid "Power"
2840+
msgstr "电力"
2841+
2842+
#. Context: DieselEngine
2843+
msgctxt "DieselEngine"
2844+
msgid "Running"
2845+
msgstr "运行"
2846+
2847+
#. Context: DieselEngine
2848+
msgctxt "DieselEngine"
2849+
msgid "Stopped"
2850+
msgstr "停机"

Source/RunActivity/Viewer3D/Popups/TrainCarOperationsViewerWindow.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1091,11 +1091,11 @@ public Texture2D locomotiveStatus1(int CarPosition)
10911091
string[] parts = data.Split(new string[] { " = " }, 2, StringSplitOptions.None);
10921092
string keyPart = parts[0];
10931093
string valuePart = parts?[1];
1094-
if (keyPart.Contains(Viewer.Catalog.GetString("Engine")))
1094+
if (keyPart.Contains(Viewer.Catalog.GetParticularString("DieselEngine","Engine")))
10951095
{
10961096
TrainCarViewer.PowerSupplyStatus = locomotiveStatus;
1097-
Texture = valuePart.Contains(Viewer.Catalog.GetString("Running")) ? PowerOn
1098-
: valuePart.Contains(Viewer.Catalog.GetString("Stopped")) ? PowerOff
1097+
Texture = valuePart.Contains(Viewer.Catalog.GetParticularString("DieselEngine", "Running")) ? PowerOn
1098+
: valuePart.Contains(Viewer.Catalog.GetParticularString("DieselEngine", "Stopped")) ? PowerOff
10991099
: PowerChanging;
11001100
break;
11011101
}

Source/RunActivity/Viewer3D/Popups/TrainCarOperationsWindow.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,12 +1033,12 @@ public Texture2D LocomotiveStatus(int CarPosition)
10331033
string[] parts = data.Split(new string[] { " = " }, 2, StringSplitOptions.None);
10341034
string keyPart = parts[0];
10351035
string valuePart = parts?[1];
1036-
if (keyPart.Contains(Viewer.Catalog.GetString("Engine")))
1036+
if (Viewer.PlayerTrain.Cars[CarPosition] is MSTSDieselLocomotive && keyPart.Contains(Viewer.Catalog.GetParticularString("DieselEngine", "Engine")))
10371037
{
10381038
TrainCarOperations.PowerSupplyStatus = locomotiveStatus;
10391039

1040-
Texture = valuePart.Contains(Viewer.Catalog.GetString("Running")) ? PowerOn
1041-
: valuePart.Contains(Viewer.Catalog.GetString("Stopped")) ? PowerOff
1040+
Texture = valuePart.Contains(Viewer.Catalog.GetParticularString("DieselEngine", "Running")) ? PowerOn
1041+
: valuePart.Contains(Viewer.Catalog.GetParticularString("DieselEngine", "Stopped")) ? PowerOff
10421042
: PowerChanging;
10431043

10441044
if (CarPosition == TrainCarViewer.CarPosition)
@@ -1047,10 +1047,10 @@ public Texture2D LocomotiveStatus(int CarPosition)
10471047
}
10481048
break;
10491049
}
1050-
else if (keyPart.Contains(Viewer.Catalog.GetString("Power")))
1050+
else if (keyPart.Contains(Viewer.Catalog.GetParticularString("PowerSupply", "Power")))
10511051
{
10521052
TrainCarViewer.PowerSupplyStatus = locomotiveStatus;
1053-
var powerStatus = valuePart.Contains(Viewer.Catalog.GetString("On"));
1053+
var powerStatus = valuePart.Contains(Viewer.Catalog.GetParticularString("PowerSupply", "On"));
10541054
Texture = powerStatus ? PowerOn : PowerOff;
10551055
if (CarPosition == TrainCarViewer.CarPosition)
10561056
TrainCarOperations.SupplyStatusChanged = TrainCarOperations.MainPowerSupplyOn != powerStatus;

0 commit comments

Comments
 (0)