Skip to content

Commit a3856f3

Browse files
committed
Translation fixes, add more strings to English translation reference
1 parent 7a73ce5 commit a3856f3

File tree

11 files changed

+341
-30
lines changed

11 files changed

+341
-30
lines changed

src/TSMapEditor/Config/Translations/en/Translation_en.ini

Lines changed: 301 additions & 1 deletion
Large diffs are not rendered by default.

src/TSMapEditor/Misc/NamedColors.cs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,21 @@ public static class NamedColors
66
{
77
public static NamedColor[] GenericSupportedNamedColors = new NamedColor[]
88
{
9-
new NamedColor(Translate("NamedColors.Teal", "Teal"), new Color(0, 196, 196)),
10-
new NamedColor(Translate("NamedColors.Green", "Green"), new Color(0, 255, 0)),
11-
new NamedColor(Translate("NamedColors.Dark Green", "Dark Green"), Color.Green),
12-
new NamedColor(Translate("NamedColors.Lime Green", "Lime Green"), Color.LimeGreen),
13-
new NamedColor(Translate("NamedColors.Yellow", "Yellow"), Color.Yellow),
14-
new NamedColor(Translate("NamedColors.Orange", "Orange"), Color.Orange),
15-
new NamedColor(Translate("NamedColors.Red", "Red"), Color.Red),
16-
new NamedColor(Translate("NamedColors.BloodRed", "Blood Red"), Color.DarkRed),
17-
new NamedColor(Translate("NamedColors.Pink", "Pink"), Color.HotPink),
18-
new NamedColor(Translate("NamedColors.Cherry", "Cherry"), Color.Pink),
19-
new NamedColor(Translate("NamedColors.Purple", "Purple"), Color.MediumPurple),
20-
new NamedColor(Translate("NamedColors.SkyBlue", "Sky Blue"), Color.SkyBlue),
21-
new NamedColor(Translate("NamedColors.Blue", "Blue"), new Color(40, 40, 255)),
22-
new NamedColor(Translate("NamedColors.Brown", "Brown"), Color.Brown),
23-
new NamedColor(Translate("NamedColors.Metalic", "Metalic"), new Color(160, 160, 200)),
9+
new NamedColor("Teal", new Color(0, 196, 196)),
10+
new NamedColor("Green", new Color(0, 255, 0)),
11+
new NamedColor("Dark Green", Color.Green),
12+
new NamedColor("Lime Green", Color.LimeGreen),
13+
new NamedColor("Yellow", Color.Yellow),
14+
new NamedColor("Orange", Color.Orange),
15+
new NamedColor("Red", Color.Red),
16+
new NamedColor("Blood Red", Color.DarkRed),
17+
new NamedColor("Pink", Color.HotPink),
18+
new NamedColor("Cherry", Color.Pink),
19+
new NamedColor("Purple", Color.MediumPurple),
20+
new NamedColor("Sky Blue", Color.SkyBlue),
21+
new NamedColor("Blue", new Color(40, 40, 255)),
22+
new NamedColor("Brown", Color.Brown),
23+
new NamedColor("Metalic", new Color(160, 160, 200)),
2424
};
2525
}
2626

src/TSMapEditor/Misc/Translator.cs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,19 @@ public string TranslateObject(string iniName)
136136

137137
public void DumpMissingValues()
138138
{
139-
string path = Path.Combine(Environment.CurrentDirectory, "MissingTranslationValues.ini");
140-
File.Delete(path);
139+
if (MissingValues.Count <= 0)
140+
{
141+
Logger.Log("No missing translation values detected.");
142+
return;
143+
}
144+
145+
string path = Path.Combine(Environment.CurrentDirectory, Constants.UserDataFolder, "MissingTranslationValues.ini");
146+
147+
if (!Directory.Exists(Path.GetDirectoryName(path)))
148+
Directory.CreateDirectory(Path.GetDirectoryName(path));
149+
else
150+
File.Delete(path);
151+
141152
var iniFile = new IniFile(path);
142153

143154
foreach (var kvp in MissingValues)

src/TSMapEditor/UI/Controls/FileBrowserListBox.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ private void ListFiles()
115115
return;
116116
}
117117

118-
AddItem(new XNAListBoxItem(Translate(this, "'ListFiles.DirectoryUp",".. <Directory Up>"), Color.Gray) { Tag = new object() });
118+
AddItem(new XNAListBoxItem(Translate(this, "ListFiles.DirectoryUp",".. <Directory Up>"), Color.Gray) { Tag = new object() });
119119

120120
var directories = Directory.GetDirectories(DirectoryPath);
121121
foreach (string dir in directories)

src/TSMapEditor/UI/KeyboardCommands.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,11 @@ public void ClearCommandSubscriptions()
117117
public KeyboardCommand PreviousTileSet { get; } = new KeyboardCommand("PreviousTileSet", Translate("KeyboardCommands.SelectPreviousTileSet", "Select Previous TileSet"), new KeyboardCommandInput(Keys.H, KeyboardModifiers.None));
118118
public KeyboardCommand NextSidebarNode { get; } = new KeyboardCommand("NextSidebarNode", Translate("KeyboardCommands.SelectNextSidebarNode", "Select Next Sidebar Node"), new KeyboardCommandInput(Keys.P, KeyboardModifiers.None));
119119
public KeyboardCommand PreviousSidebarNode { get; } = new KeyboardCommand("PreviousSidebarNode", Translate("KeyboardCommands.SelectPreviousSidebarNode", "Select Previous Sidebar Node"), new KeyboardCommandInput(Keys.O, KeyboardModifiers.None));
120-
public KeyboardCommand FrameworkMode { get; } = new KeyboardCommand("MarbleMadness", Translate("KeyboardCommands.ToggleMarbleMadnessMode", "MarbleMadness", "Framework Mode (Marble Madness)"), new KeyboardCommandInput(Keys.F, KeyboardModifiers.Shift));
120+
public KeyboardCommand FrameworkMode { get; } = new KeyboardCommand("MarbleMadness", Translate("KeyboardCommands.MarbleMadness", "Framework Mode (Marble Madness)"), new KeyboardCommandInput(Keys.F, KeyboardModifiers.Shift));
121121
public KeyboardCommand NextBrushSize { get; } = new KeyboardCommand("NextBrushSize", Translate("KeyboardCommands.NextBrushSize", "Next Brush Size"), new KeyboardCommandInput(Keys.OemPlus, KeyboardModifiers.None));
122122
public KeyboardCommand PreviousBrushSize { get; } = new KeyboardCommand("PreviousBrushSize", Translate("KeyboardCommands.PreviousBrushSize", "Previous Brush Size"), new KeyboardCommandInput(Keys.D0, KeyboardModifiers.None));
123123
public KeyboardCommand DeleteObject { get; } = new KeyboardCommand("DeleteObject", Translate("KeyboardCommands.DeleteObject", "Delete Object"), new KeyboardCommandInput(Keys.Delete, KeyboardModifiers.None));
124-
public KeyboardCommand ToggleAutoLAT { get; } = new KeyboardCommand("ToggleAutoLAT", Translate("KeyboardCommands.Toggle AutoLAT", "Toggle AutoLAT"), new KeyboardCommandInput(Keys.L, KeyboardModifiers.Ctrl));
124+
public KeyboardCommand ToggleAutoLAT { get; } = new KeyboardCommand("ToggleAutoLAT", Translate("KeyboardCommands.ToggleAutoLAT", "Toggle AutoLAT"), new KeyboardCommandInput(Keys.L, KeyboardModifiers.Ctrl));
125125
public KeyboardCommand ToggleMapWideOverlay { get; } = new KeyboardCommand("ToggleMapWideOverlay", Translate("KeyboardCommands.ToggleMapWideOverlay", "Toggle Map-Wide Overlay"), new KeyboardCommandInput(Keys.F2, KeyboardModifiers.None));
126126
public KeyboardCommand Toggle2DMode { get; } = new KeyboardCommand("Toggle2DMode", Translate("KeyboardCommands.Toggle2DMode", "Toggle 2D Mode"), new KeyboardCommandInput(Keys.D, KeyboardModifiers.Shift));
127127
public KeyboardCommand ZoomIn { get; } = new KeyboardCommand("ZoomIn", Translate("KeyboardCommands.ZoomIn", "Zoom In"), new KeyboardCommandInput(Keys.OemPlus, KeyboardModifiers.Ctrl));

