I ran the exact same test in French and in English. In both cases it passes, yet in the French interface I'm told there is one fail and 1 exception. Please see enclosed image

Cheers,

Albert

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Anonymous’s picture

Version: 7.x-dev » 8.x-dev

Does this happen with 8.x-dev?

alberto56’s picture

Title: In language other than English, test result passes but says "1 failed, 1 exception" » In French, test result passes but says "1 failed, 1 exception"

@earnie yup, same thing in D8 (latest dev). However this happens in French, but not in Spanish. (see enclosed images).

Because it seems to be a problem with the language file, I will document it more at http://localize.drupal.org/node/5133

alberto56’s picture

alberto56’s picture

Interesting: looking at the .po files in French and Spanish, there is no obvious difference. Can anyone figure out why it does this? Because I haven't found any obvious problem with the translations, I'm leaving this issue open until we can rule out a Drupal bug.

In French:

msgid "1 fail"
msgid_plural "@count fails"
msgstr[0] "1 échoué"
msgstr[1] "@count échoués"
msgid "1 exception"
msgid_plural "@count exceptions"
msgstr[0] "1 exception"
msgstr[1] "@count exceptions"

in Spanish:

msgid "1 fail"
msgid_plural "@count fails"
msgstr[0] "1 fallo"
msgstr[1] "@count fallos"
msgid "1 exception"
msgid_plural "@count exceptions"
msgstr[0] "1 excepción"
msgstr[1] "@count excepciones"
SebCorbin’s picture

This is due to the plural formulas of each language and an error in the french translation.

Reminder:

  • Spanish plural formula: nplurals=2; plural=(n!=1); so 0 will be considered as plural, hence 0 excepcionES
  • French plural formula: nplurals=2; plural=(n>1); so 0 will be considered as singular, hence 0 exception

Problem is, most french contributor don't know that they HAVE TO use the @count variable also in the singular part. I can't blame them, a good practice would be to oblige developers to also use @count in the singular form, so that the @count is exported in the .pot file. This would also be of help for any language not using the "traditional" plural formula (nplurals=2; plural=(n!=1);)

TL;DR just fixed this in the french translation: http://localize.drupal.org/translate/languages/fr/translate?sid=204706 http://localize.drupal.org/translate/languages/fr/translate?sid=204708

alberto56’s picture

Title: In French, test result passes but says "1 failed, 1 exception" » oblige developers to use @count in the singular form, so that the @count is exported in the .pot file
Component: simpletest.module » language.module
Category: bug » feature

@SebCorbin thanks, your response and explanation much appreciated! Made this into a feature request in case someone wants to look at it.

Cheers,

Albert.

Gábor Hojtsy’s picture

Indeed! Looks like a core patch would be in order?

SebCorbin’s picture

Title: oblige developers to use @count in the singular form, so that the @count is exported in the .pot file » Good practice change: use @count in the singular form, so that the @count is exported in the .pot file
Status: Active » Needs review
FileSize
1.51 KB

Comments and reviews appreciated!

alberto56’s picture

@SebCorbin thanks! Looks good.

Gábor Hojtsy’s picture

Status: Needs review » Needs work
Issue tags: +D8MI

What about actually changing the use of format_plural() as well?

Damien Tournoud’s picture

Status: Needs work » Closed (works as designed)

This is not a bug and works as designed.

The way plural forms are stored is independent on the language. The replacement of @count is available in all your plural forms. It's not because English doesn't have a @count in its form 0 (singular) that you cannot use it in your form 0.

SebCorbin’s picture

Category: feature » task
Status: Closed (works as designed) » Active

As you said, this is not a bug, it's a task, for now we're not changing code, just improving documentation to make the work of translators easier.

SebCorbin’s picture

So, back in the real discussion... Gabor, what do you mean by "changing the use of format_plural() as well?" (#10)

Gábor Hojtsy’s picture

@SebCorbin: well, changing the docs does not fix core instances where format_plural() is used. So I meant fixing the actual uses of format_plural().

alberto56’s picture

Issue summary: View changes

Here is a related issue:

#2273889: Don't use one language's plural index formula with another language's string in the case of untranslated strings using format_plural().

I was still experiencing the original problem where I was seeing 1 fail in French and 0 fails in English, due to an incomplete import of French strings.

I solved this by doing a complete import which contains:

# please see https://drupal.org/node/1788008
msgid "1 pass"
msgid_plural "@count passes"
msgstr[0] "@count réussi"
msgstr[1] "@count réussis"
msgid "1 fail"
msgid_plural "@count fails"
msgstr[0] "@count échoué"
msgstr[1] "@count échoués"
msgid "1 exception"
msgid_plural "@count exceptions"
msgstr[0] "@count exception"
msgstr[1] "@count exceptions"

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.