Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

Public Member Functions | Public Attributes | List of all members
eZTranslatorHandler Class Referenceabstract
Internationalization » Translation

Base class for translation handling. More...

Inheritance diagram for eZTranslatorHandler:

## Public Member Functions
| __construct ( $is_key_based)
| isKeyBased ()
| findKey ( $key)
| findMessage ( $context, $source, $comment=null)
| translate ( $context, $source, $comment=null)
| keyTranslate ( $key)

## Public Attributes
| $IsKeyBased

## Detailed Description

Base class for translation handling.

Definition at line 18 of file eztranslatorhandler.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZTranslatorHandler::__construct | ( |  | $is_key_based | ) |

Constructor

Parameters

  bool | $is_key_based |

Reimplemented in eZShuffleTranslator, eZTranslatorGroup, and eZRandomTranslator.

Definition at line 25 of file eztranslatorhandler.php.

## Member Function Documentation

## ◆ findKey()

eZTranslatorHandler::findKey | ( |  | $key | ) |
| pure virtual

Returns
  the translation message for the key $key or null if the key does not exist.

This function must overridden if isKeyBased() is true.

Implemented in eZTSTranslator, and eZTranslatorGroup.

Definition at line 45 of file eztranslatorhandler.php.

## ◆ findMessage()

eZTranslatorHandler::findMessage | ( |  | $context,
|  |  | $source,
|  |  | $comment = `null`
| ) |  |
| pure virtual

Returns
  the translation message for $source and $context or null if the key does not exist.

If you know the translation key use findKey() instead.

This function must overridden if isKeyBased() is true.

Implemented in eZTSTranslator, eZTranslatorGroup, eZShuffleTranslator, eZBorkTranslator, and eZ1337Translator.

Definition at line 58 of file eztranslatorhandler.php.

## ◆ isKeyBased()

eZTranslatorHandler::isKeyBased | ( |  | ) |

Returns
  true if the handler can lookup translations with translation keys.

Definition at line 34 of file eztranslatorhandler.php.

References $IsKeyBased.

Referenced by eZTranslatorGroup\registerHandler().

## ◆ keyTranslate()

eZTranslatorHandler::keyTranslate | ( |  | $key | ) |
| pure virtual

Returns
  the translation string for $key or null if the translation does not exist.

See also
  findMessage, findKey

Implemented in eZTSTranslator, and eZTranslatorGroup.

Definition at line 80 of file eztranslatorhandler.php.

## ◆ translate()

eZTranslatorHandler::translate | ( |  | $context,
|  |  | $source,
|  |  | $comment = `null`
| ) |  |
| pure virtual

Returns
  the translation string for $source and $context or null if the translation does not exist.

See also
  findMessage, findKey

Implemented in eZTSTranslator, eZTranslatorGroup, eZShuffleTranslator, eZBorkTranslator, and eZ1337Translator.

Definition at line 69 of file eztranslatorhandler.php.

## Member Data Documentation

## ◆ $IsKeyBased

eZTranslatorHandler::$IsKeyBased

Tells whether the handler is key based or not

Definition at line 87 of file eztranslatorhandler.php.

Referenced by isKeyBased().

The documentation for this class was generated from the following file:

- eztranslatorhandler.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.