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
Adds locale to the locale kebab-case warnings #3951
Conversation
Signed-off-by: Olga Bulat <obulat@gmail.com>
ad07e52
to
b50b2ad
Compare
@obulat I get the following when I try to run the testing command you've supplied:
|
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.
Changeset looks good and the command runs as expected locally 🚀
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.
LGTM. I wonder if we even need a log-per-line. If we are able to automatically convert them without issue, we could have a single log at the end with a summary "Automatically fixed x kebab-case keys to camel case", but just a nit-pick. Reducing the logging would make this look less like an error and more like an "here's some info" log.
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.
👍 The information about the locale raising the warning is good to have!
Signed-off-by: Olga Bulat <obulat@gmail.com>
I refactored this code to log a single line by default. Also, if you run |
Fixes
Fixes #3938 by @sarayourfriend
Description
This PR adds the locale to the warnings about kebab-cased locale keys.
The locale files contain strings with keys that can be used, for instance, to insert links into them:
license: "{readMore} about this license.
gets converted to something like<a href="linkURL">read more</a> about this license
The keys like
readMore
were first inkebab-case
. Kebab-cased keys are invalid in the latest versions of Vue i18n, so we converted them to camelCase. However, converting the keys in GlotPress is not easy and takes time. To account for that and make the translations usable, #2433 added a function that converts kebab-cased keys to camelCase. It also adds a warning to keep track if we still have some kebab-cased keys. You can see them when you runjust frontend/i18n
The warning only had the key name. This PR adds the locale to the warning to make it possible to locate the key better:
Testing Instructions
Run
just frontend/i18n
and see that the warnings have locales.Checklist
Update index.md
).main
) or a parent feature branch.Developer Certificate of Origin
Developer Certificate of Origin