Skip to content

Commit 05dbda2

Browse files
JoyfulShushKuroNoSeiHaiKuronoseihaiRampastring
authored
Add translations for all remaining strings in WAE
Co-authored-by: KuroNoSeiHai <[email protected]> Co-authored-by: Kuronoseihai <[email protected]> Co-authored-by: Rami Pasanen <[email protected]>
1 parent b7e7d82 commit 05dbda2

File tree

108 files changed

+1019
-563
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+1019
-563
lines changed

src/TSMapEditor/CCEngine/BuildingWithPropertyType.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ public static string ToDescription(this BuildingWithPropertyType value)
1515
{
1616
return value switch
1717
{
18-
BuildingWithPropertyType.LeastThreat => "Least threat",
19-
BuildingWithPropertyType.HighestThreat => "Highest threat",
20-
BuildingWithPropertyType.Nearest => "Nearest",
21-
BuildingWithPropertyType.Farthest => "Farthest",
18+
BuildingWithPropertyType.LeastThreat => Translate("BuildingWithPropertyTypeExtension.LeastThreat", "Least threat"),
19+
BuildingWithPropertyType.HighestThreat => Translate("BuildingWithPropertyTypeExtension.HighestThreat", "Highest threat"),
20+
BuildingWithPropertyType.Nearest => Translate("BuildingWithPropertyTypeExtension.Nearest", "Nearest"),
21+
BuildingWithPropertyType.Farthest => Translate("BuildingWithPropertyTypeExtension.Farthest", "Farthest"),
2222
_ => string.Empty,
2323
};
2424
}

src/TSMapEditor/CCEngine/ScriptAction.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ public ScriptAction(int id)
3535
}
3636

3737
public int ID { get; set; }
38-
public string Name { get; set; } = "Unknown action";
39-
public string Description { get; set; } = "No description";
40-
public string ParamDescription { get; set; } = "Use 0";
38+
public string Name { get; set; } = Translate("ScriptAction.UnknownAction", "Unknown action");
39+
public string Description { get; set; } = Translate("ScriptAction.NoDescription", "No description");
40+
public string ParamDescription { get; set; } = Translate("ScriptAction.Use0", "Use 0");
4141
public string OptionsSectionName { get; set; } = string.Empty;
4242
public TriggerParamType ParamType { get; set; } = TriggerParamType.Unknown;
4343
public List<ScriptActionPresetOption> PresetOptions { get; } = new List<ScriptActionPresetOption>(0);

src/TSMapEditor/Config/Default/UI/EditorControlsPanel.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ $Height=getBottom(btnPlaceWaypoint) + EMPTY_SPACE_BOTTOM
2323
[lblBrushSize]
2424
$X=EMPTY_SPACE_SIDES
2525
$Y=VERTICAL_SPACING
26-
Text=Brush size:
26+
$Text=translate(Brush size:)
2727

2828
[ddBrushSize]
2929
$X=getRight(lblBrushSize) + (HORIZONTAL_SPACING * 2)
@@ -40,7 +40,7 @@ DrawBorders=no
4040
[chkAutoLAT]
4141
$X=getRight(LATPanel) + EMPTY_SPACE_SIDES
4242
$Y=VERTICAL_SPACING
43-
Text=Auto-LAT
43+
$Text=translate(Auto-LAT)
4444

4545
[chkOnlyPaintOnClearGround]
4646
$X=getX(chkAutoLAT)

src/TSMapEditor/Config/Default/UI/Windows/TeamTypesWindow.ini

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -49,38 +49,38 @@ HasCloseButton=true
4949
[lblDescription]
5050
$X=EMPTY_SPACE_SIDES
5151
$Y=EMPTY_SPACE_TOP
52-
Text=TeamTypes connect a Trigger with a TaskForce and Script and define how the units behave.
52+
$Text=translate(TeamTypes connect a Trigger with a TaskForce and Script and define how the units behave.)
5353

5454
[lblTeamTypes]
5555
$X=EMPTY_SPACE_SIDES
5656
$Y=getBottom(lblDescription) + EMPTY_SPACE_TOP
5757
FontIndex=1
58-
Text=TeamTypes:
58+
$Text=translate(TeamTypes:)
5959

6060
[btnNewTeamType]
6161
$X=getX(lblTeamTypes)
6262
$Y=getBottom(lblTeamTypes) + VERTICAL_SPACING
6363
$Width=200
64-
Text=New
64+
$Text=translate(New)
6565

