mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-14 03:41:46 +00:00
feat(i18n): i18n auto-importer
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
import i18next, { init, t as i18t, changeLanguage } from 'i18next';
|
||||
|
||||
import { languageResources } from '@/i18n/resources';
|
||||
import { languageResources } from 'virtual:i18n';
|
||||
|
||||
export const loadI18n = async () =>
|
||||
await init({
|
||||
|
||||
11
src/i18n/resources/@types/index.ts
Normal file
11
src/i18n/resources/@types/index.ts
Normal file
@ -0,0 +1,11 @@
|
||||
export interface LanguageResources {
|
||||
[lang: string]: {
|
||||
translation: Record<string, unknown> & {
|
||||
language: {
|
||||
name: string;
|
||||
'local-name': string;
|
||||
code: string;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@ -1,11 +0,0 @@
|
||||
import enJson from './en.json';
|
||||
import koJson from './ko.json';
|
||||
|
||||
export const languageResources = {
|
||||
en: {
|
||||
translation: enJson
|
||||
},
|
||||
ko: {
|
||||
translation: koJson
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user