Closed
Description
Laravel Version
11.8.0
PHP Version
8.2.18
Database Driver & Version
MySQL 8.0.32 for Linux on x86_64
Description
The trans_choice
translation function always uses the pluralization rules of the selected locale. If the provided key is not translated in this locale, it falls back to the fallback locale, but it still uses the pluralization rules of the preferred locale.
For example, Czech has 3 forms, while English has 2. If the translator must fall back to English, it should use the English pluralization rules.
Steps To Reproduce
app('translator')->setLocale('cs_CZ');
$fallback = app('translator')->getFallback();
app('translator')->addLines(['strings.apple' => ':count apple|:count apples'], $fallback);
trans_choice('strings.apple', 1); // 1 apple
trans_choice('strings.apple', 2); // 2 apples
trans_choice('strings.apple', 10); // 10 apple - WRONG