1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-04 21:57:51 +02:00

Fixes #1029 - Added a warning for identical string values during language-file verification/translation.

This commit is contained in:
Cameron
2015-05-26 13:08:09 -07:00
parent 8d5e106fd6
commit 7eced6f63e

View File

@@ -777,12 +777,18 @@ 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 != ""))
{ {
$this->checkLog('def',1); $this->checkLog('def',1);
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))
{ {
@@ -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>