-
Notifications
You must be signed in to change notification settings - Fork 390
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
V5 plural RangeError: Incorrect locale information provided #2095
Closed
1 task done
Comments
This is misusage, import { plural } from '@lingui/core/macro'
import { useLingui } from '@lingui/react/macro'
export default function Developers() {
const {t} = useLingui();
return (
<div>
{t`Hello we have ${plural(4, {
zero: '# Developers',
one: '# Developer',
other: '# Developers'
})}`}
</div>
)
} |
Thank you, it works indeed. There is something broken when using it with arrow functions though. import { plural } from '@lingui/core/macro'
import { useLingui } from '@lingui/react/macro'
const Developers = () => {
const { t } = useLingui()
return (
<div>
{t`Hello we have ${plural(4, {
zero: '# Developers',
one: '# Developer',
other: '# Developers'
})}`}
</div>
)
}
export default Developers This ends up with |
Confirming the bug, would be fixed by lingui/swc-plugin#133 |
8 tasks
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Describe the bug
lowercase plural use results in RangeError: Incorrect locale information provided
To Reproduce
git clone git@github.com:lingui/js-lingui.git
git checkout next
cd examples/nextjs-swc
Does not work
Does work
Expected behavior
No error
Additional context
Plural component works out of the box, lowercase plural does not
lingui --version
5.0.0-next.4@lingui/swc-plugin
The text was updated successfully, but these errors were encountered: