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

Draft
wants to merge 3 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 changed the associated properties of ResourceCommandSnapshot and ResourceCommandAnnotation to functions that will produce a display string based on context (currently only locale).

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

I also added another method in ResourceBuilderExtensions, ResourceBuilderExtensions.WithLocalizedCommand, in case it would be desired to keep the WithCommand extension (because of the breaking change in arguments). Is there a different recommended approach?

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.

As this is a draft, I am especially looking for suggestions about design or naming.
 
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?
    • Yes
      • Is this introducing a breaking change?
    • No
Microsoft Reviewers: Open in CodeFlow

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.
1 participant