-
Notifications
You must be signed in to change notification settings - Fork 380
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
cli/extract: throw when encountering same id with different defaults #200
Comments
@lingui/babel-extract-messages` throws a syntax error when same message with different defaults is found in the same file, but maybe it's missed when messages are in different files? |
Fixed in latest release v2.3.0. |
I think we should allow undefined; this would allow to enter the default message once and use the id only in other cases.
and:
throws :
|
@tkvw The problem might be when message contains variables. <Trans id="about">About {section}</Trans>
// becomes
<Trans id="about" defaults="About {section}" values={{ section }} />
// but we would have just
<Trans id="about" defaults="About {section}" /> so, yes, this should be possible, but you just have to pass <Trans id="about" values={{ section }} /> |
I believe such situation is unexpected and we should warn (or better error) when encountering it.
Right now it saves last extracted defaults and discards all the others.
I didn't look how to better do this but let it be here for now so we can later discuss and implement this.
The text was updated successfully, but these errors were encountered: