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

Add custom Gettext loader to fix plural rules #7204

Merged

Conversation

mlocati
Copy link
Contributor

@mlocati mlocati commented Oct 15, 2018

When the Zend I18N component loads language files with wrong or missing plural rules, concrete5 aborts with this Zend\I18n\Exception\RuntimeException exception:

Plural rule of merging text domain is not compatible with the current one

End users may have a very hard time debugging (and understanding) what's going on.

So, what about fixing automatically the number of plural rules if possible (or showing a better error message if an automatic fix is not possible)?

@mlocati
Copy link
Contributor Author

mlocati commented Oct 15, 2018

Here's an example of the new error displayed to the users:

The language file
/application/languages/it_IT/LC_MESSAGES/messages.mo
for Italian (Italy) has 1 plural form instead of 2.

@mlocati
Copy link
Contributor Author

mlocati commented Oct 15, 2018

PS: this PR doesn't add much overhead, since the translations are cached once they are succesfully loaded.

@aembler aembler merged commit c032e1d into concretecms:develop Oct 17, 2018
@mlocati mlocati deleted the plural-rule-merge-problems-details branch October 17, 2018 05:24
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.

None yet

2 participants