kernel/common/ezpi18n.php
\ezpI18n
Methods

insertArguments(
$text, array $arguments
)
:
stringReplaces keys found in \a $text with values in \a $arguments.
If \a $arguments is an associative array it will use the argument keys as replacement keys. If not it will convert the index to a key looking like %n, where n is a number between 1 and 9.
| Name | Type | Description |
|---|---|---|
| $text | ||
| $arguments | array |
| Type | Description |
|---|---|
| string |

isEnabled(
)
:
boolEnabled if the site.ini settings RegionalSettings/TextTranslation is set to disabled
| Type | Description |
|---|---|
| bool |

tr(
string $context, string $source, string | null $comment
=
null, array | null $arguments
=
null
)
:
stringTranslates the source \a $source with context \a $context and optional comment \a $comment and returns the translation if translations are enabled.
Uses {@see ezpI18n::translateText()}
Example: translate( 'content/view', 'There are %count nodes in this list out of %total total nodes.', 'Children view of nodes for whole site', array( '%count' => $c, '%total' => $t ) );
| Name | Type | Description |
|---|---|---|
| $context | string | |
| $source | string | |
| $comment | string | null | |
| $arguments | array | null |
| Type | Description |
|---|---|
| string |

translateText(
string $context, string $source, string | null $comment
=
null, array | null $arguments
=
null
)
:
stringTranslates the source \a $source with context \a $context and optional comment \a $comment and returns the translation if locale code is not eng-GB.
Uses {@see eZTranslatorMananger::translate()} to do the actual translation
Example: translateText( 'content/view', 'There are %count nodes in this list out of %total total nodes.', 'Children view of nodes for whole site', array( '%count' => $c, '%total' => $t ) );
| Name | Type | Description |
|---|---|---|
| $context | string | |
| $source | string | |
| $comment | string | null | |
| $arguments | array | null |
| Type | Description |
|---|---|
| string |