Validated plural rules and warn about missing ones
See original GitHub issueDescribe the bug When plural for some language is not translated yet or missing particular form for a given value, the empty string is returned
To Reproduce
import { Trans } from "@lingui/react"
export default function App() {
return <Plural value={booksNum} other="# books" />
}
Have this extracted with en
as a sourceLanguage, then switch to eg. cs
.
Expected behavior
For booksNum < 5
I would expect that other
form will be used as a fallback if one/few is missing in translation. When the booksNum >= 5
it works correctly and result is 5 books
even with cs
locale.
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (11 by maintainers)
Top Results From Across the Web
Plural Rules - Unicode CLDR
See Language Plural Rules for the categories for each language in CLDR. ... The categories are verified by looking a minimal pairs: where...
Read more >Rails plural rules for translations - Stack Overflow
I faced with an issue that doc says about plural forms and they are different for each language. I expected that rules are...
Read more >Resolve validation errors - Azure DevOps Services
Fix errors reported upon importing a process to support customization of tracking work in Azure DevOps Services.
Read more >Checks and fixups — Weblate 4.15.1 documentation
Check fails if the number of \n literals in translation do not match the source. Missing plurals . Summary. Some plural forms are...
Read more >Disability Language Style Guide
NCDJ Recommendation: All the terms are acceptable, although, because they are not widely used, an explanation is required for a general audience. AP...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
As there’s no easy way to determine “fallback” rule, let’s simply raise validation warning/error when message is missing:
linguiConfig.sourceLocale
value.lingui compile --check
, validate plural rules for each locale. This will be tricky, as we need to parse message and find plural formatters. On the other hand, we need to parse message anyway to check there’re no syntax errors.lingui compile --check
)Sure, and you have also an absolute right to stay silent about it and move along. Screaming “this is bad, I am going away” is useful how exactly? I would recommend you trying to contribute to open-source software to get the feeling of how depressing it is when someone says you are doing a bad job in your spare time.