Skip to content

Commit 79cf515

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents 66c9e56 + 6406869 commit 79cf515

File tree

2 files changed

+23
-21
lines changed

2 files changed

+23
-21
lines changed

web/inc/i18n.php

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,24 @@
11
<?php
22
// Functions for internationalization
3-
43
/**
54
* Translates string to given language in first parameter, key given in second parameter (dynamically loads required language). Works like spritf from second parameter
65
* @global array $LANG Associative array of language pharses
76
* @return string Translated string
87
*/
98
function _translate() {
109
global $LANG;
11-
1210
$args = func_get_args();
1311
$l = $args[0];
14-
1512
if (!$l) return 'NO LANGUAGE DEFINED';
1613
$key = $args[1];
17-
1814
if (!isset($LANG[$l])) {
1915
require_once($_SERVER['DOCUMENT_ROOT'].'/inc/i18n/'.$l.'.php');
2016
}
21-
2217
if (!isset($LANG[$l][$key])) {
2318
$text=$key;
2419
} else {
2520
$text=$LANG[$l][$key];
2621
}
27-
2822
array_shift($args);
2923
if (count($args)>1) {
3024
$args[0] = $text;
@@ -33,7 +27,6 @@ function _translate() {
3327
return $text;
3428
}
3529
}
36-
3730
/**
3831
* Translates string by a given key in first parameter to current session language. Works like sprintf
3932
* @global array $LANG Associative array of language pharses
@@ -45,18 +38,15 @@ function __() {
4538
array_unshift($args,$_SESSION['language']);
4639
return call_user_func_array("_translate",$args);
4740
}
48-
4941
/**
5042
* Detects user language from Accept-Language HTTP header.
5143
* @param string Fallback language (default: 'en')
5244
* @return string Language code (such as 'en' and 'ja')
5345
*/
5446
function detect_user_language($fallback='en') {
5547
static $user_lang = '';
56-
5748
// Already detected
5849
if (!empty($user_lang)) return $user_lang;
59-
6050
// Check if Accept-Language header is available
6151
if (!isset($_SERVER) ||
6252
!isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ||
@@ -66,7 +56,6 @@ function detect_user_language($fallback='en') {
6656
$user_lang = $fallback;
6757
return $user_lang;
6858
}
69-
7059
// Sort Accept-Language by `q` value
7160
$accept_langs = explode(',', preg_replace('/\s/', '', strtolower($_SERVER['HTTP_ACCEPT_LANGUAGE'])));
7261
$accept_langs_sorted = [];
@@ -84,12 +73,10 @@ function detect_user_language($fallback='en') {
8473
}
8574
}
8675
arsort($accept_langs_sorted);
87-
8876
// List languages
8977
exec (VESTA_CMD."v-list-sys-languages json", $output, $return_var);
9078
$languages = json_decode(implode('', $output), true);
9179
unset($output);
92-
9380
// Find best matching language
9481
foreach ($accept_langs_sorted as $user_lang => $dummy) {
9582
$decision = '';
@@ -105,8 +92,7 @@ function detect_user_language($fallback='en') {
10592
return $user_lang;
10693
}
10794
}
108-
10995
// Store result for reusing
11096
$user_lang = $fallback;
11197
return $user_lang;
112-
}
98+
}

