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

feat(i18n): cache locale files #1658

Merged
merged 2 commits into from
Oct 6, 2020
Merged

feat(i18n): cache locale files #1658

merged 2 commits into from
Oct 6, 2020

Conversation

lidel
Copy link
Member

@lidel lidel commented Oct 3, 2020

This adds i18next-localstorage-backend which caches fetched translation files in window.localStorage for a week, which removes the need for seven requests for .json files.

ps. I also discovered that https://webui.ipfs.io/?lng=zh-CN works, so added it to README ;-)

This adds i18next-localstorage-backend which caches fetched translation
files in window.localStorage for a week.
@jessicaschilling
Copy link
Contributor

Will this introduce a need to repeatedly clear caches when hacking on text in master en locale?

@lidel
Copy link
Member Author

lidel commented Oct 3, 2020

Good catch! Fixed in 09ba001 – disabled cache when developer server provided by npm start is used.

@@ -121,7 +123,7 @@
"go-ipfs": "0.6.0",
"http-proxy": "^1.18.1",
"http-server": "^0.12.3",
"ipfs": "^0.48.1",
"ipfs": "0.50.2",
Copy link
Contributor

Choose a reason for hiding this comment

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

is this intended in this PR? Just want to make sure we test everything so we don't problems from upgrading ipfs :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch! js-ipfs is used only in e2e tests.

Not related to this PR, but I noticed we were not using hard-coded version so fixed it and bumped to the latest version to ensure we are green with the latest version.

@rafaelramalho19
Copy link
Contributor

Don't forget to update ipld-explorer-components translation array to match the one on this PR 😄

@lidel
Copy link
Member Author

lidel commented Oct 6, 2020

@rafaelramalho19 added it to ipfs/ipld-explorer-components#281 👌
(but should not matter, because afaik when used in webui, config and files from webui is used)

@lidel lidel merged commit a4fd2fc into master Oct 6, 2020
@lidel lidel deleted the feat/locale-sync-and-cache branch October 6, 2020 16:57
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.

3 participants