Skip to content
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

Merged
merged 3 commits into from
Jun 4, 2020
Merged

fix(i18): correctly load all translations #245

merged 3 commits into from
Jun 4, 2020

Conversation

lidel
Copy link
Member

@lidel lidel commented Jun 3, 2020

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:

french----Screen Shot 2020-06-04 at 00 49 52

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 :-)

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",
Copy link
Member Author

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

Comment on lines 106 to +110
"browsers": [
">0.25%",
"not ie 11",
"not op_mini all"
">1%",
"last 2 versions",
"Firefox ESR",
"not ie < 11"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jessicaschilling
Copy link
Contributor

You’re a force 😊
Can we please include #238 in the release too?
Thank you!

Comment on lines +6 to +14
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}>
Copy link
Member Author

@lidel lidel Jun 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was the fix for translations that did not load correctly.
I will never admit how long it took me to figure this out. 😶

problem-solver

(When used as component in webui, we need to explicitly use t passed to explorer, rather than using the magically resolved one)

Copy link
Contributor

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.

@lidel
Copy link
Member Author

lidel commented Jun 3, 2020

Thanks, will fix CI shortly and merge when green.
Yes, #238 will be included in v1.6.0 👍

lidel added 2 commits June 4, 2020 01:54
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update translations
2 participants