web/inc/i18n/tw.php

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@
339339
'first name' => '名字',
340340
'last name' => '姓氏',
341341
'account' => '帳號',
342-
'ssl certificate' => 'SSL 證書',
342+
'ssl certificate' => 'SSL 憑證',
343343
'ssl key' => 'SSL密鑰',
344344
'stats user password' => '統計使用者帳號密碼',
345345
'stats username' => '統計使用者名稱',
@@ -357,6 +357,22 @@
357357
'Action' => '動作',
358358
'Protocol' => '協議',
359359
'Port' => '端口',
360+
'Proxy Server' => '代理伺服器',
361+
'Web Server' => '網頁伺服器',
362+
'DNS Server' => 'DNS伺服器',
363+
'MAIL Server' => '郵件伺服器',
364+
'Antivirus' => '防毒系統',
365+
'AntiSpam' => '防垃圾郵件',
366+
'Webmail URL' => '網路信箱網址',
367+
'MySQL Support' => 'MySQL支援',
368+
'phpMyAdmin URL' => 'phpMyAdmin網址',
369+
'Maximum Number Of Databases' => '資料庫最高可使用數量',
370+
'Current Number Of Databases' => '資料庫目前已使用數量',
371+
'PostgreSQL Support' => 'PostgreSQL支援',
372+
'Local backup' => '本機備份',
373+
'Compression level' => '壓縮程度',
374+
'Directory' => '路徑',
375+
'Remote backup' => '異地備份',
360376
'Comment' => '備註',
361377
'Banlist' => '黑名單',
362378
'ranges are acceptable' => '可使用範圍(例如:21-22)',
@@ -400,7 +416,7 @@
400416
'CRON_CREATED_OK' => '任務排程 已加入成功!',
401417
'IP_CREATED_OK' => 'IP位置 <a href="/edit/ip/?ip=%s"><b>%s</b></a> 已加入成功!',
402418
'PACKAGE_CREATED_OK' => '方案 <a href="/edit/package/?package=%s"><b>%s</b></a> 已加入成功!',
403-
'SSL_GENERATED_OK' => 'SSL證書 已加入成功!',
419+
'SSL_GENERATED_OK' => 'SSL憑證 已加入成功!',
404420
'RULE_CREATED_OK' => 'Rule 已加入成功!',
405421
'Autoupdate has been successfully enabled' => '自動更新已成功啟動',
406422
'Autoupdate has been successfully disabled' => '自動更新已成功關閉',
@@ -587,7 +603,7 @@
587603
'Add File to the Current Selection' => '增加檔案到已選取的列表',
588604
'Select All Files' => '選取所有檔案',
589605
'shortcuts are inspired by magnificent GNU <a href="https://www.midnight-commander.org/">Midnight Commander</a> file manager' =>
590-
'快捷鍵是的想法是由 magnificent GNU <a href="https://www.midnight-commander.org/">Midnight Commander</a> 檔案管理器 啟發的',
606+
"快捷鍵是的想法是由 magnificent GNU <a href='https://www.midnight-commander.org/'>Midnight Commander</a> 檔案管理器 啟發的<br> 繁體中文翻譯是由 <a href='https://host.clark-chen.com'>Clark's 虛擬主機服務</a> 總工程師 <a href='https://www.clark-chen.com/'>Clark Chen</a> 提供。",
591607
'Save' => '儲存',
592608
'Licence Key' => '授權金鑰',
593609
'Enter License Key' => '輸入授權金鑰',
@@ -596,7 +612,7 @@
596612
'Disable and Cancel Licence' => '刪除並且取消授權',
597613
'Licence Activated' => '授權已啟用',
598614
'Licence Deactivated' => '授權已停用',
599-
'Restrict users so that they cannot use SSH and access only their home directory.' => '限制使用者只能在SSH中使用他們自己的資料夾',
600-
'Browse, copy, edit, view, and retrieve all of your web domain files using fully featured File Manager.' => '瀏覽、複製、編輯、取得你所有的網站資料使用全能的檔案管理器',
615+
'Restrict users so that they cannot use SSH and access only their home directory.' => '禁止使用者使用SSH,並且只能存取他們自己的資料夾',
616+
'Browse, copy, edit, view, and retrieve all of your web domain files using fully featured File Manager.' => '瀏覽、複製、編輯、存取你所有的網站資料使用全能的檔案管理器',
601617
'This is a commercial module, you would need to purchace license key to enable it.' => '這是一個付費模組,您需要購買授權金鑰才能啟動它。'
602-
);
618+
);

0 commit comments

Comments
 (0)