Documentation

Horde_Translation_Handler_Gettext
in package
implements Horde_Translation_Handler

The Horde_Translation_Handler_Gettext provides translations through the gettext extension, but fails gracefully if gettext is not installed.

Tags
author

Jan Schneider jan@horde.org

Interfaces, Classes and Traits

Horde_Translation_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.

Search results