Skip to content

Commit

Permalink
Fix localization of test adapter messages (#3949)
Browse files Browse the repository at this point in the history
  • Loading branch information
nohwnd authored Oct 17, 2024
1 parent d608cf5 commit 7f0381b
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,18 @@

<!-- Copy resources over to $(TargetDir) if this is a localized build. -->
<Target Name="CopyMSTestV2Resources" BeforeTargets="PrepareForBuild" Condition=" '$(EnableMSTestV2CopyResources)' == 'true' " DependsOnTargets="GetMSTestV2CultureHierarchy">
<PropertyGroup>
<CurrentUICultureHierarchy>%(CurrentUICultureHierarchy.Identity)</CurrentUICultureHierarchy>
</PropertyGroup>

<!-- Expand the UICulture hierarchy to items, such as cs-CZ, cs, and attach the culture metadata to the item. -->
<ItemGroup>
<MSTestV2Files Include="$(MSBuildThisFileDirectory)..\_localization\*.dll" />
<MSTestV2Files Include="$(MSBuildThisFileDirectory)..\_localization\%(CurrentUICultureHierarchy.Identity)\*.dll">
<UICulture>%(CurrentUICultureHierarchy.Identity)</UICulture>
</MSTestV2Files>
</ItemGroup>

<ItemGroup>
<Content Include="@(MSTestV2Files->'%(RootDir)%(Directory)$(CurrentUICultureHierarchy)\%(FileName).resources.dll')"
Condition="Exists('%(RootDir)%(Directory)$(CurrentUICultureHierarchy)\%(FileName).resources.dll')">
<Link>$(CurrentUICultureHierarchy)\%(FileName).resources.dll</Link>
<!-- Add the localization file as content so it gets copied from nuget to bin folder. -->
<Content Include="@(MSTestV2Files->'%(FullPath)')">
<Link>%(MSTestV2Files.UICulture)\%(FileName).dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<BaseAssemblyFullPath>%(FullPath)</BaseAssemblyFullPath>
<Visible>False</Visible>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,20 @@

<!-- Copy resources over to $(TargetDir) if this is a localized build. -->
<Target Name="CopyMSTestV2Resources" BeforeTargets="PrepareForBuild" Condition=" '$(EnableMSTestV2CopyResources)' == 'true' " DependsOnTargets="GetMSTestV2CultureHierarchy">

<!-- Expand the UICulture hierarchy to items, such as cs-CZ, cs, and attach the culture metadata to the item. -->
<ItemGroup>
<MSTestV2ResourceFiles Include="$(MSBuildThisFileDirectory)..\_localization\%(CurrentUICultureHierarchy.Identity)\*resources.dll">
<CultureString>%(CurrentUICultureHierarchy.Identity)</CultureString>
</MSTestV2ResourceFiles>
<MSTestV2Files Include="$(MSBuildThisFileDirectory)..\_localization\%(CurrentUICultureHierarchy.Identity)\*.dll">
<UICulture>%(CurrentUICultureHierarchy.Identity)</UICulture>
</MSTestV2Files>
</ItemGroup>

<Content Include="@(MSTestV2ResourceFiles)" Condition=" @(MSTestV2ResourceFiles) != '' ">
<Link>%(MSTestV2ResourceFiles.CultureString)\%(Filename)%(Extension)</Link>
<ItemGroup>
<!-- Add the localization file as content so it gets copied from nuget to bin folder. -->
<Content Include="@(MSTestV2Files->'%(FullPath)')">
<Link>%(MSTestV2Files.UICulture)\%(FileName).dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<BaseAssemblyFullPath>%(FullPath)</BaseAssemblyFullPath>
<Visible>False</Visible>
</Content>
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,20 @@
<!-- Copy resources over to $(TargetDir) if this is a localized build. -->
<Target Name="CopyMSTestV2Resources" BeforeTargets="PrepareForBuild" Condition=" '$(EnableMSTestV2CopyResources)' == 'true' " DependsOnTargets="GetMSTestV2CultureHierarchy">

<PropertyGroup>
<CurrentUICultureHierarchy>%(CurrentUICultureHierarchy.Identity)</CurrentUICultureHierarchy>
</PropertyGroup>

<!-- Expand the UICulture hierarchy to items, such as cs-CZ, cs, and attach the culture metadata to the item. -->
<ItemGroup>
<MSTestV2Files Include="$(MSBuildThisFileDirectory)../_localization/Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll" />
<MSTestV2Files Include="$(MSBuildThisFileDirectory)*.dll" />
<MSTestV2Files Include="$(MSBuildThisFileDirectory)..\_localization\%(CurrentUICultureHierarchy.Identity)\*.dll">
<UICulture>%(CurrentUICultureHierarchy.Identity)</UICulture>
</MSTestV2Files>
<MSTestV2Files Include="$(MSBuildThisFileDirectory)*.dll">
<UICulture>%(CurrentUICultureHierarchy.Identity)</UICulture>
</MSTestV2Files>
</ItemGroup>

<ItemGroup>
<Content Include="@(MSTestV2Files->'%(RootDir)%(Directory)$(CurrentUICultureHierarchy)\%(FileName).resources.dll')"
Condition="Exists('%(RootDir)%(Directory)$(CurrentUICultureHierarchy)\%(FileName).resources.dll')">
<Link>$(CurrentUICultureHierarchy)\%(FileName).resources.dll</Link>
<!-- Add the localization file as content so it gets copied from nuget to bin folder. -->
<Content Include="@(MSTestV2Files->'%(FullPath)')">
<Link>%(MSTestV2Files.UICulture)\%(FileName).dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<BaseAssemblyFullPath>%(FullPath)</BaseAssemblyFullPath>
<Visible>False</Visible>
Expand Down

0 comments on commit 7f0381b

Please sign in to comment.