* add zh-tw lang.

This commit is contained in:
wangyidong
2018-12-21 13:06:14 +08:00
parent 73ef25cd9c
commit 1586f7428c
8 changed files with 142 additions and 106 deletions

View File

@@ -86,6 +86,7 @@ pms:
if [ ! -d "zentaopms/config/ext" ]; then mkdir zentaopms/config/ext; fi
for module in `ls zentaopms/module/`; do if [ ! -d "zentaopms/module/$$module/ext" ]; then mkdir zentaopms/module/$$module/ext; fi done
find zentaopms/ -name ext |xargs chmod -R 777
tools/cn2tw.php
zip -rq -9 ZenTaoPMS.$(VERSION).zip zentaopms
rm -fr zentaopms ranzhi buildxx zentaoxx xuanxuan.zentao.*.zip
deb:

View File

@@ -502,9 +502,10 @@ $lang->pager->previousPage = "上一頁";
$lang->pager->nextPage = "下一頁";
$lang->pager->summery = "第 <strong>%s-%s</strong> 項,共 <strong>%s</strong> 項";
$lang->proVersion = "<a href='https://api.zentao.net/goto.php?item=proversion&from=footer' target='_blank' id='proLink' class='text-important'>專業版 <i class='text-danger icon-pro-version'></i></a> &nbsp; ";
$lang->downNotify = "下載桌面提醒";
$lang->website = "https://www.zentao.net";
$lang->proVersion = "<a href='https://api.zentao.net/goto.php?item=proversion&from=footer' target='_blank' id='proLink' class='text-important'>專業版 <i class='text-danger icon-pro-version'></i></a> &nbsp; ";
$lang->downNotify = "下載桌面提醒";
$lang->downloadClient = "下載客戶端";
$lang->website = "https://www.zentao.net";
$lang->suhosinInfo = "警告數據太多請在php.ini中修改<font color=red>sohusin.post.max_vars</font>和<font color=red>sohusin.request.max_vars</font>(大於%s的數。 保存並重新啟動apache或php-fpm否則會造成部分數據無法保存。";
$lang->maxVarsInfo = "警告數據太多請在php.ini中修改<font color=red>max_input_vars</font>(大於%s的數。 保存並重新啟動apache或php-fpm否則會造成部分數據無法保存。";

View File

@@ -28,6 +28,7 @@ $lang->entry->url = '請求地址';
$lang->entry->confirmDelete = '您確認要刪除該應用嗎?';
$lang->entry->help = '使用說明';
$lang->entry->notify = '消息通知';
$lang->entry->note = new stdClass();
$lang->entry->note->name = '授權應用名稱';

View File

@@ -3,6 +3,6 @@ $lang->message->common = '消息';
$lang->message->index = '首頁';
$lang->message->setting = '設置';
$lang->message->typeList['mail'] = '郵件';
$lang->message->typeList['message'] = '瀏覽器通知';
$lang->message->typeList['webhook'] = 'Webhook';
$lang->message->typeList['mail'] = '郵件';
$lang->message->typeList['message'] = '瀏覽器通知';
$lang->message->typeList['webhook'] = 'Webhook';

View File

@@ -15,6 +15,28 @@ $lang->misc->ping = '防超時';
$lang->misc->api = 'https://api.zentao.net';
$lang->misc->enApi = 'http://api.zentao.pm';
$lang->misc->client = new stdclass();
$lang->misc->client->version = '客戶端版本';
$lang->misc->client->os = '操作系統';
$lang->misc->client->download = '下載';
$lang->misc->client->downloading = '正在獲取安裝包:';
$lang->misc->client->downloaded = '成功獲取安裝包';
$lang->misc->client->setting = '正在設置配置信息';
$lang->misc->client->setted = '成功設置配置信息';
$lang->misc->client->osList['win64'] = 'Windows 64位';
$lang->misc->client->osList['win32'] = 'Windows 32位';
$lang->misc->client->osList['linux64'] = 'Linux 64位';
$lang->misc->client->osList['linux32'] = 'Linux 32位';
$lang->misc->client->osList['mac'] = 'Mac版';
$lang->misc->client->errorInfo = new stdclass();
$lang->misc->client->errorInfo->downloadError = '獲取安裝包失敗';
$lang->misc->client->errorInfo->configError = '配置用戶信息失敗';
$lang->misc->client->errorInfo->manualOpt = '請從 %s 手動獲取安裝包。';
$lang->misc->client->errorInfo->dirNotExist = '客戶端下載存儲路徑 <span class="code text-red">%s</span> 不存在,請創建該目錄。';
$lang->misc->client->errorInfo->dirNotWritable = '客戶端下載存儲路徑 <span class="code text-red">%s</span> 不可寫 <br />linux下面請執行命令<span class="code text-red">sudo chmod 777 %s</span>來修正';
$lang->misc->zentao = new stdclass();
$lang->misc->zentao->version = '版本%s';
$lang->misc->zentao->labels['about'] = '關於禪道';
@@ -76,6 +98,7 @@ $lang->misc->feature = new stdclass();
$lang->misc->feature->lastest = '最新版本';
$lang->misc->feature->detailed = '詳情';
$lang->misc->releaseDate['11.0.stable'] = '2018-12-21';
$lang->misc->releaseDate['10.6.stable'] = '2018-11-20';
$lang->misc->releaseDate['10.5.stable'] = '2018-10-25';
$lang->misc->releaseDate['10.4.stable'] = '2018-09-28';
@@ -96,6 +119,8 @@ $lang->misc->releaseDate['7.2.stable'] = '2015-05-22';
$lang->misc->releaseDate['7.1.stable'] = '2015-03-07';
$lang->misc->releaseDate['6.3.stable'] = '2014-11-07';
$lang->misc->feature->all['11.0.stable'][] = array('title'=>'禪道整合喧喧');
$lang->misc->feature->all['10.6.stable'][] = array('title'=>'調整備份機制', 'desc' => '<p>增加備份設置,備份更加靈活</p><p>顯示備份進度</p><p>可以更改備份目錄</p>');
$lang->misc->feature->all['10.6.stable'][] = array('title'=>'優化和調整菜單', 'desc' => '<p>調整後台菜單</p><p>調整我的地盤和項目的二級菜單</p>');

View File

@@ -12,7 +12,7 @@
$lang->tree = new stdclass();
$lang->tree->common = '模組維護';
$lang->tree->edit = '編輯';
$lang->tree->delete = '刪除模組';
$lang->tree->delete = '刪除';
$lang->tree->browse = '通用模組維護';
$lang->tree->browseTask = '任務模組維護';
$lang->tree->manage = '維護模組';

View File

@@ -46,5 +46,6 @@ $lang->upgrade->sureExecute = '確認執行';
$lang->upgrade->forbiddenExt = '以下插件與新版本不兼容,已經自動禁用:';
$lang->upgrade->updateFile = '需要更新附件信息。';
$lang->upgrade->noticeSQL = '檢查到你的資料庫跟標準不一致嘗試修復失敗。請執行以下SQL語句再刷新頁面檢查。';
$lang->upgrade->afterDeleted = '以上檔案未能刪除, 刪除後刷新!';
include dirname(__FILE__) . '/version.php';

View File

