-
Notifications
You must be signed in to change notification settings - Fork 564
Enable template localization on dotnet CLI #6677
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
Enable template localization on dotnet CLI #6677
Conversation
| <Uri>https://github.com/dotnet/runtime</Uri> | ||
| <Sha>63715256cc94963d608ef3d683d2529332c5140c</Sha> | ||
| </Dependency> | ||
| <Dependency Name="Microsoft.TemplateEngine.Tasks" Version="7.0.100-alpha.1.21601.1"> |
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.
Do we need to add a Maestro subscription for this? Can it be a dependency of dotnet/installer, so when we get updates for dotnet/installer this number follows along?
See an example here on how ILLink updates along with dotnet/installer: #6670
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.
Adding dependency is possible, but updates will be coming quite frequently - in templating all the packages are produced on any change (even unrelated to package).
Alternative is to add the task via Arcade SDK, I see the repo has already reference to it https://github.com/xamarin/xamarin-android/blob/71e6ecd67b08394482317c94db9ff35dc051ffbc/global.json#L7 and dependency https://github.com/xamarin/xamarin-android/blob/71e6ecd67b08394482317c94db9ff35dc051ffbc/eng/Version.Details.xml#L21-L24
But this version is very old, we need to update it. Also template localization task is only available from arcade SDK 7, if you need to stay on 6 - we might need to backport it.
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.
yeah need to know for us too.
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.
@pjcollins should we setup a weekly subscription for dotnet/arcade?
We might also need to configure a few things so the version number is used throughout our build.
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.
I vaguely remember maestro updates failing for arcade in the past. I think we'll need to bring more of the arcade sdk into the eng/ folder to get arcade updates to flow through maestro, but I am not positive. I can try to look at that this week, but for now maybe we can manually bump this version for this PR?
|
@jonathanpeppers @pjcollins another problem to solve is how to handoff/handback generated json files to OneLocBuild. |
To finalize the effort, we need to include also similar script here dotnet/macios@477757f. |
|
@vlada-shubina could we do this in MSBuild in this project? And make a target that runs before |
Yes, that's also possible. It should be done after |
|
@vlada-shubina you should be able to check if |
|
@vlada-shubina @rokonec we've started running OneLocBuild as of fa9629d. However, the repo is still pending onboarding via https://ceapex.visualstudio.com/CEINTL/_workitems/edit/663104. Do we need to wait for that process to complete before picking this work up again, or is the OneLocBuild job addition enough to unblock this? |
|
it should be enough to have the job added to start it, however during onboarding you should mention that you'll be localizing templates as well, afaik this needs additional setup on their side as well. Are you using arcade scripts for localization or do you have your own? Basically the following steps are needed:
On localization hand back you need to ensure that translated files are put to localize folder in .template.config folder. If you use arcade scripts, they already do all steps above. |
|
I've pulled these changes into #7248, I think we'll be able to close this in favor of that new one. |
|
Superseded by PR #7248, which has been merged. Thanks! |
Background:
Template engine (
dotnet new) added support for template localizations in .NET 6.0. This new system replaces the old way of localizing templates that only worked on Visual Studio and works on both .NET CLI as well as VS.This PR introduces changes to switch to the new template localization system.
Summary of the changes
<LocalizeTemplates>true</>to project containing templates.What to expect after merging
Every time there is a change to one of the templates: