1 | <?php |
||
2 | // This file is part of BOINC. |
||
3 | // http://boinc.berkeley.edu |
||
4 | // Copyright (C) 2014 University of California |
||
5 | // |
||
6 | // BOINC is free software; you can redistribute it and/or modify it |
||
7 | // under the terms of the GNU Lesser General Public License |
||
8 | // as published by the Free Software Foundation, |
||
9 | // either version 3 of the License, or (at your option) any later version. |
||
10 | // |
||
11 | // BOINC is distributed in the hope that it will be useful, |
||
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
||
14 | // See the GNU Lesser General Public License for more details. |
||
15 | // |
||
16 | // You should have received a copy of the GNU Lesser General Public License |
||
17 | // along with BOINC. If not, see <http://www.gnu.org/licenses/>. |
||
18 | |||
19 | $language_names = array( |
||
20 | array("ar", "العربية", "Arabic"), |
||
21 | array("az", "Azərbaycan", "Azerbaijani"), |
||
22 | array("be", "Беларускі", "Belarusian"), |
||
23 | array("bg", "Български", "Bulgarian"), |
||
24 | array("ca", "Català", "Catalan"), |
||
25 | array("cs", "Čeština ", "Czech"), |
||
26 | array("cy", "Cymraeg", "Welsh"), |
||
27 | array("da", "Dansk", "Danish"), |
||
28 | array("de", "Deutsch ", "German"), |
||
29 | array("el", "Ελληνικά", "Greek"), |
||
30 | array("en", "English", "English"), |
||
31 | array("es", "Español", "Spanish"), |
||
32 | array("eu", "Basque", "Basque"), |
||
33 | array("fi", "Suomi", "Finnish"), |
||
34 | array("fr", "Français", "French"), |
||
35 | array("gl", "Galego", "Galician"), |
||
36 | array("he", "עִבְרִית", "Hebrew"), |
||
37 | array("hr", "Hrvatski", "Croatian"), |
||
38 | array("hu", "Magyar", "Hungarian"), |
||
39 | array("it_IT", "Italiano", "Italian"), |
||
40 | array("ja", "日本語", "Japanese"), |
||
41 | array("ko", "한국어", "Korean"), |
||
42 | array("lt", "Lietuvių", "Lithuanian"), |
||
43 | array("lv", "Latviešu", "Latvian"), |
||
44 | array("ms", "بهاس ملايو", "Malay"), |
||
45 | array("nb", "Norsk", "Norwegian"), |
||
46 | array("nl", "Nederlands", "Dutch"), |
||
47 | array("pl", "Polski", "Polish"), |
||
48 | array("pt_BR", "Português - Brasil", "Portuguese - Brazil"), |
||
49 | array("pt_PT", "Português", "Portuguese"), |
||
50 | array("ro", "Română", "Romanian"), |
||
51 | array("ru", "Русский", "Russian"), |
||
52 | array("sa", "فارسی", "Persian"), |
||
53 | array("sk", "Slovenčina", "Slovakian"), |
||
54 | array("sl", "Slovenščina", "Slovenian"), |
||
55 | array("sv", "Svenska", "Swedish"), |
||
56 | array("tr", "Türkçe", "Turkish"), |
||
57 | array("uk", "Українська", "Ukrainian"), |
||
58 | array("zh_CN", "简体中文", "Chinese"), |
||
59 | array("zh_TW", "繁體中文", "Chinese (Taiwan)"), |
||
60 | ); |
||
61 | |||
62 | function language_select($cur_lang_name) { |
||
63 | global $language_names; |
||
64 | $supported_languages = get_supported_languages(); |
||
0 ignored issues
–
show
|
|||
65 | $supported_languages[] = "en"; |
||
66 | $sel = $cur_lang_name?"":"selected"; |
||
67 | echo " |
||
68 | <option $sel value=auto>Language: default |
||
69 | "; |
||
70 | foreach ($language_names as $lang) { |
||
71 | if (!in_array($lang[0], $supported_languages)) continue; |
||
72 | $sel = ($cur_lang_name == $lang[0])?"selected":""; |
||
73 | if ($lang[0] == "en") { |
||
74 | echo "<option $sel value=".$lang[0].">".$lang[1]; |
||
75 | } else { |
||
76 | echo "<option $sel value=".$lang[0].">".$lang[1]." (".$lang[2].")"; |
||
77 | } |
||
78 | echo "\n"; |
||
79 | } |
||
80 | } |
||
81 | |||
82 | // show a menu of supported languages |
||
83 | // |
||
84 | function language_form($cur_lang_name=null) { |
||
85 | echo ' |
||
86 | <form name="language" method="get" action="set_language.php"> |
||
87 | <select class="selectbox form-control" name="lang" onchange="javascript: submit()"> |
||
88 | '; |
||
89 | language_select($cur_lang_name); |
||
90 | echo '</select> |
||
91 | </form> |
||
92 | '; |
||
93 | } |
||
94 | |||
95 | // given a language code, return a string of the form "(int-name/native-name)" |
||
96 | // |
||
97 | function language_desc($code) { |
||
98 | global $language_names; |
||
99 | if ($code == 'en') { |
||
100 | return '(English)'; |
||
101 | } |
||
102 | foreach ($language_names as $lang) { |
||
103 | if ($code == $lang[0]) { |
||
104 | return "'$code'".' ('.$lang[1].'/'.$lang[2].')'; |
||
105 | } |
||
106 | } |
||
107 | return "'$code'"; |
||
108 | } |
||
109 | |||
110 | ?> |
||
111 |
This check looks for function or method calls that always return null and whose return value is assigned to a variable.
The method
getObject()
can return nothing but null, so it makes no sense to assign that value to a variable.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.