From fb030353fe9b36ea597684b1a1b934d6c38b9496 Mon Sep 17 00:00:00 2001 From: Daniel Lockyer Date: Wed, 18 Jan 2023 17:01:44 +0100 Subject: [PATCH] Moved i18n translations into JSON files refs https://github.com/TryGhost/Ghost/issues/15502 - plain JSON files are cleaner and less overwhelming than boilerplate JS files, and given they're going to be automatically generated, we probably won't be able to support comments anyway --- ghost/i18n/lib/i18n.js | 8 ++++++-- ghost/i18n/locales/en.js | 6 ------ ghost/i18n/locales/en.json | 1 + ghost/i18n/locales/nl.js | 5 ----- ghost/i18n/locales/nl.json | 3 +++ 5 files changed, 10 insertions(+), 13 deletions(-) delete mode 100644 ghost/i18n/locales/en.js create mode 100644 ghost/i18n/locales/en.json delete mode 100644 ghost/i18n/locales/nl.js create mode 100644 ghost/i18n/locales/nl.json diff --git a/ghost/i18n/lib/i18n.js b/ghost/i18n/lib/i18n.js index 5d61e2d927..1b6720dc25 100644 --- a/ghost/i18n/lib/i18n.js +++ b/ghost/i18n/lib/i18n.js @@ -14,8 +14,12 @@ module.exports = (lng = 'en') => { fallbackLng: false, resources: { - en: require('../locales/en.js'), - nl: require('../locales/nl.js') + en: { + translation: require('../locales/en.json') + }, + nl: { + translation: require('../locales/nl.json') + } } }); diff --git a/ghost/i18n/locales/en.js b/ghost/i18n/locales/en.js deleted file mode 100644 index f79e140abb..0000000000 --- a/ghost/i18n/locales/en.js +++ /dev/null @@ -1,6 +0,0 @@ -// Note: we probably don't need anything in here because we don't expect -// to translate English to English, but it's here for completeness -module.exports = { - translation: { - } -}; diff --git a/ghost/i18n/locales/en.json b/ghost/i18n/locales/en.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/ghost/i18n/locales/en.json @@ -0,0 +1 @@ +{} diff --git a/ghost/i18n/locales/nl.js b/ghost/i18n/locales/nl.js deleted file mode 100644 index fdded27c40..0000000000 --- a/ghost/i18n/locales/nl.js +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = { - translation: { - 'Hello': 'Hallo' - } -}; diff --git a/ghost/i18n/locales/nl.json b/ghost/i18n/locales/nl.json new file mode 100644 index 0000000000..904fe1b030 --- /dev/null +++ b/ghost/i18n/locales/nl.json @@ -0,0 +1,3 @@ +{ + "Hello": "Hallo" +}