ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ 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\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
PHPMailer\PHPMailer\$options
$options
Definition:
get_oauth_token.php:91
Translations
Gettext\Translations
Class to manage a collection of translations.
Definition:
Translations.php:11
Gettext\Generators
Definition:
CsvDictionary.php:3
$values
$values
Definition:
testOperations.php:7
Gettext\Generators\JsonDictionary
Definition:
JsonDictionary.php:7
Generator
php
Gettext\Generators\JsonDictionary\$options
static $options
Definition:
JsonDictionary.php:9
libs
composer
vendor
gettext
gettext
src
Generators
JsonDictionary.php
Generated on Thu Jan 30 2025 19:01:18 for ILIAS by
1.8.13 (using
Doxyfile
)