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

Extract updates to default value as new key:value pair #163

Open
abhijit945 opened this issue Jun 16, 2020 · 1 comment
Open

Extract updates to default value as new key:value pair #163

abhijit945 opened this issue Jun 16, 2020 · 1 comment

Comments

@abhijit945
Copy link

Describe the bug

I have en-us i18next strings with default values:

t("en-locale-test:GoBack", "Back to Hello World");

// change to 

t("en-locale-test:GoBack", "Back");

Additional translations could be ja-jp etc. When I try to extract them only new keys are added to ja-jp but changing the default value doesnt trigger the same behavior? This results in translations out of context or wrong strings in translation files.

How to reproduce

Babel configuration:

    {
        locales: supportedAdditionalLocales,
        keySeparator: false,
        keyAsDefaultValue: ['en-us'],
        discardOldKeys: true,
        useI18nextDefaultValue: true,
        keyAsDefaultValueForDerivedKeys: true,
        outputPath: 'src/_/i18n/languages/{{locale}}/{{ns}}.json',
      },

Expected behavior

GoBack: "Back"

What actually happens

Extraction ignores this and doesnt notify the consumer.

GoBack: "Hello Worldに戻る"
@dcalvom
Copy link

dcalvom commented Oct 31, 2020

I'm having the same issue. Did you were able to fix it?

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

2 participants