Explorar o código

added missing/removed translation IDs found using improved unit test (#201)

El RIDO %!s(int64=9) %!d(string=hai) anos
pai
achega
44327bed58
Modificáronse 10 ficheiros con 27 adicións e 9 borrados
  1. 1 0
      i18n/es.json
  2. 1 0
      i18n/fr.json
  3. 1 0
      i18n/it.json
  4. 1 0
      i18n/no.json
  5. 1 0
      i18n/oc.json
  6. 1 0
      i18n/pl.json
  7. 1 0
      i18n/pt.json
  8. 0 2
      i18n/ru.json
  9. 1 0
      i18n/sl.json
  10. 19 7
      tst/I18nTest.php

+ 1 - 0
i18n/es.json

@@ -130,6 +130,7 @@
     "Markdown": "Markdown",
     "Download attachment": "Descargar adjunto",
     "Cloned: '%s'": "Clonado: '%s'.",
+    "The cloned file '%s' was attached to this paste.": "The cloned file '%s' was attached to this paste.",
     "Attach a file": "Adjuntar archivo",
     "Remove attachment": "Remover adjunto",
     "Your browser does not support uploading encrypted files. Please use a newer browser.":

+ 1 - 0
i18n/fr.json

@@ -139,6 +139,7 @@
     "Markdown": "Markdown",
     "Download attachment": "Télécharger la pièce jointe",
     "Cloned: '%s'": "Cloner '%s'",
+    "The cloned file '%s' was attached to this paste.": "The cloned file '%s' was attached to this paste.",
     "Attach a file": "Attacher un fichier ",
     "Remove attachment": "Enlever l'attachement",
     "Your browser does not support uploading encrypted files. Please use a newer browser.":

+ 1 - 0
i18n/it.json

@@ -130,6 +130,7 @@
     "Markdown": "Markdown",
     "Download attachment": "Scarica Allegato",
     "Cloned: '%s'": "Copia: '%s'",
+    "The cloned file '%s' was attached to this paste.": "The cloned file '%s' was attached to this paste.",
     "Attach a file": "Allega un file",
     "Remove attachment": "Rimuovi allegato",
     "Your browser does not support uploading encrypted files. Please use a newer browser.":

+ 1 - 0
i18n/no.json

@@ -130,6 +130,7 @@
     "Markdown": "Oppmerket",
     "Download attachment": "Last ned vedlegg",
     "Cloned: '%s'": "Kopier: '%s'",
+    "The cloned file '%s' was attached to this paste.": "The cloned file '%s' was attached to this paste.",
     "Attach a file": "Legg til fil",
     "Remove attachment": "Slett vedlegg",
     "Your browser does not support uploading encrypted files. Please use a newer browser.":

+ 1 - 0
i18n/oc.json

@@ -139,6 +139,7 @@
     "Markdown": "Markdown",
     "Download attachment": "Telecargar la pèça junta",
     "Cloned: '%s'": "Clonar: '%s'",
+    "The cloned file '%s' was attached to this paste.": "The cloned file '%s' was attached to this paste.",
     "Attach a file": "Juntar un fichièr ",
     "Remove attachment": "Levar la pèca junta",
     "Your browser does not support uploading encrypted files. Please use a newer browser.":

+ 1 - 0
i18n/pl.json

@@ -130,6 +130,7 @@
     "Markdown": "Markdown",
     "Download attachment": "Pobierz załącznik",
     "Cloned: '%s'": "Sklonowano: '%s'",
+    "The cloned file '%s' was attached to this paste.": "The cloned file '%s' was attached to this paste.",
     "Attach a file": "Załącz plik",
     "Remove attachment": "Usuń załącznik",
     "Your browser does not support uploading encrypted files. Please use a newer browser.":

+ 1 - 0
i18n/pt.json

@@ -130,6 +130,7 @@
     "Markdown": "Markdown",
     "Download attachment": "Baixar anexo",
     "Cloned: '%s'": "Clonado: '%s'",
+    "The cloned file '%s' was attached to this paste.": "The cloned file '%s' was attached to this paste.",
     "Attach a file": "Anexar um arquivo",
     "Remove attachment": "Remover anexo",
     "Your browser does not support uploading encrypted files. Please use a newer browser.":

+ 0 - 2
i18n/ru.json

@@ -110,8 +110,6 @@
         "неизвестная причина",
     "server error or not responding":
         "ошибка сервера или нет ответа",
-    "unknown error":
-        "неизвестная ошибка",
     "Could not post comment: %s":
         "Не удалось опубликовать комментарий: %s",
     "Please move your mouse for more entropy…":

+ 1 - 0
i18n/sl.json

@@ -139,6 +139,7 @@
     "Markdown": "Markdown",
     "Download attachment": "Pretoči priponko",
     "Cloned: '%s'": "'%s' klonirana",
+    "The cloned file '%s' was attached to this paste.": "The cloned file '%s' was attached to this paste.",
     "Attach a file": "Pripni datoteko",
     "Remove attachment": "Odstrani priponko",
     "Your browser does not support uploading encrypted files. Please use a newer browser.":

+ 19 - 7
tst/I18nTest.php

@@ -146,19 +146,31 @@ class I18nTest extends PHPUnit_Framework_TestCase
     public function testMessageIdsExistInAllLanguages()
     {
         $messageIds = array();
-        $languages = array();
-        $dir = dir(PATH . 'i18n');
+        $languages  = array();
+        $dir        = dir(PATH . 'i18n');
         while (false !== ($file = $dir->read())) {
             if (strlen($file) === 7) {
-                $language = substr($file, 0, 2);
-                $translations = json_decode(file_get_contents(PATH . 'i18n' . DIRECTORY_SEPARATOR . $file), true);
-                $messageIds = array_unique($messageIds + array_keys($translations));
-                $languages[$language] = $translations;
+                $language             = substr($file, 0, 2);
+                $languageMessageIds   = array_keys(
+                    json_decode(
+                        file_get_contents(PATH . 'i18n' . DIRECTORY_SEPARATOR . $file),
+                        true
+                    )
+                );
+                $messageIds           = array_unique(array_merge($messageIds, $languageMessageIds));
+                $languages[$language] = $languageMessageIds;
             }
         }
         foreach ($messageIds as $messageId) {
             foreach (array_keys($languages) as $language) {
-                $this->assertArrayHasKey($messageId, $languages[$language], "message ID '$messageId' exists in translation file $language.json");
+                // most languages don't translate the data size units, ignore those
+                if ($messageId !== 'B' && strlen($messageId) !== 3 && strpos($messageId, 'B', 2) !== 2) {
+                    $this->assertContains(
+                        $messageId,
+                        $languages[$language],
+                        "message ID '$messageId' exists in translation file $language.json"
+                    );
+                }
             }
         }
     }