question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Usage of i18nextBrowserLanguageDetector should be optional

See original GitHub issue

I’ve been analyzing app bundle size and noticed that i18next-browser-languagedetector in the client bundle (2KB gz). Some projects may not to want this language detector, so it’d be great if it could be made an opt-in (i.e. required by the app’s i18n.js rather than in next-i18next). See https://github.com/isaachinman/next-i18next/issues/16#issuecomment-444397728 for my example of an app that uses other language detectors.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:33 (33 by maintainers)

github_iconTop GitHub Comments

1reaction
isaachinmancommented, Dec 10, 2018

How open are you to the changes of this kind given the current size of the user base? If you consider the current API of the library as locked to serve existing 500 people, I’m afraid I cannot propose any solutions to the current issues. But if you are ready to re-consider some bits and make the components of the library more composable, I’m happy to get involved and help for the benefits of folks who want to integrate i18next into Next.

I am open to breaking changes and all suggestions.

Please, keep issues limited to a SINGLE topic. If you have a new suggestion, open a new issue.

1reaction
isaachinmancommented, Dec 10, 2018

@kachkaev You have argued your point passionately, and at length.

To be clear, I’m not worried about breaking changes whatsoever at this point.

Perhaps in the future we’ll split i18next-browser-languagedetector out of the bundle to save 6kb, but it’s not going to happen now. For now all deps will remain in a single package.

The main point is that the functionality is now optional, and people can disable browser/header detection.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Usage of i18nextBrowserLanguageDetector should be optional
I've been analyzing app bundle size and noticed that i18next-browser-languagedetector in the client bundle (2KB gz). Some projects may not to want this ......
Read more >
Can I detect when a language is detected for the first time ...
I'm using i18next and i18next-browser-languageDetector to detect the browser language, and currently I have an event bound to i18next for when ...
Read more >
i18next-browser-languagedetector - npm package - Snyk
language detector used in browser environment for i18next For more information about how to use this package see README. Latest version published 2...
Read more >
Migration Guide - i18next documentation
i18next now automatically tries to detect natural language keys. This way there is no need to set nsSeparator or keySeparator option ...
Read more >
A Guide to React Localization with i18next | Phrase
The interpolation config option is used to disable i18next's escaping of values ... Go deeper » A lot of i18next-browser-languagedetector's behaviour is ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found