Skip to content

Commit 4093b01

Browse files
committed
fix: lang2RegionMap
1 parent d1f7238 commit 4093b01

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

frontend/antd/config-provider/config-provider.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import dayjs from 'dayjs';
1111
import { produce } from 'immer';
1212
import { getLocaleFromNavigator } from 'svelte-i18n';
1313

14-
import { getDefaultLocale, locales, simpleLocaleMap } from './locales';
14+
import { getDefaultLocale, lang2RegionMap, locales } from './locales';
1515

1616
function formatLocale(locale: string | null) {
1717
if (!locale) {
@@ -20,7 +20,7 @@ function formatLocale(locale: string | null) {
2020
let lang = 'en_US';
2121
const parts = locale.replace('-', '_').split('_');
2222
if (parts.length === 1) {
23-
lang = simpleLocaleMap[parts[0].toLowerCase()] || 'en_US';
23+
lang = lang2RegionMap[parts[0].toLowerCase()] || 'en_US';
2424
} else if (parts.length === 2) {
2525
lang = `${parts[0].toLowerCase()}_${parts[1].toUpperCase()}`;
2626
}

frontend/antd/config-provider/locales.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export const getDefaultLocale = () => {
99
return en_US;
1010
};
1111

12-
export const simpleLocaleMap = {
12+
export const lang2RegionMap = {
1313
ar: 'ar_EG',
1414
az: 'az_AZ',
1515
bg: 'bg_BG',

0 commit comments

Comments
 (0)