Skip to content

Commit

Permalink
Skip false strings in comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Saibamen committed Aug 15, 2015
1 parent 4259649 commit d85fdbe
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions diff.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ function diff_versions($leftContent, $rightContent)
$leftVersion = $rightVersion = null;

// FIXME: Search multi-line with ""some text""
$pattern = "/^(?!FONT)[^\"\\n]*\"\\K(?!\\s+\")([^\"]+)/m";
$pattern = "/^(?!FONT|\s*\*)[^\"\\n]*\"\\K(?!\\s+\")([^\"]+)/m";

if (preg_match_all($pattern, $leftContent, $matches) <= 0)
{
Expand All @@ -140,7 +140,7 @@ function diff_versions($leftContent, $rightContent)

$regex = new RegexIterator($it, '/^.+'. $langDir .'.+('. $originLang .')\.'. $fileExt .'$/i', RecursiveRegexIterator::GET_MATCH);

$allEnglish = $missingFiles = $missing = 0;
$allEnglish = $missingFiles = $missing = $allStrings = 0;

$lang = htmlspecialchars($_POST["lang"]);
$fileSearch = strtoupper($lang) .",". ucfirst($lang) .",". strtolower($lang);
Expand Down Expand Up @@ -179,6 +179,7 @@ function diff_versions($leftContent, $rightContent)
echo $english ."<br>";
$missing++;
}
$allStrings++;
}
echo "<hr>";
}
Expand All @@ -190,6 +191,7 @@ function diff_versions($leftContent, $rightContent)

echo "<h3>All translation RC files for english: $allEnglish</h3>";
echo "<h3>Missing translation files for your language ($lang): $missingFiles</h3>";
echo "<h3>All strings for english: $allStrings</h3>";
echo "<h3>Missing translations: $missing</h3>";
}
}
Expand Down

0 comments on commit d85fdbe

Please sign in to comment.