Skip to content

Conversation

@bekir-ozturk
Copy link
Contributor

@bekir-ozturk bekir-ozturk commented Dec 8, 2021

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

  • Adds <UsingToolTemplateLocalizer>true</> to projects containing templates.
  • Adds necessary id fields into template.json files to allow localizing certain fields (specifically, post actions).
  • Generates localization files to be translated by loc team

What to expect after merging

Every time there is a change to one of the templates:

  • The dev making the change should build (at the very least) the modified template project. This will update the loc files on the local working copy,
  • Push the loc files together with the template modifications. Review & merge.
  • OneLocBuild integration will automatically pick up the changes and will send them for translation.
  • You will receive a PR containing the translated template loc files when they are ready. Review & merge.
Microsoft Reviewers: Open in CodeFlow

@bekir-ozturk bekir-ozturk requested a review from a team as a code owner December 8, 2021 17:32
@ghost ghost assigned bekir-ozturk Dec 8, 2021
@bekir-ozturk bekir-ozturk changed the title Enable localizing templates Enable template localization on dotnet CLI Dec 8, 2021
vlada-shubina
vlada-shubina previously approved these changes Dec 8, 2021
Copy link
Contributor

@RussKie RussKie left a comment

Choose a reason for hiding this comment

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

There appears to be a lot of "noisy" changes, that don't carry any value.

"author": "Microsoft",
"name": "Aplicación de Windows Forms",
"description": "Plantilla de proyecto para crear una aplicación de Windows Forms (WinForms) de .NET.",
"description": "Plantilla de proyecto para crear una aplicación de Windows\u00A0Forms (WinForms) de .NET.",
Copy link
Contributor

Choose a reason for hiding this comment

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

Why was this changed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In some cases, loc team used hard spaces that won't break into a new line instead of a regular whitespace character. Our automated tool is configured to encode such symbols into \u#### form.
Hopefully, the tooling they are using will be able to deal with this change. But if starts going back and forth, we will update the tool to preserve the current encoding.

Copy link
Member

Choose a reason for hiding this comment

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

@bekir-ozturk , this change is causing the problem. Loc pipeline converted this back to its original state removing the \u####. But local build adds it back and thus every time you sync with main and try to build repo locally, you will be getting this unwanted change as modified one. Is this change communicated to loc pipeline?

@RussKie RussKie added area-Templates waiting-author-feedback The team requires more information from the author labels Dec 9, 2021
@ghost ghost removed the waiting-author-feedback The team requires more information from the author label Dec 9, 2021
@ghost
Copy link

ghost commented Dec 9, 2021

Hello @RussKie!

Because this pull request has the :octocat: automerge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

Happy to oblige

@ghost ghost merged commit b334a01 into main Dec 9, 2021
@ghost ghost deleted the dev/bozturk/enable-localizing-templates branch December 9, 2021 10:25
@ghost ghost added this to the 7.0 Preview1 milestone Dec 9, 2021
dreddy-work added a commit that referenced this pull request Dec 29, 2021
Untill the issue discussed here  #6319 (comment) resolved.
dreddy-work added a commit that referenced this pull request Dec 29, 2021
Untill the issue discussed here  #6319 (comment) resolved.
Danil-Andrianov pushed a commit to Danil-Andrianov/winforms that referenced this pull request Jan 10, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Jan 25, 2022
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants