ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
Php.php
Go to the documentation of this file.
1
<?
php
2
namespace
Gettext\Languages\Exporter
;
3
4
class
Php
extends
Exporter
5
{
9
protected
static
function
toStringDo
(
$languages
)
10
{
11
$lines = array();
12
$lines[] =
'<?php'
;
13
$lines[] =
'return array('
;
14
foreach
(
$languages
as
$lc
) {
15
$lines[] =
' \''
.$lc->id.
'\'
=> array(
';
16
$lines[] = '
\
'name\' => \''
.addslashes($lc->name).
'\'
,
';
17
if (isset($lc->supersededBy)) {
18
$lines[] = '
\
'supersededBy\' => \''
.$lc->supersededBy.
'\'
,
';
19
}
20
if (isset($lc->script)) {
21
$lines[] = '
\
'script\' => \''
.addslashes($lc->script).
'\'
,
';
22
}
23
if (isset($lc->territory)) {
24
$lines[] = '
\
'territory\' => \''
.addslashes($lc->territory).
'\'
,
';
25
}
26
if (isset($lc->baseLanguage)) {
27
$lines[] = '
\
'baseLanguage\' => \''
.addslashes($lc->baseLanguage).
'\'
,
';
28
}
29
$lines[] = '
\
'formula\' => \''
.$lc->formula.
'\'
,
';
30
$lines[] = '
\
'plurals\' => '
.count($lc->categories).
','
;
31
$catNames = array();
32
foreach
($lc->categories as
$c
) {
33
$catNames[] =
"'{$c->id}'"
;
34
}
35
$lines[] =
' \'cases\' => array('
.implode(
', '
, $catNames).
'),'
;
36
$lines[] =
' \'examples\' => array('
;
37
foreach
($lc->categories as $c) {
38
$lines[] =
' \''
.$c->id.
'\'
=> \
''
.$c->examples.
'\'
,
';
39
}
40
$lines[] = '
),
';
41
$lines[] = '
),
';
42
}
43
$lines[] = '
);
';
44
$lines[] = '
';
45
46
return implode("\n", $lines);
47
}
51
public static function getDescription()
52
{
53
return '
Build
a
PHP
array
';
54
}
55
}
Gettext\Languages\Exporter\Exporter
Base class for all the exporters.
Definition:
Exporter.php:10
PHP
PHP
Definition:
index.php:3
a
$c
$c
Definition:
inc.setup_header.php:183
Gettext\Languages\Exporter\Php
Definition:
Php.php:4
Gettext\Languages\Exporter
Definition:
Docs.php:2
Gettext\Languages\Exporter\Php\toStringDo
static toStringDo($languages)
Definition:
Php.php:9
$lc
$lc
Definition:
date.php:267
php
$languages
$languages
Definition:
cssgen2.php:34
libs
composer
vendor
gettext
languages
src
Exporter
Php.php
Generated on Thu Jan 16 2025 19:01:41 for ILIAS by
1.8.13 (using
Doxyfile
)