-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
#1559 Internationalize mobile text using i18n #1581
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
#1559 Internationalize mobile text using i18n #1581
Conversation
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.
Buen trabajo! :)
This looks great, there's just one quick change to do
</Sidebar> | ||
); | ||
const Explorer = ({ id, canEdit, onPressClose }) => { | ||
const { t, i18n } = useTranslation(); |
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 don't think you need the i18n
prop here, because the t
prop is the only one you use. What happens if you remove it?
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.
Done
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.
This is looking great! It'd be great if the first part of the translation key could be named after the component/filename. This makes it easier to figure out the link between a component and its translation in the language JSON files.
I've left some examples of this in the code comments.
Thanks!
const Explorer = ({ id, canEdit, onPressClose }) => { | ||
const { t, i18n } = useTranslation(); | ||
return ( | ||
<Sidebar title={t('MobileSideBar.Files')} onPressClose={onPressClose}> |
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.
It'd be great if the first part of the translation key can be named after the component/filename. So this would be Explorer
. This makes it easier to figure out the link between the translation language files and the components.
<Sidebar title={t('MobileSideBar.Files')} onPressClose={onPressClose}> | |
<Sidebar title={t('Explorer.Files')} onPressClose={onPressClose}> |
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.
Done
const { t, i18n } = useTranslation(); | ||
return [ | ||
{ | ||
value: true, label: t('Preferences.On'), ariaLabel: `${name} on`, name: `${name}`, id: `${name}-on`.replace(' ', '-') |
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.
value: true, label: t('Preferences.On'), ariaLabel: `${name} on`, name: `${name}`, id: `${name}-on`.replace(' ', '-') | |
value: true, label: t('PreferenceCreators.On'), ariaLabel: `${name} on`, name: `${name}`, id: `${name}-on`.replace(' ', '-') |
{ icon: PreferencesIcon, title: 'Examples', href: '/p5/sketches' }, | ||
{ icon: PreferencesIcon, title: 'Original Editor', action: toggleForceDesktop, }, | ||
{ icon: PreferencesIcon, title: 'Logout', action: logoutUser, }, | ||
{ icon: PreferencesIcon, title: t('MobileNav.Preferences'), href: '/preferences', }, |
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.
{ icon: PreferencesIcon, title: t('MobileNav.Preferences'), href: '/preferences', }, | |
{ icon: PreferencesIcon, title: t('MobileIDEView.Preferences'), href: '/preferences', }, |
* New language selector design * Adjust authenticated nav to consolidate Account dropdown * Adding language in NavTest Co-authored-by: Cassie Tarakajian <ctarakajian@gmail.com>
It seems like all of your comments @andrewn and @ghalestrilo have been resolved. Okay to merge? |
Fixes #1559
I have verified that this pull request:
npm run lint
)Fixes #1559