Skip to content

Commit

Permalink
Localize vstest with workaround (microsoft#351)
Browse files Browse the repository at this point in the history
  • Loading branch information
Faizan2304 authored Jan 19, 2017
1 parent 0202a8b commit 221b75b
Show file tree
Hide file tree
Showing 50 changed files with 370 additions and 16 deletions.
19 changes: 18 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,21 @@ Tools
*.nupkg
*.zip
*.props
src/package/sign/sign.nuget.targets
src/package/sign/sign.nuget.targets

# ===========================
# Localized resx files
# ===========================
*.cs.resx
*.de.resx
*.es.resx
*.fr.resx
*.it.resx
*.ja.resx
*.ko.resx
*.pl.resx
*.pt-BR.resx
*.ru.resx
*.tr.resx
*.zh-Hans.resx
*.zh-Hant.resx
4 changes: 3 additions & 1 deletion scripts/build/TestPlatform.Settings.targets
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<!-- Disable default inclusion of .cs and .resx file -->
<EnableDefaultItems>false</EnableDefaultItems>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
Expand All @@ -25,7 +27,7 @@

<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DefineConstants>$(DefineConstants);CODE_ANALYSIS</DefineConstants>
</PropertyGroup>
</PropertyGroup>

<!-- Common dependencies for all projects -->
<ItemGroup>
Expand Down
29 changes: 15 additions & 14 deletions scripts/build/TestPlatform.targets
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,37 @@
<TestPlatformRoot Condition="$(TestPlatformRoot) == ''">$(MSBuildThisFileDirectory)..\..\</TestPlatformRoot>
<TestPlatformPackageDir>$(TestPlatformRoot)packages\</TestPlatformPackageDir>
</PropertyGroup>
<!-- hack for bug https://github.com/Microsoft/msbuild/issues/1400#issuecomment-268179321 -->
<Import Project="$(MSBuildSDKsPath)\Microsoft.NET.SDK\Sdk\Sdk.targets" />

<ItemGroup>
<ResourceFiles Include="$(ProjectDir)Resources\*.resx" />
<ResxLang Include="cs;de;es;fr;it;ja;ko;pl;pt-BR;ru;tr;zh-Hans;zh-Hant" />
</ItemGroup>

<PropertyGroup>
<ResourceDirectory>$(ProjectDir)Resources</ResourceDirectory>
</PropertyGroup>

<Target Name="BeforeBuild" Condition="$(TestProject) =='' and $(TestProject) !='true' and @(ResourceFiles) != ''">
<Target Name="BeforeBuild" Condition="$(TestProject) =='' and $(TestProject) !='true' and @(EmbeddedResource) != ''">
<CallTarget Targets="CreateLocalizeXLF;CreateLocalizeResx"/>
</Target>

<Target Name="CreateLocalizeXLF" Condition="'$(SyncXlf)' == 'true'">
<CreateItem Include="@(ResourceFiles)" AdditionalMetadata="Language=%(ResxLang.Identity)">
<CreateItem Include="@(EmbeddedResource)" AdditionalMetadata="Language=%(ResxLang.Identity)">
<Output ItemName="LocResourceFile" TaskParameter="Include"/>
</CreateItem>
<Exec Command="$(TestPlatformPackageDir)fmdev.xlftool\0.1.2\tools\xlftool.exe update -Resx %(LocResourceFile.Identity) -Xlf $(ProjectDir)Resources\xlf\%(LocResourceFile.Filename).%(LocResourceFile.Language).xlf" />
<Exec Command="$(TestPlatformPackageDir)fmdev.xlftool\0.1.2\tools\xlftool.exe update -Resx %(LocResourceFile.Identity) -Xlf $(ResourceDirectory)\xlf\%(LocResourceFile.Filename).%(LocResourceFile.Language).xlf" />
<!-- Due to bug (https://github.com/fmuecke/XliffParser/issues/4) in xlftool we are not updating nuteral xlf file -->
<!--<Exec Command="$(TestPlatformPackageDir)fmdev.xlftool\0.1.2\tools\xlftool.exe update -Resx %(ResourceFiles.Identity) -Xlf $(ProjectDir)Resources\xlf\%(ResourceFiles.Filename).xlf" />-->
<!--<Exec Command="$(TestPlatformPackageDir)fmdev.xlftool\0.1.2\tools\xlftool.exe update -Resx %(EmbeddedResource.Identity) -Xlf $(ResourceDirectory)\xlf\%(EmbeddedResource.Filename).xlf" />-->
</Target>

<!-- Due to bug(https://github.com/dotnet/sdk/issues/518) in msbuild, excluding localization for net46-->
<Target Name="CreateLocalizeResx" Condition="'$(LocalizedBuild)' == 'true'" >
<CreateItem Include="@(ResourceFiles)" AdditionalMetadata="Language=%(ResxLang.Identity)">
<CreateItem Include="@(EmbeddedResource)" AdditionalMetadata="Language=%(ResxLang.Identity)">
<Output ItemName="LocResourceFile" TaskParameter="Include"/>
</CreateItem>
<PropertyGroup>
<OutputResxDir>$(ProjectDir)obj\Resx</OutputResxDir>
</PropertyGroup>
<MakeDir Directories="$(OutputResxDir)" Condition="!Exists($(OutputResxDir))" />
<Exec Command="$(TestPlatformPackageDir)fmdev.xlftool\0.1.2\tools\xlftool.exe writeTarget -Xlf $(ProjectDir)Resources\xlf\%(LocResourceFile.Filename).%(LocResourceFile.Language).xlf -Resx $(ProjectDir)obj\Resx\%(LocResourceFile.Filename).%(LocResourceFile.Language).resx -verbose" />
<Exec Command="$(TestPlatformPackageDir)fmdev.xlftool\0.1.2\tools\xlftool.exe writeTarget -Xlf $(ResourceDirectory)\xlf\%(LocResourceFile.Filename).%(LocResourceFile.Language).xlf -Resx $(ResourceDirectory)\%(LocResourceFile.Filename).%(LocResourceFile.Language).resx -verbose" />
<ItemGroup>
<EmbeddedResource Include="$(ProjectDir)obj\Resx\*.resx" />
<EmbeddedResource Include="$(ResourceDirectory)\%(LocResourceFile.Filename).%(LocResourceFile.Language).resx" />
</ItemGroup>
</Target>
</Project>
</Project>
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
<TargetFrameworks>netstandard1.5;net46</TargetFrameworks>
<PackageTargetFallback Condition=" '$(TargetFramework)' == 'netstandard1.5' ">$(PackageTargetFallback);dnxcore50;portable-net45+win8</PackageTargetFallback>
</PropertyGroup>
<ItemGroup>
<Compile Include="**\*.cs" />
<EmbeddedResource Include="Resources\Resources.resx"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Microsoft.TestPlatform.ObjectModel\Microsoft.TestPlatform.ObjectModel.csproj" />
<ProjectReference Include="..\Microsoft.TestPlatform.CoreUtilities\Microsoft.TestPlatform.CoreUtilities.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
<TargetFrameworks>netstandard1.5;net46</TargetFrameworks>
<WarningsAsErrors>true</WarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<Compile Include="**\*.cs" />
<EmbeddedResource Include="Resources\Resources.resx"/>
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net46' ">
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Configuration" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
<WarningsAsErrors>true</WarningsAsErrors>
<PackageTargetFallback Condition=" '$(TargetFramework)' == 'netstandard1.5' ">$(PackageTargetFallback);dnxcore50;portable-net45+win8</PackageTargetFallback>
</PropertyGroup>
<ItemGroup>
<Compile Include="**\*.cs" />
<EmbeddedResource Include="Resources\Resources.resx"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Microsoft.TestPlatform.CoreUtilities\Microsoft.TestPlatform.CoreUtilities.csproj" />
<ProjectReference Include="..\Microsoft.TestPlatform.ObjectModel\Microsoft.TestPlatform.ObjectModel.csproj" />
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
<WarningsAsErrors>true</WarningsAsErrors>
<PackageTargetFallback Condition=" '$(TargetFramework)' == 'netstandard1.5' ">$(PackageTargetFallback);dnxcore50;portable-net45+win8</PackageTargetFallback>
</PropertyGroup>
<ItemGroup>
<Compile Include="**\*.cs" />
<EmbeddedResource Include="Resources\Resources.resx"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Microsoft.TestPlatform.CommunicationUtilities\Microsoft.TestPlatform.CommunicationUtilities.csproj" />
<ProjectReference Include="..\Microsoft.TestPlatform.ObjectModel\Microsoft.TestPlatform.ObjectModel.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
<TargetFrameworks>netstandard1.5;net46</TargetFrameworks>
<PackageTargetFallback Condition=" '$(TargetFramework)' == 'netstandard1.5' ">$(PackageTargetFallback);dnxcore50;portable-net45+win8</PackageTargetFallback>
</PropertyGroup>
<ItemGroup>
<Compile Include="**\*.cs" />
<EmbeddedResource Include="Resources\TrxResource.resx"/>
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net46' ">
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
<TargetFrameworks>netstandard1.5;net46</TargetFrameworks>
<PackageTargetFallback Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">$(PackageTargetFallback);dnxcore50;netstandardapp1.0;portable-net45+win8;portable-net45+wp80+win8+wpa81+dnxcore50</PackageTargetFallback>
</PropertyGroup>
<ItemGroup>
<Compile Include="**\*.cs" />
<EmbeddedResource Include="Resources\Resources.resx"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Microsoft.TestPlatform.CoreUtilities\Microsoft.TestPlatform.CoreUtilities.csproj" />
<ProjectReference Include="..\Microsoft.TestPlatform.ObjectModel\Microsoft.TestPlatform.ObjectModel.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<RuntimeIdentifier>win7-x64</RuntimeIdentifier>
</PropertyGroup>
<ItemGroup>
<Compile Include="**\*.cs" />
<Contents Include="[Content_Types].xml;extension.vsixmanifest;License.rtf;testhost.x86.exe.config;testhost.exe.config;TestPlatform.ObjectModel.manifest;TestPlatform.ObjectModel.x86.manifest">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Contents>
Expand Down
Binary file not shown.
1 change: 1 addition & 0 deletions src/datacollector.x86/datacollector.x86.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<RuntimeIdentifier>win7-x64</RuntimeIdentifier>
</PropertyGroup>
<ItemGroup>
<Compile Include="**\*.cs" />
<None Include="app.config" />
</ItemGroup>
<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/datacollector/datacollector.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<RuntimeIdentifier>win7-x64</RuntimeIdentifier>
</PropertyGroup>
<ItemGroup>
<Compile Include="**\*.cs" />
<Compile Include="..\datacollector.x86\Program.cs;..\datacollector.x86\DataCollectionCoordinator.cs;..\datacollector.x86\Interfaces\IDataCollectionManager.cs;..\datacollector.x86\Friends.cs" />
<None Include="app.config" />
</ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/testhost.x86/testhost.x86.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<RuntimeIdentifier>win7-x64</RuntimeIdentifier>
</PropertyGroup>
<ItemGroup>
<Compile Include="**\*.cs" />
<None Include="app.config" />
</ItemGroup>
<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/testhost/testhost.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<RuntimeIdentifier>win7-x64</RuntimeIdentifier>
</PropertyGroup>
<ItemGroup>
<Compile Include="**\*.cs" />
<Compile Include="..\testhost.x86\Program.cs;..\testhost.x86\DefaultEngineInvoker.cs;..\testhost.x86\IEngineInvoker.cs;..\testhost.x86\AppDomainEngineInvoker.cs;..\testhost.x86\Friends.cs" />
<None Include="app.config" />
</ItemGroup>
Expand Down
19 changes: 19 additions & 0 deletions src/vstest.console/Resources/xlf/Resources.cs.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -1495,6 +1495,25 @@
<target state="new">One or more runsettings provided contain invalid token</target>
<note></note>
</trans-unit>
<trans-unit id="ResultsDirectoryArgumentHelp">
<source>--ResultsDirectory|/ResultsDirectory
Test results directory will be created in specified path if not exists.
Example /ResultsDirectory:&lt;pathToResultsDirectory&gt;</source>
<target state="new">--ResultsDirectory|/ResultsDirectory
Test results directory will be created in specified path if not exists.
Example /ResultsDirectory:&lt;pathToResultsDirectory&gt;</target>
<note></note>
</trans-unit>
<trans-unit id="ResultsDirectoryValueRequired">
<source>The /ResultsDirectory parameter requires a value, where the test results should be saved. Example: /ResultsDirectory:c:\MyTestResultsDirectory</source>
<target state="new">The /ResultsDirectory parameter requires a value, where the test results should be saved. Example: /ResultsDirectory:c:\MyTestResultsDirectory</target>
<note></note>
</trans-unit>
<trans-unit id="InvalidResultsDirectoryPathCommand">
<source>The path '{0}' specified in the 'ResultsDirectory' is invalid. Error: {1}</source>
<target state="new">The path '{0}' specified in the 'ResultsDirectory' is invalid. Error: {1}</target>
<note></note>
</trans-unit>
</body>
</file>
</xliff>
19 changes: 19 additions & 0 deletions src/vstest.console/Resources/xlf/Resources.de.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -1495,6 +1495,25 @@ Standardeinstellungen werden verwendet, wenn die Verwendung der Einstellungsdate
<target state="new">One or more runsettings provided contain invalid token</target>
<note></note>
</trans-unit>
<trans-unit id="ResultsDirectoryArgumentHelp">
<source>--ResultsDirectory|/ResultsDirectory
Test results directory will be created in specified path if not exists.
Example /ResultsDirectory:&lt;pathToResultsDirectory&gt;</source>
<target state="new">--ResultsDirectory|/ResultsDirectory
Test results directory will be created in specified path if not exists.
Example /ResultsDirectory:&lt;pathToResultsDirectory&gt;</target>
<note></note>
</trans-unit>
<trans-unit id="ResultsDirectoryValueRequired">
<source>The /ResultsDirectory parameter requires a value, where the test results should be saved. Example: /ResultsDirectory:c:\MyTestResultsDirectory</source>
<target state="new">The /ResultsDirectory parameter requires a value, where the test results should be saved. Example: /ResultsDirectory:c:\MyTestResultsDirectory</target>
<note></note>
</trans-unit>
<trans-unit id="InvalidResultsDirectoryPathCommand">
<source>The path '{0}' specified in the 'ResultsDirectory' is invalid. Error: {1}</source>
<target state="new">The path '{0}' specified in the 'ResultsDirectory' is invalid. Error: {1}</target>
<note></note>
</trans-unit>
</body>
</file>
</xliff>
19 changes: 19 additions & 0 deletions src/vstest.console/Resources/xlf/Resources.es.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -1507,6 +1507,25 @@
<target state="new">One or more runsettings provided contain invalid token</target>
<note></note>
</trans-unit>
<trans-unit id="ResultsDirectoryArgumentHelp">
<source>--ResultsDirectory|/ResultsDirectory
Test results directory will be created in specified path if not exists.
Example /ResultsDirectory:&lt;pathToResultsDirectory&gt;</source>
<target state="new">--ResultsDirectory|/ResultsDirectory
Test results directory will be created in specified path if not exists.
Example /ResultsDirectory:&lt;pathToResultsDirectory&gt;</target>
<note></note>
</trans-unit>
<trans-unit id="ResultsDirectoryValueRequired">
<source>The /ResultsDirectory parameter requires a value, where the test results should be saved. Example: /ResultsDirectory:c:\MyTestResultsDirectory</source>
<target state="new">The /ResultsDirectory parameter requires a value, where the test results should be saved. Example: /ResultsDirectory:c:\MyTestResultsDirectory</target>
<note></note>
</trans-unit>
<trans-unit id="InvalidResultsDirectoryPathCommand">
<source>The path '{0}' specified in the 'ResultsDirectory' is invalid. Error: {1}</source>
<target state="new">The path '{0}' specified in the 'ResultsDirectory' is invalid. Error: {1}</target>
<note></note>
</trans-unit>
</body>
</file>
</xliff>
19 changes: 19 additions & 0 deletions src/vstest.console/Resources/xlf/Resources.fr.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -1495,6 +1495,25 @@
<target state="new">One or more runsettings provided contain invalid token</target>
<note></note>
</trans-unit>
<trans-unit id="ResultsDirectoryArgumentHelp">
<source>--ResultsDirectory|/ResultsDirectory
Test results directory will be created in specified path if not exists.
Example /ResultsDirectory:&lt;pathToResultsDirectory&gt;</source>
<target state="new">--ResultsDirectory|/ResultsDirectory
Test results directory will be created in specified path if not exists.
Example /ResultsDirectory:&lt;pathToResultsDirectory&gt;</target>
<note></note>
</trans-unit>
<trans-unit id="ResultsDirectoryValueRequired">
<source>The /ResultsDirectory parameter requires a value, where the test results should be saved. Example: /ResultsDirectory:c:\MyTestResultsDirectory</source>
<target state="new">The /ResultsDirectory parameter requires a value, where the test results should be saved. Example: /ResultsDirectory:c:\MyTestResultsDirectory</target>
<note></note>
</trans-unit>
<trans-unit id="InvalidResultsDirectoryPathCommand">
<source>The path '{0}' specified in the 'ResultsDirectory' is invalid. Error: {1}</source>
<target state="new">The path '{0}' specified in the 'ResultsDirectory' is invalid. Error: {1}</target>
<note></note>
</trans-unit>
</body>
</file>
</xliff>
19 changes: 19 additions & 0 deletions src/vstest.console/Resources/xlf/Resources.it.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -1495,6 +1495,25 @@
<target state="new">One or more runsettings provided contain invalid token</target>
<note></note>
</trans-unit>
<trans-unit id="ResultsDirectoryArgumentHelp">
<source>--ResultsDirectory|/ResultsDirectory
Test results directory will be created in specified path if not exists.
Example /ResultsDirectory:&lt;pathToResultsDirectory&gt;</source>
<target state="new">--ResultsDirectory|/ResultsDirectory
Test results directory will be created in specified path if not exists.
Example /ResultsDirectory:&lt;pathToResultsDirectory&gt;</target>
<note></note>
</trans-unit>
<trans-unit id="ResultsDirectoryValueRequired">
<source>The /ResultsDirectory parameter requires a value, where the test results should be saved. Example: /ResultsDirectory:c:\MyTestResultsDirectory</source>
<target state="new">The /ResultsDirectory parameter requires a value, where the test results should be saved. Example: /ResultsDirectory:c:\MyTestResultsDirectory</target>
<note></note>
</trans-unit>
<trans-unit id="InvalidResultsDirectoryPathCommand">
<source>The path '{0}' specified in the 'ResultsDirectory' is invalid. Error: {1}</source>
<target state="new">The path '{0}' specified in the 'ResultsDirectory' is invalid. Error: {1}</target>
<note></note>
</trans-unit>
</body>
</file>
</xliff>
19 changes: 19 additions & 0 deletions src/vstest.console/Resources/xlf/Resources.ja.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -1495,6 +1495,25 @@
<target state="new">One or more runsettings provided contain invalid token</target>
<note></note>
</trans-unit>
<trans-unit id="ResultsDirectoryArgumentHelp">
<source>--ResultsDirectory|/ResultsDirectory
Test results directory will be created in specified path if not exists.
Example /ResultsDirectory:&lt;pathToResultsDirectory&gt;</source>
<target state="new">--ResultsDirectory|/ResultsDirectory
Test results directory will be created in specified path if not exists.
Example /ResultsDirectory:&lt;pathToResultsDirectory&gt;</target>
<note></note>
</trans-unit>
<trans-unit id="ResultsDirectoryValueRequired">
<source>The /ResultsDirectory parameter requires a value, where the test results should be saved. Example: /ResultsDirectory:c:\MyTestResultsDirectory</source>
<target state="new">The /ResultsDirectory parameter requires a value, where the test results should be saved. Example: /ResultsDirectory:c:\MyTestResultsDirectory</target>
<note></note>
</trans-unit>
<trans-unit id="InvalidResultsDirectoryPathCommand">
<source>The path '{0}' specified in the 'ResultsDirectory' is invalid. Error: {1}</source>
<target state="new">The path '{0}' specified in the 'ResultsDirectory' is invalid. Error: {1}</target>
<note></note>
</trans-unit>
</body>
</file>
</xliff>
Loading

0 comments on commit 221b75b

Please sign in to comment.