Documentation

Horde_Translation_Autodetect extends Horde_Translation
in package

The Horde_Translation_Autodetect auto detects the locale directory location for the class implementing it.

Tags
author

Jan Schneider jan@horde.org

category

Horde

copyright

2010-2017 Horde LLC

license

http://www.horde.org/licenses/lgpl21 LGPL 2.1

since
2.2.0

Table of Contents

$_directory  : string
The relative path to the translations for the default gettext handler.
$_domain  : string
The translation domain, e.g. the library name, for the default gettext handler.
$_handlers  : array<string|int, mixed>
The handlers providing the actual translations.
$_pearDirectory  : string
The absolute PEAR path to the translations for the default gettext handler.
loadHandler()  : mixed
Auto detects the locale directory location.
ngettext()  : string
Returns the plural translation of a message.
r()  : string
Allows a gettext string to be defined and recognized as a string by the horde translation utilities, but no translation is actually performed (raw gettext = r()).
setHandler()  : mixed
Assigns a translation handler object to $_handlers.
t()  : string
Returns the translation of a message.
_getSearchDirectories()  : mixed
Get potential locations for the locale directory.
_searchLocaleDirectory()  : mixed
Search for the locale directory for different installations methods (eg: PEAR, Composer).

Properties

$_directory

The relative path to the translations for the default gettext handler.

protected static string $_directory

$_domain

The translation domain, e.g. the library name, for the default gettext handler.

protected static string $_domain

$_handlers

The handlers providing the actual translations.

protected static array<string|int, mixed> $_handlers = array()

$_pearDirectory

The absolute PEAR path to the translations for the default gettext handler.

protected static string $_pearDirectory

This value is automatically set by PEAR Replace Tasks.

Methods

loadHandler()

Auto detects the locale directory location.

public static loadHandler(string $handlerClass) : mixed
Parameters
$handlerClass : string

The name of a class implementing the Horde_Translation_Handler interface.

Return values
mixed

ngettext()

Returns the plural translation of a message.

public static 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.

r()

Allows a gettext string to be defined and recognized as a string by the horde translation utilities, but no translation is actually performed (raw gettext = r()).

public static r(string $message) : string
Parameters
$message : string

The raw string to mark for translation.

Tags
since
2.1.0
Return values
string

The raw string.

setHandler()

Assigns a translation handler object to $_handlers.

public static setHandler(string $domain, Horde_Translation_Handler $handler) : mixed

Type hinting isn't used on purpose. You should extend a custom translation handler passed here from the Horde_Translation interface, but technically it's sufficient if you provide the API of that interface.

Parameters
$domain : string

The translation domain.

$handler : Horde_Translation_Handler

An object implementing the Horde_Translation_Handler interface.

Return values
mixed

t()

Returns the translation of a message.

public static t(mixed $message) : string
Parameters
$message : mixed
Return values
string

The string translation, or the original string if no translation exists.

_getSearchDirectories()

Get potential locations for the locale directory.

protected static _getSearchDirectories() : mixed
Return values
mixed

_searchLocaleDirectory()

Search for the locale directory for different installations methods (eg: PEAR, Composer).

protected static _searchLocaleDirectory() : mixed
Return values
mixed

Search results