backstage / backstage

Backstage is an open framework for building developer portals
https://backstage.io/
Apache License 2.0
26.73k stars 5.52k forks source link

add i18n for core components #20932

Closed mario-mui closed 3 months ago

mario-mui commented 7 months ago

Hey, I just made a Pull Request!

:heavy_check_mark: Checklist

backstage-goalie[bot] commented 7 months ago

Missing Changesets

The following package(s) are changed by this PR but do not have a changeset:

See CONTRIBUTING.md for more information about how to add changesets.

Changed Packages

Package Name Package Path Changeset Bump Current Version
@backstage/core-components packages/core-components patch v0.14.0
@backstage/plugin-git-release-manager plugins/git-release-manager none v0.3.42
github-actions[bot] commented 7 months ago

Uffizzi Ephemeral Environment - Virtual Cluster

:cloud: deploying ...

:gear: Updating now by workflow run 7041634079.

Download the Uffizzi CLI to interact with the upcoming virtual cluster https://docs.uffizzi.com/install

Rugvip commented 6 months ago

Linking this one to #21267 as well

mario-mui commented 6 months ago

@vinzscam @tikabom @Rugvip please review this PR, I had fix all unit test

mario-mui commented 6 months ago

@tikabom PR not merge automatically, is this need any other reviewer to approve ?

github-actions[bot] commented 6 months ago

This PR has been automatically marked as stale because it has not had recent activity from the author. It will be closed if no further activity occurs. If the PR was closed and you want it re-opened, let us know and we'll re-open the PR so that you can continue the contribution!

github-actions[bot] commented 6 months ago

This PR has been automatically marked as stale because it has not had recent activity from the author. It will be closed if no further activity occurs. If the PR was closed and you want it re-opened, let us know and we'll re-open the PR so that you can continue the contribution!

emmaindal commented 6 months ago

hello @mario-mui, it would require approval from @backstage/maintainers before its possible to merge this in, in the meanwhile can you rebase this on the latest master to resolve the conflicts. Thank you!

benjdlambert commented 6 months ago

Hey @mario-mui!

Thanks for the PR! As you might have seen there's still some ongoing discussion and decisions happening over in https://github.com/backstage/backstage/issues/21267 that we'd like to settle before merging the i18n PRs. We're hoping to get these documented this week so that we can unblock these i18n PR's and get them merged :tada:

mario-mui commented 6 months ago

@benjdlambert @Rugvip I had change messages keys to nested and camelCase. Please review again

github-actions[bot] commented 6 months ago

Uffizzi Ephemeral Environment - Virtual Cluster

:cloud: deploying ...

:gear: Updating now by workflow run 7044808910.

Download the Uffizzi CLI to interact with the upcoming virtual cluster https://docs.uffizzi.com/install

github-actions[bot] commented 5 months ago

Uffizzi Ephemeral Environment - Virtual Cluster

:cloud: deploying ...

:gear: Updating now by workflow run 7125086276.

Download the Uffizzi CLI to interact with the upcoming virtual cluster https://docs.uffizzi.com/install

mario-mui commented 5 months ago

@benjdlambert This is ready for merge?

benjdlambert commented 5 months ago

@mario-mui not yet unfortunately, I think that we might just need to possibly make some small changes to the keys and their nesting shape. I'm hoping to have some docs and recommendations for i18n stuff written up by the end of the day!

mario-mui commented 5 months ago
message: {
  componentName: {
      key1:
      key2
  }
}

what about this translation structure? @benjdlambert

benjdlambert commented 5 months ago

Hey @mario-mui :wave:

I don't know if you saw but there's some updated documentation now https://backstage.io/docs/plugins/internationalization#guidelines-for-i18n-messages-and-keys with some suggestions for how to structure the key names.

Could be a little tricky here with the componentName as they could be a little specific, but maybe lets list some examples of what you were thinking?

mario-mui commented 5 months ago

for instance: https://github.com/backstage/backstage/pull/20932/files#diff-fd24c3513000f2c84e0f9310bcb6efa282b69c472b38fd73b1088d15330bf66dR117

The customProvider is underlie src.layout.SignInPage so tokenInvalid key should defined like ?

layout: {
  signInPage: {
     tokenInvalid: 'Token is not a valid OpenID Connect JWT Token'
  }
}

@benjdlambert

github-actions[bot] commented 5 months ago

