Skip to content

Commit 301f9b3

Browse files
Cosifnearunchndr
andauthored
Onboard Localization pipeline (#5990)
* Prep for localization * Add package.nls.json and one LOC strings for test sample * Install l10n and l10n-dev * Uninstall vscode-nls-dev * Add l10n path * Modify package * Update to vscode 1.73 * Add one localized target string * Add script * Add reverse script * Add a stub task * Clean up * Clean up * Add LOCProject.json * Add loc.yml * Temp skip the build to verify * Use script * Add back prerequest * Checkout build.yml back * Update loc.yml * Fix : * Checkout repo * Fix path * Referencing PAT * Comment out the pacakge ID * Add lclPacakgeId * Add publish build artifacts task * Comment out task * Modity the task * Use LCL-JUNO-PROD-VSCODECS * Install vscode-l10n * Add script * Fix typo * Import xlf back to json * Also publish l10n file * Include xlf files in gitignore * Part of the script * Install octokit * Uninstall simple-git * Script in progress * Script in progress * Script in progress * Link script to yml * Install gulp * Update gulp file * Update filter * Update task * Update script * Remove * Add target branch * Change diff * Modify task * Fix git diff * Add rest of git command * Modify the script * Add GitHub PullRequest Creation * Add code owner * Install gulp * Check the existence of pull request * Check if PR is open * Merge script * Debug * Debug * Modify script * Use path.basename * Use a different pool * Fix style problem * Use git reset * Remote add * Alias * Polish output * Remote add with token * Fix syntax * Try use node 18 * Put token in client * Fix style * Remove auth() * Change code owner * Fix Uri * Fix owner and repo * Debug * Fix issue when checking PR * Clean up * Clean up yml * Add condition to only loc from a branch * Change package.json * Change this back to main * Clean up * Remove unused packages * Remove unused packages * Clean up * Add bundle.json generation to compile task * Hardcode dotnet and make userName and email optional * Revert back the \u200b changes * Generated bundle.l10n.json * Optimize script * Fix the namespace problem after merge * Add the content change for razor * Use path.sep * Compare head * Check if file exist * Use log error in vso * Revert "Check if file exist" This reverts commit 11a6c97. * Update package.json.lock --------- Co-authored-by: Arun Chander <[email protected]>
1 parent 78b8603 commit 301f9b3

23 files changed

+1492
-142
lines changed

azure-pipelines/loc.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
trigger: none
2+
pr: none
3+
4+
parameters:
5+
- name: publishLocalizationFile
6+
type: boolean
7+
default: true
8+
9+
variables:
10+
# Variable group contains the PAT to LOC
11+
- group: OneLocBuildVariables
12+
13+
stages:
14+
- stage: LocalizationStage
15+
condition: eq(variables['Build.SourceBranch'], 'refs/heads/main')
16+
jobs:
17+
- job: Localization
18+
pool:
19+
name: NetCore1ESPool-Internal
20+
demands: ImageOverride -equals windows.vs2022preview.amd64
21+
steps:
22+
- task: NodeTool@0
23+
displayName: 'Install Node.js 18.x'
24+
inputs:
25+
# Octokit client needs 18.x to have 'fetch' function.
26+
versionSpec: '18.x'
27+
- checkout: self
28+
clean: true
29+
submodules: true
30+
fetchTags: false
31+
fetchDepth: 0
32+
- pwsh: |
33+
npm install
34+
npm install -g @vscode/l10n-dev
35+
npm install -g gulp
36+
displayName: 'Install tools'
37+
- pwsh: npm run compile
38+
displayName: 'Compile'
39+
- pwsh: npm run l10nDevGenerateLocalizationBundle
40+
displayName: 'Generate bundle.l10.json'
41+
- pwsh: npm run l10nDevGenerateXlf
42+
displayName: 'Generate xlf files from bundle.10n.json'
43+
- task: OneLocBuild@2
44+
env:
45+
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
46+
inputs:
47+
locProj: loc/LocProject.json
48+
outDir: '$(Build.SourcesDirectory)/loc'
49+
isCreatePrSelected: false
50+
patVariable: $(dn-bot-ceapex-package-r)
51+
packageSourceAuth: patAuth
52+
lclSource: lclFilesfromPackage
53+
LclPackageId: 'LCL-JUNO-PROD-VSCODECS'
54+
- pwsh: npm run l10nDevImportXlf
55+
displayName: 'Import xlf to json.'
56+
- pwsh: gulp 'publish localization content' --userName dotnet-bot --email [email protected] --commitSha $(Build.SourceVersion) --targetRemoteRepo vscode-csharp --baseBranch 'main'
57+
displayName: 'Create PR in GitHub.'
58+
env:
59+
GitHubPAT: $(BotAccount-dotnet-bot-repo-PAT)
60+
- task: PublishBuildArtifacts@1
61+
displayName: 'Publish Localization Files'
62+
inputs:
63+
PathtoPublish: '$(Build.SourcesDirectory)/loc'
64+
PublishLocation: Container
65+
ArtifactName: Loc
66+
condition: ${{ parameters.publishLocalizationFile }}
67+
- task: PublishBuildArtifacts@1
68+
displayName: 'Publish l10n file'
69+
inputs:
70+
PathtoPublish: '$(Build.SourcesDirectory)/l10n'
71+
PublishLocation: Container
72+
ArtifactName: l10n
73+
condition: ${{ parameters.publishLocalizationFile }}

gulpfile.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import * as packageDependencyUpdater from './src/tools/updatePackageDependencies
1010
require('./tasks/testTasks');
1111
require('./tasks/offlinePackagingTasks');
1212
require('./tasks/backcompatTasks');
13+
require('./tasks/localizationTasks');
1314

1415
// Disable warning about wanting an async function
1516
// tslint:disable-next-line

l10n/bundle.l10n.json

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
{
2+
"Cannot load Razor language server because the directory was not found: '{0}'": "Cannot load Razor language server because the directory was not found: '{0}'",
3+
"Could not find '{0}' in or above '{1}'.": "Could not find '{0}' in or above '{1}'.",
4+
"Invalid trace setting for Razor language server. Defaulting to '{0}'": "Invalid trace setting for Razor language server. Defaulting to '{0}'",
5+
"Could not find Razor Language Server executable within directory '{0}'": "Could not find Razor Language Server executable within directory '{0}'",
6+
"Server failed to start after retrying 5 times.": "Server failed to start after retrying 5 times.",
7+
"Razor Language Server failed to start unexpectedly, please check the 'Razor Log' and report an issue.": "Razor Language Server failed to start unexpectedly, please check the 'Razor Log' and report an issue.",
8+
"Tried to send requests while server is not started.": "Tried to send requests while server is not started.",
9+
"Tried to bind on request logic while server is not started.": "Tried to bind on request logic while server is not started.",
10+
"Tried to bind on notification logic while server is not started.": "Tried to bind on notification logic while server is not started.",
11+
"Cannot stop Razor Language Server as it is already stopped.": "Cannot stop Razor Language Server as it is already stopped.",
12+
"Razor Language Server failed to stop correctly, please check the 'Razor Log' and report an issue.": "Razor Language Server failed to stop correctly, please check the 'Razor Log' and report an issue.",
13+
"Would you like to restart the Razor Language Server to enable the Razor trace configuration change?": "Would you like to restart the Razor Language Server to enable the Razor trace configuration change?",
14+
"Restart": "Restart",
15+
"Razor HTML Preview": "Razor HTML Preview",
16+
"Unexpected error when attaching to HTML preview window.": "Unexpected error when attaching to HTML preview window.",
17+
"Razor HTML copied to clipboard": "Razor HTML copied to clipboard",
18+
"Report a Razor issue": "Report a Razor issue",
19+
"Host document file path": "Host document file path",
20+
"Virtual document file path": "Virtual document file path",
21+
"Copy Html": "Copy Html",
22+
"Token cancellation requested: {0}": "Token cancellation requested: {0}",
23+
"Synchronization timed out": "Synchronization timed out",
24+
"Report Razor Issue": "Report Razor Issue",
25+
"Unexpected error when attaching to report Razor issue window.": "Unexpected error when attaching to report Razor issue window.",
26+
"You must first start the data collection before copying.": "You must first start the data collection before copying.",
27+
"Razor issue copied to clipboard": "Razor issue copied to clipboard",
28+
"Razor issue data collection started. Reproduce the issue then press \"Stop\"": "Razor issue data collection started. Reproduce the issue then press \"Stop\"",
29+
"You must first start the data collection before stopping.": "You must first start the data collection before stopping.",
30+
"Razor issue data collection stopped. Copying issue content...": "Razor issue data collection stopped. Copying issue content...",
31+
"Start": "Start",
32+
"Press {0}": "Press {0}",
33+
"Perform the actions (or no action) that resulted in your Razor issue": "Perform the actions (or no action) that resulted in your Razor issue",
34+
"Stop": "Stop",
35+
"Click {0}. This will copy all relevant issue information.": "Click {0}. This will copy all relevant issue information.",
36+
"Go to GitHub": "Go to GitHub",
37+
"{0}, paste your issue contents as the body of the issue. Don't forget to fill out any details left unfilled.": "{0}, paste your issue contents as the body of the issue. Don't forget to fill out any details left unfilled.",
38+
"Privacy Alert! The contents copied to your clipboard may contain personal data. Prior to posting to GitHub, please remove any personal data which should not be publicly viewable.": "Privacy Alert! The contents copied to your clipboard may contain personal data. Prior to posting to GitHub, please remove any personal data which should not be publicly viewable.",
39+
"Copy issue content again": "Copy issue content again",
40+
"Cannot start collecting Razor logs when {0} is set to {1}. Please set {0} to {2} and then reload your VSCode environment and re-run the report Razor issue command.": "Cannot start collecting Razor logs when {0} is set to {1}. Please set {0} to {2} and then reload your VSCode environment and re-run the report Razor issue command.",
41+
"Non Razor file as active document": "Non Razor file as active document",
42+
"Could not determine CSharp content": "Could not determine CSharp content",
43+
"Could not determine Html content": "Could not determine Html content",
44+
"A valid dotnet installation could not be found: {0}": "A valid dotnet installation could not be found: {0}",
45+
"Is this a Bug or Feature request?": "Is this a Bug or Feature request?",
46+
"Bug": "Bug",
47+
"Steps to reproduce": "Steps to reproduce",
48+
"Please fill in this section": "Please fill in this section",
49+
"Description of the problem": "Description of the problem",
50+
"Expected behavior": "Expected behavior",
51+
"Actual behavior": "Actual behavior",
52+
"Logs": "Logs",
53+
"OmniSharp": "OmniSharp",
54+
"Razor": "Razor",
55+
"Expand": "Expand",
56+
"Workspace information": "Workspace information",
57+
"Razor document": "Razor document",
58+
"Projected CSharp document": "Projected CSharp document",
59+
"Projected Html document": "Projected Html document",
60+
"Machine information": "Machine information",
61+
"Razor.VSCode version": "Razor.VSCode version",
62+
"VSCode version": "VSCode version",
63+
"Extensions": "Extensions",
64+
"Projected CSharp as seen by extension": "Projected CSharp as seen by extension",
65+
"Unable to resolve VSCode's version of CSharp": "Unable to resolve VSCode's version of CSharp",
66+
"Projected Html as seen by extension": "Projected Html as seen by extension",
67+
"Unable to resolve VSCode's version of Html": "Unable to resolve VSCode's version of Html",
68+
"Unable to find Razor extension version.": "Unable to find Razor extension version.",
69+
"Extension": "Extension",
70+
"Author": "Author",
71+
"Version": "Version",
72+
"Razor C# Preview": "Razor C# Preview",
73+
"Unexpected error when attaching to C# preview window.": "Unexpected error when attaching to C# preview window.",
74+
"Razor C# copied to clipboard": "Razor C# copied to clipboard",
75+
"Copy C#": "Copy C#",
76+
"Unexpected completion trigger kind: {0}": "Unexpected completion trigger kind: {0}",
77+
"1 reference": "1 reference",
78+
"{0} references": "{0} references",
79+
"Run and Debug: auto-detection found {0} for a launch browser": "Run and Debug: auto-detection found {0} for a launch browser",
80+
"There was an unexpected error while launching your debugging session. Check the console for helpful logs and visit the debugging docs for more info.": "There was an unexpected error while launching your debugging session. Check the console for helpful logs and visit the debugging docs for more info.",
81+
"View Debug Docs": "View Debug Docs",
82+
"Ignore": "Ignore",
83+
"Run and Debug: A valid browser is not installed": "Run and Debug: A valid browser is not installed",
84+
"Restart Language Server": "Restart Language Server"
85+
}

loc/LocProject.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"Projects": [
3+
{
4+
"LanguageSet": "VS_Main_Languages",
5+
"LocItems": [
6+
{
7+
"SourceFile": "./loc/vscode-csharp.xlf",
8+
"CopyOption": "LangIDOnName",
9+
"OutputPath": "./loc/"
10+
}
11+
]
12+
}
13+
]
14+
}

0 commit comments

Comments
 (0)