Source

php-libs / zf_translate / tests / ZendY / TranslateTestCase.php

<?php
class ZendY_TranslateTestCase extends PHPUnit_Framework_TestCase
{
    public function testTranslate()
    {
        $translator = new ZendY_Translate(
            'array',
            dirname(__FILE__) . '/i18n',
            'ru' // default locale
        );
        // if we are unable to find translation for language "ru",
        // use translation for language "en"
        $translator->setDefault(array('en'));

        // translation for language "ru"
        $this->assertEquals('ru', $translator->translate('lang'));

        // translation for language "en"
        $this->assertEquals('laughing out loud', $translator->translate('lol'));
    }
}