Pop\I18n\I18n::__ PHP Method

__() public method

Return the translated string
public __ ( string $str, string | array $params = null )
$str string
$params string | array
    public function __($str, $params = null)
    {
        return $this->translate($str, $params);
    }

Usage Example

Ejemplo n.º 1
0
 public function testConstructor()
 {
     define('POP_LANG', 'fr_FR');
     $l = new I18n();
     $this->assertEquals('Ce champ est obligatoire.', $l->__('This field is required.'));
     $this->assertEquals('La valeur ne doit pas faire partie du 127.0.0 de sous-réseau.', $l->__('The value must not be part of the subnet %1.', '127.0.0'));
     $this->assertEquals('La valeur ne doit pas faire partie du 127.0.0 de sous-réseau.', $l->__('The value must not be part of the subnet %1.', array('127.0.0')));
     $this->assertEquals('fr', $l->getLanguage());
     $this->assertEquals('FR', $l->getLocale());
 }
All Usage Examples Of Pop\I18n\I18n::__