phanpy/src/locales.js

19 lines
431 B
JavaScript
Raw Normal View History

import catalogs from './data/catalogs.json';
export const DEFAULT_LANG = 'en';
export const CATALOGS = catalogs;
// Get locales that's >= X% translated
const PERCENTAGE_THRESHOLD = 50;
2024-08-17 11:47:46 +08:00
const locales = [
DEFAULT_LANG,
...catalogs
.filter(({ completion }) => completion >= PERCENTAGE_THRESHOLD)
.map(({ code }) => code),
2024-08-17 11:47:46 +08:00
];
if (import.meta.env.DEV) {
locales.push('pseudo-LOCALE');
}
export const LOCALES = locales;