";
$shortfile = substr($file, $l);
$lines = file($file);
foreach ($lines as $line) {
$myterms = [];
// Find terms but ignore those starting with ->get_lang(), which are
// for plugins
$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) {
exit("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 " |