From ee2ac68b0dd4ec838382a53e79ab521861c762cc Mon Sep 17 00:00:00 2001 From: limes Date: Thu, 20 Aug 2026 21:46:35 +0200 Subject: [PATCH] fix: timezones types Co-Authored-By: mrjvs --- src/utils/localizeConsole.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/utils/localizeConsole.ts b/src/utils/localizeConsole.ts index 020a777..acb2983 100644 --- a/src/utils/localizeConsole.ts +++ b/src/utils/localizeConsole.ts @@ -1,8 +1,17 @@ import regions from '@/assets/json/regions.json'; -import timezones from '@/assets/json/timezones.json'; +import timezoneData from '@/assets/json/timezones.json'; -export function webLocaleToConsoleLocale(lo: string): 'japanese' | 'french' | 'german' | 'italian' | 'spanish' | 'korean' | 'dutch' | 'portuguese' | 'russian' | 'chinese_traditional' | 'chinese_simple' | 'english' { - const convObj = { +type Timezone = { + area: string; + language: string; + name: string; + utc_offset: string; + order: string; +}; +type TimezoneLanguageCollection = Record>; +type TimezoneCollection = Record; + +const timezones = timezoneData as TimezoneCollection; 'ja': 'japanese', 'fr': 'french', 'de': 'german',