Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check the localizations into the project nightly #16835

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
34261dd
okay just try it
DHowett May 17, 2023
b723aaf
okay just try it ii
DHowett May 17, 2023
a69f569
okay just try it iii
DHowett May 17, 2023
e544692
foo bar baz
DHowett May 17, 2023
f719185
baz far fozz
DHowett May 17, 2023
db0fb14
Try to normalize line endings....... ffs
DHowett May 19, 2023
e745011
Merge remote-tracking branch 'origin/main' into dev/duhowett/what-if-…
DHowett Mar 6, 2024
a545a2e
Well let's just try it
DHowett Mar 6, 2024
26a90b1
I always get something wrong
DHowett Mar 6, 2024
852354a
Yeah i'm using tar for this what of it
DHowett Mar 6, 2024
88bddb7
Okay i hate it too
DHowett Mar 6, 2024
3ba5838
idk i guess no base then?
DHowett Mar 6, 2024
77cb4c3
Foo
DHowett Mar 6, 2024
7f7a73d
Actually, don't edit the CascadiaPackage resources
DHowett Mar 6, 2024
1135e66
skip spellcheck for all non-en-us resources
DHowett Mar 6, 2024
f639909
Set loc target to true
DHowett Mar 6, 2024
f0168ad
Spellbot consvc
DHowett Mar 6, 2024
083b052
No longer must we fetch localizations during release builds!
DHowett Mar 6, 2024
18967d1
Revert "Actually, don't edit the CascadiaPackage resources"
DHowett Mar 6, 2024
c7a2ec1
On second thought...
DHowett Mar 6, 2024
b40f738
Try to fix CRLF I guess
DHowett Mar 7, 2024
f067b54
ffs try the branch thing
DHowett Mar 7, 2024
914ac8c
OH I SEE, THE DOCS JUST LIE
DHowett Mar 7, 2024
ae8c38f
Context Menu Merge: fully standardize XML writing
DHowett Mar 7, 2024
a3b99e3
Propagate the en-us context menu changes
DHowett Mar 7, 2024
e00f944
restore normlacy, speelboot
DHowett Mar 7, 2024
806c6f9
Maybe the only en-us change was ContextMenu; in that case, we actuall…
DHowett Mar 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/actions/spelling/allow/allow.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ changelog
clickable
clig
CMMI
consvc
copyable
Counterintuitively
CtrlDToClose
Expand Down
1 change: 1 addition & 0 deletions .github/actions/spelling/excludes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,4 @@
^tools/ReleaseEngineering/ServicingPipeline\.ps1$
^XamlStyler\.json$
ignore$
Resources/(?!en)
1 change: 1 addition & 0 deletions .github/actions/spelling/expect/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ aumid
Authenticode
AUTOBUDDY
AUTOCHECKBOX
autocrlf
autohide
AUTOHSCROLL
automagically
Expand Down
60 changes: 52 additions & 8 deletions build/pipelines/daily-loc-submission.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ schedules:
- main
always: false # only run if there's code changes!


parameters:
- name: targetBranch
type: string
default: "automated/loc-update"

pool:
vmImage: windows-2019

Expand Down Expand Up @@ -38,6 +44,13 @@ steps:
persistCredentials: true
path: s/Terminal.Internal

- pwsh: |-
Install-Module PSGitHub -Scope CurrentUser -Force
git config --local user.email "consvc@microsoft.com"
git config --local user.name "Console Service Bot"
git config --local core.autocrlf true
Fixed Show fixed Hide fixed
displayName: Prepare git submission environment

- task: MicrosoftTDBuild.tdbuild-task.tdbuild-task.TouchdownBuildTask@1
displayName: 'Touchdown Build - 7105, PRODEXT'
inputs:
Expand All @@ -51,13 +64,44 @@ steps:
outputDirectoryRoot: LocOutput
appendRelativeDir: true
pseudoSetting: Included
localizationTarget: true

# Saving one of these makes it really easy to inspect the loc output...
- powershell: 'tar czf LocOutput.tar.gz LocOutput'
displayName: 'Archive Loc Output for Submission'
- pwsh: |-
Remove-Item -EA:Ignore -R -Force LocOutput\Terminal.Internal
$Files = Get-ChildItem LocOutput -R -Include 'ContextMenu.resw','Resources.resw' | ? FullName -Like '*en-US\*\*.resw'
$Files | % { Move-Item -Verbose $_.Directory $_.Directory.Parent.Parent -EA:Ignore }
& tar.exe -c -f LocOutputMunged.tar -C LocOutput .
& tar.exe -x -v -f LocOutputMunged.tar
rm LocOutputMunged.tar
rm -r -fo LocOutput
& ./build/scripts/Copy-ContextMenuResourcesToCascadiaPackage.ps1
displayName: Move Loc files to the right places

- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: LocOutput'
inputs:
PathtoPublish: LocOutput.tar.gz
ArtifactName: LocOutput
- pwsh: |-
git add **/*.resw
git status
git diff --quiet --cached --exit-code
If ($LASTEXITCODE -Ne 0) {
$Now = Get-Date
git commit -m "Localization Updates - $Now"
git push origin HEAD:refs/heads/${{parameters.targetBranch}} -f
Write-Host "##vso[task.setvariable variable=ChangesPushedToRepo]1"
} Else {
Write-Host "##vso[task.setvariable variable=ChangesPushedToRepo]0"
}
displayName: git commit and push

- pwsh: |-
Import-Module PSGitHub
$BaseBranch = "$(Build.SourceBranch)" -Replace "^refs/heads/",""
Write-Host "Preparing PR against $BaseBranch"
$PSDefaultParameterValues['*GitHub*:Owner'] = "microsoft"
$PSDefaultParameterValues['*GitHub*:RepositoryName'] = "terminal"
$PSDefaultParameterValues['*GitHub*:Token'] = ("$(GithubPullRequestToken)" | ConvertTo-SecureString -AsPlainText -Force)
$existingPr = Get-GitHubPullRequest -HeadBranch "${{parameters.targetBranch}}" -BaseBranch $BaseBranch
If ($null -Eq $existingPr) {
$Now = Get-Date
New-GitHubPullRequest -Head "${{parameters.targetBranch}}" -Base $BaseBranch -Title "Localization Updates - $BaseBranch - $Now" -Verbose
}
displayName: Publish pull request
condition: and(eq(variables['ChangesPushedToRepo'], '1'), succeeded())
4 changes: 0 additions & 4 deletions build/pipelines/templates-v2/pipeline-full-release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,6 @@ stages:
packageListDownload: e82d490c-af86-4733-9dc4-07b772033204
versionListDownload: ${{ parameters.terminalInternalPackageVersion }}

- template: ./steps-fetch-and-prepare-localizations.yml
parameters:
includePseudoLoc: true

- ${{ if eq(parameters.buildWPF, true) }}:
# Add an Any CPU build flavor for the WPF control bits
- template: ./job-build-project.yml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,6 @@ extends:
packageListDownload: e82d490c-af86-4733-9dc4-07b772033204
versionListDownload: ${{ parameters.terminalInternalPackageVersion }}

- template: ./build/pipelines/templates-v2/steps-fetch-and-prepare-localizations.yml@self
parameters:
includePseudoLoc: true

- ${{ if eq(parameters.buildWPF, true) }}:
# Add an Any CPU build flavor for the WPF control bits
- template: ./build/pipelines/templates-v2/job-build-project.yml@self
Expand Down

This file was deleted.

18 changes: 16 additions & 2 deletions build/scripts/Copy-ContextMenuResourcesToCascadiaPackage.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ $LocalizationsFromContextMenu | ForEach-Object {
ForEach ($pair in $Languages.GetEnumerator()) {
$LanguageDir = "./src/cascadia/CascadiaPackage/Resources/$($pair.Key)"
$ResPath = "$LanguageDir/Resources.resw"
$XmlDocument = $null
$PreexistingResw = Get-Item $ResPath -EA:Ignore
If ($null -eq $PreexistingResw) {
Write-Host "Copying $($pair.Value.FullName) to $ResPath"
$XmlDocument = [xml](Get-Content $pair.Value.FullName)
New-Item -type Directory $LanguageDir -EA:Ignore
Copy-Item $pair.Value.FullName $ResPath
} Else {
# Merge Them!
Write-Host "Merging $($pair.Value.FullName) into $ResPath"
Expand All @@ -29,6 +30,19 @@ ForEach ($pair in $Languages.GetEnumerator()) {
$newXml.root.data | % {
$null = $existingXml.root.AppendChild($existingXml.ImportNode($_, $true))
}
$existingXml.Save($PreexistingResw.FullName)
$XmlDocument = $existingXml # (which has been updated)
}

# Reset paths to be absolute (for .NET)
$LanguageDir = (Get-Item $LanguageDir).FullName
Comment on lines +36 to +37
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolve-Path?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would probably work as well.

$ResPath = "$LanguageDir/Resources.resw"
# Force the "new" and "preexisting" paths to serialize with XmlWriter,
# to ensure consistency.
$writerSettings = [System.Xml.XmlWriterSettings]::new()
$writerSettings.NewLineChars = "`r`n"
$writerSettings.Indent = $true
$writer = [System.Xml.XmlWriter]::Create($ResPath, $writerSettings)
$XmlDocument.Save($writer)
$writer.Flush()
$writer.Close()
Comment on lines +41 to +47
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$XmlDocument.Save($ResPath)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you look on the red side of the diff, I removed exactly that code 😄

I was seeing cases where it saved some lines with \n and some with \r\n. Yes. No, seriously.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I didn't even notice that.
This may be worth a comment IMO. When I read "consistency" I was wondering "what consistency". 😅

}
48 changes: 31 additions & 17 deletions src/cascadia/CascadiaPackage/Resources/en-US/Resources.resw
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<root>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file changed because we no longer run the script before every build... so it's gotta be finalized.

<!--
Microsoft ResX Schema
Expand Down Expand Up @@ -119,66 +119,80 @@
</resheader>
<data name="AppName" xml:space="preserve">
<value>Terminal</value>
<comment>{Locked}</comment>
<comment>{Locked=qps-ploc,qps-ploca,qps-plocm}</comment>
</data>
<data name="AppNameDev" xml:space="preserve">
<value>Terminal Dev</value>
<comment>{Locked}</comment>
<comment>{Locked} The dev build will never be seen in multiple languages</comment>
</data>
<data name="AppNameCan" xml:space="preserve">
<value>Terminal Canary</value>
<comment>{Locked}</comment>
<comment>{Locked=qps-ploc,qps-ploca,qps-plocm}</comment>
</data>
<data name="AppNamePre" xml:space="preserve">
<value>Terminal Preview</value>
<comment>{Locked}</comment>
<comment>{Locked=qps-ploc,qps-ploca,qps-plocm}</comment>
</data>
<data name="AppStoreName" xml:space="preserve">
<value>Windows Terminal</value>
<comment>{Locked}</comment>
<comment>{Locked=qps-ploc,qps-ploca,qps-plocm}</comment>
</data>
<data name="AppStoreNameDev" xml:space="preserve">
<value>Windows Terminal Dev</value>
<comment>{Locked}</comment>
<comment>{Locked} The dev build will never be seen in multiple languages</comment>
</data>
<data name="AppStoreNameCan" xml:space="preserve">
<value>Windows Terminal Canary</value>
<comment>{Locked}</comment>
<comment>{Locked=qps-ploc,qps-ploca,qps-plocm}. "Canary" in this context means an unstable or nightly build of a software product, not the bird.</comment>
</data>
<data name="AppStoreNamePre" xml:space="preserve">
<value>Windows Terminal Preview</value>
<comment>{Locked}</comment>
<comment>{Locked=qps-ploc,qps-ploca,qps-plocm}</comment>
</data>
<data name="AppShortName" xml:space="preserve">
<value>Terminal</value>
<comment>{Locked}</comment>
<comment>{Locked=qps-ploc,qps-ploca,qps-plocm}</comment>
</data>
<data name="AppShortNameDev" xml:space="preserve">
<value>Terminal Dev</value>
<comment>{Locked}</comment>
<comment>{Locked} The dev build will never be seen in multiple languages</comment>
</data>
<data name="AppShortNameCan" xml:space="preserve">
<value>Terminal Canary</value>
<comment>{Locked}</comment>
<comment>{Locked=qps-ploc,qps-ploca,qps-plocm}</comment>
</data>
<data name="AppShortNamePre" xml:space="preserve">
<value>Terminal Preview</value>
<comment>{Locked}</comment>
<comment>{Locked=qps-ploc,qps-ploca,qps-plocm}</comment>
</data>
<data name="AppDescription" xml:space="preserve">
<value>The New Windows Terminal</value>
<comment>{Locked}</comment>
</data>
<data name="AppDescriptionDev" xml:space="preserve">
<value>The Windows Terminal, but Unofficial</value>
<comment>{Locked}</comment>
<comment>{Locked} The dev build will never be seen in multiple languages</comment>
</data>
<data name="AppDescriptionCan" xml:space="preserve">
<value>The Windows Terminal (Canary build)</value>
<comment>{Locked}</comment>
</data>
<data name="AppDescriptionPre" xml:space="preserve">
<value>Windows Terminal with a preview of upcoming features</value>
<comment>{Locked}</comment>
</data>
</root>
<data name="ShellExtension_OpenInTerminalMenuItem_Dev" xml:space="preserve">
<value>Open in Terminal (&amp;Dev)</value>
<comment>{Locked} The dev build will never be seen in multiple languages</comment>
</data>
<data name="ShellExtension_OpenInTerminalMenuItem_Canary" xml:space="preserve">
<value>Open in Terminal (&amp;Canary)</value>
<comment>This is a menu item that will be displayed in the Windows File Explorer that launches the Canary version of Windows Terminal. Please mark one of the characters to be an accelerator key.</comment>
</data>
<data name="ShellExtension_OpenInTerminalMenuItem_Preview" xml:space="preserve">
<value>Open in Terminal &amp;Preview</value>
<comment>This is a menu item that will be displayed in the Windows File Explorer that launches the Preview version of Windows Terminal. Please mark one of the characters to be an accelerator key.</comment>
</data>
<data name="ShellExtension_OpenInTerminalMenuItem" xml:space="preserve">
<value>Open in &amp;Terminal</value>
<comment>This is a menu item that will be displayed in the Windows File Explorer that launches the non-preview version of Windows Terminal. Please mark one of the characters to be an accelerator key.</comment>
</data>
</root>
Loading