ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
translator_functions.php File Reference

Go to the source code of this file.

Functions

 __ ($original)
 Returns the translation of a string. More...
 
 n__ ($original, $plural, $value)
 Returns the singular/plural translation of a string. More...
 
 p__ ($context, $original)
 Returns the translation of a string in a specific context. More...
 
 d__ ($domain, $original)
 Returns the translation of a string in a specific domain. More...
 
 dp__ ($domain, $context, $original)
 Returns the translation of a string in a specific domain and context. More...
 
 np__ ($context, $original, $plural, $value)
 Returns the singular/plural translation of a string in a specific context. More...
 
 dnp__ ($domain, $context, $original, $plural, $value)
 Returns the singular/plural translation of a string in a specific domain and context. More...
 
 __e ()
 Prints function result. More...
 
 n__e ()
 Prints function result. More...
 
 p__e ()
 Prints function result. More...
 
 d__e ()
 Prints function result. More...
 
 dp__e ()
 Prints function result. More...
 
 dnp__e ()
 Prints function result. More...
 

Function Documentation

◆ __()

__ (   $original)

Returns the translation of a string.

Parameters
string$original
Returns
string

Definition at line 12 of file translator_functions.php.

13{
14 $text = BaseTranslator::$current->gettext($original);
15
16 if (func_num_args() === 1) {
17 return $text;
18 }
19
20 $args = array_slice(func_get_args(), 1);
21
22 return vsprintf($text, is_array($args[0]) ? $args[0] : $args);
23}
$text
Definition: errorreport.php:18

References $current, and $text.

◆ __e()

__e ( )

Prints function result.

See also
__

Definition at line 163 of file translator_functions.php.

164{
165 echo call_user_func_array('__', func_get_args());
166}

◆ d__()

d__ (   $domain,
  $original 
)

Returns the translation of a string in a specific domain.

Parameters
string$domain
string$original
Returns
string

Definition at line 76 of file translator_functions.php.

77{
78 $text = BaseTranslator::$current->dgettext($domain, $original);
79
80 if (func_num_args() === 2) {
81 return $text;
82 }
83
84 $args = array_slice(func_get_args(), 2);
85
86 return vsprintf($text, is_array($args[0]) ? $args[0] : $args);
87}
if(!array_key_exists('domain', $_REQUEST)) $domain
Definition: resume.php:8

References $current, $domain, and $text.

◆ d__e()

d__e ( )

Prints function result.

See also
d__

Definition at line 193 of file translator_functions.php.

194{
195 echo call_user_func_array('d__', func_get_args());
196}

◆ dnp__()

dnp__ (   $domain,
  $context,
  $original,
  $plural,
  $value 
)

Returns the singular/plural translation of a string in a specific domain and context.

Parameters
string$domain
string$context
string$original
string$plural
string$value
Returns
string

Definition at line 145 of file translator_functions.php.

146{
147 $text = BaseTranslator::$current->dnpgettext($domain, $context, $original, $plural, $value);
148
149 if (func_num_args() === 5) {
150 return $text;
151 }
152
153 $args = array_slice(func_get_args(), 5);
154
155 return vsprintf($text, is_array($args[0]) ? $args[0] : $args);
156}

References $current, $domain, and $text.

◆ dnp__e()

dnp__e ( )

Prints function result.

See also
dnp__

Definition at line 213 of file translator_functions.php.

214{
215 echo call_user_func_array('dnp__', func_get_args());
216}

◆ dp__()

dp__ (   $domain,
  $context,
  $original 
)

Returns the translation of a string in a specific domain and context.

Parameters
string$domain
string$context
string$original
Returns
string

Definition at line 98 of file translator_functions.php.

99{
100 $text = BaseTranslator::$current->dpgettext($domain, $context, $original);
101
102 if (func_num_args() === 3) {
103 return $text;
104 }
105
106 $args = array_slice(func_get_args(), 3);
107
108 return vsprintf($text, is_array($args[0]) ? $args[0] : $args);
109}

References $current, $domain, and $text.

◆ dp__e()

dp__e ( )

Prints function result.

See also
dp__

Definition at line 203 of file translator_functions.php.

204{
205 echo call_user_func_array('dp__', func_get_args());
206}

◆ n__()

n__ (   $original,
  $plural,
  $value 
)

Returns the singular/plural translation of a string.

Parameters
string$original
string$plural
string$value
Returns
string

Definition at line 34 of file translator_functions.php.

35{
36 $text = BaseTranslator::$current->ngettext($original, $plural, $value);
37
38 if (func_num_args() === 3) {
39 return $text;
40 }
41
42 $args = array_slice(func_get_args(), 3);
43
44 return vsprintf($text, is_array($args[0]) ? $args[0] : $args);
45}

References $current, and $text.

◆ n__e()

n__e ( )

Prints function result.

See also
n__

Definition at line 173 of file translator_functions.php.

174{
175 echo call_user_func_array('n__', func_get_args());
176}

◆ np__()

np__ (   $context,
  $original,
  $plural,
  $value 
)

Returns the singular/plural translation of a string in a specific context.

Parameters
string$context
string$original
string$plural
string$value
Returns
string

Definition at line 121 of file translator_functions.php.

122{
123 $text = BaseTranslator::$current->npgettext($context, $original, $plural, $value);
124
125 if (func_num_args() === 4) {
126 return $text;
127 }
128
129 $args = array_slice(func_get_args(), 4);
130
131 return vsprintf($text, is_array($args[0]) ? $args[0] : $args);
132}

References $current, and $text.

◆ p__()

p__ (   $context,
  $original 
)

Returns the translation of a string in a specific context.

Parameters
string$context
string$original
Returns
string

Definition at line 55 of file translator_functions.php.

56{
57 $text = BaseTranslator::$current->pgettext($context, $original);
58
59 if (func_num_args() === 2) {
60 return $text;
61 }
62
63 $args = array_slice(func_get_args(), 2);
64
65 return vsprintf($text, is_array($args[0]) ? $args[0] : $args);
66}

References $current, and $text.

◆ p__e()

p__e ( )

Prints function result.

See also
p__

Definition at line 183 of file translator_functions.php.

184{
185 echo call_user_func_array('p__', func_get_args());
186}