Skip to content

Commit 97adff3

Browse files
committed
fix: fixes longitude i10n message
1 parent 4df1590 commit 97adff3

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

src/l10n/locale.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
import en from "./locales/en";
22
import zhCN from "./locales/zh_CN";
33

4-
5-
const lang = window.localStorage.getItem('language');
4+
const lang = window.localStorage.getItem("language");
65

76
const localeMap: { [k: string]: Partial<typeof en> } = {
87
en,
9-
zh: zhCN,
8+
zh: zhCN
109
};
11-
const userLocale = localeMap[lang || 'en'];
10+
const userLocale = localeMap[lang || "en"];
1211

1312
export default function t(str: keyof typeof en, ...inserts: string[]): string {
14-
let localeStr = (userLocale && userLocale[str]) ?? en[str];
13+
let localeStr = (userLocale && userLocale[str]) ?? en[str] ?? str;
1514

1615
for (let i = 0; i < inserts.length; i++) {
1716
localeStr = localeStr.replace(`%${i + 1}`, inserts[i]);

src/l10n/locales/en.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ export default {
1313
"Could not parse GeoJSON file": "Could not parse GeoJSON file",
1414
"Could not parse overlay radius. Please make sure it is in the format `<length> <unit>`.":
1515
"Could not parse overlay radius. Please make sure it is in the format `<length> <unit>`.",
16-
"There was an error with the provided latitude. Using defaults.":
17-
"There was an error with the provided latitude. Using defaults.",
18-
"There was an error with the provided longitude. Using defaults.":
19-
"There was an error with the provided longitude. Using defaults.",
16+
"There was an error with the provided latitude. Using default.":
17+
"There was an error with the provided latitude. Using default.",
18+
"There was an error with the provided longitude. Using default.":
19+
"There was an error with the provided longitude. Using default.",
2020

2121
//loader.ts
2222
"There was an issue getting the image dimensions.":

src/l10n/locales/zh_CN.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ export default {
1313
"Could not parse GeoJSON file": "无法解析 GeoJSON 文件",
1414
"Could not parse overlay radius. Please make sure it is in the format `<length> <unit>`.":
1515
"无法解析覆盖半径. 请确保格式为 `<长度> <单位>`.",
16-
"There was an error with the provided latitude. Using defaults.":
16+
"There was an error with the provided latitude. Using default.":
1717
"提供的纬度有误. 使用默认值.",
18-
"There was an error with the provided longitude. Using defaults.":
18+
"There was an error with the provided longitude. Using default.":
1919
"提供的经度有误. 使用默认值.",
2020

2121
//loader.ts

0 commit comments

Comments
 (0)