-
Notifications
You must be signed in to change notification settings - Fork 377
Change templating support to new system #7536
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
Conversation
| $jsonFiles += Get-ChildItem -Recurse -Path "$SourcesDirectory" | Where-Object { $_.FullName -Match "en\\strings\.json" } # current winforms pattern | ||
| $jsonTemplateFiles = Get-ChildItem -Recurse -Path "$SourcesDirectory" | Where-Object { $_.FullName -Match "\.template\.config\\localize\\.+\.en\.json" } # .NET templating pattern | ||
| $jsonTemplateFiles | ForEach-Object { | ||
| $null = $_.Name -Match "(.+)\.[\w-]+\.json" # matches '[filename].[langcode].json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$null = ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's a powershell-ism. disposes the created variable :)
| $jsonFiles = @() | ||
| $jsonFiles += Get-ChildItem -Recurse -Path "$SourcesDirectory" | Where-Object { $_.FullName -Match "\.template\.config\\localize\\en\..+\.json" } # .NET templating pattern | ||
| $jsonFiles += Get-ChildItem -Recurse -Path "$SourcesDirectory" | Where-Object { $_.FullName -Match "en\\strings\.json" } # current winforms pattern | ||
| $jsonTemplateFiles = Get-ChildItem -Recurse -Path "$SourcesDirectory" | Where-Object { $_.FullName -Match "\.template\.config\\localize\\.+\.en\.json" } # .NET templating pattern |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
non actionable: i just noticed that stub files create in our repo are .templatestrings.json instead of templatestrings..json
That's probably what made dotnet/templating#3296 messy:

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
precisely! @bekir-ozturk and I have talked about renaming the templates so onelocbuild supports them, and this work makes sure the names are handled properly when they get pushed in.
|
@jonfortescue just to double check: are you expecting repos with templates to provide files for all languages or only english? why do you need to copy the file en.templatestrings.json as templatestrings.json without lang code? |
|
@vlada-shubina the en is the base file from which translations are created; all languages end up being returned but only one file needs to be submitted. |
Closes dotnet/core-eng#13399.
dotnet/templating has a new format for templates (per our request actually!). This adds support for it. Test build here showing it works as a proof of concept.
To double check: