mirror of
https://example.com
synced 2024-11-23 04:16:41 +09:00
better locale merge
fixes some problems including https://ddoskey.com/notes/9jikq12rmqfv27rh as usual, users may need to clear the browser cache
This commit is contained in:
parent
29760fbe01
commit
c911357873
1 changed files with 6 additions and 14 deletions
|
@ -70,20 +70,12 @@ module.exports = Object.entries(locales).reduce(
|
||||||
(a, [k, v]) => (
|
(a, [k, v]) => (
|
||||||
(a[k] = (() => {
|
(a[k] = (() => {
|
||||||
const [lang] = k.split("-");
|
const [lang] = k.split("-");
|
||||||
switch (k) {
|
return k === "en-US" ? v :
|
||||||
case "en-US":
|
merge(
|
||||||
return v;
|
locales["en-US"],
|
||||||
case "ja-JP":
|
locales[`${lang}-${primaries[lang]}`] || {},
|
||||||
case "ja-KS":
|
v,
|
||||||
return merge(locales["en-US"], v);
|
);
|
||||||
default:
|
|
||||||
return merge(
|
|
||||||
locales["en-US"],
|
|
||||||
locales["ja-JP"],
|
|
||||||
locales[`${lang}-${primaries[lang]}`] || {},
|
|
||||||
v,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
})()),
|
})()),
|
||||||
a
|
a
|
||||||
),
|
),
|
||||||
|
|
Loading…
Reference in a new issue