From e5c86859e4c6a9a6829bcc2e3cf626b05a873ff7 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Tue, 20 Dec 2022 17:54:56 -0500 Subject: Revamped next/previous cmds (Voting system); Basic i18n support; --- Utilities/i18n.js | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 Utilities/i18n.js (limited to 'Utilities/i18n.js') diff --git a/Utilities/i18n.js b/Utilities/i18n.js new file mode 100644 index 0000000..c667c4c --- /dev/null +++ b/Utilities/i18n.js @@ -0,0 +1,38 @@ +/************************************************************************** + * + * DLAP Bot: A Discord bot that plays local audio tracks. + * (C) Copyright 2022 + * Programmed by Andrew Lee + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + ***************************************************************************/ +import i18next from 'i18next'; +import fsBackend from 'i18next-fs-backend'; + +i18next.use(fsBackend).init({ + lng: 'en', // if you're using a language detector, do not define the lng option + debug: true, + fallbackLng: 'en', + backend: { + loadPath: './Locales/{{lng}}/{{ns}}.json' + } +}); + +export default { + i18next, + t(key) { + return i18next.t(key); + } +}; -- cgit v1.2.3