Skip to content

Commit b039087

Browse files
authored
Merge pull request #1708 from paulvanbrenk/improveLocalization
Improve localization
2 parents 3ec3710 + 7fbc185 commit b039087

16 files changed

+503
-59
lines changed

Nodejs/Product/InteractiveWindow/Repl/Commands/CancelExecutionCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
1+
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
22

33
using System.ComponentModel.Composition;
44
using System.Reflection;
@@ -21,7 +21,7 @@ public Task<ExecutionResult> Execute(IReplWindow window, string arguments)
2121

2222
public string Description
2323
{
24-
get { return "Stops execution of the current command."; }
24+
get { return Resources.CancelDescription; }
2525
}
2626

2727
public string Command

Nodejs/Product/InteractiveWindow/Repl/Commands/ClearScreenReplCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
1+
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
22

33
using System.ComponentModel.Composition;
44
using System.Reflection;
@@ -21,7 +21,7 @@ public Task<ExecutionResult> Execute(IReplWindow window, string arguments)
2121

2222
public string Description
2323
{
24-
get { return "Clears the contents of the REPL editor window"; }
24+
get { return Resources.ClearDescription; }
2525
}
2626

2727
public string Command

Nodejs/Product/InteractiveWindow/Repl/Commands/EchoReplCommand.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
1+
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
22

33
using System.ComponentModel.Composition;
44
using System.Threading.Tasks;
@@ -15,7 +15,7 @@ public Task<ExecutionResult> Execute(IReplWindow window, string arguments)
1515
if (string.IsNullOrWhiteSpace(arguments))
1616
{
1717
var curValue = (bool)window.GetOptionValue(ReplOptions.ShowOutput);
18-
window.WriteLine("ECHO is " + (curValue ? "ON" : "OFF"));
18+
window.WriteLine(string.Format(Resources.EchoState, curValue ? "\'ON\'" : "\'OFF\'"));
1919
return ExecutionResult.Succeeded;
2020
}
2121

@@ -38,7 +38,7 @@ public Task<ExecutionResult> Execute(IReplWindow window, string arguments)
3838

3939
public string Description
4040
{
41-
get { return "Suppress or unsuppress output to the buffer"; }
41+
get { return Resources.EchoDescription; }
4242
}
4343

4444
public string Command

Nodejs/Product/InteractiveWindow/Repl/Commands/ResetReplCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
1+
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
22

33
using System.ComponentModel.Composition;
44
using System.Reflection;
@@ -21,7 +21,7 @@ public Task<ExecutionResult> Execute(IReplWindow window, string arguments)
2121

2222
public string Description
2323
{
24-
get { return "Reset to an empty execution engine, but keep REPL history"; }
24+
get { return Resources.ResetDescription; }
2525
}
2626

2727
public string Command

Nodejs/Product/InteractiveWindow/Repl/Commands/WaitReplCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
1+
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
22

33
using System;
44
using System.ComponentModel.Composition;
@@ -31,7 +31,7 @@ public Task<ExecutionResult> Execute(IReplWindow window, string arguments)
3131

3232
public string Description
3333
{
34-
get { return "Wait for at least the specified number of milliseconds"; }
34+
get { return Resources.WaitDescription; }
3535
}
3636

3737
public string Command

Nodejs/Product/InteractiveWindow/Repl/ReplOutputClassificationFormatDefinitions.cs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
1+
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
22

33
using System.ComponentModel.Composition;
44
using System.Windows.Media;
@@ -23,7 +23,7 @@ internal class InteractiveErrorFormatDefinition : ClassificationFormatDefinition
2323

2424
public InteractiveErrorFormatDefinition()
2525
{
26-
DisplayName = Name;
26+
DisplayName = Resources.ClassificationError;
2727
ForegroundColor = Color.FromRgb(0xee, 00, 00);
2828
}
2929
}
@@ -43,7 +43,7 @@ internal class InteractiveBlackFormatDefinition : ClassificationFormatDefinition
4343

4444
public InteractiveBlackFormatDefinition()
4545
{
46-
DisplayName = Name;
46+
DisplayName = Resources.ClassificationBlack;
4747
ForegroundColor = Colors.Black;
4848
}
4949
}
@@ -63,7 +63,7 @@ internal class InteractiveDarkRedFormatDefinition : ClassificationFormatDefiniti
6363

6464
public InteractiveDarkRedFormatDefinition()
6565
{
66-
DisplayName = Name;
66+
DisplayName = Resources.ClassificationDarkRed;
6767
ForegroundColor = Color.FromRgb(0xd4, 0, 0);
6868
}
6969
}
@@ -83,7 +83,7 @@ internal class InteractiveDarkGreenFormatDefinition : ClassificationFormatDefini
8383

8484
public InteractiveDarkGreenFormatDefinition()
8585
{
86-
DisplayName = Name;
86+
DisplayName = Resources.ClassificationDarkGreen;
8787
ForegroundColor = Color.FromRgb(0x00, 0x8a, 0);
8888
}
8989
}
@@ -103,7 +103,7 @@ internal class InteractiveDarkYellowFormatDefinition : ClassificationFormatDefin
103103

104104
public InteractiveDarkYellowFormatDefinition()
105105
{
106-
DisplayName = Name;
106+
DisplayName = Resources.ClassificationDarkYellow;
107107
ForegroundColor = Color.FromRgb(0x98, 0x70, 0);
108108
}
109109
}
@@ -123,7 +123,7 @@ internal class InteractiveDarkBlueFormatDefinition : ClassificationFormatDefinit
123123

124124
public InteractiveDarkBlueFormatDefinition()
125125
{
126-
DisplayName = Name;
126+
DisplayName = Resources.ClassificationDarkBlue;
127127
ForegroundColor = Color.FromRgb(0x00, 0x57, 0xff);
128128
}
129129
}
@@ -143,7 +143,7 @@ internal class InteractiveDarkMagentaFormatDefinition : ClassificationFormatDefi
143143

