Repository navigation
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The provider-free React guide needs an entry-point ./i18n import so readers who skip the optional layout still initialize translations for useTranslation and <Trans>.
1 open issue
What changed in this PR
Updates the React localization guide with corrected MF2 examples, compatible installation instructions, and an alternative integration using i18next-mf2.
Changes:
- Fixes MF2 syntax and specifies supported i18next peer-dependency versions.
- Clarifies optional provider usage, corrects the configuration import, and documents bidi isolation characters.
- Adds an
i18next-mf2setup and rich-text example, and corrects terminology and package attribution.
| File | Description |
|---|---|
docs/frameworks/react.md |
Corrects React/MF2 setup guidance and adds the alternative i18next plugin integration. |
Review effort: Balanced
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Hi,
I maintain i18next, react-i18next and i18next-mf2, and went through this page with the current releases (mf2react 0.1.12, messageformat 4.1.0, i18next 26.7.1, react-i18next 17.1.12). This PR fixes what I found:
.match {$count: number}, is not valid MF2.messageformatthrows a syntax error (4.1.0, and also 4.0.0-8, which the playground uses), and mf2react then renders the message source. It now declares the variable with.input {$count :number}and selects with.match $count.i18next ^25andreact-i18next ^16as peer dependencies. In a project that already uses i18next 26 or react-i18next 17,npm install mf2reactfails with ERESOLVE, so the install command now names the supported versions.I18nextProvideris optional:initReactI18nextalready passes the instance touseTranslationand<Trans>, and the examples render without the provider. The layout example also imported{ i18n }, whilei18n.tshas a default export.messageformat.@messageformat/coreis the MessageFormat 1 package.I also added a short section on i18next-mf2, the i18next plugin for MF2 that the spec README lists among known implementations, since readers of this page already use i18next. If you'd rather keep the page about mf2react only, I'll drop that commit.
I ran all examples with React 19 and
react-dom/server.cc @izaaksarnecki1: the examples on this page render the same with i18next 26.7.1 and react-i18next 17.1.12, so widening the peer dependency ranges of mf2react would let the install command go back to the latest versions.
Thanks,
Adriano