You are here

public function LocalePluralFormatTest::getPoFileWithSimplePlural in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/locale/src/Tests/LocalePluralFormatTest.php \Drupal\locale\Tests\LocalePluralFormatTest::getPoFileWithSimplePlural()

Returns a .po file with a simple plural formula.

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

File

core/modules/locale/src/Tests/LocalePluralFormatTest.php, line 356
Contains \Drupal\locale\Tests\LocalePluralFormatTest.

Class

LocalePluralFormatTest
Tests plural handling for various languages.

Namespace

Drupal\locale\Tests

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 "1 hour"
msgid_plural "@count hours"
msgstr[0] "@count heure"
msgstr[1] "@count heures"

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

msgid "Monday"
msgstr "lundi"
EOF;
}