Fix "Subject too long" message#1041
Fix "Subject too long" message#1041andreyv wants to merge 1 commit intocms-dev:masterfrom andreyv:fix-pot
Conversation
Also update .pot file.
Codecov Report
@@ Coverage Diff @@
## master #1041 +/- ##
==========================================
- Coverage 62.02% 61.97% -0.06%
==========================================
Files 227 227
Lines 16411 16411
==========================================
- Hits 10179 10170 -9
- Misses 6232 6241 +9
Continue to review full report at Codecov.
|
lw
left a comment
There was a problem hiding this comment.
N_ is only used to mark a message for translation; the actual translation (in this case) is done inside the add_notification method of ContestHandler. The changes you propose have an issue: the message that is marked and that thus appears in cms.pot is of the form text %(foo)d, however the one that is translated is of the form text 42, because the formatting happens after the marking but before calling add_notification. This means that the message won't be translated since it won't be found in cms.pot.
There's no obvious solution to that. The only one I see is to add a new field to UnacceptableQuestion and a new argument to notify_error and add_notification. This field/argument, named for example text_args, would contain the formatting arguments, while the text would now remain unformatted. This way the replacement can be done inside add_notification, rather than when the exception is created. This same problem also affects the other UnacceptableSth exceptions, it would be great if you could fix all of them.
|
To be clear: the issue (a big one) is in our code, this PR uncovered and addressed one symptom but didn't fix the core problem. |
|
Thanks for the explanation, I confused |
|
Hi Andrey, do you have time to fix this up today or tomorrow? We'd like to include this fix in rc1 and to release it asap as there were a few substantial usability bugs in rc0. If not it's not a problem, I think Luca can work on it 😁 |
|
Superseded by #1046. |
Fixes #1040. Also update
.potfile.This change is