public function testTranslate() { $adapter = new Zend_Translate_Adapter_Csv(dirname(__FILE__) . '/_files/translation_en.csv', 'en'); $this->assertEquals('Message 1 (en)', $adapter->translate('Message 1')); $this->assertEquals('Message 1 (en)', $adapter->_('Message 1')); $this->assertEquals('Message 5 (en)', $adapter->translate('Message 5')); $adapter = new Zend_Translate_Adapter_Csv(dirname(__FILE__) . '/_files/translation_en2.csv', 'en', array('separator' => ',')); $this->assertEquals('Message 1 (en)', $adapter->translate('Message 1')); $this->assertEquals('Message 4 (en)', $adapter->translate('Message 4,')); $this->assertEquals('Message 5, (en)', $adapter->translate('Message 5')); $this->assertEquals('Message 6,addon (en)', $adapter->translate('Message 6,addon,')); }
public function testSpecialChars() { $adapter = new Zend_Translate_Adapter_Csv(dirname(__FILE__) . '/_files/translation_specialchars.csv', 'en'); $this->assertEquals('Message 1 (en)', $adapter->translate('Message 1')); $this->assertEquals('Message 1 (en)', $adapter->_('Message 1')); $this->assertEquals('Message 6;" (en)', $adapter->translate('Message 6')); $this->assertEquals('Message 7 (en)', $adapter->translate('Message ;" 7')); }