Skip to content

Commit 54c4e16

Browse files
committed
Fix TrainDrivingInfo, some texts are misaligned.
1 parent 36608e2 commit 54c4e16

File tree

10 files changed

+118
-31
lines changed

10 files changed

+118
-31
lines changed

Source/Locales/Orts.Simulation/ru.po

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ msgid ""
22
msgstr ""
33
"Project-Id-Version: \n"
44
"POT-Creation-Date: 2023-12-16 11:02:51+0300\n"
5-
"PO-Revision-Date: 2023-12-16 12:09+0300\n"
5+
"PO-Revision-Date: 2024-10-07 18:28+0200\n"
66
"Last-Translator: \n"
77
"Language-Team: \n"
88
"Language: ru\n"
99
"MIME-Version: 1.0\n"
1010
"Content-Type: text/plain; charset=UTF-8\n"
1111
"Content-Transfer-Encoding: 8bit\n"
12-
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
13-
"n%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);\n"
14-
"X-Generator: Poedit 3.2.2\n"
12+
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
13+
"%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);\n"
14+
"X-Generator: Poedit 3.1.1\n"
1515

1616
#: ../../Orts.Simulation/Common/Scripting/BrakeController.cs:379
1717
#: ../../Orts.Simulation/Simulation/RollingStocks/SubSystems/Brakes/MSTS/AirSinglePipe.cs:110
@@ -2868,7 +2868,7 @@ msgstr "Ручной тормоз"
28682868
#: ../../Orts.Simulation/Simulation/RollingStocks/SubSystems/Brakes/MSTS/SingleTransferPipe.cs:88
28692869
#: ../../Orts.Simulation/Simulation/RollingStocks/SubSystems/Brakes/MSTS/VacuumSinglePipe.cs:130
28702870
msgid "V"
2871-
msgstr ""
2871+
msgstr "Bak."
28722872

28732873
#: ../../Orts.Simulation/Simulation/RollingStocks/SubSystems/Brakes/MSTS/VacuumSinglePipe.cs:134
28742874
msgid "Lead BP"

Source/Locales/RunActivity/cs.po

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3217,3 +3217,13 @@ msgstr "Naběrač vody je poškozen, nelze ji doplnit"
32173217
#~ msgctxt "Labels"
32183218
#~ msgid "none"
32193219
#~ msgstr "není"
3220+
3221+
#. Context: BrakeStatus
3222+
msgctxt "BrakeStatus"
3223+
msgid "EOT"
3224+
msgstr ""
3225+
3226+
#. Context: BrakeStatus
3227+
msgctxt "BrakeStatus"
3228+
msgid "Flow"
3229+
msgstr "Spotř."

Source/Locales/RunActivity/da.po

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2886,3 +2886,13 @@ msgstr[1] "{0} meter"
28862886
#~ msgctxt "Labels"
28872887
#~ msgid "none"
28882888
#~ msgstr "ingen"
2889+
2890+
#. Context: BrakeStatus
2891+
msgctxt "BrakeStatus"
2892+
msgid "EOT"
2893+
msgstr ""
2894+
2895+
#. Context: BrakeStatus
2896+
msgctxt "BrakeStatus"
2897+
msgid "Flow"
2898+
msgstr ""

Source/Locales/RunActivity/de.po

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4108,3 +4108,13 @@ msgstr ""
41084108
#~ msgctxt "Switch"
41094109
#~ msgid "change"
41104110
#~ msgstr "stellen"
4111+
4112+
#. Context: BrakeStatus
4113+
msgctxt "BrakeStatus"
4114+
msgid "EOT"
4115+
msgstr ""
4116+
4117+
#. Context: BrakeStatus
4118+
msgctxt "BrakeStatus"
4119+
msgid "Flow"
4120+
msgstr "Fluss"

Source/Locales/RunActivity/fr.po

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3215,3 +3215,13 @@ msgstr "Dist"
32153215
#, csharp-format
32163216
#~ msgid "filtered by {0:F0}"
32173217
#~ msgstr "filtré par {0:F0}"
3218+
3219+
#. Context: BrakeStatus
3220+
msgctxt "BrakeStatus"
3221+
msgid "EOT"
3222+
msgstr ""
3223+
3224+
#. Context: BrakeStatus
3225+
msgctxt "BrakeStatus"
3226+
msgid "Flow"
3227+
msgstr "Débit"

Source/Locales/RunActivity/hu.po

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

49844984
#~ msgid "Coupler overloaded"
49854985
#~ msgstr "Vonókészülék túlterhelve"
4986+
4987+
#. Context: BrakeStatus
4988+
msgctxt "BrakeStatus"
4989+
msgid "EOT"
4990+
msgstr ""
4991+
4992+
#. Context: BrakeStatus
4993+
msgctxt "BrakeStatus"
4994+
msgid "Flow"
4995+
msgstr "Fogyaszt."

Source/Locales/RunActivity/pt-BR.po

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1496,3 +1496,13 @@ 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: BrakeStatus
1501+
msgctxt "BrakeStatus"
1502+
msgid "EOT"
1503+
msgstr ""
1504+
1505+
#. Context: BrakeStatus
1506+
msgctxt "BrakeStatus"
1507+
msgid "Flow"
1508+
msgstr "Fluxo"

Source/Locales/RunActivity/ru.po

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3799,3 +3799,18 @@ msgstr "Соединено"
37993799
#~ msgctxt "Coupler"
38003800
#~ msgid "Push"
38013801
#~ msgstr "Растян"
3802+
3803+
#. Context: BrakeStatus
3804+
msgctxt "BrakeStatus"
3805+
msgid "EOT"
3806+
msgstr "ХВ"
3807+
3808+
#. Context: BrakeStatus
3809+
msgctxt "BrakeStatus"
3810+
msgid "Flow"
3811+
msgstr "Расх"
3812+
3813+
#. Context: BrakeStatus
3814+
msgctxt "BrakeStatus"
3815+
msgid "V"
3816+
msgstr "Bak."

Source/Locales/RunActivity/zh-CN.po

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

28272827
#~ msgid "successfully"
28282828
#~ msgstr "成功"
2829+
2830+
#. Context: BrakeStatus
2831+
msgctxt "BrakeStatus"
2832+
msgid "EOT"
2833+
msgstr ""
2834+
2835+
#. Context: BrakeStatus
2836+
msgctxt "BrakeStatus"
2837+
msgid "Flow"
2838+
msgstr "流动"

Source/RunActivity/Viewer3D/Popups/TrainDrivingWindow.cs

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public struct ListLabel
5353
{
5454
Viewer.Catalog.GetString("BP"),
5555
Viewer.Catalog.GetString("EQ"),
56-
Viewer.Catalog.GetString("V")
56+
Viewer.Catalog.GetParticularString("BrakeStatus","V")
5757
};
5858

