Documentation

Class Phalcon\Translate\Adapter\Gettext

extends abstract class Phalcon\Translate\Adapter

implements Phalcon\Translate\AdapterInterface, ArrayAccess

Source on GitHub

Allows to define translation lists using gettext

<?php

  $t = new \Phalcon\Translate\Adapter\Gettext(array(
      'locale' => 'en_US.utf8',
      'defaultDomain' => 'messages',
      'directory' => __DIR__ . DIRECTORY_SEPARATOR . 'locale'
 ));

Methods

public __construct (array $options)

Phalcon\Translate\Adapter\Gettext constructor

public string query (string $index, [array $placeholders])

Returns the translation related to the given key

public boolean exists (string $index)

Check whether is defined a translation key in the internal array

public string t (string $translateKey, [array $placeholders]) inherited from Phalcon\Translate\Adapter

Returns the translation string of the given key

public offsetSet (unknown $property, string $value) inherited from Phalcon\Translate\Adapter

Sets a translation value

public boolean offsetExists (unknown $property) inherited from Phalcon\Translate\Adapter

Check whether a translation key exists

public offsetUnset (unknown $property) inherited from Phalcon\Translate\Adapter

Unsets a translation from the dictionary

public string offsetGet (unknown $property) inherited from Phalcon\Translate\Adapter

Returns the translation related to the given key

public _ (unknown $translateKey, [unknown $placeholders]) inherited from Phalcon\Translate\Adapter

...