mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 03:29:51 +02:00
feat: localize game assets
This commit is contained in:
1 parent
d8459d373c
commit
ef9778ea96
90 files changed
+336
-251
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import { DEFAULT_LOCALE, SupportedLocale } from '@blitzkit/core';
|
||||
import { DEFAULT_LOCALE, SupportedLocale } from '@blitzkit/i18n';
|
||||
import { Locale } from 'discord.js';
|
||||
|
||||
const SUPPORTED_LOCALES_DISCORD_MAP: Record<SupportedLocale, Locale> = {
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
import { unwrapper } from '@blitzkit/i18n';
|
||||
import { Locale } from 'discord.js';
|
||||
import { translations } from './strings';
|
||||
import {
|
||||
DEFAULT_LOCALE_DISCORD,
|
||||
SUPPORTED_LOCALES_DISCORD,
|
||||
SUPPORTED_LOCALES_DISCORD_MAP_INVERSE,
|
||||
} from './strings/constants';
|
||||
|
||||
export function translator(localeRaw: Locale) {
|
||||
@@ -74,5 +76,7 @@ export function translator(localeRaw: Locale) {
|
||||
.join('');
|
||||
}
|
||||
|
||||
return { locale, translate, t };
|
||||
const unwrap = unwrapper(SUPPORTED_LOCALES_DISCORD_MAP_INVERSE[locale]);
|
||||
|
||||
return { locale, translate, t, unwrap };
|
||||
}
|
||||
Reference in new issue
Block a user