Skip to content

Commit e2cb34a

Browse files
authored
Move localization process to OneLocBuild (#616)
* Add new build step for OneLocBuild process Because this build step modifies the resource files in-situ, it breaks build reproducibility. Moving it to the end should still produce the outputs necessary to create a PR for localization handbacks. This required renaming one resx file so that the new tool would generate the correct localized file names. * Remove MAT-related XLF files These will be replaced with LCL files from OneLocBuild soon. We still have XLF files for the VSCT file, which uses a different tool for conversion.
1 parent 872df16 commit e2cb34a

File tree

61 files changed

+1123
-11424
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+1123
-11424
lines changed

Localize/LocProject.json

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"Projects": [
3+
{
4+
"LanguageSet": "VS_Main_Languages",
5+
"LocItems": [
6+
{
7+
"SourceFile": "src\\libman\\Resources\\Text.resx",
8+
"CopyOption": "LangIdOnName",
9+
"OutputPath": "src\\libman\\Resources",
10+
"LclFile": "src\\libman\\Resources\\loc\\{Lang}\\Resources\\Text.resx.lcl"
11+
},
12+
{
13+
"SourceFile": "src\\LibraryManager\\Resources\\Text.resx",
14+
"CopyOption": "LangIdOnName",
15+
"OutputPath": "src\\LibraryManager\\Resources",
16+
"LclFile": "src\\LibraryManager\\Resources\\loc\\{Lang}\\Resources\\Text.resx.lcl"
17+
},
18+
{
19+
"SourceFile": "src\\LibraryManager.Contracts\\Resources\\Text.resx",
20+
"CopyOption": "LangIdOnName",
21+
"OutputPath": "src\\LibraryManager.Contracts\\Resources",
22+
"LclFile": "src\\LibraryManager.Contracts\\Resources\\loc\\{Lang}\\Resources\\Text.resx.lcl"
23+
},
24+
{
25+
"SourceFile": "src\\LibraryManager.Vsix\\Resources\\Text.resx",
26+
"CopyOption": "LangIdOnName",
27+
"OutputPath": "src\\Librarymanager.Vsix\\Resources",
28+
"LclFile": "src\\LibraryManager.Vsix\\Resources\\loc\\{Lang}\\Resources\\Text.resx.lcl"
29+
},
30+
{
31+
"SourceFile": "src\\LibraryManager.Vsix\\source.extension.resx",
32+
"CopyOption": "LangIdOnName",
33+
"OutputPath": "src\\LibraryManager.Vsix",
34+
"LclFile": "src\\LibraryManager.Vsix\\Resources\\loc\\{Lang}\\source.extension.resx.lcl"
35+
},
36+
{
37+
"$comment": "This is copied from the ENU XLF file by a preceding PowerShell step",
38+
"SourceFile": "src\\LibraryManager.Vsix\\Commands\\CommandTable\\LocalizationFiles\\VSCommandTable.xlf",
39+
"CopyOption": "LangIdOnName",
40+
"OutputPath": "src\\LibraryManager.Vsix\\Commands\\CommandTable\\LocalizationFiles",
41+
"LclFile": "src\\LibraryManager.Vsix\\Resources\\loc\\{Lang}\\Commands\\CommandTable\\LocalizationFiles\\VSCommandTable.xlf.lcl"
42+
}
43+
]
44+
}
45+
]
46+
}

azure-pipelines/build.yml

+22
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,28 @@ steps:
4040
- ${{ if eq(variables['system.collectionId'], '011b8bdf-6d56-4f87-be0d-0092136884d9') }}:
4141
- template: azure-pipeline.microbuild.after.yml
4242

43+
- ${{ if eq(variables['system.collectionId'], '011b8bdf-6d56-4f87-be0d-0092136884d9') }}:
44+
- powershell: |
45+
New-Item -ItemType Directory ${env:Build_ArtifactStagingDirectory}\locAssets
46+
- powershell: |
47+
Copy-Item src\LibraryManager.Vsix\Commands\CommandTable\LocalizationFiles\VSCommandTable.en.xlf src\LibraryManager.Vsix\Commands\CommandTable\LocalizationFiles\VSCommandTable.xlf
48+
- task: OneLocBuild@2
49+
env:
50+
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
51+
inputs:
52+
locProj: 'Localize/LocProject.json'
53+
outDir: '$(Build.ArtifactStagingDirectory)\locAssets'
54+
repoType: github
55+
gitHubPatVariable: '$(OneLocGitHubPat)'
56+
prSourceBranchPrefix: 'locfiles'
57+
condition: ne(variables['Build.Reason'], 'PullRequest')
58+
- task: PublishBuildArtifacts@1
59+
inputs:
60+
PathtoPublish: '$(Build.ArtifactStagingDirectory)\locAssets'
61+
ArtifactName: locAssets
62+
ArtifactType: Container
63+
displayName: Publish artifacts
64+
4365
- task: CopyFiles@1
4466
inputs:
4567
contents: |

azure-pipelines/official.yml

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ variables:
88
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
99
BuildConfiguration: Release
1010
BuildPlatform: Any CPU
11-
DisableMAT: true
1211

1312
jobs:
1413
- job: Windows

src/Directory.Build.targets

-23
This file was deleted.

src/LibraryManager.Contracts/Microsoft.Web.LibraryManager.Contracts.csproj

-4
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@
1616
<ItemGroup Condition="'$(TargetFramework)'=='net472'">
1717
<Reference Include="System.Runtime" />
1818
</ItemGroup>
19-
<!-- Needed for Multilingual App Toolkit-->
20-
<ItemGroup>
21-
<XliffResource Include="MultilingualResources\*.xlf" />
22-
</ItemGroup>
2319
<ItemGroup>
2420
<Compile Update="Resources\Text.Designer.cs">
2521
<DesignTime>True</DesignTime>

src/LibraryManager.Vsix/Microsoft.Web.LibraryManager.Vsix.csproj

+2-5
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@
152152
<None Include="source.extension.vsixmanifest">
153153
<SubType>Designer</SubType>
154154
<Generator>VsixManifestGenerator</Generator>
155-
<LastGenOutput>source.extension.en.resx</LastGenOutput>
155+
<LastGenOutput>source.extension.resx</LastGenOutput>
156156
</None>
157157
</ItemGroup>
158158
<ItemGroup>
@@ -347,7 +347,7 @@
347347
<MergeWithCTO>true</MergeWithCTO>
348348
<LogicalName>VSPackage.zh-Hant.Resources</LogicalName>
349349
</EmbeddedResource>
350-
<EmbeddedResource Include="source.extension.en.resx">
350+
<EmbeddedResource Include="source.extension.resx">
351351
<AutoGen>True</AutoGen>
352352
<DesignTime>True</DesignTime>
353353
<DependentUpon>source.extension.vsixmanifest</DependentUpon>
@@ -410,9 +410,6 @@
410410
<ItemGroup>
411411
<None Include="Commands\CommandTable\LocalizationFiles\VSCommandTable.*.xlf" />
412412
</ItemGroup>
413-
<ItemGroup>
414-
<XliffResource Include="MultilingualResources\*.xlf" />
415-
</ItemGroup>
416413
<ItemGroup>
417414
<FilesToSign Include="$(OutputPath)\Minimatch.dll;$(OutputPath)\Nerdbank.Streams.dll">
418415
<Authenticode>3PartySHA2</Authenticode>

src/LibraryManager.Vsix/MultilingualResources/Microsoft.Web.LibraryManager.Vsix.cs.xlf

-211
This file was deleted.

0 commit comments

Comments
 (0)