ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
Jed.php
Go to the documentation of this file.
1
<?
php
2
3
namespace
Gettext\Generators
;
4
5
use
Gettext\Translations
;
6
7
class
Jed
extends
PhpArray
implements
GeneratorInterface
8
{
12
public
static
function
toString
(
Translations
$translations)
13
{
14
$array =
static::toArray
($translations);
15
16
return
json_encode($array);
17
}
18
22
protected
static
function
buildArray
(
Translations
$translations)
23
{
24
$array = array();
25
26
$context_glue =
"\004"
;
27
28
foreach
($translations as $translation) {
29
$key
= ($translation->hasContext() ? $translation->getContext().$context_glue :
''
).$translation->getOriginal();
30
31
if
($translation->hasPluralTranslation()) {
32
$array[
$key
] = array_merge(array($translation->getTranslation()), $translation->getPluralTranslation());
33
}
else
{
34
$array[
$key
] = array($translation->getTranslation());
35
}
36
}
37
38
return
$array;
39
}
40
}
Gettext\Generators\GeneratorInterface
Definition:
GeneratorInterface.php:7
Gettext\Generators\PhpArray
Definition:
PhpArray.php:7
Translations
Gettext\Generators\Jed\buildArray
static buildArray(Translations $translations)
{}.
Definition:
Jed.php:22
Gettext\Translations
Class to manage a collection of translations.
Definition:
Translations.php:11
Gettext\Generators
Definition:
CsvDictionary.php:3
Gettext\Generators\Jed\toString
static toString(Translations $translations)
{}.
Definition:
Jed.php:12
ILIAS\UI\Implementation\Component\toArray
toArray($value)
Wrap the given value in an array if it is no array.
Definition:
ComponentHelper.php:243
php
Gettext\Generators\Jed
Definition:
Jed.php:7
$key
$key
Definition:
croninfo.php:18
libs
composer
vendor
gettext
gettext
src
Generators
Jed.php
Generated on Thu Feb 27 2025 19:01:19 for ILIAS by
1.8.13 (using
Doxyfile
)