@@ -11,10 +11,8 @@ $config->global->flow = 'full';
/* set module root path and included the resource of group module. */
$moduleRoot = '../module/';
include $moduleRoot . '/group/lang/resource.php';
foreach(glob($moduleRoot . '/group/ext/lang/zh-cn/*.php') as $resourceFile)
{
include $resourceFile;
}
foreach(glob($moduleRoot . '/group/ext/lang/zh-cn/*.php') as $resourceFile) include $resourceFile;
foreach(glob('../xuanxuan/module/group/ext/lang/zh-cn/*.php') as $resourceFile) include $resourceFile;
$lang->productCommon = '';
$lang->projectCommon = '';
@@ -116,59 +114,62 @@ $whiteList[] = 'webhook-asyncsend';
/* checking actions of every module. */
echo '-------------action checking-----------------' . "\n";
foreach(glob($moduleRoot . '*') as $modulePath)
foreach(array($moduleRoot, '../xuanxuan/module/') as $subModuleRoot)
{
$moduleName = basename($modulePath);
if(strpos('install|upgrade|convert|common|misc|editor', $moduleName) !== false) continue;
$controlFile = $modulePath . '/control.php';
if(file_exists($controlFile))
foreach(glob($subModuleRoot . '*') as $modulePath)
{
include $controlFile;
if(class_exists($moduleName))
$moduleName = basename($modulePath);
if(strpos('install|upgrade|convert|common|misc|editor', $moduleName) !== false) continue;
$controlFile = $modulePath . '/control.php';
if(file_exists($controlFile))
{
if($moduleName == 'block') continue;
$class = new ReflectionClass($moduleName);
$methods = $class->getMethods();
foreach($methods as $method)
include $controlFile;
if(class_exists($moduleName))
{
$methodRef = new ReflectionMethod($method->class, $method->name);
if($methodRef->isPublic() and strpos($method->name, '__') === false)
if($moduleName == 'block') continue;
$class = new ReflectionClass($moduleName);
$methods = $class->getMethods();
foreach($methods as $method)
{
$methodName = $method->name;
if(in_array($moduleName . '-' . strtolower($method->name), $whiteList)) continue;
if(strpos($methodName, 'ajax') !== false) continue;
$exits = false;
if(isset($lang->resource->$moduleName))
$methodRef = new ReflectionMethod($method->class, $method->name);
if($methodRef->isPublic() and strpos($method->name, '__') === false)
{
foreach($lang->resource->$moduleName as $key => $label)
$methodName = $method->name;
if(in_array($moduleName . '-' . strtolower($method->name), $whiteList)) continue;
if(strpos($methodName, 'ajax') !== false) continue;
$exits = false;
if(isset($lang->resource->$moduleName))
{
if(strtolower($methodName) == strtolower($key)) $exits = true;
foreach($lang->resource->$moduleName as $key => $label)
{
if(strtolower($methodName) == strtolower($key)) $exits = true;
}
}
if(!$exits) echo $moduleName . "\t" . $methodName . " not in the list. \n";
}
if(!$exits) echo $moduleName . "\t" . $methodName . " not in the list. \n";
}
}
}
}
/* Checking extension files. */
$extControlFiles = glob($modulePath . '/ext/control/*.php');
if($extControlFiles)
{
foreach($extControlFiles as $extControlFile)
/* Checking extension files. */
$extControlFiles = glob($modulePath . '/ext/control/*.php');
if($extControlFiles)
{
$methodFile = substr($extControlFile, strrpos($extControlFile, '/') + 1);
$methodName = substr($methodFile, 0, strpos($methodFile, '.'));
if(in_array($moduleName . '-' . strtolower($methodName), $whiteList)) continue;
if(strpos($methodName, 'ajax') !== false) continue;
$exits = false;
foreach($lang->resource->$moduleName as $key => $label)
foreach($extControlFiles as $extControlFile)
{
if(strtolower($methodName) == strtolower($key)) $exits = true;
$methodFile = substr($extControlFile, strrpos($extControlFile, '/') + 1);
$methodName = substr($methodFile, 0, strpos($methodFile, '.'));
if(in_array($moduleName . '-' . strtolower($methodName), $whiteList)) continue;
if(strpos($methodName, 'ajax') !== false) continue;
$exits = false;
foreach($lang->resource->$moduleName as $key => $label)
{
if(strtolower($methodName) == strtolower($key)) $exits = true;
}
if(!$exits) echo $moduleName . "\t" . $methodName . " not in the list. \n";
}
if(!$exits) echo $moduleName . "\t" . $methodName . " not in the list. \n";
}
}
}
@@ -177,66 +178,69 @@ foreach(glob($moduleRoot . '*') as $modulePath)
echo '-------------lang checking-----------------' . "\n";
include '../module/common/lang/zh-cn.php';
include '../config/config.php';
foreach(glob($moduleRoot . '*') as $modulePath)
foreach(array($moduleRoot, '../xuanxuan/module/') as $subModuleRoot)
{
unset($lang);
$moduleName = basename($modulePath);
$mainLangFile = $modulePath . '/lang/zh-cn.php';
if(!file_exists($mainLangFile)) continue;
$mainLines = file($mainLangFile);
foreach($config->langs as $langKey => $langName)
foreach(glob($subModuleRoot . '*') as $modulePath)
{
if($langKey == 'zh-cn' or $langKey == 'zh-tw') continue;
$langFile = $modulePath . '/lang/' . $langKey . '.php';
if(!file_exists($langFile)) continue;
$lines = file($langFile);
foreach($mainLines as $lineNO => $line)
unset($lang);
$moduleName = basename($modulePath);
$mainLangFile = $modulePath . '/lang/zh-cn.php';
if(!file_exists($mainLangFile)) continue;
$mainLines = file($mainLangFile);
foreach($config->langs as $langKey => $langName)
{
if(!isset($lines[$lineNO]) OR empty(trim($lines[$lineNO]))) continue;
if(empty(trim($line))) continue;
if(strpos($line, '$lang') === 0)
if($langKey == 'zh-cn' or $langKey == 'zh-tw') continue;
$langFile = $modulePath . '/lang/' . $langKey . '.php';
if(!file_exists($langFile)) continue;
$lines = file($langFile);
foreach($mainLines as $lineNO => $line)
{
if(strpos($line, '=') !== false)
if(!isset($lines[$lineNO]) OR empty(trim($lines[$lineNO]))) continue;
if(empty(trim($line))) continue;
if(strpos($line, '$lang') === 0)
{
list($mainKey, $mainValue) = explode('=', $line);
list($key, $value) = explode('=', $lines[$lineNO]);
}
if((strpos($line, '=') === false and $line != $lines[$lineNO]) or trim($mainKey) != trim($key))
{
$key = trim($key);
$lineNO = $lineNO + 1;
echo "module $moduleName need checking, command is:";
echo " vim -O +$lineNO ../module/$moduleName/lang/zh-cn.php +$lineNO ../module/$moduleName/lang/en.php \n";
break;
if(strpos($line, '=') !== false)
{
list($mainKey, $mainValue) = explode('=', $line);
list($key, $value) = explode('=', $lines[$lineNO]);
}
if((strpos($line, '=') === false and $line != $lines[$lineNO]) or trim($mainKey) != trim($key))
{
$key = trim($key);
$lineNO = $lineNO + 1;
echo "module $moduleName need checking, command is:";
echo " vim -O +$lineNO ../module/$moduleName/lang/zh-cn.php +$lineNO ../module/$moduleName/lang/en.php \n";
break;
}
}
}
}
}
foreach(glob($modulePath . '/ext/lang/zh-cn/*.php') as $extMainLangFile)
{
$extMainLines = file($extMainLangFile);
$extLangFile = basename($extMainLangFile);
$extEnFile = $modulePath . '/ext/lang/en/' . $extLangFile;
$extLines = file($extEnFile);
foreach($extMainLines as $lineNO => $line)
foreach(glob($modulePath . '/ext/lang/zh-cn/*.php') as $extMainLangFile)
{
if(strpos($line, '$lang') === false)
$extMainLines = file($extMainLangFile);
$extLangFile = basename($extMainLangFile);
$extEnFile = $modulePath . '/ext/lang/en/' . $extLangFile;
$extLines = file($extEnFile);
foreach($extMainLines as $lineNO => $line)
{
//if($line != $lines[$lineNO]) echo $moduleName . ' ' . $langKey . ' ' . $lineNO . "\n";
}
else
{
list($mainKey, $mainValue) = explode('=', $line);
list($key, $value) = explode('=', $extLines[$lineNO]);
if(trim($mainKey) != trim($key))
if(strpos($line, '$lang') === false)
{
$key = trim($key);
$lineNO = $lineNO + 1;
echo "module $moduleName need checking, command is:";
echo " vim -O +$lineNO ../../module/$moduleName/ext/lang/zh-cn/$extLangFile +$lineNO ../../module/$moduleName/ext/lang/en/$extLangFile \n";
break;
//if($line != $lines[$lineNO]) echo $moduleName . ' ' . $langKey . ' ' . $lineNO . "\n";
}
else
{
list($mainKey, $mainValue) = explode('=', $line);
list($key, $value) = explode('=', $extLines[$lineNO]);
if(trim($mainKey) != trim($key))
{
$key = trim($key);
$lineNO = $lineNO + 1;
echo "module $moduleName need checking, command is:";
echo " vim -O +$lineNO ../../module/$moduleName/ext/lang/zh-cn/$extLangFile +$lineNO ../../module/$moduleName/ext/lang/en/$extLangFile \n";
break;
}
}
}
}
@@ -249,18 +253,21 @@ $app = new app;
$lang = new stdclass();
error_reporting(E_WARNING | E_STRICT );
foreach(glob($moduleRoot . '*') as $modulePath)
foreach(array($moduleRoot, '../xuanxuan/module/') as $subModuleRoot)
{
$moduleName = basename($modulePath);
$cnLangFile = $modulePath . '/lang/zh-cn.php';
$enLangFile = $modulePath . '/lang/en.php';
$configFile = $modulePath . '/config.php';
foreach(glob($subModuleRoot . '*') as $modulePath)
{
$moduleName = basename($modulePath);
$cnLangFile = $modulePath . '/lang/zh-cn.php';
$enLangFile = $modulePath . '/lang/en.php';
$configFile = $modulePath . '/config.php';
if(!isset($lang->$moduleName)) $lang->$moduleName = new stdclass();
if(!isset($config->$moduleName)) $config->$moduleName = new stdclass();
if(file_exists($cnLangFile)) include $cnLangFile;
if(file_exists($enLangFile)) include $enLangFile;
if(file_exists($configFile)) include $configFile;
if(!isset($lang->$moduleName)) $lang->$moduleName = new stdclass();
if(!isset($config->$moduleName)) $config->$moduleName = new stdclass();
if(file_exists($cnLangFile)) include $cnLangFile;
if(file_exists($enLangFile)) include $enLangFile;
if(file_exists($configFile)) include $configFile;
}
}
echo '-------------demo data checking. -----------------' . "\n";