Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
drupal_set_message(t('No test(s) selected.'), 'error');
Comment | File | Size | Author |
---|---|---|---|
#19 | jamesan_335067-19.patch | 2.37 KB | JamesAn |
#14 | jamesan_335067-14.patch | 2.37 KB | JamesAn |
#12 | jamesan_335067-12.patch | 3.39 KB | JamesAn |
#9 | jamesan_335067-9.patch | 3.06 KB | JamesAn |
Comments
Comment #1
hass CreditAttribution: hass commentedComment #2
hass CreditAttribution: hass commentedStrings is not context sensitive:
Comment #3
hass CreditAttribution: hass commentedformat_plural is missing for situation where we only have one stale table:
Comment #4
hass CreditAttribution: hass commentedSame again:
Comment #5
hass CreditAttribution: hass commentedComment #6
hass CreditAttribution: hass commentedMaybe we have only ONE test:
Comment #7
boombatower CreditAttribution: boombatower commented...unltra minor, please provide a patch for core and then this can be backported.
Comment #8
webchickComment #9
JamesAn CreditAttribution: JamesAn commented#2 seems to no longer be in the HEAD.
The fix for #6 is more involved as I needed to fetch the test results from the db using the test_id and count them. The counting mirrors how the test summary is aggregated in simpletest_test_form(), in a simplified way.
Comment #10
JamesAn CreditAttribution: JamesAn commentedI swear I flipped the switch just now.. =\
Comment #11
hass CreditAttribution: hass commentedWhat about the singular of
drupal_set_message(t('No tests selected.'), 'error');
?Comment #12
JamesAn CreditAttribution: JamesAn commentedI didn't think the singular of
drupal_set_message(t('No tests selected.'), 'error');
would ever be used. That message is only displayed when no tests are selected. Zero is conventionally placed in the plural form: you say, "I have 0 items," not "I have 0 item."But according to wiki (http://en.wikipedia.org/wiki/Plural#Zero), English uses the plural form for zero, but not all languages do that. For example, French uses the singular form for zero: they say, "j'ai 0 élément."
I've fixed another error message is displayed when no test cases are found (which happens also when no tests are selected):
drupal_set_message('No test cases found.', 'error');
. It was also missing the t() function.Comment #14
JamesAn CreditAttribution: JamesAn commentedThe patch has been updated against the intervening changes to simpletest.module.
The code in #6 has been changed to use "test(s)" instead of "tests" to show that one test is possible. The patch in #12 actually counts the number of tests performed to run the statement through format_plural. It felt inappropriate to do all that processing just to decide whether or not to pluralize the statement.
Comment #15
Damien Tournoud CreditAttribution: Damien Tournoud commentedI suggest to replace "The test(s)" by "The test run", which is slightly less ugly.
This change serves no purpose: format_plural() is only useful when the translation can actually change, which is not the case here. The fact that the grammar might be different between languages is perfectly irrelevant.
Shouldn't that be "left-over", instead of "left over"?
Comment #16
hass CreditAttribution: hass commentedCannot follow... in German I would translate 'No test case found.' to "Es wurde kein Testfall gefunden" and 'No test cases found.' to "Es wurden keine Testfälle gefunden". If there is no plural form we are not able to translate correctly. Code looks absolutely correct.
'The test(s) finished in @elapsed.' is not good - it need to become 'The test finished in @elapsed.' and 'The tests finished in @elapsed.' to translate to "Der Test wurde abgeschlossen in @elapsed" and "Die Tests wurden abgeschlossen in @elapsed" (German).
Comment #17
Damien Tournoud CreditAttribution: Damien Tournoud commented@hass: the English sentence "No test cases found" is absolutely not ambiguous. It means that 0 test cases have been found. You will translate it using the correct form in German. In French, it will become "Aucun cas de test n'a été trouvé", using a singular form.
About the ugly "The test(s)", please see my proposal above.
Comment #18
hass CreditAttribution: hass commentedUps, I missed
(count($classes) == 0)
... sorryComment #19
JamesAn CreditAttribution: JamesAn commentedOops indeed. I didn't think much about my use of format_plural() for zero either. XD
I like your suggestion of "test run". It removes the need to consider singular and plural cases since a test run is always singular regardless of the number of tests being done.
Doing some digging around about "left over" vs. "left-over" vs. "leftover", I didn't find very much on the usage of "left-over". It seemed that "leftover" is more common than "left over" as an adjective. "left over" tends to be used in the verb form, i.e., the tables were left over from the test crash.
I found a Wiktionary entry saying that "leftover" is preferred over "left over" when used as an adjective. Unfortunately, there's no citation and I couldn't find the source of that tidbit.
http://en.wiktionary.org/wiki/leftover
http://en.wiktionary.org/wiki/left_over
http://dictionary.reference.com/browse/leftover
http://dictionary.reference.com/browse/left%20over
----------------
In this patch, I've
Comment #20
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks!