19declare(strict_types=1);
31require
$ilias_root .
'/vendor/composer/vendor/autoload.php';
36foreach (glob(
$ilias_root .
'/lang/ilias_*.lang') ?: [] as $file) {
37 $lang = substr(basename($file,
'.lang'), 6);
39 foreach (file($file, FILE_IGNORE_NEW_LINES) ?: [] as $line) {
41 $started = trim($line) ===
'<!-- language file start -->';
44 $parts = explode(
'#:#', $line);
45 if (count($parts) < 3) {
48 $violations =
$policy->findViolations(explode(
'###', $parts[2])[0]);
49 if ($violations === []) {
53 $key = $parts[0] .
'#:#' . $parts[1];
54 $by_key[$key][
'langs'][] = $lang;
55 foreach ($violations as $violation) {
56 $by_key[$key][
'violations'][$violation] =
true;
62echo sprintf(
"%d Werte in %d Keys\n\n",
$total, count(
$by_key));
63echo
"| Key | Sprachen | Verstoß |\n|---|---|---|\n";
65 $langs = count(
$data[
'langs']) >= 25
66 ?
'fast alle (' . count(
$data[
'langs']) .
')'
67 : implode(
', ',
$data[
'langs']);
68 $violations = implode(
'; ', array_map(
69 static fn(
string $violation):
string => str_replace(
'|',
'\\|', $violation),
70 array_keys(
$data[
'violations'])
72 echo sprintf(
"| `%s` | %s | %s |\n", $key, $langs, htmlspecialchars($violations, ENT_NOQUOTES));
The HTML a translation value may contain, decided in one place for the shipped files (cleaned in Setu...
$ilias_root
Lists every value of the shipped lang/ilias_*.lang files that TranslationMarkupPolicy does not allow,...