From 116d799497d1f04aa28b165b2b4880310ec1f5e5 Mon Sep 17 00:00:00 2001 From: Eduardo Gomez Date: Mon, 22 Jun 2020 23:03:11 +0200 Subject: [PATCH] Add newline at the end of locales files --- locales/ar.json | 2 +- locales/bg.json | 2 +- locales/de-informal.json | 2 +- locales/de.json | 2 +- locales/en.json | 2 +- locales/es.json | 2 +- locales/fa.json | 2 +- locales/fr-informal.json | 2 +- locales/fr.json | 2 +- locales/he.json | 2 +- locales/id.json | 2 +- locales/it.json | 2 +- locales/ky.json | 2 +- locales/lt.json | 2 +- locales/nl.json | 2 +- locales/pl.json | 2 +- locales/pt-br.json | 2 +- locales/pt.json | 2 +- locales/ro.json | 2 +- locales/ru.json | 2 +- locales/tr.json | 2 +- locales/vi.json | 2 +- locales/zh-hans.json | 2 +- locales/zh-hant.json | 2 +- src/order-locales.js | 9 ++++++--- 25 files changed, 30 insertions(+), 27 deletions(-) diff --git a/locales/ar.json b/locales/ar.json index 984452c..81f53e0 100644 --- a/locales/ar.json +++ b/locales/ar.json @@ -36,4 +36,4 @@ "of": "علي", "with the email address": " بعنوان بريدك الالكتروني", "with this tag": " بهذا التصنيف" -} \ No newline at end of file +} diff --git a/locales/bg.json b/locales/bg.json index 49c6930..431255e 100644 --- a/locales/bg.json +++ b/locales/bg.json @@ -37,4 +37,4 @@ "of": "от", "with the email address": "с имейл адресa", "with this tag": "с този таг" -} \ No newline at end of file +} diff --git a/locales/de-informal.json b/locales/de-informal.json index 1a0fce4..cf8aaab 100644 --- a/locales/de-informal.json +++ b/locales/de-informal.json @@ -44,4 +44,4 @@ "of": "von", "with the email address": "erfolgreich mit folgender E-Mail Adresse abonniert", "with this tag": "mit diesem Tag" -} \ No newline at end of file +} diff --git a/locales/de.json b/locales/de.json index da8a69e..d25f888 100644 --- a/locales/de.json +++ b/locales/de.json @@ -44,4 +44,4 @@ "of": "von", "with the email address": "erfolgreich mit folgender E-Mail Adresse abonniert", "with this tag": "mit diesem Tag" -} \ No newline at end of file +} diff --git a/locales/en.json b/locales/en.json index a1d4fee..17a2594 100644 --- a/locales/en.json +++ b/locales/en.json @@ -45,4 +45,4 @@ "of": "of", "with the email address": "with the email address", "with this tag": "with this tag" -} \ No newline at end of file +} diff --git a/locales/es.json b/locales/es.json index a041a3e..87ae172 100644 --- a/locales/es.json +++ b/locales/es.json @@ -45,4 +45,4 @@ "of": "de", "with the email address": "con la dirección de correo electrónico", "with this tag": "con esta etiqueta" -} \ No newline at end of file +} diff --git a/locales/fa.json b/locales/fa.json index 2e6d36a..22d7bd3 100644 --- a/locales/fa.json +++ b/locales/fa.json @@ -45,4 +45,4 @@ "of": "از", "with the email address": "با آدرس ایمیل", "with this tag": "با این تگ" -} \ No newline at end of file +} diff --git a/locales/fr-informal.json b/locales/fr-informal.json index 418ae52..f541ab3 100644 --- a/locales/fr-informal.json +++ b/locales/fr-informal.json @@ -44,4 +44,4 @@ "of": "de", "with the email address": "avec l'adresse email", "with this tag": "avec ce mot clé" -} \ No newline at end of file +} diff --git a/locales/fr.json b/locales/fr.json index 006caf5..388c75d 100644 --- a/locales/fr.json +++ b/locales/fr.json @@ -44,4 +44,4 @@ "of": "de", "with the email address": "avec l'adresse email", "with this tag": "avec ce mot clé" -} \ No newline at end of file +} diff --git a/locales/he.json b/locales/he.json index d8bd637..7a8a18d 100644 --- a/locales/he.json +++ b/locales/he.json @@ -36,4 +36,4 @@ "of": "של", "with the email address": "עם כתובת האימייל", "with this tag": "עם התגית הזו" -} \ No newline at end of file +} diff --git a/locales/id.json b/locales/id.json index e1f683e..dd66cd2 100644 --- a/locales/id.json +++ b/locales/id.json @@ -37,4 +37,4 @@ "of": "dari", "with the email address": "dengan alamat email", "with this tag": "dengan tag ini" -} \ No newline at end of file +} diff --git a/locales/it.json b/locales/it.json index f5b31f5..9dec9c6 100644 --- a/locales/it.json +++ b/locales/it.json @@ -36,4 +36,4 @@ "of": "di", "with the email address": "con l'indirizzo email", "with this tag": "con questo tag" -} \ No newline at end of file +} diff --git a/locales/ky.json b/locales/ky.json index 7d6387e..5091f17 100644 --- a/locales/ky.json +++ b/locales/ky.json @@ -45,4 +45,4 @@ "of": "/", "with the email address": "email-дарек менен", "with this tag": "ушундай эле тег менен" -} \ No newline at end of file +} diff --git a/locales/lt.json b/locales/lt.json index 45ce40f..70d81c2 100644 --- a/locales/lt.json +++ b/locales/lt.json @@ -44,4 +44,4 @@ "of": "iš", "with the email address": "Su pašto adresu", "with this tag": "Su šia žyme" -} \ No newline at end of file +} diff --git a/locales/nl.json b/locales/nl.json index 794d826..86214fa 100644 --- a/locales/nl.json +++ b/locales/nl.json @@ -45,4 +45,4 @@ "of": "of", "with the email address": "met het email adres", "with this tag": "met de tag" -} \ No newline at end of file +} diff --git a/locales/pl.json b/locales/pl.json index 97b6fc3..4af6af0 100644 --- a/locales/pl.json +++ b/locales/pl.json @@ -37,4 +37,4 @@ "of": "z", "with the email address": "z adresem e-mail", "with this tag": "z tagiem" -} \ No newline at end of file +} diff --git a/locales/pt-br.json b/locales/pt-br.json index 2237e78..ff2be94 100644 --- a/locales/pt-br.json +++ b/locales/pt-br.json @@ -35,4 +35,4 @@ "of": "de", "with the email address": "com seu email", "with this tag": "com este marcador" -} \ No newline at end of file +} diff --git a/locales/pt.json b/locales/pt.json index 01bcb88..1c8cde3 100644 --- a/locales/pt.json +++ b/locales/pt.json @@ -36,4 +36,4 @@ "of": "de", "with the email address": "com endereço de email", "with this tag": "com esta etiqueta" -} \ No newline at end of file +} diff --git a/locales/ro.json b/locales/ro.json index 26ef9f7..1ca2be5 100644 --- a/locales/ro.json +++ b/locales/ro.json @@ -37,4 +37,4 @@ "of": "din", "with the email address": "cu adresa de email", "with this tag": "cu acest tag" -} \ No newline at end of file +} diff --git a/locales/ru.json b/locales/ru.json index 937395d..37e98af 100644 --- a/locales/ru.json +++ b/locales/ru.json @@ -36,4 +36,4 @@ "of": "из", "with the email address": "с email-адресом", "with this tag": "с таким же тегом" -} \ No newline at end of file +} diff --git a/locales/tr.json b/locales/tr.json index 6a1788f..d089317 100644 --- a/locales/tr.json +++ b/locales/tr.json @@ -37,4 +37,4 @@ "of": "/", "with the email address": "e-posta ile", "with this tag": ", bu etiket ile" -} \ No newline at end of file +} diff --git a/locales/vi.json b/locales/vi.json index 92ccae5..8befd69 100644 --- a/locales/vi.json +++ b/locales/vi.json @@ -36,4 +36,4 @@ "of": "của", "with the email address": "với địa chỉ email", "with this tag": "với thẻ tag này" -} \ No newline at end of file +} diff --git a/locales/zh-hans.json b/locales/zh-hans.json index 21e61b7..f15e2bc 100755 --- a/locales/zh-hans.json +++ b/locales/zh-hans.json @@ -37,4 +37,4 @@ "of": " / ", "with the email address": "在此邮箱", "with this tag": "包含此标签" -} \ No newline at end of file +} diff --git a/locales/zh-hant.json b/locales/zh-hant.json index 282fcf2..05b7415 100644 --- a/locales/zh-hant.json +++ b/locales/zh-hant.json @@ -37,4 +37,4 @@ "of": " / ", "with the email address": "在此郵箱", "with this tag": "包含此標籤" -} \ No newline at end of file +} diff --git a/src/order-locales.js b/src/order-locales.js index 0a8e077..a77de7a 100644 --- a/src/order-locales.js +++ b/src/order-locales.js @@ -2,21 +2,24 @@ const fs = require("fs"); const path = require("path"); - const locales = "../locales"; fs.readdir(locales, function(err, files) { - files.forEach(function(file, index) { + if (err) return console.error(err); + + files.forEach(function(file) { const unordered = JSON.parse(fs.readFileSync(path.join(locales, file))); const ordered = {}; + Object.keys(unordered) .sort() .forEach(function(key) { ordered[key] = unordered[key]; }); + fs.writeFileSync( path.join(locales, file), - JSON.stringify(ordered, null, 2) + JSON.stringify(ordered, null, 2).concat('\n') ); }); });