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
tokenize settings menu and add French translations #14905
Conversation
|
Thank you for opening this PR! We appreciate you! For all pull requests coming from third-party forks we will need to A Forem Team member will review this contribution and get back to |
config/locales/en.yml
Outdated
| @@ -30,6 +30,14 @@ | |||
| # available at https://guides.rubyonrails.org/i18n.html. | |||
|
|
|||
| en: | |||
| settings_menu: | |||
| profile: Profile | |||
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.
Currently, we're not being consistent with our usage of quotes in the translation file. While they are strictly speaking not necessary, using them consistently avoids problems with YAML's type coercions. For example, Yes will be turned into a boolean true and no will become false.
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.
Oh I didn't know YAML does that. TIL 🎉
I'll update these
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.
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.
Ok we should make a decision as i18n-tasks normalize removes quotes and right now we have an English file and a French file without them
Line 8 in cceb175
| create_account: Create account |
(we're not enforcing either)
config/locales/en.yml
Outdated
| @@ -30,6 +30,14 @@ | |||
| # available at https://guides.rubyonrails.org/i18n.html. | |||
|
|
|||
| en: | |||
| settings_menu: | |||
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.
Sorry for being so nitpicky but could we keep this file (and the French one) alphabetically sorted, so put settings_menu after core?
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.
I merged in the latest version of main, so the settings_menu is all the way at the bottom now, after podcasts.
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.
Thanks a lot @metamoni
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.
Thank you @metamoni!
|
Thank you for this contribution @metamoni . Great work here. 🥳 |

What type of PR is this? (check all applicable)
Description
This PR aims to tokenize strings in the Settings menu, which are currently defined in the
Constant::Settings::TAB_LISTconstant. At my current work we ran into issues when storing strings in constants like this, as they get loaded before any translations are looked up, and as a consequence they never get translated into the user's chosen locale. This is why I moved the tokens into a class method. And since we're not using a constant anymore, I moved theSettingsmodule out of theConstantsnamespace.Related Tickets & Documents
#14888
QA Instructions, Screenshots, Recordings
/settingsmissing translationserrors on the pageUI accessibility concerns?
N/A
Added/updated tests?
have not been included
[Forem core team only] How will this change be communicated?
Will this PR introduce a change that impacts Forem members or creators, the
development process, or any of our internal teams? If so, please note how you
will share this change with the people who need to know about it.
Storybook (for Crayons components)
updated. I have filled out the
Changes Requested
issue template so Community Success can help update the Admin Docs
appropriately.
CHANGELOG.mdor in a forem.dev post
replace this line with details on why this change doesn't need to be
shared