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

variable only cases in select is omitted #1522

Closed
taozhou-glean opened this issue Mar 16, 2023 · 0 comments · Fixed by #1523 or lingui/swc-plugin#41
Closed

variable only cases in select is omitted #1522

taozhou-glean opened this issue Mar 16, 2023 · 0 comments · Fixed by #1523 or lingui/swc-plugin#41
Assignees
Labels

Comments

@taozhou-glean
Copy link
Contributor

Describe the bug

pure variable variant is omitted from the extracted message, resulting in invalid ICU format

select(variant, {
    other: localeDateAndTime,
    today: `Today at ${localeTime}`,
    tomorrow: `Tomorrow at ${localeTime}`,
    yesterday: `Yesterday at ${localeTime}`,
  })

right now, other is omitted from the extracted message

 {variant, select, today {Today at {localeTime}} tomorrow {Tomorrow at {localeTime}} yesterday {Yesterday at {localeTime}}

and according to https://format-message.github.io/icu-message-format-for-translators/editor.html, this format is invalid as missing other there.

Expected behavior

expect other is included

{variant, select, other {{localeDateAndTime}} today {Today at {localeTime}} tomorrow {Tomorrow at {localeTime}} yesterday {Yesterday at {localeTime}}

Additional context

not sure if this is v4 only, only tested on v4 tho

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment