We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug Extracted keys include extra symbols at the front when nsSeparator is set to more then 1 symbol.
How to reproduce Set nsSeparator to more then 1 symbol, like double colon nsSeparator: '::'
nsSeparator: '::'
Babel configuration:
{ "presets": ["@babel/preset-react"], "plugins": [ "@babel/plugin-proposal-class-properties", "@babel/plugin-syntax-dynamic-import", [ "i18next-extract", { "locales": ["fr"], "defaultNS": "common", "keySeparator": null, "nsSeparator": "::", "defaultValue": null } ] ] }
Reproduction:
import { useTranslation } from 'react-i18next'; const { t } = useTranslation('customers', 'common'); {t('common::Cancel')}; {t('common::OK')}; {t('common::Close')}
Expected behavior common.json:
{ "Cancel": null, "Close": null, "OK": null }
What actually happens
{ ":Cancel": null, ":Close": null, ":OK": null }
Your environment
Workarounds In node_modules\babel-plugin-i18next-extract\index.js
function parseExtractedKey(key, config), line 1685 :
Before:
cleanKey = cleanKey.slice(nsSeparatorPos + 1);
After:
cleanKey = cleanKey.slice(nsSeparatorPos + config.nsSeparator.length);
The text was updated successfully, but these errors were encountered:
Encountering the same issue here.
Sorry, something went wrong.
No branches or pull requests
Describe the bug
Extracted keys include extra symbols at the front when nsSeparator is set to more then 1 symbol.
How to reproduce
Set nsSeparator to more then 1 symbol, like double colon
nsSeparator: '::'
Babel configuration:
Reproduction:
Expected behavior
common.json:
What actually happens
Your environment
Workarounds
In node_modules\babel-plugin-i18next-extract\index.js
function parseExtractedKey(key, config), line 1685 :
Before:
After:
The text was updated successfully, but these errors were encountered: