-
Notifications
You must be signed in to change notification settings - Fork 23
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
fix(i18): correctly load all translations #245
Conversation
When used as component in webui, AboutIpld did not load translations correctly. Using t passed to component fixes the problem. While at it, synced all translations, added keys that are used by webui and replaced backend to the new HTTP one. License: MIT Signed-off-by: Marcin Rataj <[email protected]>
"i18next": "^19.1.0", | ||
"i18next-browser-languagedetector": "^4.0.1", | ||
"i18next-icu": "^1.3.1", | ||
"i18next-http-backend": "^1.0.15", |
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.
i18next-xhr-backend
is deprecated, switched to i18next-http-backend
, will do the same in ipfs-webui and explore.ipld.io
"browsers": [ | ||
">0.25%", | ||
"not ie 11", | ||
"not op_mini all" | ||
">1%", | ||
"last 2 versions", | ||
"Firefox ESR", | ||
"not ie < 11" |
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.
Switched to what aegir uses: https://github.com/ipfs/aegir/blob/v22.0.0/package.json#L142-L146
You’re a force 😊 |
export const AboutIpld = ({ t }) => { | ||
return ( | ||
<Box className='tl dib pa4 avenir measure-wide-l lh-copy dark-gray ba-l b--black-10'> | ||
<div className='tc'> | ||
<a className='link' href='https://ipld.io'> | ||
<img src={ipldLogoSrc} alt='IPLD' style={{ height: 60 }} /> | ||
</a> | ||
</div> | ||
<Trans i18nKey='AboutIpld.paragraph1'> | ||
<Trans i18nKey='AboutIpld.paragraph1' t={t}> |
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.
I’d never have found that.
Thanks, will fix CI shortly and merge when green. |
react-scripts test seems to be overzealous when it comes to webpack version current version works fine with webui and website, disabling for now License: MIT Signed-off-by: Marcin Rataj <[email protected]>
License: MIT Signed-off-by: Marcin Rataj <[email protected]>
This PR updates and fixes i18n in a way that works in both ipfs-webui and explore.ipld.io
@jessicaschilling @rafaelramalho19
I'm going to fast track this: merge and make a new release (v1.6.0) of ipld-explorer-components and then PR against both ipfs-webui and explore.ipld.io
Details
When used as component in webui, AboutIpld did not load translations
correctly. Using t passed to component fixes the problem:
While at it, synced all translations, added keys that are used by webui and replaced backend to the new HTTP one.
Closes #242 cc @bertrandfalguiere :-)