ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
◀ ilDoc Overview
Jed.php
Go to the documentation of this file.
1
<?php
2
3
namespace
Gettext\Extractors
;
4
5
use
Gettext\Translations
;
6
10
class
Jed
extends
PhpArray
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
$content = json_decode($string,
true
);
22
23
PhpArray::handleArray
($content, $translations);
24
25
return
$translations;
26
}
27
35
protected
static
function
insertTranslation
(
Translations
$translations,
$key
,
$message
)
36
{
37
$context_glue =
'\u0004'
;
38
$key
= explode($context_glue,
$key
);
39
40
$context = isset(
$key
[1]) ? array_shift(
$key
) :
''
;
41
$original = array_shift(
$key
);
42
$translation = array_shift(
$message
);
43
$plural_translation = array_shift(
$message
);
44
45
$entry = $translations->
insert
($context, $original);
46
$entry->setTranslation($translation);
47
$entry->setPluralTranslation($plural_translation);
48
}
49
}
Gettext\Extractors\Jed\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:
Jed.php:15
Translations
Gettext\Translations\insert
insert($context, $original, $plural='')
Creates and insert/merges a new translation.
Definition:
Translations.php:329
Gettext\Extractors\Jed
Class to get gettext strings from json files.
Definition:
Jed.php:10
Gettext\Translations
Class to manage a collection of translations.
Definition:
Translations.php:11
Gettext\Extractors\PhpArray\handleArray
static handleArray(array $content, Translations $translations)
Handle an array of translations and append to the Translations instance.
Definition:
PhpArray.php:48
$message
catch(Exception $e) $message
Definition:
saml2-logout.php:34
Gettext\Extractors\Jed\insertTranslation
static insertTranslation(Translations $translations, $key, $message)
Extract and insert a new translation.
Definition:
Jed.php:35
Gettext\Extractors\ExtractorInterface
Definition:
ExtractorInterface.php:7
Gettext\Extractors\PhpArray
Class to get gettext strings from php files returning arrays.
Definition:
PhpArray.php:11
$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
$key
$key
Definition:
croninfo.php:18
libs
composer
vendor
gettext
gettext
src
Extractors
Jed.php
Generated on Tue Jan 28 2025 19:01:05 for ILIAS by
1.8.13 (using
Doxyfile
)