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

fix(cli): extract with --overwrite should fallback to key #1166

Merged
merged 1 commit into from
Nov 26, 2021

Conversation

ardeois
Copy link
Contributor

@ardeois ardeois commented Nov 15, 2021

When we run lingui extract --overwrite only translations with a custom id + message were working properly.
However, if there is no default message but only the id, --overwrite option was resetting the translation to empty string instead of using key as default

This was working properly when a "new" key was added, but not when we update the key (on merge)

Also update snapshot go-gettext.test.ts.snap because it fails on master

Fixes #1162
See this repository to reproduce the issue

When we run `lingui extract --overwrite` only translations with a custom id + message were working properly.
However, if there is no default `message` but only the `id`, `--overwrite` option was resetting the translation to empty string instead of using `key` as default

This was working properly when a "new" key is added, but not when we update the key (on merge)

Also update snapshot `go-gettext.test.ts.snap` because it fails on master
@vercel
Copy link

vercel bot commented Nov 15, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/lingui-js/js-lingui/8ZX6E4x3uiUS9ZY3UbPnkgRPnDMm
✅ Preview: Failed

@ardeois
Copy link
Contributor Author

ardeois commented Nov 15, 2021

@semoal whenever you have some time to check this out, let me know if the fix I suggest for issue #1162 is correct

Also the Vercel deployment failed, but I don't have access to logs, so I'm not sure if I can do something about it?

Thanks !!

@semoal semoal merged commit e5e9d59 into lingui:main Nov 26, 2021
@semoal
Copy link
Contributor

semoal commented Nov 26, 2021

Super! Thanks mate

@ardeois ardeois deleted the fix/lingui-extract-overwrite branch November 26, 2021 15:06
@semoal
Copy link
Contributor

semoal commented Nov 26, 2021

Released with 3.13.0, enjoy it!
Sorry for the late release, has been really busy lately.
https://github.com/lingui/js-lingui/releases/tag/v3.13.0

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 this pull request may close these issues.

Extract --overwrite command not using IDs as default message
2 participants