* code for task #5827.
This commit is contained in:
@@ -162,6 +162,10 @@ class translate extends control
|
||||
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'reload'));
|
||||
}
|
||||
|
||||
$this->view->title = $this->lang->translate->module;
|
||||
$this->view->position[] = html::a($this->createLink('translate', 'index'), $this->lang->translate->common);
|
||||
$this->view->position[] = $this->lang->translate->module;
|
||||
|
||||
$this->view->referItems = $this->translate->getModuleLangs($module, $referLang);
|
||||
$this->view->translations = $this->translate->getTranslations($language, $module);
|
||||
$this->view->moduleGroup = $moduleGroup;
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
$lang->translate->common = '翻译';
|
||||
$lang->translate->index = '首页';
|
||||
$lang->translate->addLang = '新增语言';
|
||||
$lang->translate->module = '翻译模块';
|
||||
$lang->translate->chooseModule = '选择翻译模块';
|
||||
|
||||
$lang->translate->name = '语言名称';
|
||||
|
||||
@@ -142,7 +142,7 @@ class translateModel extends model
|
||||
if(preg_match( '/; *\/\//', $value)) $value = preg_replace('/; *\/\/.*/', '', $value);
|
||||
$value = trim($value, ';');
|
||||
/* Trim ['] or ["] when not [.] . */
|
||||
if(preg_match('/["\'] *\./', $value) == 0 and preg_match('/\. *[\'"]/', $value) == 0)
|
||||
if(preg_match('/["\'] *\.[^\.]/', $value) == 0 and preg_match('/[^\.]\. *["\']/', $value) == 0)
|
||||
{
|
||||
if($value{0} == '"' or $value{0} == "'") $value = trim($value, $value{0});
|
||||
}
|
||||
@@ -374,7 +374,7 @@ class translateModel extends model
|
||||
{
|
||||
$result = true;
|
||||
if($value == 'new stdclass()') $result = false;
|
||||
if(strpos($value, '$') === 0 and strpos($value, '$lang->productCommon') === false and strpos($value, '$lang->projectCommon') === false and preg_match('/["\'] *\./', $value) == 0 and preg_match('/\. *["\']/', $value) == 0) $result = false;
|
||||
if(strpos($value, '$') === 0 and strpos($value, '$lang->productCommon') === false and strpos($value, '$lang->projectCommon') === false and preg_match('/["\'] *\.[^\.]/', $value) == 0 and preg_match('/[^\.]\. *["\']/', $value) == 0) $result = false;
|
||||
if($value == '$lang->productCommon' or $value == '$lang->projectCommon') $result = false;
|
||||
|
||||
return $result;
|
||||
|
||||
Reference in New Issue
Block a user