ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
YamlDictionary.php
Go to the documentation of this file.
1
<?
php
2
3
namespace
Gettext\Generators
;
4
5
use
Gettext\Translations
;
6
use
Symfony\Component\Yaml\Dumper
;
7
8
class
YamlDictionary
extends
Generator
implements
GeneratorInterface
9
{
13
public
static
function
toString
(
Translations
$translations)
14
{
15
$array =
PhpArray::toArray
($translations);
16
17
//for a simple json translation dictionary, one domain is supported
18
$values
= current($array);
19
20
// remove meta / header data
21
if
(array_key_exists(
''
,
$values
)) {
22
unset(
$values
[
''
]);
23
}
24
25
//map to a simple yml dictionary (no plurals)
26
$yml =
new
Dumper
();
27
$output
= $yml->dump(
28
array_map(
29
function
($val) {
30
return
isset($val[1]) ? $val[1] : null;
31
},
32
$values
33
),
34
1
35
);
36
37
return
$output
;
38
}
39
}
Sabre\VObject\$output
$output
Definition:
mergeduplicates.php: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\YamlDictionary\toString
static toString(Translations $translations)
{}.
Definition:
YamlDictionary.php:13
Gettext\Generators\YamlDictionary
Definition:
YamlDictionary.php:8
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
Symfony\Component\Yaml\Dumper
Dumper dumps PHP variables to YAML strings.
Definition:
Dumper.php:19
Generator
Dumper
php
libs
composer
vendor
gettext
gettext
src
Generators
YamlDictionary.php
Generated on Thu Jan 16 2025 19:01:41 for ILIAS by
1.8.13 (using
Doxyfile
)