ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
◀ ilDoc Overview
JsonDictionary.php
Go to the documentation of this file.
1
<?php
2
3
namespace
Gettext\Generators
;
4
5
use
Gettext\Translations
;
6
7
class
JsonDictionary
extends
Generator
implements
GeneratorInterface
8
{
9
public
static
$options
= 0;
10
14
public
static
function
toString
(
Translations
$translations)
15
{
16
$array =
PhpArray::toArray
($translations);
17
18
//for a simple json translation dictionary, one domain is supported
19
$values = current($array);
20
21
// remove meta / header data
22
if
(array_key_exists(
''
, $values)) {
23
unset($values[
''
]);
24
}
25
26
//map to a simple json dictionary (no plurals)
27
return
json_encode(
28
array_filter(
29
array_map(
function
($val) {
30
return
isset($val[1]) ? $val[1] : null;
31
}, $values)
32
),
33
self::$options
34
);
35
}
36
}
Gettext\Generators\Generator
Definition:
Generator.php:7
Gettext\Generators\GeneratorInterface
Definition:
GeneratorInterface.php:7
Gettext\Generators\PhpArray\toArray
static toArray(Translations $translations)
Generates an array with the translations.
Definition:
PhpArray.php:26
Gettext\Generators\JsonDictionary\toString
static toString(Translations $translations)
{}.
Definition:
JsonDictionary.php:14
Translations
Gettext\Translations
Class to manage a collection of translations.
Definition:
Translations.php:11
Gettext\Generators
Definition:
CsvDictionary.php:3
Gettext\Generators\JsonDictionary
Definition:
JsonDictionary.php:7
Gettext\Generators\JsonDictionary\$options
static $options
Definition:
JsonDictionary.php:9
$options
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
Definition:
as_login.php:20
libs
composer
vendor
gettext
gettext
src
Generators
JsonDictionary.php
Generated on Tue Jan 28 2025 19:01:05 for ILIAS by
1.8.13 (using
Doxyfile
)