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

Log message is shown when no translation key is added #245

Closed
kirillku opened this issue Mar 16, 2023 · 0 comments · Fixed by #246
Closed

Log message is shown when no translation key is added #245

kirillku opened this issue Mar 16, 2023 · 0 comments · Fixed by #246

Comments

@kirillku
Copy link
Contributor

🐛 Bug Report

If I don't want to add empty translations to other languages, the log message is still shown like this

i18next-scanner: Added a new translation key { "translation.key": undefined } to "locales/en-US/common.json"

This place should be updated somehow https://github.com/i18next/i18next-scanner/blob/master/src/parser.js#L1035-L1043

To Reproduce

  1. Update config to not add empty translations
defaultValue: (lng, _ns, _key, entry) =>
  (lng === DEFAULT_LOCALE) ? entry.defaultValue : undefined
  1. Add translation to code
  2. Run scanner

Expected behavior

No log is shown when no entry is added to translation file

Your Environment

@kirillku kirillku changed the title Log message is shown when no translation is added Log message is shown when no translation key is added Mar 18, 2023
kirillku added a commit to kirillku/i18next-scanner that referenced this issue Mar 18, 2023
…use in this case no tranlsation key is added

Fixes i18next#245
kirillku added a commit to kirillku/i18next-scanner that referenced this issue Mar 18, 2023
…use in this case no translation key is added

Fixes i18next#245
cheton pushed a commit that referenced this issue Mar 19, 2023
…use in this case no translation key is added (#246)

Fixes #245
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

Successfully merging a pull request may close this issue.

1 participant