Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Copyright 2010-2017 Horde LLC (http://www.horde.org/) See the enclosed file LICENSE for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.

Copyright: 2010-2017 Horde LLC
License: http://www.horde.org/licenses/lgpl21 LGPL 2.1
File Size: 132 lines (4 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 2 classes

Horde_Translation:: (1 method):
  loadHandler()

that:: (4 methods):
  setHandler()
  t()
  ngettext()
  r()


Class: Horde_Translation  - X-Ref

Horde_Translation is the base class for any translation wrapper classes in
libraries that want to utilize the Horde_Translation library for
translations.

loadHandler($handlerClass)   X-Ref
Loads a translation handler class pointing to the library's translations
and assigns it to $_handler.

param: string $handlerClass  The name of a class implementing the

Class: that  - X-Ref

setHandler($domain, $handler)   X-Ref
Assigns a translation handler object to $_handlers.

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.

param: string $domain                      The translation domain.
param: Horde_Translation_Handler $handler  An object implementing the

t($message)   X-Ref
Returns the translation of a message.

return: string  The string translation, or the original string if no

ngettext($singular, $plural, $number)   X-Ref
Returns the plural translation of a message.

param: string $singular  The singular version to translate.
param: string $plural    The plural version to translate.
param: integer $number   The number that determines singular vs. plural.
return: string  The string translation, or the original string if no

r($message)   X-Ref
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()).

param: string $message  The raw string to mark for translation.
return: string  The raw string.