backstage
backstage copied to clipboard
[i18n] Add i18n to scaffolder plugin
Hey, I just made a Pull Request!
Come back from #20130
Sorry for the HUGE PR, next plugin I will break this in better steps, so we can work better toward that.
:heavy_check_mark: Checklist
Changed Packages
| Package Name | Package Path | Changeset Bump | Current Version |
|---|---|---|---|
| @backstage/plugin-scaffolder | plugins/scaffolder | patch | v1.16.0-next.2 |
Uffizzi Ephemeral Environment deployment-38393
:cloud: https://app.uffizzi.com/github.com/backstage/backstage/pull/20577
:page_facing_up: View Application Logs etc.
What is Uffizzi? Learn more!
@angeliski sorry for the issues with this rebase, we managed to get in #20221 there's a few files that have been moved around - hopefully it's not too difficult to rebase this work on top 🤞
@benjdlambert idk why the tests are breaking 🤔
@angeliski looks good now - was waiting for this latest -next release to go out before shipping more stuff to the scaffolder just because of the switch to the next work :) Wanna probably mob review this @backstage/scaffolder-maintainers @backstage/maintainers?
@angeliski How do you see the i18n of the template? There are properties, step names, descriptions, etc. will be shown to the user what is defined in the template itself.
I'm thinking that for now it can be fine, as a workaround could be to tag templates with the language and filter them by locale. But eventually maybe would be nice to make it work holistically.
Hey team! Thanks for the feedback.
@acierto Maybe we can provide a simple "path translation" for templates.
This line could be something like:
create-react-app-template.spec.parameters.0.title=Translation
We need to experiment a little before move in this direction
@benjdlambert Yeah, I think it is a good approach to avoid the actual text. The drawback is we have more keys to handle because some texts are not to be deduplicated anymore.
I like the ${page}_${context} but maybe is better${component}_${context}.
Some examples:
entity_name_picker_schema_title, ongoing_task_page_header_title, ongoing_task_header_title, dev_tools_layout_header_title
WDYT?
I like the
${page}_${context}but maybe is better${component}_${context}. Some examples:entity_name_picker_schema_title,ongoing_task_page_header_title,ongoing_task_header_title,dev_tools_layout_header_titleWDYT?
I like these very much!
Hey!
@acierto Maybe we can provide a simple "path translation" for templates. This line could be something like:
create-react-app-template.spec.parameters.0.title=TranslationWe need to experiment a little before move in this direction
It would create kinda magic :) As there is no indication that this line is going to be replaced with something.
Maybe having it explicitly defined as ${{ t('template_step_1_title') }} will be more explicit and aligned with the rest of the code?
Nice @benjdlambert , I will try to update the pr this week to follow this pattern
@acierto I like magic 🤣 But I got your point, my suggestion is to avoid mixing translation in the template. On the other hand, your approach could be more explicit and avoid confusion.
I will ship this PR and after that try to draft an implementation so we could talk about that solution looking in the code
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!
@angeliski sorry I meant to remove stale on this before the bot closed it, but just come back from chicago and missed it. Feel free to ping when it's ready for a new review! :tada:
Uffizzi Ephemeral Environment - Virtual Cluster
Your cluster pr-20577 was successfully created. Learn more about Uffizzi virtual clusters
To connect to this cluster, follow these steps:
- Download and install the Uffizzi CLI from https://docs.uffizzi.com/install
- Login to Uffizzi, then select the
backstageaccount and project:
uffizzi login
Select an account:
‣ backstage
jdoe
Select a project or create a new project:
‣ backstage-6783521
- Update your kubeconfig:
uffizzi cluster update-kubeconfig pr-20577 --kubeconfig=[PATH_TO_KUBECONFIG]After updating your kubeconfig, you can manage your cluster withkubectl,kustomize,helm, and other tools that use kubeconfig files:kubectl get namespace --kubeconfig [PATH_TO_KUBECONFIG]
Access the backstage endpoint at https://backstage-default-pr-20577-c1885.uclusters.app.uffizzi.com
Created #21267 for transparency. tl;dr: we'd like to figure out naming patterns before moving forward with more i18n additions
Nice @Rugvip
I will try to put some effort in the definitions so we can move I18N forward :)
Hey @angeliski :wave:
Don't know if you've seen it, but we recently published some guidelines on key names and message names API over here https://backstage.io/docs/plugins/internationalization#guidelines-for-i18n-messages-and-keys.
Might be worth having a read through to make sure that those practices are being followed here in this PR.
Apologies for the delay here and thanks for the patience! :pray:
Ping @angeliski.
I know there's a large amount of work gone into this and I don't want to loose it :(
Just needs fixing up and rebasing I think so we can start on a deeper review :pray:
Sorry @benjdlambert , I missed your last comment.
No worries, I will try to ship this week or maybe next
Thanks for ping
@angeliski no worries thanks! For reference, a lot of the /legacy components have been cleaned up and removed, so don't be alarmed if theres less translations than before :)
@angeliski I'm gonna close this for now as it looks like it's gone a little bit stale, although we would really like the work to get merged one day if ever you get the chance to fix this up 🤞 :pray: