-
Notifications
You must be signed in to change notification settings - Fork 23
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
Accessibility: translate internal component labels #3717
Accessibility: translate internal component labels #3717
Conversation
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.
Really good reflections in your draft notes ! I don't think there would be a more clean way of handling translations than this, for such a small set of translations. let's not bring out the big hammer and do reactiveness before it is actually an identified need. good PR, great scope ! ❤️
libs/designsystem/shared/src/translation/translation.service.ts
Outdated
Show resolved
Hide resolved
libs/designsystem/shared/src/translation/translation.service.ts
Outdated
Show resolved
Hide resolved
libs/designsystem/shared/src/translation/translation.service.ts
Outdated
Show resolved
Hide resolved
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.
Great work, Raz 👌🏻
I like the scoping you've done, we can always later add support for changes to the locale 👍🏻
Maybe we can shorten the syntax a bit? I.e.
Consuming component:
constructor(
...,
public translations: TranslationService
) {
Template binding:
[attr.aria-label]="translations.get('previousMonth')"
and then in TranslationService:
get(key: keyof Translation): string {
return this.currentTranslation[key];
}
…ranslate-internal-labels
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.
Really nice work 👌🏻
Great docs!
Co-authored-by: Jakob Engelbrecht <jakob@basher.dk>
Great to finally get the issue closed 🎉 |
Hi @MortenGregersen 👋 Nice to see you around here again 😄 Before it was closed, #942 was the second-oldest open issue on our backlog. Only outlived by #803. |
Which issue does this PR close?
This PR closes #3694 closes #942
What is the new behavior?
Component labels are translated with newly added
TranslationService
. Translations are simple key-value pairs for ease of use, and because we intentionally want to bake in translations instead of handing over the burden to projects and i18n tooling.Scoping
Does this PR introduce a breaking change?
Are there any additional context?
Checklist:
The following tasks should be carried out in sequence in order to follow the process of contributing correctly.
Reminders
Review
When the pull request has been approved it will be merged to
develop
by Team Kirby.