- Phalcon\Translate\Adapter\AbstractAdapter
- Phalcon\Translate\Adapter\AdapterInterface
- Phalcon\Translate\Adapter\Csv
- Phalcon\Translate\Adapter\Gettext
- Phalcon\Translate\Adapter\NativeArray
- Phalcon\Translate\Exception
- Phalcon\Translate\Interpolator\AssociativeArray
- Phalcon\Translate\Interpolator\IndexedArray
- Phalcon\Translate\Interpolator\InterpolatorInterface
- Phalcon\Translate\InterpolatorFactory
- Phalcon\Translate\TranslateFactory
Abstract Class Phalcon\Translate\Adapter\AbstractAdapter
| Namespace | Phalcon\Translate\Adapter | | Uses | Phalcon\Helper\Arr, Phalcon\Translate\Exception, Phalcon\Translate\InterpolatorFactory | | Implements | AdapterInterface |
Phalcon\Translate\Adapter
Base class for Phalcon\Translate adapters
Properties¶
/**
* @var string
*/
protected defaultInterpolator = ;
/**
* @var InterpolatorFactory
*/
protected interpolatorFactory;
Methods¶
Returns the translation string of the given key (alias of method 't') Check whether a translation key exists Returns the translation related to the given key Sets a translation value Unsets a translation from the dictionary Returns the translation string of the given key Replaces placeholders by the values passedInterface Phalcon\Translate\Adapter\AdapterInterface
| Namespace | Phalcon\Translate\Adapter |
Phalcon\Translate\Adapter\AdapterInterface
Interface for Phalcon\Translate adapters
Methods¶
Check whether is defined a translation key in the internal array Returns the translation related to the given key Returns the translation string of the given keyClass Phalcon\Translate\Adapter\Csv
| Namespace | Phalcon\Translate\Adapter | | Uses | ArrayAccess, Phalcon\Translate\Exception, Phalcon\Translate\InterpolatorFactory | | Extends | AbstractAdapter | | Implements | ArrayAccess |
Phalcon\Translate\Adapter\Csv
Allows to define translation lists using CSV file
Properties¶
Methods¶
Phalcon\Translate\Adapter\Csv constructor Check whether is defined a translation key in the internal array Returns the translation related to the given keyClass Phalcon\Translate\Adapter\Gettext
| Namespace | Phalcon\Translate\Adapter | | Uses | ArrayAccess, Phalcon\Translate\Exception, Phalcon\Translate\InterpolatorFactory | | Extends | AbstractAdapter | | Implements | ArrayAccess |
Phalcon\Translate\Adapter\Gettext
use Phalcon\Translate\Adapter\Gettext;
$adapter = new Gettext(
[
"locale" => "de_DE.UTF-8",
"defaultDomain" => "translations",
"directory" => "/path/to/application/locales",
"category" => LC_MESSAGES,
]
);
Allows translate using gettext
Properties¶
/**
* @var int
*/
protected category;
/**
* @var string
*/
protected defaultDomain;
/**
* @var string|array
*/
protected directory;
/**
* @var string
*/
protected locale;
Methods¶
Phalcon\Translate\Adapter\Gettext constructor Check whether is defined a translation key in the internal arraypublic function nquery( string $msgid1, string $msgid2, int $count, array $placeholders = [], string $domain = null ): string;
// Set the directory path
$gettext->setDirectory("/path/to/the/messages");
// Set the domains and directories path
$gettext->setDirectory(
[
"messages" => "/path/to/the/messages",
"another" => "/path/to/the/another",
]
);
// Set locale to Dutch
$gettext->setLocale(LC_ALL, "nl_NL");
// Try different possible locale names for German
$gettext->setLocale(LC_ALL, "de_DE@euro", "de_DE", "de", "ge");
Class Phalcon\Translate\Adapter\NativeArray
| Namespace | Phalcon\Translate\Adapter | | Uses | ArrayAccess, Phalcon\Translate\Exception, Phalcon\Translate\InterpolatorFactory | | Extends | AbstractAdapter | | Implements | ArrayAccess |
Phalcon\Translate\Adapter\NativeArray
Allows to define translation lists using PHP arrays
Properties¶
Methods¶
Phalcon\Translate\Adapter\NativeArray constructor Check whether is defined a translation key in the internal array Whenever a key is not found this method will be called Returns the translation related to the given keyClass Phalcon\Translate\Exception
| Namespace | Phalcon\Translate | | Extends | \Phalcon\Exception |
Phalcon\Translate\Exception
Class for exceptions thrown by Phalcon\Translate
Class Phalcon\Translate\Interpolator\AssociativeArray
| Namespace | Phalcon\Translate\Interpolator | | Implements | InterpolatorInterface |
This file is part of the Phalcon Framework.
(c) Phalcon Team team@phalcon.io
For the full copyright and license information, please view the LICENSE.txt file that was distributed with this source code.
Methods¶
Replaces placeholders by the values passedClass Phalcon\Translate\Interpolator\IndexedArray
| Namespace | Phalcon\Translate\Interpolator | | Implements | InterpolatorInterface |
This file is part of the Phalcon Framework.
(c) Phalcon Team team@phalcon.io
For the full copyright and license information, please view the LICENSE.txt file that was distributed with this source code.
Methods¶
Replaces placeholders by the values passedInterface Phalcon\Translate\Interpolator\InterpolatorInterface
| Namespace | Phalcon\Translate\Interpolator |
Phalcon\Translate\InterpolatorInterface
Interface for Phalcon\Translate interpolators
Methods¶
Replaces placeholders by the values passedClass Phalcon\Translate\InterpolatorFactory
| Namespace | Phalcon\Translate | | Uses | Phalcon\Factory\AbstractFactory, Phalcon\Translate\Interpolator\InterpolatorInterface | | Extends | AbstractFactory |
This file is part of the Phalcon Framework.
(c) Phalcon Team team@phalcon.io
For the full copyright and license information, please view the LICENSE.txt file that was distributed with this source code.
Methods¶
AdapterFactory constructor. Create a new instance of the adapterClass Phalcon\Translate\TranslateFactory
| Namespace | Phalcon\Translate | | Uses | Phalcon\Config, Phalcon\Factory\AbstractFactory, Phalcon\Helper\Arr, Phalcon\Translate\Adapter\AdapterInterface | | Extends | AbstractFactory |
This file is part of the Phalcon Framework.
(c) Phalcon Team team@phalcon.io
For the full copyright and license information, please view the LICENSE.txt file that was distributed with this source code.