-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Unable to open automation rules when PL or RU translation is activated #3679
Comments
@JC5 Hey, thanks for such a quick reply. I can confirm that this change fixes the issue for me, thanks again! I don't know how pluralization works in this framework, but when I worked with gettext and PO files it was important that Polish language has 3 plurals forms, while other languages tend to have only 2. Maybe it's related to this problem? It's the same for Russian apparently. |
Thanks for pointing it out. |
Ah yes, has_attachments. Thanks sephrat. And I realised without a emoji my "accusation" feels pretty serious. But no worries :D |
OK, that is a tricky one. There's probably a reason behind this added complexity, but for now it seems Polish and Russian implementation for pluralization is not as robust as that of other languages. It breaks when the variable passed to trans_choice is not a numeric (like 'Category is [name of category]'). Other languages supported by Firefly III work fine, I tested them all. |
For this particular instance, we can also fix it by rephrasing the sentence: "the transaction has this many attachments: n". Not the best solution but a lot less complicated. And yes, this is something for Laravel to fix. |
Found the faulty code in Laravel: |
Gentlemen, hello everyone. Thank you, but I still didn't understand anything, even with the help of a translator. I realized that with the translation something, I'll try to roll back the files. )) |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Bug description
I am running Firefly III version 5.3.3, and my problem is:
When Polish translation is activated, going to Automation->Rules always shows a page with "Whoops! An error occurred.".
An exception has been thrown during the rendering of a template ("A non-numeric value encountered").
I figured out that the same thing happens for Russian. Only those two languages (Polish and Russian) have the problem. When for example English is activated, the page displays without problems.
Steps to reproduce
My attempt to fix it
I thought that maybe there's a mistake somehwere in the Polish translation files. I copied the files from en_US locale, overwriting completely Polish files. Then I restarted the Docker container to make sure that the changes will be applied. To my surprise, the error persisted. Which means it's something else and I'm not that much into PHP to debug it further :(
Extra info
Debug information generated at 2020-08-09 20:09:33 UTC for Firefly III version 5.3.3.
Stacktrace
Bonus points
The text was updated successfully, but these errors were encountered: