Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why am I submitting this PR
Internally we have code like this to fallback to
''
, but this trips up i18next-parser, which was reported in #634:The PR aims to make the existing behavior consistent across files and
--fail-on-update
. I'm proposing this behind an option, but it could also just be done as the default behavior.Details
This PR adds a new configuration option
ignoreEmptyKeys
(default: true) that controls whether empty keys should be ignored when scanning source files.When set to
true
(default), empty keys in source files are ignored. These changes allows usingt('')
without false "Added keys" messages causing thefailOnUpdate
option to fail incorrectly.When set to
false
, empty keys are included in the translation files. This is different from the current behavior, in this case adding''
will also causefailOnUpdate
to fail which is the current behavior.Does it fix an existing ticket?
Yes #634
Checklist
yarn test
(see details here)This PR was generated with the help of https://www.all-hands.dev/ (an open source agent) but I have reviewed the code changes prior to submitting, updated the test suite, and adjusted this description to include additional context.