Example #1
0
 /**
  * @covers de\detert\sebastian\slimline\Translate::getTranslation
  * @covers de\detert\sebastian\slimline\Translate::loadCategory
  */
 public function testShouldTranslateTextWithParams()
 {
     $translate = new Translate(__DIR__ . DS . 'translate', 'en');
     $actual = $translate->getTranslation('test', 'foo_var', array('i' => 17));
     $expected = 'i = 17!';
     $this->assertEquals($expected, $actual);
 }
Example #2
0
 /**
  * @param string $category
  * @param string $text
  * @param array $params
  *
  * @return string
  */
 public function getTranslation($category, $text, array $params = array())
 {
     return isset($this->translate) ? $this->translate->getTranslation($category, $text, $params) : $text;
 }