Line 2990 goes:
watchdog('file system', 'Did not delete temporary file "%path" during garbage collection, because it is in use by the following modules: %modules.', array('%path' => $file->uri, '%modules' => implode(', ', array_keys($references))), WATCHDOG_INFO);
Although in English it sounds ok for either plural or singular, it is not the same in Brazilian Portuguese, for example. I'm unsure about the fix, maybe a format_plural would do?
Comment | File | Size | Author |
---|---|---|---|
#18 | 1053690-watchdog-plural_17.patch | 1.2 KB | Schnitzel |
#16 | 1053690-watchdog-plural.patch | 1.12 KB | franz |
#14 | 1053690-watchdog-plural.patch | 1.12 KB | franz |
#11 | 1053690-watchdog-plural.patch | 1.1 KB | franz |
#6 | watchdog_plural.patch | 1.09 KB | Yaron Tal |
Comments
Comment #1
franzForgot to say, this is in modules/system/system.module
Comment #2
franzBetter component
Comment #3
Yaron Tal CreditAttribution: Yaron Tal commentedYou can't use format_plural because that would also translate the string. The best way I can see is to have 2 different strings which are (in english) only slightly different.
I attached a patch which will fix the problem, I'm just not entirely sure it's the best way to do this.
Comment #4
franzI've just seen that the string is actually in plural... Perhaps this fix is right for this then, let's wait for a review
Comment #6
Yaron Tal CreditAttribution: Yaron Tal commentedI see other patches don't have the a/filename and b/filename paths, fixed it.
Comment #7
Yaron Tal CreditAttribution: Yaron Tal commentedComment #8
franzYaron Tal, see the patch documentation, there is a link for git (I assume you're using it), and there are some usefull alias configuration to generate proper patches. I always forget to use it, but it's very handy
Comment #9
franzI guess this is really ok to go
Comment #10
rfayThis is a -p0 patch - needs to be rerolled.
Comment #11
franzRe-rolled
Comment #12
franzComment #13
webchickCan we add a comment here to explain why we can't use format_plural() here? I can see someone trying to "optimize" this later.
Comment #14
franzRe-rolled, added comment.
I tried to improve legibility as well by separating the 2 messages from the watchdog function call, this way is less confusing, I believe.
Comment #16
franzOoops.
Comment #17
Niklas Fiekas CreditAttribution: Niklas Fiekas commentedNeeds a reroll because of the new directory structure.
Comment #18
Schnitzel CreditAttribution: Schnitzel commentedreroll and also adapted the text, because it was changed in the meantime by #806974: Punctuation errors in messages
Comment #19
Niklas Fiekas CreditAttribution: Niklas Fiekas commentedLooks good.
Comment #20
oriol_e9gWhy don't use format_plural insteaf of if...else structure?EDIT: Ops, sorry, because watchdog don't need to be translated. RTBC.
Comment #21
jbrown CreditAttribution: jbrown commentedThe bulk of the message is the same whether modules is plural or not. There is no point in repeating the whole thing twice.
Comment #22
Gábor Hojtsy1. The message would need to be included verbatim with watchdog() to be extracted for translation. The way it is used in the patch it will not be translatable by the community.
2. count($references) == 1 is a very bad way to decide whether to use plural or non-plural strings. Different languages have different rules, some even have 4 different versions of a string based on the number.
watchdog() unfortunately has no support for plurals yet, this should either be accepted, or watchdog() itself should be improved to take a translation callback like hook_menu() implements so that it can support plurals clearly. Solving that problem would be required to solve this issue cleanly.
Comment #23
sunThis issue won't fix for me - implementing proper plural grammar/logic for system log messages is totally not worth the effort.
Almost no one reads log messages, and those who do, do not care for grammar.
Comment #24
Gábor HojtsyThat is likely why watchdog() did not yet get plural support for quite some time now.
Comment #25
akalata CreditAttribution: akalata commentedSo, just set this as a 'won't fix' and call it done?
Comment #26
webchickDone.