For now, even with #24 implemented i18next-icu will still fail on creation with Error (for missed variable):
"SyntaxError: Expected "," or "}" but "u" found.
at peg$buildException (webpack-internal:///../node_modules/intl-messageformat-parser/lib/parser.js:365:14)
at Function.peg$parse (webpack-internal:///../node_modules/intl-messageformat-parser/lib/parser.js:1384:13)
at new MessageFormat (webpack-internal:///../node_modules/intl-messageformat/lib/core.js:18:27)
at ICU.parse (webpack-internal:///../node_modules/i18next-icu/dist/commonjs/index.js:127:14)
at Translator.extendTranslation (webpack-internal:///../node_modules/i18next/dist/esm/i18next.js:724:31)
at Translator.translate (webpack-internal:///../node_modules/i18next/dist/esm/i18next.js:708:20)
at I18n.t (webpack-internal:///../node_modules/i18next/dist/esm/i18next.js:2198:80)
Cause the main problem still exists at new IntlMessageFormat(res, lng, this.formats): when it is created peg$parse is invoked for the first time and that will produce Uncaught error.
Fixes #21
Checklist
[x] only relevant code is changed (make a diff before you submit the PR)
For now, even with #24 implemented
i18next-icu
will still fail on creation with Error (for missed variable):Cause the main problem still exists at
new IntlMessageFormat(res, lng, this.formats)
: when it is createdpeg$parse
is invoked for the first time and that will produceUncaught
error.Fixes #21
Checklist
npm run test