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)
 {}. More...
 
- Static Public Member Functions inherited from Gettext\Generators\PhpArray
static toString (Translations $translations)
 {Generates a string with the translations ready to save in a file.
Parameters
Translations$translations
Returns
string
} More...
 
static toArray (Translations $translations)
 Generates an array with the translations. More...
 
- Static Public Member Functions inherited from Gettext\Generators\Generator
static toFile (Translations $translations, $file)
 Saves the translations in a file. More...
 
- Static Public Member Functions inherited from Gettext\Generators\GeneratorInterface
static toFile (Translations $translations, $file)
 Saves the translations in a file. More...
 

Static Protected Member Functions

static buildArray (Translations $translations)
 {}. More...
 
- Static Protected Member Functions inherited from Gettext\Generators\PhpArray
static buildArray (Translations $translations)
 Generates an array with all translations. More...
 

Detailed Description

Definition at line 7 of file Jed.php.

Member Function Documentation

◆ buildArray()

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

{}.

Definition at line 22 of file Jed.php.

References $key, and array.

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  }
Create styles array
The data for the language used.
$key
Definition: croninfo.php:18

◆ toString()

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

{}.

Implements Gettext\Generators\GeneratorInterface.

Definition at line 12 of file Jed.php.

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

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.
+ Here is the call graph for this function:

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