src/TSMapEditor/UI/Windows/ApplyINICodeWindow.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ private void ApplyCode()
7070
if (stagingINI == null)
7171
throw new InvalidOperationException("Staging INI is null!");
7272

73-
string successMessage = Translate(this, "Success", "INI code successfully added to map.");
73+
string successMessage = Translate(this, "CodeApplied.DefaultSuccessMessage", "INI code successfully added to map.");
7474
successMessage = stagingINI.GetStringValue(EditorSection, "Success", successMessage);
7575
successMessage = Renderer.FixText(successMessage, Constants.UIDefaultFont, Width).Text;
7676

@@ -79,7 +79,7 @@ private void ApplyCode()
7979
IniFile.ConsolidateIniFiles(map.LoadedINI, stagingINI);
8080

8181
EditorMessageBox.Show(WindowManager,
82-
Translate(this, "CodeApplied", "Code Applied"),
82+
Translate(this, "CodeApplied.Title", "Code Applied"),
8383
successMessage,
8484
MessageBoxButtons.OK);
8585
}
@@ -94,8 +94,8 @@ public void Open()
9494
{
9595
Logger.Log("Map INI code directory not found!");
9696
EditorMessageBox.Show(WindowManager,
97-
Translate(this, "Error", "Error"),
98-
string.Format(Translate(this, "DirectoryNotFound",
97+
Translate(this, "DirectoryNotFound.Title", "Error"),
98+
string.Format(Translate(this, "DirectoryNotFound.Description",
9999
"Map INI code directory not found!" + Environment.NewLine + Environment.NewLine + "Expected path: {0}"), directoryPath),
100100
MessageBoxButtons.OK);
101101
return;

src/TSMapEditor/UI/Windows/CreateRandomTriggerSetWindow.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public override void Initialize()
5555
ddColor.AddItem(Translate(this, "None", "None"));
5656
Array.ForEach(Trigger.SupportedColors, sc =>
5757
{
58-
ddColor.AddItem(sc.Name, sc.Value);
58+
ddColor.AddItem(Translate("NamedColors." + sc.Name, sc.Name), sc.Value);
5959
});
6060

6161
btnApply.LeftClick += BtnApply_LeftClick;

src/TSMapEditor/UI/Windows/PlaceWaypointWindow.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public override void Initialize()
4545
// Init color dropdown options
4646
ddWaypointColor = FindChild<XNADropDown>(nameof(ddWaypointColor));
4747
ddWaypointColor.AddItem(Translate(this, "None", "None"));
48-
Array.ForEach(Waypoint.SupportedColors, sc => ddWaypointColor.AddItem(sc.Name, sc.Value));
48+
Array.ForEach(Waypoint.SupportedColors, sc => ddWaypointColor.AddItem(Translate("NamedColors." + sc.Name, sc.Name), sc.Value));
4949
}
5050

5151
private void BtnPlace_LeftClick(object sender, EventArgs e)

src/TSMapEditor/UI/Windows/ScriptsWindow.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public override void Initialize()
102102
ddScriptColor.AddItem(Translate(this, "None", "None"));
103103
Array.ForEach(Script.SupportedColors, supportedColor =>
104104
{
105-
ddScriptColor.AddItem(supportedColor.Name, supportedColor.Value);
105+
ddScriptColor.AddItem(Translate("NamedColors." + supportedColor.Name, supportedColor.Name), supportedColor.Value);
106106
});
107107

108108
tbFilter.TextChanged += TbFilter_TextChanged;

src/TSMapEditor/UI/Windows/TeamTypesWindow.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public override void Initialize()
114114
ddTeamTypeColor.AddItem(Translate(this, "HouseColor", "House Color"));
115115
foreach (var supportedColor in TeamType.SupportedColors)
116116
{
117-
ddTeamTypeColor.AddItem(supportedColor.Name, supportedColor.Value);
117+
ddTeamTypeColor.AddItem(Translate("NamedColors." + supportedColor.Name, supportedColor.Name), supportedColor.Value);
118118
}
119119
ddTeamTypeColor.SelectedIndexChanged += DdTeamTypeColor_SelectedIndexChanged;
120120

0 commit comments

Comments
 (0)