Skip to content

Commit c0ae6cd

Browse files
committed
Fix:TrainCarOperations-crashes-locales
1 parent 58b2418 commit c0ae6cd

File tree

11 files changed

+228
-8
lines changed

11 files changed

+228
-8
lines changed

Source/Locales/RunActivity/cs.po

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3217,3 +3217,28 @@ msgstr "Naběrač vody je poškozen, nelze ji doplnit"
32173217
#~ msgctxt "Labels"
32183218
#~ msgid "none"
32193219
#~ msgstr "není"
3220+
3221+
#. Context: DieselEngine
3222+
msgctxt "DieselEngine"
3223+
msgid "Engine"
3224+
msgstr "Lokomotiva"
3225+
3226+
#. Context: PowerSupply
3227+
msgctxt "PowerSupply"
3228+
msgid "On"
3229+
msgstr "Zap"
3230+
3231+
#. Context: PowerSupply
3232+
msgctxt "PowerSupply"
3233+
msgid "Power"
3234+
msgstr "Výkon"
3235+
3236+
#. Context: DieselEngine
3237+
msgctxt "DieselEngine"
3238+
msgid "Running"
3239+
msgstr "Motor běží"
3240+
3241+
#. Context: DieselEngine
3242+
msgctxt "DieselEngine"
3243+
msgid "Stopped"
3244+
msgstr "Motor zastaven"

Source/Locales/RunActivity/da.po

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2886,3 +2886,28 @@ msgstr[1] "{0} meter"
28862886
#~ msgctxt "Labels"
28872887
#~ msgid "none"
28882888
#~ msgstr "ingen"
2889+
2890+
#. Context: DieselEngine
2891+
msgctxt "DieselEngine"
2892+
msgid "Engine"
2893+
msgstr "Motor"
2894+
2895+
#. Context: PowerSupply
2896+
msgctxt "PowerSupply"
2897+
msgid "On"
2898+
msgstr "Til"
2899+
2900+
#. Context: PowerSupply
2901+
msgctxt "PowerSupply"
2902+
msgid "Power"
2903+
msgstr "Effekt"
2904+
2905+
#. Context: DieselEngine
2906+
msgctxt "DieselEngine"
2907+
msgid "Running"
2908+
msgstr "Kører"
2909+
2910+
#. Context: DieselEngine
2911+
msgctxt "DieselEngine"
2912+
msgid "Stopped"
2913+
msgstr "Stoppet"

Source/Locales/RunActivity/de.po

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4108,3 +4108,28 @@ msgstr ""
41084108
#~ msgctxt "Switch"
41094109
#~ msgid "change"
41104110
#~ msgstr "stellen"
4111+
4112+
#. Context: DieselEngine
4113+
msgctxt "DieselEngine"
4114+
msgid "Engine"
4115+
msgstr "Motor"
4116+
4117+
#. Context: PowerSupply
4118+
msgctxt "PowerSupply"
4119+
msgid "On"
4120+
msgstr "An"
4121+
4122+
#. Context: PowerSupply
4123+
msgctxt "PowerSupply"
4124+
msgid "Power"
4125+
msgstr "Strom"
4126+
4127+
#. Context: DieselEngine
4128+
msgctxt "DieselEngine"
4129+
msgid "Running"
4130+
msgstr "An"
4131+
4132+
#. Context: DieselEngine
4133+
msgctxt "DieselEngine"
4134+
msgid "Stopped"
4135+
msgstr "Aus"

Source/Locales/RunActivity/fr.po

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3215,3 +3215,28 @@ msgstr "Dist"
32153215
#, csharp-format
32163216
#~ msgid "filtered by {0:F0}"
32173217
#~ msgstr "filtré par {0:F0}"
3218+
3219+
#. Context: DieselEngine
3220+
msgctxt "DieselEngine"
3221+
msgid "Engine"
3222+
msgstr "Moteur"
3223+
3224+
#. Context: PowerSupply
3225+
msgctxt "PowerSupply"
3226+
msgid "On"
3227+
msgstr "Actif"
3228+
3229+
#. Context: PowerSupply
3230+
msgctxt "PowerSupply"
3231+
msgid "Power"
3232+
msgstr "Puissance"
3233+
3234+
#. Context: DieselEngine
3235+
msgctxt "DieselEngine"
3236+
msgid "Running"
3237+
msgstr "En marche"
3238+
3239+
#. Context: DieselEngine
3240+
msgctxt "DieselEngine"
3241+
msgid "Stopped"
3242+
msgstr "Arrêté"

Source/Locales/RunActivity/hu.po

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4983,3 +4983,28 @@ msgstr "csatl."
49834983

49844984
#~ msgid "Coupler overloaded"
49854985
#~ msgstr "Vonókészülék túlterhelve"
4986+
4987+
#. Context: DieselEngine
4988+
msgctxt "DieselEngine"
4989+
msgid "Engine"
4990+
msgstr "Gép"
4991+
4992+
#. Context: PowerSupply
4993+
msgctxt "PowerSupply"
4994+
msgid "On"
4995+
msgstr "Van"
4996+
4997+
#. Context: PowerSupply
4998+
msgctxt "PowerSupply"
4999+
msgid "Power"
5000+
msgstr "Feszültség"
5001+
5002+
#. Context: DieselEngine
5003+
msgctxt "DieselEngine"
5004+
msgid "Running"
5005+
msgstr "Üzemben"
5006+
5007+
#. Context: DieselEngine
5008+
msgctxt "DieselEngine"
5009+
msgid "Stopped"
5010+
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
@@ -1496,3 +1496,23 @@ msgstr "O furo está quebrado, não é possível reabastecer"
14961496
#: ../../RunActivity/Viewer3D/RollingStock/MSTSSteamLocomotiveViewer.cs:230
14971497
msgid "Scoop broken because activated outside through"
14981498
msgstr "Scoop quebrado porque ativado do lado de fora"
1499+
1500+
#. Context: DieselEngine
1501+
msgctxt "DieselEngine"
1502+
msgid "Engine"
1503+
msgstr "Motor"
1504+
1505+
#. Context: PowerSupply
1506+
msgctxt "PowerSupply"
1507+
msgid "On"
1508+
msgstr "Ligada"
1509+
1510+
#. Context: DieselEngine
1511+
msgctxt "DieselEngine"
1512+
msgid "Running"
1513+
msgstr "Trabalhando"
1514+
1515+
#. Context: DieselEngine
1516+
msgctxt "DieselEngine"
1517+
msgid "Stopped"
1518+
msgstr "Parado"

Source/Locales/RunActivity/ru.po

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3799,3 +3799,28 @@ msgstr "Соединено"
37993799
#~ msgctxt "Coupler"
38003800
#~ msgid "Push"
38013801
#~ msgstr "Растян"
3802+
3803+
#. Context: DieselEngine
3804+
msgctxt "DieselEngine"
3805+
msgid "Engine"
3806+
msgstr "ДВС"
3807+
3808+
#. Context: PowerSupply
3809+
msgctxt "PowerSupply"
3810+
msgid "Power"
3811+
msgstr "Напряж"
3812+
3813+
#. Context: PowerSupply
3814+
msgctxt "PowerSupply"
3815+
msgid "On"
3816+
msgstr "Вкл"
3817+
3818+
#. Context: DieselEngine
3819+
msgctxt "DieselEngine"
3820+
msgid "Running"
3821+
msgstr "Работает"
3822+
3823+
#. Context: DieselEngine
3824+
msgctxt "DieselEngine"
3825+
msgid "Stopped"
3826+
msgstr "Заглушен"

Source/Locales/RunActivity/zh-CN.po

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2826,3 +2826,28 @@ msgstr[1] "{0}米"
28262826

28272827
#~ msgid "successfully"
28282828
#~ msgstr "成功"
2829+
2830+
#. Context: DieselEngine
2831+
msgctxt "DieselEngine"
2832+
msgid "Engine"
2833+
msgstr "柴油机"
2834+
2835+
#. Context: PowerSupply
2836+
msgctxt "PowerSupply"
2837+
msgid "On"
2838+
msgstr "打开"
2839+
2840+
#. Context: PowerSupply
2841+
msgctxt "PowerSupply"
2842+
msgid "Power"
2843+
msgstr "电力"
2844+
2845+
#. Context: DieselEngine
2846+
msgctxt "DieselEngine"
2847+
msgid "Running"
2848+
msgstr "运行"
2849+
2850+
#. Context: DieselEngine
2851+
msgctxt "DieselEngine"
2852+
msgid "Stopped"
2853+
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
@@ -1029,12 +1029,12 @@ public Texture2D LocomotiveStatus(int CarPosition)
10291029
string[] parts = data.Split(new string[] { " = " }, 2, StringSplitOptions.None);
10301030
string keyPart = parts[0];
10311031
string valuePart = parts?[1];
1032-
if (keyPart.Contains(Viewer.Catalog.GetString("Engine")))
1032+
if (Viewer.PlayerTrain.Cars[CarPosition] is MSTSDieselLocomotive && keyPart.Contains(Viewer.Catalog.GetParticularString("DieselEngine", "Engine")))
10331033
{
10341034
TrainCarOperations.PowerSupplyStatus = locomotiveStatus;
10351035

1036-
Texture = valuePart.Contains(Viewer.Catalog.GetString("Running")) ? PowerOn
1037-
: valuePart.Contains(Viewer.Catalog.GetString("Stopped")) ? PowerOff
1036+
Texture = valuePart.Contains(Viewer.Catalog.GetParticularString("DieselEngine", "Running")) ? PowerOn
1037+
: valuePart.Contains(Viewer.Catalog.GetParticularString("DieselEngine", "Stopped")) ? PowerOff
10381038
: PowerChanging;
10391039

10401040
if (CarPosition == TrainCarViewer.CarPosition)
@@ -1043,10 +1043,10 @@ public Texture2D LocomotiveStatus(int CarPosition)
10431043
}
10441044
break;
10451045
}
1046-
else if (keyPart.Contains(Viewer.Catalog.GetString("Power")))
1046+
else if (keyPart.Contains(Viewer.Catalog.GetParticularString("PowerSupply", "Power")))
10471047
{
10481048
TrainCarViewer.PowerSupplyStatus = locomotiveStatus;
1049-
var powerStatus = valuePart.Contains(Viewer.Catalog.GetString("On"));
1049+
var powerStatus = valuePart.Contains(Viewer.Catalog.GetParticularString("PowerSupply", "On"));
10501050
Texture = powerStatus ? PowerOn : PowerOff;
10511051
if (CarPosition == TrainCarViewer.CarPosition)
10521052
TrainCarOperations.SupplyStatusChanged = TrainCarOperations.MainPowerSupplyOn != powerStatus;

0 commit comments

Comments
 (0)