Skip to content

Commit 96c56fb

Browse files
authored
Consolidation of localization (#2110)
1 parent b82b1eb commit 96c56fb

26 files changed

+647
-7716
lines changed

build.proj

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105

106106
<Target Name="BuildTools" Condition="'$(BuildTools)' == 'true'">
107107
<PropertyGroup>
108-
<DotnetBuildCmd>$(DotNetCmd) dotnet build -c Release -p:ReferenceType=$(ReferenceType)"</DotnetBuildCmd>
108+
<DotnetBuildCmd>$(DotNetCmd) dotnet build -c Release -p:ReferenceType=$(ReferenceType)</DotnetBuildCmd>
109109
</PropertyGroup>
110110
<Exec Command="$(DotnetBuildCmd)" WorkingDirectory="$(GenAPISrcDir)Microsoft.DotNet.GenAPI\" />
111111
</Target>

src/Directory.Build.props

+5-1
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,12 @@
4343
<ManagedSourceCode>$(ProjectDir)Microsoft.Data.SqlClient\</ManagedSourceCode>
4444
<SqlServerSourceCode>$(ProjectDir)Microsoft.SqlServer.Server\</SqlServerSourceCode>
4545
<NetCoreSource>$(ManagedSourceCode)netcore\</NetCoreSource>
46+
<NetCoreResources>$(ManagedSourceCode)src\Resources\</NetCoreResources>
47+
<ResxFileName>Strings</ResxFileName>
48+
<ResourceFileName>SqlClient.Resources.$(ResxFileName)</ResourceFileName>
49+
<GeneratedSourceFileName>$(ResxFileName).ResourceNames.cs</GeneratedSourceFileName>
4650
<NetFxSource>$(ManagedSourceCode)netfx\</NetFxSource>
47-
<NetFxResources>$(ManagedSourceCode)netfx\src\Resources\</NetFxResources>
51+
<NetFxResources>$(ManagedSourceCode)src\Resources\</NetFxResources>
4852
<AddOnsPath>$(ManagedSourceCode)add-ons\</AddOnsPath>
4953
<SqlServerSource>$(RepoRoot)src\Microsoft.SqlServer.Server\</SqlServerSource>
5054
<ObjFolder>$(Artifacts)obj\</ObjFolder>

src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj

+16-10
Original file line numberDiff line numberDiff line change
@@ -495,15 +495,12 @@
495495
<Compile Include="..\..\src\Microsoft\Data\SqlClient\SqlStream.cs">
496496
<Link>Microsoft\Data\SqlClient\SqlStream.cs</Link>
497497
</Compile>
498-
<Compile Include="..\..\src\Resources\ResCategoryAttribute.cs">
498+
<Compile Include="..\..\src\Resources\ResCategoryAttribute.cs">
499499
<Link>Resources\ResCategoryAttribute.cs</Link>
500500
</Compile>
501501
<Compile Include="..\..\src\Resources\ResDescriptionAttribute.cs">
502502
<Link>Resources\ResDescriptionAttribute.cs</Link>
503503
</Compile>
504-
<Compile Include="..\..\src\Resources\StringsHelper.cs">
505-
<Link>Resources\StringsHelper.cs</Link>
506-
</Compile>
507504
<Compile Include="..\..\src\System\Diagnostics\CodeAnalysis.cs">
508505
<Link>Common\System\Diagnostics\CodeAnalysis.cs</Link>
509506
</Compile>
@@ -570,20 +567,28 @@
570567
<Compile Include="Microsoft\Data\ProviderBase\DbConnectionPool.NetCoreApp.cs" />
571568
<Compile Include="Microsoft\Data\SqlClient\SqlConnectionFactory.AssemblyLoadContext.cs" />
572569
</ItemGroup>
573-
<ItemGroup Condition="'$(OSGroup)' != 'AnyOS'">
574-
<Compile Include="Resources\StringsHelper.cs">
575-
<Link>Resources\StringsHelper.NetCore.cs</Link>
576-
</Compile>
577-
<Compile Include="Resources\Strings.Designer.cs">
570+
<ItemGroup>
571+
<Compile Include="..\..\src\Resources\StringsHelper.cs">
572+
<Link>Resources\StringsHelper.cs</Link>
573+
</Compile>
574+
<Compile Include="..\..\src\Resources\Strings.Designer.cs">
575+
<Link>Resources\Strings.Designer.cs</Link>
578576
<DesignTime>True</DesignTime>
579577
<AutoGen>True</AutoGen>
580578
<DependentUpon>Strings.resx</DependentUpon>
581579
</Compile>
582-
<EmbeddedResource Update="Resources\Strings.resx">
580+
<EmbeddedResource Include="..\..\src\Resources\Strings.resx">
581+
<Link>Resources\Strings.resx</Link>
582+
<LogicalName>Microsoft.Data.SqlClient.Resources.Strings.resources</LogicalName>
583583
<Generator>ResXFileCodeGenerator</Generator>
584584
<LastGenOutput>Strings.Designer.cs</LastGenOutput>
585585
<CustomToolNamespace>System</CustomToolNamespace>
586586
</EmbeddedResource>
587+
<EmbeddedResource Include="..\..\src\Resources\$(ResxFileName).*.resx">
588+
<Link>Resources\%(RecursiveDir)%(Filename)%(Extension)</Link>
589+
</EmbeddedResource>
590+
</ItemGroup>
591+
<ItemGroup Condition="'$(OSGroup)' != 'AnyOS'">
587592
<Compile Include="$(CommonPath)\CoreLib\System\Threading\Tasks\TaskToApm.cs">
588593
<Link>Common\CoreLib\System\Threading\Tasks\TaskToApm.cs</Link>
589594
</Compile>
@@ -985,4 +990,5 @@
985990
<Import Project="$(ToolsDir)targets\GenerateThisAssemblyCs.targets" />
986991
<Import Project="$(ToolsDir)targets\ResolveContract.targets" Condition="'$(OSGroup)' == 'AnyOS'" />
987992
<Import Project="$(ToolsDir)targets\NotSupported.targets" Condition="'$(OSGroup)' == 'AnyOS'" />
993+
<Import Project="..\..\src\tools\targets\GenerateResourceStringsSource.targets" />
988994
</Project>

0 commit comments

Comments
 (0)