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

This commit is contained in:
El RIDO 2017-03-25 13:19:11 +01:00
parent e80c726f92
commit 44327bed58
No known key found for this signature in database
GPG Key ID: 0F5C940A6BD81F92
10 changed files with 27 additions and 9 deletions

View File

@ -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.":

View File

@ -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.":

View File

@ -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.":

View File

@ -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.":

View File

@ -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.":

View File

@ -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.":

View File

@ -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.":

View File

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

View File

@ -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.":

View File

@ -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"
);
}
}
}
}