This PR has been automatically marked as stale because it has not had recent activity from the author. It will be closed if no further activity occurs. If the PR was closed and you want it re-opened, let us know and we'll re-open the PR so that you can continue the contribution!

github-actions[bot] commented 5 months ago

This PR has been automatically marked as stale because it has not had recent activity from the author. It will be closed if no further activity occurs. If the PR was closed and you want it re-opened, let us know and we'll re-open the PR so that you can continue the contribution!

mario-mui commented 5 months ago

for instance: https://github.com/backstage/backstage/pull/20932/files#diff-fd24c3513000f2c84e0f9310bcb6efa282b69c472b38fd73b1088d15330bf66dR117

The customProvider is underlie src.layout.SignInPage so tokenInvalid key should defined like ?

layout: {
  signInPage: {
     tokenInvalid: 'Token is not a valid OpenID Connect JWT Token'
  }
}

@benjdlambert

Hi, @benjdlambert are you have time to have a look

benjdlambert commented 5 months ago

@mario-mui sorry just getting back up to speed after the holidays.

I wouldn't pay too much attention to the filepath and filenames as those can change frequently and then updating the i18n messages would be unfortunate side effects.

I think for your example, focus on more of the context, what the component does and what is the message purpose. You can drop the layout I would say.

Something like signIn.invalidToken or something like that makes a little more sense to me.

mario-mui commented 4 months ago

@mario-mui sorry just getting back up to speed after the holidays.

I wouldn't pay too much attention to the filepath and filenames as those can change frequently and then updating the i18n messages would be unfortunate side effects.

I think for your example, focus on more of the context, what the component does and what is the message purpose. You can drop the layout I would say.

Something like signIn.invalidToken or something like that makes a little more sense to me.

@benjdlambert can you review this PR again

github-actions[bot] commented 4 months ago

This PR has been automatically marked as stale because it has not had recent activity from the author. It will be closed if no further activity occurs. If the PR was closed and you want it re-opened, let us know and we'll re-open the PR so that you can continue the contribution!

mario-mui commented 4 months ago

@benjdlambert @Rugvip Sorry to disturb you, since there is no new comment or other thing happen to this PR for two weeks.

I want to know, is this PR being review or something else need me to do ?

benjdlambert commented 4 months ago

@mario-mui sorry we've been pretty slammed with a lot of work that last few weeks, so sorry it's taking a while. This is on our TODO to sit down a review it. We will get to it soon! :tada:

mario-mui commented 4 months ago

@mario-mui sorry we've been pretty slammed with a lot of work that last few weeks, so sorry it's taking a while. This is on our TODO to sit down a review it. We will get to it soon! 🎉

I see, thanks , waitting for your advises

mario-mui commented 4 months ago

This is looking great, just a few little things that we want to iron out here too.

Cool, I will fix this today

github-actions[bot] commented 4 months ago

Uffizzi Cluster pr-20932 was deleted.

benjdlambert commented 3 months ago

@mario-mui I think you might want to rebase this to fix the conflict and the e2e errors :)

github-actions[bot] commented 3 months ago

This PR has been automatically marked as stale because it has not had recent activity from the author. It will be closed if no further activity occurs. If the PR was closed and you want it re-opened, let us know and we'll re-open the PR so that you can continue the contribution!

mario-mui commented 3 months ago

@mario-mui I think you might want to rebase this to fix the conflict and the e2e errors :)

sure, I just come from Chinese new year holiday. I will fix it soon

mario-mui commented 3 months ago

@mario-mui I think you might want to rebase this to fix the conflict and the e2e errors :)

Done. @benjdlambert Ready to merge?

benjdlambert commented 3 months ago

@mario-mui I think that we still need to address these: https://github.com/backstage/backstage/pull/20932#discussion_r1494484164

mario-mui commented 3 months ago

@mario-mui I think that we still need to address these: #20932 (comment)

@benjdlambert Had revert some suffix translation keys.

mario-mui commented 3 months ago

@benjdlambert Hi, is this PR now ready to merge ?

backstage-goalie[bot] commented 3 months ago

Thanks for the contribution! All commits need to be DCO signed before they are reviewed. Please refer to the the DCO section in CONTRIBUTING.md or the DCO status for more info.

github-actions[bot] commented 3 months ago

Thank you for contributing to Backstage! The changes in this pull request will be part of the 1.24.0 release, scheduled for Tue, 19 Mar 2024.