aboutsummaryrefslogtreecommitdiff
path: root/cli/i18n/I18nCompletionValidator.php
diff options
context:
space:
mode:
Diffstat (limited to 'cli/i18n/I18nCompletionValidator.php')
-rw-r--r--cli/i18n/I18nCompletionValidator.php21
1 files changed, 10 insertions, 11 deletions
diff --git a/cli/i18n/I18nCompletionValidator.php b/cli/i18n/I18nCompletionValidator.php
index 3287a2500..ee4ab9f78 100644
--- a/cli/i18n/I18nCompletionValidator.php
+++ b/cli/i18n/I18nCompletionValidator.php
@@ -23,23 +23,22 @@ class I18nCompletionValidator implements I18nValidatorInterface {
return $this->result;
}
- /**
- * @param array<string>|null $ignore
- */
- public function validate($ignore) {
+ public function validate() {
foreach ($this->reference as $file => $data) {
- foreach ($data as $key => $value) {
+ foreach ($data as $refKey => $refValue) {
$this->totalEntries++;
- if (is_array($ignore) && in_array($key, $ignore)) {
- $this->passEntries++;
+ if (!array_key_exists($refKey, $this->language[$file])) {
+ $this->result .= "Missing key $refKey" . PHP_EOL;
continue;
}
- if (!array_key_exists($key, $this->language[$file])) {
- $this->result .= sprintf('Missing key %s', $key) . PHP_EOL;
+
+ $value = $this->language[$file][$refKey];
+ if ($value->isIgnore()) {
+ $this->passEntries++;
continue;
}
- if ($value === $this->language[$file][$key]) {
- $this->result .= sprintf('Untranslated key %s - %s', $key, $value) . PHP_EOL;
+ if ($refValue->equal($value)) {
+ $this->result .= "Untranslated key $refKey - $refValue" . PHP_EOL;
continue;
}
$this->passEntries++;