示例#1
0
 public function testTranslate()
 {
     $adapter = new Zend_Translate_Adapter_XmlTm(dirname(__FILE__) . '/_files/XmlTm_test_en.xml', 'en');
     $this->assertEquals('Message 1', $adapter->translate('Message 1'));
     $this->assertEquals('Message 1', $adapter->_('Message 1'));
     $this->assertEquals('Message 5', $adapter->translate('Message 5'));
 }
 public function testIsoEncoding()
 {
     $adapter = new Zend_Translate_Adapter_XmlTm(dirname(__FILE__) . '/_files/translation_en3.xmltm', 'en');
     $this->assertEquals('Message 1 (en)', $adapter->translate('Message 1'));
     $this->assertEquals('Message 6', $adapter->_('Message 6'));
     if (PHP_OS == 'AIX') {
         return;
         // 'Charsets below are not supported on AIX';
     }
     $this->assertEquals(iconv('UTF-8', 'ISO-8859-1', 'Küchen Möbel (en)'), $adapter->translate('Cooking furniture'));
     $this->assertEquals('Cooking furniture (en)', $adapter->translate(iconv('UTF-8', 'ISO-8859-1', 'Küchen Möbel')));
 }
示例#3
0
文件: XmlTmTest.php 项目: lortnus/zf1
 public function testIsoEncoding()
 {
     $adapter = new Zend_Translate_Adapter_XmlTm(dirname(__FILE__) . '/_files/XmlTm_test_en2.xml', 'en');
     $this->assertEquals('Message 1 (en)', $adapter->translate('Mess1'));
     $this->assertEquals('Message 1 (en)', $adapter->_('Mess1'));
     $this->assertEquals(iconv('UTF-8', 'ISO-8859-1', 'Küchen Möbel (en)'), $adapter->translate('Cooking Furniture'));
     $this->assertEquals('Cooking Furniture (en)', $adapter->translate(iconv('UTF-8', 'ISO-8859-1', 'Küchen Möbel')));
 }