1
0
Fork 0
mirror of https://github.com/cheeaun/phanpy.git synced 2025-05-02 21:23:13 +03:00

Sync the list of locales between config & app code

This commit is contained in:
Lim Chee Aun 2024-08-14 17:16:56 +08:00
parent fcb85d1172
commit f359d36e9b
4 changed files with 13 additions and 8 deletions
src/utils

View file

@ -7,17 +7,12 @@ import {
} from '@lingui/detect-locale';
import Locale from 'intl-locale-textinfo-polyfill';
import { DEFAULT_LANG, LOCALES } from '../locales';
import { messages } from '../locales/en.po';
import localeMatch from '../utils/locale-match';
const { PHANPY_DEFAULT_LANG } = import.meta.env;
export const DEFAULT_LANG = 'en';
export const LOCALES = [DEFAULT_LANG];
if (import.meta.env.DEV) {
LOCALES.push('pseudo-LOCALE');
}
i18n.load(DEFAULT_LANG, messages);
i18n.on('change', () => {
const lang = i18n.locale;