-
Notifications
You must be signed in to change notification settings - Fork 154
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
Message key is lost by CLI when file has only one key #339
Labels
Comments
I'm considering an additional minor-level fix for this by expanding the |
Closing this, as the actual bug has long since been fixed and the upstream dependency has not shown any interest in making required changes. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The current behavior breaks the contract provided by structured KV pairs when compiling a module, at least from the CLI. I want the precise opposite of the OP.
Consider translations with just one key:
pnpx messageformat <dir>
yields =>
As shown above,
greet
is missing. By just adding another key,The correct shape is omitted:
This broke me today unexpectedly where I had one translation with a single key. To keep the same structure, I now must artificially add an additional key so that the compiler does not drop valuable key/value pair information.
Is it agreed that this is/is not a problem? If this lossy behavior is desired, can it be opt-in only?
Originally posted by @cdaringe in #328 (comment)
The text was updated successfully, but these errors were encountered: