1: <?php
2: /**
3: * Copyright 2010-2012 Horde LLC (http://www.horde.org/)
4: *
5: * See the enclosed file COPYING for license information (LGPL). If you
6: * did not receive this file, see http://www.horde.org/licenses/lgpl21.
7: *
8: * @category Horde
9: * @package Translation
10: */
11:
12: /**
13: * Horde_Token_Translation is the translation wrapper class for horde/Token.
14: *
15: * @author Jan Schneider <jan@horde.org>
16: * @package Token
17: */
18: class Horde_Token_Translation extends Horde_Translation
19: {
20: /**
21: * Returns the translation of a message.
22: *
23: * @var string $message The string to translate.
24: *
25: * @return string The string translation, or the original string if no
26: * translation exists.
27: */
28: static public function t($message)
29: {
30: self::$_domain = 'Horde_Token';
31: self::$_directory = '@data_dir@' == '@'.'data_dir'.'@' ? dirname(__FILE__) . '/../../../locale' : '@data_dir@/Horde_Token/locale';
32: return parent::t($message);
33: }
34:
35: /**
36: * Returns the plural translation of a message.
37: *
38: * @param string $singular The singular version to translate.
39: * @param string $plural The plural version to translate.
40: * @param integer $number The number that determines singular vs. plural.
41: *
42: * @return string The string translation, or the original string if no
43: * translation exists.
44: */
45: static public function ngettext($singular, $plural, $number)
46: {
47: self::$_domain = 'Horde_Token';
48: self::$_directory = '@data_dir@' == '@'.'data_dir'.'@' ? dirname(__FILE__) . '/../../../locale' : '@data_dir@/Horde_Token/locale';
49: return parent::ngettext($singular, $plural, $number);
50: }
51:
52: }
53: