ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
Gettext\Generators\Jed Class Reference
+ Inheritance diagram for Gettext\Generators\Jed:
+ Collaboration diagram for Gettext\Generators\Jed:

Static Public Member Functions

static toString (Translations $translations)
 {@parentDoc}. More...
 
- Static Public Member Functions inherited from Gettext\Generators\GeneratorInterface
static toFile (Translations $translations, $file)
 Saves the translations in a file. More...
 
static toString (Translations $translations)
 Generates a string with the translations ready to save in a file. More...
 

Static Protected Member Functions

static buildArray (Translations $translations)
 {@parentdoc}. More...
 

Detailed Description

Definition at line 7 of file Jed.php.

Member Function Documentation

◆ buildArray()

static Gettext\Generators\Jed::buildArray ( Translations  $translations)
staticprotected

{@parentdoc}.

Definition at line 22 of file Jed.php.

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 }
$key
Definition: croninfo.php:18

References $key.

◆ toString()

static Gettext\Generators\Jed::toString ( Translations  $translations)
static

{@parentDoc}.

Implements Gettext\Generators\GeneratorInterface.

Definition at line 12 of file Jed.php.

13 {
14 $array = static::toArray($translations);
15
16 return json_encode($array);
17 }
toArray($value)
Wrap the given value in an array if it is no array.

References ILIAS\UI\Implementation\Component\toArray().

+ Here is the call graph for this function:

The documentation for this class was generated from the following file: