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

Accessibility: translate internal component labels #3717

Merged
merged 21 commits into from
Dec 4, 2024

Conversation

RasmusKjeldgaard
Copy link
Collaborator

@RasmusKjeldgaard RasmusKjeldgaard commented Nov 21, 2024

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

  • Setting translation from locale only happens on initialization right now.
  • Currently no way to register own translation or overwrite existing translation

Does this PR introduce a breaking change?

  • Yes
  • No

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

  • Make sure you have implemented tests following the guidelines in: "The good: Test".
  • Make sure you have updated the cookbook with examples and showcases (for bug fixes, enhancements & new components).

Review

  • Determine if your changes are a fix, feature or breaking-change, and add the matching label to your PR. If it is tooling, dependency updates or similar, add ignore-for-release.
  • Do a self-review.
  • Request that the changes are code-reviewed
  • Request that the changes are UX reviewed (only necessary if your PR introduces visual changes)

When the pull request has been approved it will be merged to develop by Team Kirby.

@RasmusKjeldgaard RasmusKjeldgaard changed the title Add translation service and initial translations Accessibility: Add internal component translations Nov 21, 2024
@RasmusKjeldgaard RasmusKjeldgaard changed the title Accessibility: Add internal component translations Accessibility: add internal component translations Nov 21, 2024
@github-actions github-actions bot temporarily deployed to pr-3694-translate-internal-labels November 21, 2024 10:33 Inactive
@github-actions github-actions bot temporarily deployed to pr-3694-translate-internal-labels November 21, 2024 14:07 Inactive
Copy link
Collaborator

@Fuzzy3 Fuzzy3 left a 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 ! ❤️

Copy link
Collaborator

@jakobe jakobe left a 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];
}

@RasmusKjeldgaard RasmusKjeldgaard changed the title Accessibility: add internal component translations Accessibility: translate internal component labels Dec 3, 2024
@RasmusKjeldgaard RasmusKjeldgaard added the feature Add this PR to the changelog as a feature label Dec 3, 2024
@github-actions github-actions bot temporarily deployed to pr-3694-translate-internal-labels December 3, 2024 14:28 Inactive
@RasmusKjeldgaard RasmusKjeldgaard marked this pull request as ready for review December 3, 2024 15:51
@github-actions github-actions bot temporarily deployed to pr-3694-translate-internal-labels December 3, 2024 16:01 Inactive
@github-actions github-actions bot temporarily deployed to pr-3694-translate-internal-labels December 4, 2024 08:28 Inactive
Copy link
Collaborator

@jakobe jakobe left a 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>
@github-actions github-actions bot temporarily deployed to pr-3694-translate-internal-labels December 4, 2024 10:06 Inactive
@RasmusKjeldgaard RasmusKjeldgaard enabled auto-merge (squash) December 4, 2024 10:35
@RasmusKjeldgaard RasmusKjeldgaard merged commit 532ed37 into develop Dec 4, 2024
12 checks passed
@RasmusKjeldgaard RasmusKjeldgaard deleted the enhancement/3694-translate-internal-labels branch December 4, 2024 12:28
@MortenGregersen
Copy link
Contributor

Great to finally get the issue closed 🎉

@RasmusKjeldgaard
Copy link
Collaborator Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Add this PR to the changelog as a feature
Projects
None yet
4 participants