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

discardOldKeys removes phrases when shared by multiple files #181

Open
chrys1110 opened this issue Jan 14, 2021 · 0 comments
Open

discardOldKeys removes phrases when shared by multiple files #181

chrys1110 opened this issue Jan 14, 2021 · 0 comments

Comments

@chrys1110
Copy link

Describe the bug

with discardOldKeys: true already translated keys get removed when multiple files share the same namespaces.
i.E Both depend on namespace 'errors' and import them with useTranslation.
fileA uses errorA. fileB uses errorB.
Babel extracts errorA when compiling fileA and dismisses errorB, and vice versa. Already translated terms get removed unfortunately.

How to reproduce

Described above.

Babel configuration:

{
    "presets": [
        "next/babel"
    ],
    "plugins": [
        [
            "i18next-extract",
            {
                "locales": [
                    "en-US",
                    "de"
                ],
                "defaultNS": "common",
                "discardOldKeys": true,
                "jsonSpace": 4,
                "useI18nextDefaultValue": [
                    "en-US"
                ],
                "outputPath": "public/static/locales/{{locale}}/{{ns}}.json",
                "customUseTranslationHooks": [
                    ["next-i18next", "useTranslation"]
                ]
            }
        ]
    ]
}
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

No branches or pull requests

1 participant