finish fixing i18n
/ build (push) Successful in 2m1s Details
/ build_x64 (push) Successful in 10m22s Details
/ build_arm64 (push) Successful in 3m16s Details

This commit is contained in:
core 2023-10-09 21:58:03 -04:00
parent 31229a1172
commit 36227f99e5
Signed by: core
GPG Key ID: FDBF740DADDCEECF
1 changed files with 51 additions and 11 deletions

View File

@ -11,17 +11,57 @@ function buildLoader(locale: string, key: string, file: string) {
const config: Config = ({ const config: Config = ({
loaders: [ loaders: [
buildLoader('en', '2fa', './locales/en/2fa.json'), {
buildLoader('en', '2fasetup', './locales/en/2fasetup.json'), locale: 'en',
buildLoader('en', 'common', './locales/en/common.json'), key: '2fa',
buildLoader('en', 'hosts', './locales/en/hosts.json'), loader: async () => (await import('./locales/en/2fa.json')).default
buildLoader('en', 'itworks', './locales/en/itworks.json'), },
buildLoader('en', 'login', './locales/en/login.json'), {
buildLoader('en', 'ml', './locales/en/ml.json'), locale: 'en',
buildLoader('en', 'networkcreate', './locales/en/networkcreate.json'), key: '2fasetup',
buildLoader('en', 'roles', './locales/en/roles.json'), loader: async () => (await import('./locales/en/2fasetup.json')).default
buildLoader('en', 'signup', './locales/en/signup.json'), },
{
locale: 'en',
key: 'common',
loader: async () => (await import('./locales/en/common.json')).default
},
{
locale: 'en',
key: 'hosts',
loader: async () => (await import('./locales/en/hosts.json')).default
},
{
locale: 'en',
key: 'itworks',
loader: async () => (await import('./locales/en/itworks.json')).default
},
{
locale: 'en',
key: 'login',
loader: async () => (await import('./locales/en/login.json')).default
},
{
locale: 'en',
key: 'ml',
loader: async () => (await import('./locales/en/ml.json')).default
},
{
locale: 'en',
key: 'networkcreate',
loader: async () => (await import('./locales/en/networkcreate.json')).default
},
{
locale: 'en',
key: 'roles',
loader: async () => (await import('./locales/en/roles.json')).default
},
{
locale: 'en',
key: 'signup',
loader: async () => (await import('./locales/en/signup.json')).default
},
] ]
}) })
export const { t, locale, locales, loading, loadTranslations } = new i18n(config); export const { t, locale, locales, loading, loadTranslations } = new i18n(config);