";
$shortfile = substr($file, $l);
$lines = file($file);
foreach ($lines as $line) {
$myterms = [];
$res = preg_match_all('/get_lang\(\'(\\w*)\'\)/', $line, $myterms);
if ($res > 0) {
foreach ($myterms[1] as $term) {
if (!isset($defined_terms[$term]) && !isset($defined_terms['lang'.$term])) {
$undefined_terms[$term] = $shortfile;
//echo "Undefined: $term
";
}
}
}
$res = 0;
$res = preg_match_all('/\{[\'"](\\w*)[\'"]\|get_lang\}/', $line, $myterms);
if ($res > 0) {
foreach ($myterms[1] as $term) {
if (!isset($defined_terms[$term]) && !isset($defined_terms['lang'.$term])) {
$undefined_terms[$term] = $shortfile;
//echo "Undefined: $term
";
}
}
}
}
flush();
}
//$undefined_terms = array_flip($undefined_terms);
if (count($undefined_terms) < 1) {
die("No missing terms
\n");
} else {
echo "The following terms were nowhere to be found:
\n
$i | $term | in $file"; if ($isPlugin) { echo " (this one should be taken care of by the plugin's language files)"; } echo " |