mirror of
https://github.com/e107inc/e107.git
synced 2025-08-05 06:07:32 +02:00
Fixes #1029 - Added a warning for identical string values during language-file verification/translation.
This commit is contained in:
@@ -777,6 +777,7 @@ class lancheck
|
|||||||
// return $eng_line."<br />".$trans_line."<br /><br />";
|
// return $eng_line."<br />".$trans_line."<br /><br />";
|
||||||
|
|
||||||
$error = array();
|
$error = array();
|
||||||
|
$warning = array();
|
||||||
|
|
||||||
if((!array_key_exists($def,$translation) && $eng_line != "") || (trim($trans_line) == "" && $eng_line != ""))
|
if((!array_key_exists($def,$translation) && $eng_line != "") || (trim($trans_line) == "" && $eng_line != ""))
|
||||||
{
|
{
|
||||||
@@ -784,6 +785,11 @@ class lancheck
|
|||||||
return $def.": ".LAN_CHECK_5."<br />";
|
return $def.": ".LAN_CHECK_5."<br />";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($eng_line == $trans_line && !empty($eng_line))
|
||||||
|
{
|
||||||
|
$warning[] = "<span class='text-warning'>".$def. ": Identical string (warning only) </span>";
|
||||||
|
}
|
||||||
|
|
||||||
if((strpos($eng_line,"[link=")!==FALSE && strpos($trans_line,"[link=")===FALSE) || (strpos($eng_line,"[b]")!==FALSE && strpos($trans_line,"[b]")===FALSE))
|
if((strpos($eng_line,"[link=")!==FALSE && strpos($trans_line,"[link=")===FALSE) || (strpos($eng_line,"[b]")!==FALSE && strpos($trans_line,"[b]")===FALSE))
|
||||||
{
|
{
|
||||||
$error[] = $def. ": Missing bbcodes";
|
$error[] = $def. ": Missing bbcodes";
|
||||||
@@ -821,7 +827,13 @@ class lancheck
|
|||||||
|
|
||||||
$this->checkLog('def',count($error));
|
$this->checkLog('def',count($error));
|
||||||
|
|
||||||
return ($error) ? implode("<br />",$error)."<br />" : "";
|
$text = ($error) ? implode("<br />",$error)."<br />" : "";
|
||||||
|
$text .= ($warning) ? implode("<br />",$warning)."<br />" : "";
|
||||||
|
|
||||||
|
if($text)
|
||||||
|
{
|
||||||
|
return $text;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1138,7 +1150,12 @@ class lancheck
|
|||||||
$rowamount = round(strlen($trans['orig'][$sk])/34)+1;
|
$rowamount = round(strlen($trans['orig'][$sk])/34)+1;
|
||||||
$hglt1=""; $hglt2="";
|
$hglt1=""; $hglt2="";
|
||||||
if ($trans['tran'][$sk] == "" && $trans['orig'][$sk]!="") {
|
if ($trans['tran'][$sk] == "" && $trans['orig'][$sk]!="") {
|
||||||
$hglt1="<span style='font-style:italic;font-weight:bold;color:red'>";
|
$hglt1="<span class='label label-danger label-important e-tip' title='Missing' >";
|
||||||
|
$hglt2="</span>";
|
||||||
|
}
|
||||||
|
elseif($trans['tran'][$sk] == $trans['orig'][$sk])
|
||||||
|
{
|
||||||
|
$hglt1="<span class='label label-warning e-tip' title='Identical' >";
|
||||||
$hglt2="</span>";
|
$hglt2="</span>";
|
||||||
}
|
}
|
||||||
$text .="<tr>
|
$text .="<tr>
|
||||||
|
Reference in New Issue
Block a user