mirror of
https://github.com/kirameki-cafe/Yumi.git
synced 2026-09-14 03:09:59 +00:00
Support localization
This commit is contained in:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user