Skip to content
Permalink
Browse files

Add tests covering use case in #12013

  • Loading branch information...
markstory committed Apr 27, 2018
1 parent 62944e3 commit f5555dbb83e66eb68cce2c75677e48287799d45c
Showing with 15 additions and 0 deletions.
  1. +5 −0 tests/TestCase/I18n/Parser/PoFileParserTest.php
  2. +10 −0 tests/test_app/TestApp/Locale/en/context.po
@@ -178,12 +178,17 @@ public function testParseContextOnSomeMessages()
$this->assertSame('En resolved', $messages['Resolved']['_context']['']);
$this->assertSame('En resolved - context', $messages['Resolved']['_context']['Pay status']);
$key = '{0,plural,=0{Je suis}=1{Je suis}=2{Nous sommes} other{Nous sommes}}';
$this->assertContains("I've", $messages[$key]['_context']['origin']);
// Confirm actual behavior
I18n::setLocale('en_CA');
$this->assertSame('En cours', __('Pending'));
$this->assertSame('En cours - context', __x('Pay status', 'Pending'));
$this->assertSame('En resolved', __('Resolved'));
$this->assertSame('En resolved - context', __x('Pay status', 'Resolved'));
$this->assertSame("I've", __x('origin', $key, [1]));
$this->assertSame("We are", __x('origin', $key, [3]));
}
/**
@@ -27,3 +27,13 @@ msgstr "Titel mit Kontext"
msgctxt "another_context"
msgid "title"
msgstr "Titel mit anderem Kontext"

#, fuzzy
msgctxt "being"
msgid "{0,plural,=0{Je suis}=1{Je suis}=2{Nous sommes} other{Nous sommes}}"
msgstr "{0,plural,=0{I'm}=1{I'm}=2{We are} other{We are}}"

#, fuzzy
msgctxt "origin"
msgid "{0,plural,=0{Je suis}=1{Je suis}=2{Nous sommes} other{Nous sommes}}"
msgstr "{0,plural,=0{I've}=1{I've}=2{We are} other{We are}}"

0 comments on commit f5555db

Please sign in to comment.
You can’t perform that action at this time.