Skip to content

Fix trans_choice() pluralization#3405

Merged
jasonvarga merged 3 commits intomasterfrom
fix/trans-choice-pluralization
Mar 19, 2021
Merged

Fix trans_choice() pluralization#3405
jasonvarga merged 3 commits intomasterfrom
fix/trans-choice-pluralization

Conversation

@jesseleite
Copy link
Copy Markdown
Contributor

@jesseleite jesseleite commented Mar 19, 2021

Laravel's MessageSelector requires locales like de_CH to use underscores, but we were using dashes. This fixes the use of trans_choice() to pluralize strings in locales like de_CH.

Anyone referencing de-CH with a dash in their config, will be taken care of by the middleware for backwards compatibility. However, all translations with a dash in their path will need to be updated.

…uld be underscores.

They need to be underscores for pluralization to work with Laravel’s `MessageSelector` class.
The locale that gets passed is affected by our middleware change, so it should always have underscores.
@jesseleite jesseleite requested a review from jasonvarga March 19, 2021 18:09
@jasonvarga jasonvarga merged commit 7a74fc4 into master Mar 19, 2021
@jasonvarga jasonvarga deleted the fix/trans-choice-pluralization branch March 19, 2021 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants