function LocalePluralFormatTest::getPoFileWithSimplePlural

Same name in other branches
  1. 7.x modules/locale/locale.test \LocalePluralFormatTest::getPoFileWithSimplePlural()
  2. 9 core/modules/locale/tests/src/Functional/LocalePluralFormatTest.php \Drupal\Tests\locale\Functional\LocalePluralFormatTest::getPoFileWithSimplePlural()
  3. 8.9.x core/modules/locale/tests/src/Functional/LocalePluralFormatTest.php \Drupal\Tests\locale\Functional\LocalePluralFormatTest::getPoFileWithSimplePlural()
  4. 11.x core/modules/locale/tests/src/Functional/LocalePluralFormatTest.php \Drupal\Tests\locale\Functional\LocalePluralFormatTest::getPoFileWithSimplePlural()

Returns a .po file with a simple plural formula.

3 calls to LocalePluralFormatTest::getPoFileWithSimplePlural()
LocalePluralFormatTest::testGetPluralFormat in core/modules/locale/tests/src/Functional/LocalePluralFormatTest.php
Tests locale_get_plural() and \Drupal::translation()->formatPlural().
LocalePluralFormatTest::testPluralEditDateFormatter in core/modules/locale/tests/src/Functional/LocalePluralFormatTest.php
Tests plural editing of DateFormatter strings.
LocalePluralFormatTest::testPluralEditExport in core/modules/locale/tests/src/Functional/LocalePluralFormatTest.php
Tests plural editing and export functionality.

File

core/modules/locale/tests/src/Functional/LocalePluralFormatTest.php, line 401

Class

LocalePluralFormatTest
Tests plural handling for various languages.

Namespace

Drupal\Tests\locale\Functional

Code

public function getPoFileWithSimplePlural() {
    return <<<EOF
msgid ""
msgstr ""
"Project-Id-Version: Drupal 8\\n"
"MIME-Version: 1.0\\n"
"Content-Type: text/plain; charset=UTF-8\\n"
"Content-Transfer-Encoding: 8bit\\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\\n"

msgid "@count hour"
msgid_plural "@count hours"
msgstr[0] "@count heure"
msgstr[1] "@count heures"

msgid "@count second"
msgid_plural "@count seconds"
msgstr[0] "@count seconde"
msgstr[1] "@count secondes"

msgid "Monday"
msgstr "lundi"
EOF;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.