ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
◀ ilDoc Overview
YamlDictionary.php
Go to the documentation of this file.
1
<?php
2
3
namespace
Gettext\Extractors
;
4
5
use
Gettext\Translations
;
6
use
Symfony\Component\Yaml\Parser
;
7
11
class
YamlDictionary
extends
Extractor
implements
ExtractorInterface
12
{
16
public
static
function
fromString
($string,
Translations
$translations = null,
$file
=
''
)
17
{
18
if
($translations === null) {
19
$translations =
new
Translations
();
20
}
21
22
$yml =
new
Parser
();
23
24
if
(($entries = $yml->parse($string))) {
25
foreach
($entries as $original => $translation) {
26
$translations->insert(null, $original)->setTranslation($translation);
27
}
28
}
29
30
return
$translations;
31
}
32
}
Parser
Translations
Gettext\Extractors\YamlDictionary
Class to get gettext strings from plain json.
Definition:
YamlDictionary.php:11
Gettext\Translations
Class to manage a collection of translations.
Definition:
Translations.php:11
Gettext\Extractors\Extractor
Definition:
Extractor.php:9
Gettext\Extractors\ExtractorInterface
Definition:
ExtractorInterface.php:7
Symfony\Component\Yaml\Parser
Parser parses YAML strings to convert them to PHP arrays.
Definition:
Parser.php:21
Gettext\Extractors\YamlDictionary\fromString
static fromString($string, Translations $translations=null, $file='')
{Parses a string and append the translations found in the Translations instance.The file path to inse...
Definition:
YamlDictionary.php:16
$file
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
Definition:
rename-config.php:43
Gettext\Extractors
Definition:
Blade.php:3
libs
composer
vendor
gettext
gettext
src
Extractors
YamlDictionary.php
Generated on Tue Jan 28 2025 19:01:05 for ILIAS by
1.8.13 (using
Doxyfile
)