ILIAS  release_8 Revision v8.24
class.ilMDLanguageItem.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4/*
5 +-----------------------------------------------------------------------------+
6 | ILIAS open source |
7 +-----------------------------------------------------------------------------+
8 | Copyright (c) 1998-2001 ILIAS open source, University of Cologne |
9 | |
10 | This program is free software; you can redistribute it and/or |
11 | modify it under the terms of the GNU General Public License |
12 | as published by the Free Software Foundation; either version 2 |
13 | of the License, or (at your option) any later version. |
14 | |
15 | This program is distributed in the hope that it will be useful, |
16 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
18 | GNU General Public License for more details. |
19 | |
20 | You should have received a copy of the GNU General Public License |
21 | along with this program; if not, write to the Free Software |
22 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
23 +-----------------------------------------------------------------------------+
24*/
25
32{
33 private string $language_code;
34
35 public function __construct(string $a_code)
36 {
37 $this->language_code = $a_code;
38 }
39
40 public function getLanguageCode(): string
41 {
43 if (in_array($this->language_code, $lang)) {
45 }
46 return '';
47 }
48
52 public static function _getPossibleLanguageCodes(): array
53 {
54 return array(
55 "aa",
56 "ab",
57 "af",
58 "am",
59 "ar",
60 "as",
61 "ay",
62 "az",
63 "ba",
64 "be",
65 "bg",
66 "bh",
67 "bi",
68 "bn",
69 "bo",
70 "br",
71 "ca",
72 "co",
73 "cs",
74 "cy",
75 "da",
76 "de",
77 "dz",
78 "el",
79 "en",
80 "eo",
81 "es",
82 "et",
83 "eu",
84 "fa",
85 "fi",
86 "fj",
87 "fo",
88 "fr",
89 "fy",
90 "ga",
91 "gd",
92 "gl",
93 "gn",
94 "gu",
95 "ha",
96 "he",
97 "hi",
98 "hr",
99 "hu",
100 "hy",
101 "ia",
102 "ie",
103 "ik",
104 "id",
105 "is",
106 "it",
107 "iu",
108 "ja",
109 "jv",
110 "ka",
111 "kk",
112 "kl",
113 "km",
114 "kn",
115 "ko",
116 "ks",
117 "ku",
118 "ky",
119 "la",
120 "ln",
121 "lo",
122 "lt",
123 "lv",
124 "mg",
125 "mi",
126 "mk",
127 "ml",
128 "mn",
129 "mo",
130 "mr",
131 "ms",
132 "mt",
133 "my",
134 "na",
135 "ne",
136 "nl",
137 "no",
138 "oc",
139 "om",
140 "or",
141 "pa",
142 "pl",
143 "ps",
144 "pt",
145 "qu",
146 "rm",
147 "rn",
148 "ro",
149 "ru",
150 "rw",
151 "sa",
152 "sd",
153 "sg",
154 "sh",
155 "si",
156 "sk",
157 "sl",
158 "sm",
159 "sn",
160 "so",
161 "sq",
162 "sr",
163 "ss",
164 "st",
165 "su",
166 "sv",
167 "sw",
168 "ta",
169 "te",
170 "tg",
171 "th",
172 "ti",
173 "tk",
174 "tl",
175 "tn",
176 "to",
177 "tr",
178 "ts",
179 "tt",
180 "tw",
181 "ug",
182 "uk",
183 "ur",
184 "uz",
185 "vi",
186 "vo",
187 "wo",
188 "xh",
189 "yi",
190 "yo",
191 "za",
192 "zh",
193 "zu"
194 );
195 }
196
200 public static function _getLanguages(): array
201 {
202 global $DIC;
203
204 $lng = $DIC->language();
205
206 $lng->loadLanguageModule("meta");
207
208 $langs = array();
209 foreach (self::_getPossibleLanguageCodes() as $lngcode) {
210 $langs[$lngcode] = $lng->txt("meta_l_" . $lngcode);
211 }
212 asort($langs);
213 return $langs;
214 }
215}
__construct(string $a_code)
global $DIC
Definition: feed.php:28
$lng
$lang
Definition: xapiexit.php:26