ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
◀ ilDoc Overview
CsvDictionary.php
Go to the documentation of this file.
1
<?php
2
3
namespace
Gettext\Extractors
;
4
5
use
Gettext\Translations
;
6
10
class
CsvDictionary
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
$handle = fopen(
'php://memory'
,
'w'
);
22
23
fputs($handle, $string);
24
rewind($handle);
25
26
$entries =
array
();
27
while
(
$row
= fgetcsv($handle)) {
28
$entries[
$row
[0]] = $row[1];
29
}
30
31
fclose($handle);
32
33
if
($entries) {
34
foreach
($entries as $original => $translation) {
35
$translations->insert(null, $original)->setTranslation($translation);
36
}
37
}
38
39
return
$translations;
40
}
41
}
Gettext\Extractors\CsvDictionary\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:
CsvDictionary.php:15
Translations
Gettext\Translations
Class to manage a collection of translations.
Definition:
Translations.php:11
Gettext\Extractors\Extractor
Definition:
Extractor.php:9
Gettext\Extractors\CsvDictionary
Class to get gettext strings from plain json.
Definition:
CsvDictionary.php:10
Gettext\Extractors\ExtractorInterface
Definition:
ExtractorInterface.php:7
array
Create styles array
The data for the language used.
Definition:
40duplicateStyle.php:19
$file
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
Definition:
rename-config.php:43
$row
$row
Definition:
10autofilter-selection-1.php:74
Gettext\Extractors
Definition:
Blade.php:3
libs
composer
vendor
gettext
gettext
src
Extractors
CsvDictionary.php
Generated on Sat Jan 18 2025 19:01:04 for ILIAS by
1.8.13 (using
Doxyfile
)