-
Notifications
You must be signed in to change notification settings - Fork 911
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
chore(react-i18next): change usage of custom useTranslation to react-i18next #6443
chore(react-i18next): change usage of custom useTranslation to react-i18next #6443
Conversation
setupNodeEvents(on, _config) { | ||
on('before:browser:launch', (browser, launchOptions) => { | ||
if (browser.family === 'chromium' && browser.name !== 'electron') { | ||
launchOptions.preferences.default.intl = { | ||
accept_languages: 'en-US,en', | ||
selected_languages: 'en-US,en', | ||
}; | ||
|
||
return launchOptions; | ||
} | ||
}); | ||
}, |
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 just so the local setup uses the same as the CI everywhere. Was quite annoying when it picked Swedish instead of English all the time.
@@ -15,7 +14,6 @@ export default function MapOptionSelector({ | |||
children, | |||
isMobile, | |||
}: MapOptionSelectorProps) { | |||
const { __ } = 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.
since we consider any variable that begins with _
to be a placeholder/allowed unused we didn't catch these unused hooks before.
There are a few more that I removed as well.
…-vsprintf-and-use-i18n-interpolation-instead
…-vsprintf-and-use-i18n-interpolation-instead
Sorry for the massive PR guys, should be pretty straight forward to review though. |
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.
My fingers hurt from scrolling, but it all looks great and on the preview app everything looks as expected! Thanks for taking the time to do this one, it's cleaning up a lot of tech debt 🙏 💚
export function getBadgeText(chartData: AreaGraphElement[]) { | ||
const { __ } = useTranslation(); | ||
|
||
export function getBadgeText(chartData: AreaGraphElement[], t: TFunction) { | ||
const allEstimated = chartData.every( |
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.
Nice with this change so we don't need the hook in here :)
@madsnedergaard should we wait for a review from Tony or Silke as well or merge this now? I would like to merge this as soon as possible since it changes 88 files and merge conflicts are only a matter of time... |
…interpolation-instead
I think it's fine to merge it, I reviewed it thoroughly (famous last words 😉) |
Issue
Description
Updates out translation code to make use of i18n interpolation instead of sprintf-js. This should help with performance, developer experience and bundle size.
Todo:
Double check
pnpx prettier@2 --write .
andpoetry run format
in the top level directory to format my changes.