Skip to content

Make the adapter localizable#23

Merged
LukaszMendakiewicz merged 7 commits into
dev15from
dev/rsarwar/localization_fixes
Aug 24, 2017
Merged

Make the adapter localizable#23
LukaszMendakiewicz merged 7 commits into
dev15from
dev/rsarwar/localization_fixes

Conversation

@rashidsarwar
Copy link
Copy Markdown

adding localization changes

@msftclas
Copy link
Copy Markdown

msftclas commented Aug 10, 2017

@rashidsarwar,
Thanks for your contribution as a Microsoft full-time employee or intern. You do not need to sign a CLA.
Thanks,
Microsoft Pull Request Bot
#Closed

Copy link
Copy Markdown

@LukaszMendakiewicz LukaszMendakiewicz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First part of the review.

}
public class PreparingTestRunner : ITestRunner
{
public const string TestSetup = "Test setup";
Copy link
Copy Markdown

@LukaszMendakiewicz LukaszMendakiewicz Aug 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these still used anywhere? #Closed

Copy link
Copy Markdown
Author

@rashidsarwar rashidsarwar Aug 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes they are being used in TestAdapter.Tests\TestExecutorTestsBase.cs #Closed

Copy link
Copy Markdown

@LukaszMendakiewicz LukaszMendakiewicz Aug 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's move them to TestExecutorTestsBase then so we won't have unlocalized strings in this binary. #Closed

Copy link
Copy Markdown
Author

@rashidsarwar rashidsarwar Aug 15, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RESOLVED #Closed

Copy link
Copy Markdown
Author

@rashidsarwar rashidsarwar Aug 15, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved #Closed

Comment thread GoogleTestAdapter/Core/Resources.resx Outdated
</data>
<data name="ExecutionTime" xml:space="preserve">
<value>{0} Execution took {1}</value>
<comment>{0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents unlocalized string for time it took (e.g. "3/1/2008 7:00:00 AM")</comment>
Copy link
Copy Markdown

@LukaszMendakiewicz LukaszMendakiewicz Aug 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"3/1/2008 7:00:00 AM" is a time stamp, not time taken. The latter would be e.g. 2 hours 4 minutes 48 seconds. What do we print out here? #Closed

Copy link
Copy Markdown
Author

@rashidsarwar rashidsarwar Aug 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we print something like "0:00:00.0504161".. updated the comment to reflect it #Closed

}
_logger.DebugInfo(
$"'{executable}' {(matches ? "matches" : "does not match")} {regexSource} regex '{regex}'");
string strMatch = " " + Resources.Matches + " " + regexSource + " " + String.Format(Resources.Regex, regex);
Copy link
Copy Markdown

@LukaszMendakiewicz LukaszMendakiewicz Aug 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's weird that executable, regexSource, and regex are not just fill-ins in Resources.Matches/DontMatch.
Also it is wasteful to create two strings and use only one later on. #Closed

Copy link
Copy Markdown
Author

@rashidsarwar rashidsarwar Aug 15, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved #Closed

if (zone.SecurityZone != System.Security.SecurityZone.MyComputer)
{
logger.LogError("Executable " + executable + " came from another computer and was blocked to help protect this computer.");
logger.LogError(String.Format(Resources.ExecutableError,executable));
Copy link
Copy Markdown

@LukaszMendakiewicz LukaszMendakiewicz Aug 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing space after comma. #Closed

Copy link
Copy Markdown
Author

@rashidsarwar rashidsarwar Aug 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved #Closed

@@ -70,12 +70,12 @@ private static void DiscoverTests(string executable, ITestFrameworkReporter repo
Action<TestCase> reportTestCases = tc =>
Copy link
Copy Markdown

@LukaszMendakiewicz LukaszMendakiewicz Aug 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs to update the legal header at the top of the file to "8/2017".
Apply to all other files with different month there as well. #Closed

Copy link
Copy Markdown
Author

@rashidsarwar rashidsarwar Aug 15, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved #Closed

@@ -1,4 +1,5 @@
using System.Linq;
using System;
Copy link
Copy Markdown

@LukaszMendakiewicz LukaszMendakiewicz Aug 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs Microsoft-modification header.
Apply to all other modified files missing it as well. #Closed

Copy link
Copy Markdown
Author

@rashidsarwar rashidsarwar Aug 15, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved #Closed

@LukaszMendakiewicz LukaszMendakiewicz changed the title Dev/rsarwar/localization fixes Make the adapter localizable Aug 14, 2017
Copy link
Copy Markdown

@LukaszMendakiewicz LukaszMendakiewicz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

End of the pass for this iteration.

Also please squash the fix-up commits before merging.

Comment thread GoogleTestAdapter/Core/Resources.resx Outdated
<comment>{0} represents an unlocalized test name (e.g. "TestSuite1.Test2")</comment>
</data>
<data name="AlreadyInAnalyzer" xml:space="preserve">
<value>test case already in analyzer:</value>
Copy link
Copy Markdown

@LukaszMendakiewicz LukaszMendakiewicz Aug 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capitalize the sentence? #Closed

Copy link
Copy Markdown
Author

@rashidsarwar rashidsarwar Aug 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved #Closed

Comment thread GoogleTestAdapter/Core/Resources.resx Outdated
<comment>{0} represents unlocalized properties of current object</comment>
</data>
<data name="BatchFileMissing" xml:space="preserve">
<value>{0} {1} batch file: Did not find file: {2}</value>
Copy link
Copy Markdown

@LukaszMendakiewicz LukaszMendakiewicz Aug 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make "batch file" part of the {1} fill-in (same for the string below)? #Closed

Copy link
Copy Markdown
Author

@rashidsarwar rashidsarwar Aug 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added a separate BatchFile for "batch file" string #Closed

Copy link
Copy Markdown
Author

@rashidsarwar rashidsarwar Aug 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed the comment as well #Closed

Comment thread GoogleTestAdapter/Core/Resources.resx Outdated
</data>
<data name="BatchFileMissing" xml:space="preserve">
<value>{0} {1} batch file: Did not find file: {2}</value>
<comment>{0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents a localized name for test mode (e.g. "Test setup" or "Test teardown"), {2} represents unlocalized file path (e.g c:\test\foo.bat)</comment>
Copy link
Copy Markdown

@LukaszMendakiewicz LukaszMendakiewicz Aug 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please indicate in the comment which resource names are the potential fill-ins for {1}. #Closed

Copy link
Copy Markdown
Author

@rashidsarwar rashidsarwar Aug 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed #Closed

<comment>{0} represents an unlocalized process name (e.g notepad.exe), {1} represents unlocalized string for time (e.g. "3/1/2008 7:00:00 AM"), {2} represents localized exception message (e.g. "Cannot load file")</comment>
</data>
<data name="CrashTest" xml:space="preserve">
<value>reason is probably a crash of test {0}</value>
Copy link
Copy Markdown

@LukaszMendakiewicz LukaszMendakiewicz Aug 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What context this will be printed out in that it is not capitalized? #Closed

Copy link
Copy Markdown
Author

@rashidsarwar rashidsarwar Aug 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have capitalized it. I could not track where it would get printed. #Closed

Comment thread GoogleTestAdapter/Core/Resources.resx Outdated
<comment>{0} represents a unlocalized name of executable (e.g. cmd.exe) file</comment>
</data>
<data name="ExecuteSteps" xml:space="preserve">
<value>{0} In particular: launch command prompt, change into directory '{1}', and execute the following command to make sure your tests can be run in general.</value>
Copy link
Copy Markdown

@LukaszMendakiewicz LukaszMendakiewicz Aug 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please indicate in the comment that logically this sentence is a continuation for TroubleShootingLink string. #Closed

Copy link
Copy Markdown
Author

@rashidsarwar rashidsarwar Aug 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved it #Closed

</data>
<data name="DebuggerAttachMessage" xml:space="preserve">
<value>Could not attach debugger to process {0}, no error message available</value>
<comment>{0} represents a number (e.g. "12" or "14")</comment>
Copy link
Copy Markdown

@LukaszMendakiewicz LukaszMendakiewicz Aug 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment seems wrong. #Closed

Copy link
Copy Markdown
Author

@rashidsarwar rashidsarwar Aug 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed it #Closed

</data>
<data name="DebuggerAttachTime" xml:space="preserve">
<value>Debugger attached to process {0}, took {1} ms</value>
<comment>{0} represents a number (e.g. "12" or "14"), {1} represents a number (e.g. "12" or "14")</comment>
Copy link
Copy Markdown

@LukaszMendakiewicz LukaszMendakiewicz Aug 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto. #Closed

Copy link
Copy Markdown
Author

@rashidsarwar rashidsarwar Aug 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed it #Closed

catch (InvalidOperationException e) when (e.InnerException is XmlSchemaValidationException)
{
throw new InvalidRunSettingsException($"Invalid {GoogleTestConstants.SettingsName}", e.InnerException);
throw new InvalidRunSettingsException($"{Resources.Invalid} {GoogleTestConstants.SettingsName}", e.InnerException);
Copy link
Copy Markdown

@LukaszMendakiewicz LukaszMendakiewicz Aug 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SettingsName should be a fill-in for the string. #Closed

Copy link
Copy Markdown
Author

@rashidsarwar rashidsarwar Aug 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved #Closed

<comment>{0} represents a number (e.g. "0" or "1")</comment>
</data>
<data name="UnknownVisualStudioVersion" xml:space="preserve">
<value>Unknown VisualStudio version: {0}</value>
Copy link
Copy Markdown

@LukaszMendakiewicz LukaszMendakiewicz Aug 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Visual Studio" #Closed

Copy link
Copy Markdown
Author

@rashidsarwar rashidsarwar Aug 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed it #Closed

}

CommonFunctions.ReportErrors(_logger, "test discovery", _settings.DebugMode);
CommonFunctions.ReportErrors(_logger, Resources.TestDiscovery, _settings.DebugMode);
Copy link
Copy Markdown

@LukaszMendakiewicz LukaszMendakiewicz Aug 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you should pass down enum here rather than a string like you did with the other one. #Closed

Copy link
Copy Markdown
Author

@rashidsarwar rashidsarwar Aug 15, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved it. passed down enum #Closed

@rashidsarwar rashidsarwar force-pushed the dev/rsarwar/localization_fixes branch from 82a4fe7 to f5b511c Compare August 17, 2017 19:22
@@ -163,7 +163,7 @@ public void GetTestsFromExecutable_WithoutPathExtension_ProducesWarning()
IList<TestCase> testCases = discoverer.GetTestsFromExecutable(targetExe);
Copy link
Copy Markdown

@LukaszMendakiewicz LukaszMendakiewicz Aug 17, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs Microsoft-modified header at the top of the file. #Closed

Copy link
Copy Markdown
Author

@rashidsarwar rashidsarwar Aug 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved #Closed

@@ -17,8 +17,9 @@ namespace GoogleTestAdapter.TestAdapter
{
Copy link
Copy Markdown

@LukaszMendakiewicz LukaszMendakiewicz Aug 17, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs Microsoft-modified header on top. #Closed

Copy link
Copy Markdown
Author

@rashidsarwar rashidsarwar Aug 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved #Closed

Comment thread GoogleTestAdapter/Core/Resources.resx Outdated
<comment>This sentence is continuation of TroubleShooting string. {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents unlocalized directory path (e.g c:\test\dir), {2} represents a unlocalized new line string (e.g "\n")</comment>
</data>
<data name="ExecutionCancelled" xml:space="preserve">
<value>{0} Execution has been canceled: {1}</value>
Copy link
Copy Markdown

@LukaszMendakiewicz LukaszMendakiewicz Aug 17, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"cancelled" (double l), sorry to have missed this before. #Closed

Copy link
Copy Markdown
Author

@rashidsarwar rashidsarwar Aug 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved #Closed

Comment thread GoogleTestAdapter/Core/Resources.resx Outdated
<comment>{0} represents an unlocalized string for test name (e.g. "TestSuite1.Test2")</comment>
</data>
<data name="TestCaseNotRun" xml:space="preserve">
<value>{0} Test cases seem to not have been run - are you repeating a test run, but tests have changed in the meantime? Test cases:{1}</value>
Copy link
Copy Markdown

@LukaszMendakiewicz LukaszMendakiewicz Aug 17, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Test cases" should not be capitalized. #Closed

Copy link
Copy Markdown
Author

@rashidsarwar rashidsarwar Aug 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved #Closed

<comment>this is used in ErrorAndWarning string</comment>
</data>
<data name="ErrorAndWarning" xml:space="preserve">
<value>The following errors and warnings have occured during {0},{1}:{2}</value>
Copy link
Copy Markdown

@LukaszMendakiewicz LukaszMendakiewicz Aug 17, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No comma between {0} and {1}. #Closed

Copy link
Copy Markdown
Author

@rashidsarwar rashidsarwar Aug 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved #Closed

</data>
<data name="ErrorAndWarning" xml:space="preserve">
<value>The following errors and warnings have occured during {0},{1}:{2}</value>
<comment>{0} represents localized phase of test (e.g. "test discovery"), {1} represents unlocalized hint (e.g. "enable debug mode for more information"), {2} represents a unlocalized new line string (e.g "\n")</comment>
Copy link
Copy Markdown

@LukaszMendakiewicz LukaszMendakiewicz Aug 17, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clarify that {0} will be either TestDiscovery or TestExecution. #Closed

Copy link
Copy Markdown
Author

@rashidsarwar rashidsarwar Aug 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved #Closed

<value>test discovery</value>
</data>
<data name="TestExecution" xml:space="preserve">
<value>Test execution</value>
Copy link
Copy Markdown

@LukaszMendakiewicz LukaszMendakiewicz Aug 17, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should not be capitalized when used in ErrorAndWarning. #Closed

Copy link
Copy Markdown
Author

@rashidsarwar rashidsarwar Aug 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved #Closed

@LukaszMendakiewicz LukaszMendakiewicz added this to the next milestone Aug 17, 2017
@LukaszMendakiewicz LukaszMendakiewicz self-assigned this Aug 23, 2017
Comment thread GoogleTestAdapter/Core/Resources.resx Outdated
</data>
<data name="Results" xml:space="preserve">
<value>Test {0}: Expected {1} ms, actual {2} ms</value>
<comment>{0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents a number (e.g. 5), {2} represents a number (e.g. 5)</comment>
Copy link
Copy Markdown

@LukaszMendakiewicz LukaszMendakiewicz Aug 23, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{0} represents an unlocalized name for thread (e.g. "T001519"), [](start = 13, length = 63)

This is incorrect #Closed

Comment thread GoogleTestAdapter/Core/Resources.resx Outdated
</data>
<data name="XmlNodeParse" xml:space="preserve">
<value>XmlNode could not be parsed: '{0}'. Exception message: {1}</value>
<comment>{0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents localized exception message (e.g. "Cannot load file")</comment>
Copy link
Copy Markdown

@LukaszMendakiewicz LukaszMendakiewicz Aug 23, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{0} represents an unlocalized name for thread (e.g. "T001519") [](start = 13, length = 62)

This is incorrect #Closed

@LukaszMendakiewicz LukaszMendakiewicz merged commit f4d42c5 into dev15 Aug 24, 2017
@LukaszMendakiewicz LukaszMendakiewicz deleted the dev/rsarwar/localization_fixes branch August 24, 2017 05:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants