Support localization

This commit is contained in:
2022-06-07 03:08:27 +07:00
parent fb6808fa59
commit 6919bb7d90
19 changed files with 932 additions and 580 deletions
+17
View File
@@ -0,0 +1,17 @@
import { Snowflake } from 'discord.js';
import { I18n } from 'i18n';
import Cache from '../providers/Cache';
import Locale from '../providers/Locale';
export async function getGuildLocale(id: Snowflake): Promise<I18n> {
const cachedGuild = await Cache.getCachedGuild(id);
if (!cachedGuild) return Locale.getLocaleProvider("en");
const LocaleProvider = Locale.getLocaleProvider(cachedGuild.locale);
return LocaleProvider;
}
export default {
getGuildLocale
}