kernel/common/ezpi18n.php
File containing the ezpI18n class.
- Copyright
- Copyright (C) 1999-2011 eZ Systems AS. All rights reserved.
- License
- eZ Business Use License Agreement Version 2.0
- Package
- kernel
- Version
- 4.6.0
\ezpI18n
File containing the ezpI18n class.
- Copyright
- Copyright (C) 1999-2011 eZ Systems AS. All rights reserved.
- License
- eZ Business Use License Agreement Version 2.0
- Version
- 4.6.0
Methods


insertArguments(
$text, array $arguments
)
:
string
Replaces 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(
)
:
bool
Enabled 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
)
:
string
Translates the source \a $source with context \a $context and optional comment \a $comment and returns the translation if translations are enabled.
Uses {@link 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
)
:
string
Translates 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 {@link 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 |