refactor(server): async import without side effects

This commit is contained in:
Elian Doran
2025-05-25 14:09:51 +03:00
parent e07a7d291b
commit fa9d0be651
2 changed files with 25 additions and 18 deletions

View File

@@ -9,7 +9,7 @@ export interface Locale {
electronLocale?: string;
}
export const LOCALES: Locale[] = [
const UNSORTED_LOCALES = [
{
id: "en",
name: "English",
@@ -75,4 +75,9 @@ export const LOCALES: Locale[] = [
rtl: true,
contentOnly: true
}
].sort((a, b) => a.name.localeCompare(b.name));
] as const;
export const LOCALES: Locale[] = Array.from(UNSORTED_LOCALES)
.sort((a, b) => a.name.localeCompare(b.name));
export type LOCALE_IDS = typeof UNSORTED_LOCALES[number]["id"];