144144
public InteractiveDarkMagentaFormatDefinition()
145145
{
146-
DisplayName = Name;
146+
DisplayName = Resources.ClassificationDarkMagenta;
147147
ForegroundColor = Color.FromRgb(0xbb, 0x00, 0xbb);
148148
}
149149
}
@@ -163,7 +163,7 @@ internal class InteractiveDarkCyanFormatDefinition : ClassificationFormatDefinit
163163

164164
public InteractiveDarkCyanFormatDefinition()
165165
{
166-
DisplayName = Name;
166+
DisplayName = Resources.ClassificationDarkCyan;
167167
ForegroundColor = Color.FromRgb(0x00, 0x7f, 0x7f);
168168
}
169169
}
@@ -182,7 +182,7 @@ internal class InteractiveGrayFormatDefinition : ClassificationFormatDefinition
182182
internal static ClassificationTypeDefinition Definition = null; // Set via MEF
183183
public InteractiveGrayFormatDefinition()
184184
{
185-
DisplayName = Name;
185+
DisplayName = Resources.ClassificationGray;
186186
ForegroundColor = Color.FromRgb(0x76, 0x76, 0x76);
187187
}
188188
}
@@ -202,7 +202,7 @@ internal class InteractiveDarkGrayFormatDefinition : ClassificationFormatDefinit
202202

203203
public InteractiveDarkGrayFormatDefinition()
204204
{
205-
DisplayName = Name;
205+
DisplayName = Resources.ClassificationDarkGray;
206206
ForegroundColor = Color.FromRgb(0x69, 0x69, 0x69);
207207
}
208208
}
@@ -222,7 +222,7 @@ internal class InteractiveRedFormatDefinition : ClassificationFormatDefinition
222222

223223
public InteractiveRedFormatDefinition()
224224
{
225-
DisplayName = Name;
225+
DisplayName = Resources.ClassificationRed;
226226
ForegroundColor = Color.FromRgb(0xEE, 0, 0);
227227
}
228228
}
@@ -242,7 +242,7 @@ internal class InteractiveGreenFormatDefinition : ClassificationFormatDefinition
242242

243243
public InteractiveGreenFormatDefinition()
244244
{
245-
DisplayName = Name;
245+
DisplayName = Resources.ClassificationGreen;
246246
ForegroundColor = Color.FromRgb(0x00, 0x80, 0);
247247
}
248248
}
@@ -262,7 +262,7 @@ internal class InteractiveYellowFormatDefinition : ClassificationFormatDefinitio
262262

263263
public InteractiveYellowFormatDefinition()
264264
{
265-
DisplayName = Name;
265+
DisplayName = Resources.ClassificationYellow;
266266
ForegroundColor = Color.FromRgb(0xff, 0xff, 0);
267267
}
268268
}
@@ -283,7 +283,7 @@ internal class InteractiveBlueFormatDefinition : ClassificationFormatDefinition
283283

284284
public InteractiveBlueFormatDefinition()
285285
{
286-
DisplayName = Name;
286+
DisplayName = Resources.ClassificationBlue;
287287
ForegroundColor = Color.FromRgb(0x00, 0x00, 0xff);
288288
}
289289
}
@@ -303,7 +303,7 @@ internal class InteractiveMagentaFormatDefinition : ClassificationFormatDefiniti
303303

304304
public InteractiveMagentaFormatDefinition()
305305
{
306-
DisplayName = Name;
306+
DisplayName = Resources.ClassificationMagenta;
307307
ForegroundColor = Color.FromRgb(0xd1, 0x00, 0xd1);
308308
}
309309
}
@@ -323,7 +323,7 @@ internal class InteractiveCyanFormatDefinition : ClassificationFormatDefinition
323323

324324
public InteractiveCyanFormatDefinition()
325325
{
326-
DisplayName = Name;
326+
DisplayName = Resources.ClassificationCyan;
327327
ForegroundColor = Color.FromRgb(0x00, 0xff, 0xff);
328328
}
329329
}
@@ -343,7 +343,7 @@ internal class InteractiveWhiteFormatDefinition : ClassificationFormatDefinition
343343

344344
public InteractiveWhiteFormatDefinition()
345345
{
346-
DisplayName = Name;
346+
DisplayName = Resources.ClassificationWhite;
347347
ForegroundColor = Color.FromRgb(0xff, 0xff, 0xff);
348348
}
349349
}

Nodejs/Product/InteractiveWindow/Repl/ReplWindow.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
1+
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
22

33
using System;
44
using System.Collections.Generic;
@@ -2786,7 +2786,7 @@ private Task<ExecutionResult> ExecuteCommand(string text, bool updateHistory)
27862786
}
27872787
catch (Exception e)
27882788
{
2789-
WriteError(string.Format("Command '{0}' failed: {1}", command, e.Message));
2789+
WriteError(string.Format(Resources.ReplCommandFailed, command, e.Message));
27902790
return ExecutionResult.Failed;
27912791
}
27922792
}
@@ -2797,7 +2797,7 @@ private void ShowReplHelp()
27972797
cmdnames.Sort((x, y) => StringComparer.CurrentCulture.Compare(x.Command, y.Command));
27982798

27992799
const string helpFmt = " {0,-24} {1}";
2800-
WriteLine(string.Format(helpFmt, _commandPrefix + "help", "Show a list of REPL commands"));
2800+
WriteLine(string.Format(helpFmt, _commandPrefix + "help", Resources.HelpDescription));
28012801

28022802
foreach (var cmd in cmdnames)
28032803
{

0 commit comments

Comments
 (0)