feat: locales #27

Merged
Anri merged 26 commits from lang into main 2022-07-22 11:46:48 +02:00
Showing only changes of commit 9669ec376f - Show all commits

View file

@ -56,8 +56,10 @@ const getLocale = async (client: Client) => {
const default_lang = 'en';
// Check if there is a defined valid value
const old_path = __dirname.split('/');
old_path.pop();
const lang = client.config.lang === undefined ? default_lang : existsSync(
`./src/locales/${client.config.lang}.json`,
`${old_path.join('/')}/locales/${client.config.lang}.json`,
) ? client.config.lang : default_lang;
// Fallback to default language in case lang isn't valid