diff options
| author | Andrew Lee <alee14498@protonmail.com> | 2022-12-20 17:54:56 -0500 |
|---|---|---|
| committer | Andrew Lee <alee14498@protonmail.com> | 2022-12-20 18:05:51 -0500 |
| commit | e5c86859e4c6a9a6829bcc2e3cf626b05a873ff7 (patch) | |
| tree | 96c04baa3f064a160a595a0faf73696cc5cf8eaa /Utilities/i18n.js | |
| parent | 239b254760381946f57d6cbccb077f5341ca2f30 (diff) | |
| download | DLAP-e5c86859e4c6a9a6829bcc2e3cf626b05a873ff7.tar.gz DLAP-e5c86859e4c6a9a6829bcc2e3cf626b05a873ff7.tar.bz2 DLAP-e5c86859e4c6a9a6829bcc2e3cf626b05a873ff7.zip | |
Revamped next/previous cmds (Voting system); Basic i18n support;
Diffstat (limited to 'Utilities/i18n.js')
| -rw-r--r-- | Utilities/i18n.js | 38 |
1 files changed, 38 insertions, 0 deletions
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 <https://www.gnu.org/licenses/>. + * + ***************************************************************************/ +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); + } +}; |