6666
[btnDeleteTeamType]
6767
$X=getX(lblTeamTypes)
6868
$Y=getBottom(btnNewTeamType) + VERTICAL_SPACING
6969
$Width=getWidth(btnNewTeamType)
70-
Text=Delete
70+
$Text=translate(Delete)
7171

7272
[btnCloneTeamType]
7373
$X=getX(lblTeamTypes)
7474
$Y=getBottom(btnDeleteTeamType) + VERTICAL_SPACING
7575
$Width=getWidth(btnNewTeamType)
76-
Text=Clone
76+
$Text=translate(Clone)
7777

7878
[tbFilter]
7979
$X=getX(lblTeamTypes)
8080
$Y=getBottom(btnCloneTeamType) + VERTICAL_SPACING
8181
$Width=getWidth(btnCloneTeamType) - BUTTON_HEIGHT
8282
$Height=BUTTON_HEIGHT
83-
Suggestion=Search team types...
83+
$Suggestion=translate(Search team types...)
8484

8585
[btnSortOptions]
8686
$X=getRight(tbFilter)
@@ -96,7 +96,7 @@ $Height=getHeight(TeamTypesWindow) - getY(lbTeamTypes) - EMPTY_SPACE_BOTTOM
9696
$X=getRight(btnNewTeamType) + (HORIZONTAL_SPACING * 2)
9797
$Y=getY(lblTeamTypes)
9898
FontIndex=1
99-
Text=Selected TeamType:
99+
$Text=translate(Selected TeamType:)
100100

101101
[tbName]
102102
$X=getX(lblSelectedTeamType) + 100
@@ -106,7 +106,7 @@ $Width=150
106106
[lblName]
107107
$X=getX(lblSelectedTeamType)
108108
$Y=getY(tbName) + 1
109-
Text=Name:
109+
$Text=translate(Name:)
110110

111111
[ddVeteranLevel]
112112
$X=getX(tbName)
@@ -119,7 +119,7 @@ Option2=Elite
119119
[lblVeteranLevel]
120120
$X=getX(lblName)
121121
$Y=getY(ddVeteranLevel) + 1
122-
Text=Veteran Level:
122+
$Text=translate(Veteran Level:)
123123

124124
[ddHouse]
125125
$X=getX(tbName)
@@ -129,7 +129,7 @@ $Y=getBottom(ddVeteranLevel) + VERTICAL_SPACING
129129
[lblHouse]
130130
$X=getX(lblName)
131131
$Y=getY(ddHouse) + 1
132-
Text=House:
132+
$Text=translate(House:)
133133

134134
[tbPriority]
135135
$X=getX(tbName)
@@ -139,7 +139,7 @@ $Y=getBottom(ddHouse) + VERTICAL_SPACING
139139
[lblPriority]
140140
$X=getX(lblName)
141141
$Y=getY(tbPriority) + 1
142-
Text=Priority:
142+
$Text=translate(Priority:)
143143

144144
[tbMax]
145145
$X=getX(tbName)
@@ -149,7 +149,7 @@ $Y=getBottom(tbPriority) + VERTICAL_SPACING
149149
[lblMax]
150150
$X=getX(lblName)
151151
$Y=getY(tbMax) + 1
152-
Text=Max:
152+
$Text=translate(Max:)
153153

154154
[tbTechLevel]
155155
$X=getX(tbName)
@@ -159,7 +159,7 @@ $Y=getBottom(tbMax) + VERTICAL_SPACING
159159
[lblTechLevel]
160160
$X=getX(lblName)
161161
$Y=getY(tbTechLevel) + 1
162-
Text=Tech Level:
162+
$Text=translate(Tech Level:)
163163

164164
[ddMindControlDecision]
165165
$X=getX(tbName)
@@ -176,7 +176,7 @@ Option5=Do Nothing
176176
[lblMindControlDecision]
177177
$X=getX(lblName)
178178
$Y=getY(ddMindControlDecision) + 1
179-
Text=On Mind Control:
179+
$Text=translate(On Mind Control:)
180180
$Enabled=IS_RA2YR
181181

182182
; *************
@@ -191,7 +191,7 @@ $Y=getY(tbName)
191191
[lblTeamTypeColor]
192192
$X=getX(ddTeamTypeColor) - 100
193193
$Y=getY(lblName)
194-
Text=Color:
194+
$Text=translate(Color:)
195195

196196
[tbGroup]
197197
$X=getX(ddTeamTypeColor)
@@ -201,7 +201,7 @@ $Y=getY(ddVeteranLevel)
201201
[lblGroup]
202202
$X=getX(lblTeamTypeColor)
203203
$Y=getY(lblVeteranLevel)
204-
Text=Group:
204+
$Text=translate(Group:)
205205

206206
[tbWaypoint]
207207
$X=getX(ddTeamTypeColor)
@@ -211,7 +211,7 @@ $Y=getY(ddHouse)
211211
[lblWaypoint]
212212
$X=getX(lblTeamTypeColor)
213213
$Y=getY(lblHouse)
214-
Text=Waypoint:
214+
$Text=translate(Waypoint:)
215215

216216
[selTaskForce]
217217
$X=getX(ddTeamTypeColor)
@@ -228,7 +228,7 @@ Text=->
228228
[lblTaskForce]
229229
$X=getX(lblTeamTypeColor)
230230
$Y=getY(lblPriority)
231-
Text=TaskForce:
231+
$Text=translate(TaskForce:)
232232

233233
[selScript]
234234
$X=getX(ddTeamTypeColor)
@@ -245,7 +245,7 @@ Text=->
245245
[lblScript]
246246
$X=getX(lblTeamTypeColor)
247247
$Y=getY(lblMax)
248-
Text=Script:
248+
$Text=translate(Script:)
249249

250250
[selTag]
251251
$X=getX(ddTeamTypeColor)
@@ -262,7 +262,7 @@ Text=->
262262
[lblTag]
263263
$X=getX(lblTeamTypeColor)
264264
$Y=getY(lblTechLevel)
265-
Text=Tag:
265+
$Text=translate(Tag:)
266266

267267
[tbTransportWaypoint]
268268
$X=getX(ddTeamTypeColor)
@@ -273,7 +273,7 @@ $Enabled=IS_RA2YR
273273
[lblTransportWaypoint]
274274
$X=getX(lblTeamTypeColor)
275275
$Y=getY(lblMindControlDecision)
276-
Text=Transport Wpt:
276+
$Text=translate(Transport Wpt:)
277277
$Enabled=IS_RA2YR
278278

279279
; **************

src/TSMapEditor/Config/Scripts/Add Map Reveal Trigger.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
using TSMapEditor.Rendering;
1111
using TSMapEditor.GameMath;
1212
using TSMapEditor.UI.Windows;
13+
using TSMapEditor.Misc;
1314

1415
namespace WAEScript
1516
{
@@ -19,7 +20,7 @@ public class AddMapRevealTrigger
1920
/// Returns the description of this script.
2021
/// All scripts must contain this function.
2122
/// </summary>
22-
public string GetDescription() => "This script will create a new map reveal trigger. Continue?";
23+
public string GetDescription() => Translator.Translate("MapScripts.AddMapRevealTrigger.Description", "This script will create a new map reveal trigger. Continue?");
2324

2425
/// <summary>
2526
/// Returns the message that is presented to the user if running this script succeeded.
@@ -28,14 +29,16 @@ public class AddMapRevealTrigger
2829
public string GetSuccessMessage()
2930
{
3031
if (error == null)
31-
return $"Successfully created a map reveal trigger with name \"{mapRevealTriggerName}\". You can locate it in the Triggers window.";
32+
return string.Format(Translator.Translate("MapScripts.AddMapRevealTrigger.SuccessMessage",
33+
"Successfully created a map reveal trigger with name \"{0}\". You can locate it in the Triggers window."),
34+
mapRevealTriggerName);
3235

3336
return error;
3437
}
3538

3639
private string error;
3740

38-
private const string mapRevealTriggerName = "Map Reveal Trigger";
41+
private string mapRevealTriggerName = Translator.Translate("MapScripts.AddMapRevealTrigger.TriggerName", "Map Reveal Trigger");
3942

4043
/// <summary>
4144
/// The function that actually does the magic.
@@ -62,7 +65,7 @@ public void Perform(Map map)
6265
map.AddTag(new Tag()
6366
{
6467
ID = map.GetNewUniqueInternalId(),
65-
Name = trigger.Name + " (tag)",
68+
Name = trigger.Name + Translator.Translate("MapScripts.AddMapRevealTrigger.Tag", " (tag)"),
6669
Trigger = trigger,
6770
Repeating = 0
6871
});

src/TSMapEditor/Config/Scripts/Apply Animated Water.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
using TSMapEditor.CCEngine;
1111
using TSMapEditor.Rendering;
1212
using TSMapEditor.GameMath;
13+
using TSMapEditor.Misc;
1314

1415
namespace WAEScript
1516
{
@@ -19,7 +20,7 @@ public class ApplyAnimatedWaterScript
1920
/// Returns the description of this script.
2021
/// All scripts must contain this function.
2122
/// </summary>
22-
public string GetDescription() => "This script will replace all water on the map with animated water. Continue?";
23+
public string GetDescription() => Translator.Translate("MapScripts.ApplyAnimatedWater.Description", "This script will replace all water on the map with animated water. Continue?");
2324

2425
/// <summary>
2526
/// Returns the message that is presented to the user if running this script succeeded.
@@ -28,7 +29,7 @@ public class ApplyAnimatedWaterScript
2829
public string GetSuccessMessage()
2930
{
3031
if (error == null)
31-
return "Successfully replaced water with animated water.";
32+
return Translator.Translate("MapScripts.ApplyAnimatedWater.SuccessMessage", "Successfully replaced water with animated water.");
3233

3334
return error;
3435
}
@@ -49,14 +50,14 @@ public void Perform(Map map)
4950
var animatedWaterTileSet = map.TheaterInstance.Theater.FindTileSet(AnimatedWaterTileSetName);
5051
if (animatedWaterTileSet == null)
5152
{
52-
error = "TileSet for animated water not found!";
53+
error = Translator.Translate("MapScripts.ApplyAnimatedWater.Errors.AnimatedWaterTileSetNotFound", "TileSet for animated water not found!");
5354
return;
5455
}
5556

5657
waterTileSet = map.TheaterInstance.Theater.FindTileSet(WaterTileSetName);
5758
if (waterTileSet == null)
5859
{
59-
error = "TileSet for regular (non-animated) water not found!";
60+
error = Translator.Translate("MapScripts.ApplyAnimatedWater.Errors.RegularWaterTileSetNotFound", "TileSet for regular (non-animated) water not found!");
6061
return;
6162
}
6263

src/TSMapEditor/Config/Scripts/Area Guard Mission Assignment Cursor Action.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
using TSMapEditor.Scripts;
1515
using TSMapEditor.UI;
1616
using TSMapEditor.UI.Windows;
17+
using TSMapEditor.Misc;
1718

1819
namespace WAEScript
1920
{
@@ -37,7 +38,7 @@ public AssignMissionCursorAction(ICursorActionTarget cursorActionTarget) : base(
3738
/// </summary>
3839
private string missionName = "Area Guard";
3940

40-
public override string GetName() => $"Apply '{missionName}' Mission To Units";
41+
public override string GetName() => Translator.Translate("MapScripts.AreaGuardMissionCursorAction.Name", "Apply Area Guard Mission To Units");
4142

4243
public override void LeftClick(Point2D cellCoords)
4344
{
@@ -89,7 +90,7 @@ public override void DrawPreview(Point2D cellCoords, Point2D cameraTopLeftPoint)
8990

9091
cellCenterPoint = cellCenterPoint.ScaleBy(CursorActionTarget.Camera.ZoomLevel);
9192

92-
const string text = "Assign Mission";
93+
string text = Translator.Translate("MapScripts.AreaGuardMissionCursorAction.CursorActionText", "Assign Mission");
9394
var textDimensions = Renderer.GetTextDimensions(text, Constants.UIBoldFont);
9495
int x = cellCenterPoint.X - (int)(textDimensions.X / 2);
9596
int y = cellCenterPoint.Y - (int)(textDimensions.Y / 2);

src/TSMapEditor/Config/Scripts/Count Credits On Map.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
using TSMapEditor.CCEngine;
1010
using TSMapEditor.Rendering;
1111
using TSMapEditor.GameMath;
12+
using TSMapEditor.Misc;
1213

1314
namespace WAEScript
1415
{
@@ -18,15 +19,16 @@ public class CountCreditsOnMapScript
1819
/// Returns the description of this script.
1920
/// All scripts must contain this function.
2021
/// </summary>
21-
public string GetDescription() => "This script will count credit value of all Tiberium and ore overlays. Continue?";
22+
public string GetDescription() => Translator.Translate("MapScripts.CountCreditsOnMap.Description", "This script will count credit value of all Tiberium and ore overlays. Continue?");
2223

2324
/// <summary>
2425
/// Returns the message that is presented to the user if running this script succeeded.
2526
/// All scripts must contain this function.
2627
/// </summary>
2728
public string GetSuccessMessage()
2829
{
29-
return $"There are {count} credits' worth of resources present.";
30+
return string.Format(Translator.Translate("MapScripts.CountCreditsOnMap.SuccessMessage",
31+
"There are {0} credits' worth of resources present."), count);
3032
}
3133

3234
int count = 0;

0 commit comments

Comments
 (0)