From 44327bed58b409500fdb62b37efabadc1309a4ba Mon Sep 17 00:00:00 2001 From: El RIDO Date: Sat, 25 Mar 2017 13:19:11 +0100 Subject: [PATCH] added missing/removed translation IDs found using improved unit test (#201) --- i18n/es.json | 1 + i18n/fr.json | 1 + i18n/it.json | 1 + i18n/no.json | 1 + i18n/oc.json | 1 + i18n/pl.json | 1 + i18n/pt.json | 1 + i18n/ru.json | 2 -- i18n/sl.json | 1 + tst/I18nTest.php | 26 +++++++++++++++++++------- 10 files changed, 27 insertions(+), 9 deletions(-) diff --git a/i18n/es.json b/i18n/es.json index 98251e9..427f90d 100644 --- a/i18n/es.json +++ b/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.": diff --git a/i18n/fr.json b/i18n/fr.json index d5d447e..10c36a4 100644 --- a/i18n/fr.json +++ b/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.": diff --git a/i18n/it.json b/i18n/it.json index b7b19e8..583e0e4 100644 --- a/i18n/it.json +++ b/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.": diff --git a/i18n/no.json b/i18n/no.json index f131e4f..c0d376c 100644 --- a/i18n/no.json +++ b/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.": diff --git a/i18n/oc.json b/i18n/oc.json index 8f923b1..9047876 100644 --- a/i18n/oc.json +++ b/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.": diff --git a/i18n/pl.json b/i18n/pl.json index b722c48..82d9b57 100644 --- a/i18n/pl.json +++ b/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.": diff --git a/i18n/pt.json b/i18n/pt.json index 01d5dfe..6af67cf 100644 --- a/i18n/pt.json +++ b/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.": diff --git a/i18n/ru.json b/i18n/ru.json index 53431ad..989d3e4 100644 --- a/i18n/ru.json +++ b/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…": diff --git a/i18n/sl.json b/i18n/sl.json index 4c0a7e9..21db8c1 100644 --- a/i18n/sl.json +++ b/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.": diff --git a/tst/I18nTest.php b/tst/I18nTest.php index 187fd1a..c7ded0e 100644 --- a/tst/I18nTest.php +++ b/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" + ); + } } } }