-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
feat(i18n): improve i18n #1692
feat(i18n): improve i18n #1692
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/uniswap/uniswap-interface/DTXziA7CUJzQzwsh3QDo9cEJToto |
src/components/Web3Status/index.tsx
Outdated
<span role="img" aria-label="has socks emoji" style={{ marginTop: -4, marginBottom: -4 }}> | ||
<span | ||
role="img" | ||
aria-label={t({ id: 'wallet.hasSocks', message: 'has socks emoji' })} |
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.
does this work? i think not because it's a constant, and not a function component
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.
that's why I'm using t():string here instead of . t returns a string.
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 mean the SOCKS is a constant and is only evaluated at compile first run time so the label wouldnt change when the locale changes
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.
You're right.. it doesn't change. I'll revert this until I figure out a better solution.
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.
just make it a function component instead of a const
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.
aria-label needs a string, but I could make an image component
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 was saying, instead of doing const SOCK = (<jsx.../>)
do
function Sock() {
return <jsx.../>
}
and
<Sock />
This will fix the translation issue
* replaced i18next with lingui * integrate lingui in i18n and update dev setup * updated components to @lingui * fix compile error after rebase * detect locale * add all previous languages to linguirc * address pr feedback * remove it for now * ignore generate *js files, various fixes * added more translations * fixed yarn build command * wrapped more hardcoded english around <Trans> * finished second round of translations * added support for pseudo-en locale * improvements * moved copy.tsx to different branch * moved extra files to different branch * regenerated po * clean up * more fixes * regenerate po * remove messages.js * clean up * addressed pr feedback * regenerated po
replace i18next with linguijs
t
withTrans
componentfollow-up pr to wrap hard coded english text around
Trans
To test: https://uniswap-interface-git-lingui-uniswap.vercel.app/?lang=pseudo-en