Skip to content

Use top level statements does not have an accelerator key in display name for Visual Studio #42719

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

Closed
1 task done
phenning opened this issue Jul 13, 2022 · 11 comments
Closed
1 task done
Assignees
Labels
feature-templates old-area-web-frameworks-do-not-use *DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels
Milestone

Comments

@phenning
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

From https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1576097/

Accelerator key should be displayed for use top level statements (and probably other template defined options as well)

image

See also, dotnet/templating#4961

Expected Behavior

Some sort of accelerator key should be indicated.

Steps To Reproduce

Repro steps:
Launch VS and open NPD
Choose any web project template and click "Next" to "Additional information"
Click "Alt" on the keyboard
Observe the "Do not use top-level statements" option

Exceptions (if any)

No response

.NET Version

No response

Anything else?

No response

@TanayParikh
Copy link
Contributor

cc/ @DamianEdwards & @dougbu as this may impact ongoing localization efforts

@dougbu
Copy link
Contributor

dougbu commented Jul 13, 2022

I don't see a localization issue here. Added underscores in template.json or ide.host.json files should automatically cause those underscores to be reflected in templatestrings.en.json files (assuming the dev does a local build and includes updated localize/* files in their PR). The next OneLocBuild handback PR should propagate them to the other language files.

@Pilchie Pilchie added the old-area-web-frameworks-do-not-use *DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels label Jul 13, 2022
@phenning
Copy link
Contributor Author

@dougbu is correct, worse case is that non-enu would not have the accelerators until the updated language strings files got checked in by OneLocBuild.

@phenning
Copy link
Contributor Author

A bit greater concern is how dotnet new handles underscores in display names in the help text. I asked that question in the dotnet/templating version of this issue.

@dougbu
Copy link
Contributor

dougbu commented Jul 13, 2022

@phenning is it a bug that underscores are duplicated from template.json files (if that's where they first appear) into templatestrings.{lang}.json files as part of the $(UsingToolTemplateLocalizer) processing❔ I suspect underscores that appear only in ide.host.json files will avoid both any dotnet new issues and problematic translations but I'm not sure how accelerators work in a localized VS instance.

/cc @jonfortescue
/fyi @cristianosuzuki77

@phenning
Copy link
Contributor Author

I'm not sure what you mean, do you mean that a string like "Do not use _top level statements" would added to templatestrings.en.json as "Do not use __toplevel statements"? Have you seen this with other strings? That seems like it would be a bug to me, since I would think we would want the accelerator indicator preserved.

/cc @vlada-shubina

@dougbu
Copy link
Contributor

dougbu commented Jul 15, 2022

Sorry s/duplicated/copied/. I was asking if the accelerator indicator should appear anywhere but in ide.jost.json files and whether using it in template.json and the strings files would cause problems.

/fyi existing "translated" accelerator indicators:

As far as I can see, these strings aren't visible in the command-line help e.g. dotnet new install viewimports --help doesn't show an option to open the new ViewImports.cshtml file in an editor and dotnet new blazorwasm --help doesn't use the displayName properties referenced above.

@phenning
Copy link
Contributor Author

Vlada informed me that the CLI does not currently use the displayName property. So it is safe to put the accelerators into the template.json and templatestrings.json files as the displayName.

@jonfortescue
Copy link
Contributor

Accelerators can be loc'd, but under our current loc process they often require manual intervention to ensure we're not breaking our product with duplicate accelerators. There's not much we can do about that without significantly overhauling the loc process. Basically, if using accelerators, make sure to scrutinize the loc PR handbacks.

@vlada-shubina
Copy link
Member

According to dotnet/templating#4961 (comment) suggestion we will be using T as accelerator.

@captainsafia
Copy link
Member

Closed via #42802.

@ghost ghost locked as resolved and limited conversation to collaborators Aug 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-templates old-area-web-frameworks-do-not-use *DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels
Projects
None yet
Development

No branches or pull requests

8 participants