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
}
php
An exception for terminatinating execution or to throw for unit testing.
Gettext\Extractors\Extractor
Definition:
Extractor.php:10
Gettext\Extractors\YamlDictionary
Class to get gettext strings from plain json.
Definition:
YamlDictionary.php:12
Gettext\Extractors\YamlDictionary\fromString
static fromString($string, Translations $translations=null, $file='')
{Parses a string and append the translations found in the Translations instance.Translations}
Definition:
YamlDictionary.php:16
Gettext\Translations
Class to manage a collection of translations.
Definition:
Translations.php:12
Symfony\Component\Yaml\Parser
Parser parses YAML strings to convert them to PHP arrays.
Definition:
Parser.php:22
Gettext\Extractors\ExtractorInterface
Definition:
ExtractorInterface.php:8
Gettext\Extractors
Definition:
Blade.php:3
$file
if(!file_exists("$old.txt")) if( $old===$new) if(file_exists("$new.txt")) $file
Definition:
rename-config.php:43
libs
composer
vendor
gettext
gettext
src
Extractors
YamlDictionary.php
Generated on Sat Oct 4 2025 19:00:54 for ILIAS by
1.9.4 (using
Doxyfile
)