GettextHandler
in package
implements
Handler
The Horde_Translation_Handler_Gettext provides translations through the gettext extension, but fails gracefully if gettext is not installed.
Tags
Interfaces, Classes, Traits and Enums
- Handler
- The Horde_Translation_Handler interface defines the interface for any classes providing translations.
Table of Contents
- $domain : string
- The translation domain, e.g. package name.
- $gettext : bool
- Whether the gettext extension is installed.
- __construct() : mixed
- Constructor.
- ngettext() : string
- Returns the plural translation of a message.
- t() : string
- Returns the translation of a message.
Properties
$domain
The translation domain, e.g. package name.
protected
string
$domain
$gettext
Whether the gettext extension is installed.
protected
bool
$gettext
Methods
__construct()
Constructor.
public
__construct(string $domain, string $path) : mixed
Parameters
- $domain : string
-
The translation domain, e.g. package name.
- $path : string
-
The path to the gettext catalog.
Return values
mixed —ngettext()
Returns the plural translation of a message.
public
ngettext(string $singular, string $plural, int $number) : string
Parameters
- $singular : string
-
The singular version to translate.
- $plural : string
-
The plural version to translate.
- $number : int
-
The number that determines singular vs. plural.
Return values
string —The string translation, or the original string if no translation exists.
t()
Returns the translation of a message.
public
t(string $message) : string
Parameters
- $message : string
-
The string to translate.
Return values
string —The string translation, or the original string if no translation exists.