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

Allow dynamic localization of command display name and descriptions #6984

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

adamint
Copy link
Member

@adamint adamint commented Dec 23, 2024

Description

It is not currently possible for resource commands to contain localizations for their display name, description, or confirmation message. This is problematic because the rest of the dashboard is localized depending on the client's current display locale.

I added 3 properties to ResourceCommandSnapshot and ResourceCommandAnnotation, functions that will produce a display string based on context (currently only locale).
I updated ResourceBuilderExtensions.WithCommand to accept the new optional parameters.

I also added localized display names and descriptions for the resources that we add (stop/start/restart).

We do not need to modify the dashboard client in any way other than passing the current display locale, as the page is reloaded on locale change.

Fixes #6982

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No tbd, asked about this
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No
  • Does the change require an update in our Aspire docs?
Microsoft Reviewers: Open in CodeFlow

@adamint adamint marked this pull request as ready for review December 26, 2024 20:06
@JamesNK
Copy link
Member

JamesNK commented Dec 30, 2024

I don't think we want to do this. And if we do want to do this, we shouldn't do it without discussing how localize all the values coming back from the resource service as a whole. Team dicussion and design meetings are required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[WebToolsE2E][Aspire] Some strings in the dashboard of Aspire 9.1 are not localized.
2 participants