5959
/// <summary>
@@ -298,15 +298,17 @@ protected override ControlLayout Layout(ControlLayout layout)
298298
var vbox = base.Layout(layout).AddLayoutVertical();
299299
if (labels.Count > 0)
300300
{
301-
var colWidth = labels.Max(x => x.FirstColWidth) + (normalTextMode? 15: 20);
301+
var colWidth = labels.Max(x => x.FirstColWidth) + (normalTextMode ? 15 : 20);
302302
var TimeHboxPositionY = 0;
303303

304304
// search wider
305305
var tokenOffset = 0;
306306
var tokenWidth = 0;
307307
foreach (var data in tokens.Where((string d) => !string.IsNullOrWhiteSpace(d)))
308308
{
309-
tokenWidth = Owner.TextFontDefault.MeasureString(data);
309+
// Allows alignment of columns
310+
var dataFormated = data.Length > 3 ? data.Substring(0, 3) : data;
311+
tokenWidth = Owner.TextFontDefault.MeasureString(dataFormated);
310312
tokenOffset = tokenWidth > tokenOffset ? tokenWidth : tokenOffset;
311313
}
312314

@@ -536,7 +538,7 @@ private void UpdateColsWidth(ListLabel label, bool normalmode)
536538
{
537539
var tempFirstCol = firstCol.Substring(0, firstCol.Length - 3);
538540
firstColWidth = FontToBold ? Owner.TextFontDefaultBold.MeasureString(tempFirstCol.TrimEnd())
539-
: !normalTextMode? Owner.TextFontMonoSpacedBold.MeasureString(tempFirstCol.TrimEnd())
541+
: !normalTextMode ? Owner.TextFontMonoSpacedBold.MeasureString(tempFirstCol.TrimEnd())
540542
: Owner.TextFontDefault.MeasureString(tempFirstCol.TrimEnd());
541543
}
542544
else
@@ -791,7 +793,7 @@ void AddSeparator() => AddLabel(new ListLabel
791793
// Booster engine label
792794
if (locomotive is MSTSSteamLocomotive steamLocomotive4)
793795
{
794-
string boosterEngineIndicator = "", boosterEngineKey="";
796+
string boosterEngineIndicator = "", boosterEngineKey = "";
795797
if (BoosterLocked)
796798
{
797799
boosterLabelVisible = true;
@@ -882,8 +884,8 @@ void AddSeparator() => AddLabel(new ListLabel
882884
});
883885

884886
index = trainBrakeStatus.IndexOf(Viewer.Catalog.GetString("EQ"));
885-
if (trainBrakeStatus.IndexOf(Viewer.Catalog.GetString("V"), index) > 0)
886-
brakeInfoValue = trainBrakeStatus.Substring(index, trainBrakeStatus.IndexOf(Viewer.Catalog.GetString("V"), index) - index).TrimEnd();
887+
if (trainBrakeStatus.IndexOf(Viewer.Catalog.GetParticularString("BrakeStatus", "V"), index) > 0)
888+
brakeInfoValue = trainBrakeStatus.Substring(index, trainBrakeStatus.IndexOf(Viewer.Catalog.GetParticularString("BrakeStatus", "V"), index) - index).TrimEnd();
887889
else
888890
brakeInfoValue = trainBrakeStatus.Substring(index, trainBrakeStatus.IndexOf(Viewer.Catalog.GetString("BC")) - index).TrimEnd();
889891

@@ -893,21 +895,21 @@ void AddSeparator() => AddLabel(new ListLabel
893895
});
894896

895897
int endIndex;
896-
if (trainBrakeStatus.Contains(Viewer.Catalog.GetString("Flow")))
898+
if (trainBrakeStatus.Contains(Viewer.Catalog.GetParticularString("BrakeStatus", "Flow")))
897899
{
898-
endIndex = trainBrakeStatus.IndexOf(Viewer.Catalog.GetString("Flow"));
900+
endIndex = trainBrakeStatus.IndexOf(Viewer.Catalog.GetParticularString("BrakeStatus", "Flow"));
899901
}
900-
else if (trainBrakeStatus.Contains(Viewer.Catalog.GetString("EOT")))
902+
else if (trainBrakeStatus.Contains(Viewer.Catalog.GetParticularString("BrakeStatus", "EOT")))
901903
{
902-
endIndex = trainBrakeStatus.IndexOf(Viewer.Catalog.GetString("EOT"));
904+
endIndex = trainBrakeStatus.IndexOf(Viewer.Catalog.GetParticularString("BrakeStatus", "EOT"));
903905
}
904906
else
905907
{
906908
endIndex = trainBrakeStatus.Length;
907909
}
908910

909-
if (trainBrakeStatus.IndexOf(Viewer.Catalog.GetString("V"), index) > 0)
910-
index = trainBrakeStatus.IndexOf(Viewer.Catalog.GetString("V"), index);
911+
if (trainBrakeStatus.IndexOf(Viewer.Catalog.GetParticularString("BrakeStatus", "V"), index) > 0)
912+
index = trainBrakeStatus.IndexOf(Viewer.Catalog.GetParticularString("BrakeStatus", "V"), index);
911913
else
912914
index = trainBrakeStatus.IndexOf(Viewer.Catalog.GetString("BC"));
913915

@@ -916,13 +918,13 @@ void AddSeparator() => AddLabel(new ListLabel
916918
{
917919
LastCol = brakeInfoValue,
918920
});
919-
920-
if (trainBrakeStatus.Contains(Viewer.Catalog.GetString("Flow")))
921+
922+
if (trainBrakeStatus.Contains(Viewer.Catalog.GetParticularString("BrakeStatus", "Flow")))
921923
{
922924
index = endIndex;
923925

924-
if (trainBrakeStatus.Contains(Viewer.Catalog.GetString("EOT")))
925-
endIndex = trainBrakeStatus.IndexOf(Viewer.Catalog.GetString("EOT"));
926+
if (trainBrakeStatus.Contains(Viewer.Catalog.GetParticularString("BrakeStatus", "EOT")))
927+
endIndex = trainBrakeStatus.IndexOf(Viewer.Catalog.GetParticularString("BrakeStatus", "EOT"));
926928
else
927929
endIndex = trainBrakeStatus.Length;
928930

@@ -933,11 +935,11 @@ void AddSeparator() => AddLabel(new ListLabel
933935
});
934936
}
935937

936-
if (trainBrakeStatus.Contains(Viewer.Catalog.GetString("EOT")))
938+
if (trainBrakeStatus.Contains(Viewer.Catalog.GetParticularString("BrakeStatus", "EOT")))
937939
{
938-
int indexOffset = Viewer.Catalog.GetString("EOT").Length + 1;
940+
int indexOffset = Viewer.Catalog.GetParticularString("BrakeStatus", "EOT").Length + 1;
939941

940-
index = trainBrakeStatus.IndexOf(Viewer.Catalog.GetString("EOT")) + indexOffset;
942+
index = trainBrakeStatus.IndexOf(Viewer.Catalog.GetParticularString("BrakeStatus", "EOT")) + indexOffset;
941943
brakeInfoValue = trainBrakeStatus.Substring(index, trainBrakeStatus.Length - index).TrimStart();
942944
AddLabel(new ListLabel
943945
{
@@ -956,15 +958,15 @@ void AddSeparator() => AddLabel(new ListLabel
956958
});
957959

958960
index = trainBrakeStatus.IndexOf(Viewer.Catalog.GetString("Lead")) + indexOffset;
959-
if (trainBrakeStatus.Contains(Viewer.Catalog.GetString("EOT")))
961+
if (trainBrakeStatus.Contains(Viewer.Catalog.GetParticularString("BrakeStatus", "EOT")))
960962
{
961-
brakeInfoValue = trainBrakeStatus.Substring(index, trainBrakeStatus.IndexOf(Viewer.Catalog.GetString("EOT")) - index).TrimEnd();
963+
brakeInfoValue = trainBrakeStatus.Substring(index, trainBrakeStatus.IndexOf(Viewer.Catalog.GetParticularString("BrakeStatus", "EOT")) - index).TrimEnd();
962964
AddLabel(new ListLabel
963965
{
964966
LastCol = brakeInfoValue,
965967
});
966968

967-
index = trainBrakeStatus.IndexOf(Viewer.Catalog.GetString("EOT")) + indexOffset;
969+
index = trainBrakeStatus.IndexOf(Viewer.Catalog.GetParticularString("BrakeStatus", "EOT")) + indexOffset;
968970
brakeInfoValue = trainBrakeStatus.Substring(index, trainBrakeStatus.Length - index).TrimEnd();
969971
AddLabel(new ListLabel
970972
{
@@ -1292,7 +1294,7 @@ void AddSeparator() => AddLabel(new ListLabel
12921294
boosterIdleValveKey = Symbols.ArrowToRight + ColorCode[Color.Yellow];
12931295
}
12941296
// When shut off the booster system and the air open valve is closed, we set the idle valve from the run position to idle.
1295-
if (steamLocomotive6.SteamBoosterIdle && !steamLocomotive6.SteamBoosterAirOpen )
1297+
if (steamLocomotive6.SteamBoosterIdle && !steamLocomotive6.SteamBoosterAirOpen)
12961298
{
12971299
steamLocomotive6.ToggleSteamBoosterIdle();// set to idle
12981300
boosterIdleValveIndicator = Viewer.Catalog.GetString("Idle") + ColorCode[Color.White];
@@ -1326,7 +1328,7 @@ void AddSeparator() => AddLabel(new ListLabel
13261328
KeyPressed = boosterLatchOnKey,
13271329
SymbolCol = ""
13281330
});
1329-
AddSeparator();
1331+
AddSeparator();
13301332
}
13311333
}
13321334

@@ -1363,7 +1365,7 @@ void AddSeparator() => AddLabel(new ListLabel
13631365
{
13641366
AddLabel(new ListLabel
13651367
{
1366-
FirstCol = Viewer.Catalog.GetString("EOT"),
1368+
FirstCol = Viewer.Catalog.GetParticularString("BrakeStatus", "EOT"),
13671369
LastCol = $"{locomotive.Train.EOT?.EOTState.ToString()}"
13681370
});
13691371
AddSeparator();

0 commit comments

Comments
 (0)