1
0
Fork 1
mirror of https://example.com synced 2024-11-23 04:36:39 +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:
naskya 2023-09-13 21:50:01 +00:00
parent 29760fbe01
commit c911357873

View file

@ -70,20 +70,12 @@ module.exports = Object.entries(locales).reduce(
(a, [k, v]) => (
(a[k] = (() => {
const [lang] = k.split("-");
switch (k) {
case "en-US":
return v;
case "ja-JP":
case "ja-KS":
return merge(locales["en-US"], v);
default:
return merge(
return k === "en-US" ? v :
merge(
locales["en-US"],
locales["ja-JP"],
locales[`${lang}-${primaries[lang]}`] || {},
v,
);
}
})()),
a
),