mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 10:31:47 +00:00
19 lines
431 B
TypeScript
19 lines
431 B
TypeScript
import i18next, { init, t as i18t, changeLanguage } from 'i18next';
|
|
|
|
import { languageResources } from 'virtual:i18n';
|
|
|
|
export const loadI18n = async () =>
|
|
await init({
|
|
resources: languageResources,
|
|
lng: 'en',
|
|
fallbackLng: 'en',
|
|
interpolation: {
|
|
escapeValue: false,
|
|
},
|
|
});
|
|
|
|
export const setLanguage = async (language: string) =>
|
|
await changeLanguage(language);
|
|
|
|
export const t = i18t.bind(i18next);
|