diff options
| author | Andrew Lee <alee14498@protonmail.com> | 2024-02-13 22:35:50 -0500 |
|---|---|---|
| committer | Andrew Lee <alee14498@protonmail.com> | 2024-02-13 23:39:19 -0500 |
| commit | 72ea1090753ccca3c5573801ae0b0a4439e1b736 (patch) | |
| tree | bb3ff6e00572d111ddc1af0a864df90208c63840 /Utilities/i18n.js | |
| parent | 3d4f5061d402b44218cdfd351f39317d5f8ecd11 (diff) | |
| download | DLAP-72ea1090753ccca3c5573801ae0b0a4439e1b736.tar.gz DLAP-72ea1090753ccca3c5573801ae0b0a4439e1b736.tar.bz2 DLAP-72ea1090753ccca3c5573801ae0b0a4439e1b736.zip | |
Fully working i18n (hopefully); Docker on walkthrough
Diffstat (limited to 'Utilities/i18n.js')
| -rw-r--r-- | Utilities/i18n.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Utilities/i18n.js b/Utilities/i18n.js index c667c4c..9b431a1 100644 --- a/Utilities/i18n.js +++ b/Utilities/i18n.js @@ -20,10 +20,12 @@ ***************************************************************************/ import i18next from 'i18next'; import fsBackend from 'i18next-fs-backend'; +import { readFileSync } from 'node:fs'; +const { locale } = JSON.parse(readFileSync('./config.json', 'utf-8')); i18next.use(fsBackend).init({ - lng: 'en', // if you're using a language detector, do not define the lng option - debug: true, + lng: locale, // if you're using a language detector, do not define the lng option + debug: false, fallbackLng: 'en', backend: { loadPath: './Locales/{{lng}}/{{ns}}.json' @@ -32,7 +34,7 @@ i18next.use(fsBackend).init({ export default { i18next, - t(key) { - return i18next.t(key); + t(key, option) { + return i18next.t(key, option); } }; |
