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\Extractors
;
4
5
use
Gettext\Translations
;
6
10
class
JsonDictionary
extends
Extractor
implements
ExtractorInterface
11
{
15
public
static
function
fromString
($string,
Translations
$translations =
null
,
$file
=
''
)
16
{
17
if
($translations ===
null
) {
18
$translations =
new
Translations
();
19
}
20
21
if
(($entries = json_decode($string,
true
))) {
22
foreach
($entries as $original => $translation) {
23
$translations->insert(
null
, $original)->setTranslation($translation);
24
}
25
}
26
27
return
$translations;
28
}
29
}
php
An exception for terminatinating execution or to throw for unit testing.
Gettext\Extractors\Extractor
Definition:
Extractor.php:10
Gettext\Extractors\JsonDictionary
Class to get gettext strings from plain json.
Definition:
JsonDictionary.php:11
Gettext\Extractors\JsonDictionary\fromString
static fromString($string, Translations $translations=null, $file='')
{Parses a string and append the translations found in the Translations instance.Translations}
Definition:
JsonDictionary.php:15
Gettext\Translations
Class to manage a collection of translations.
Definition:
Translations.php:12
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
JsonDictionary.php
Generated on Sat Oct 4 2025 19:00:54 for ILIAS by
1.9.4 (using
Doxyfile
)