Complete Commonlib rc.6 integration and setup workflows

This commit is contained in:
vorotamoroz
2026-07-21 15:00:28 +00:00
parent e005f9eb13
commit 1ef8c88139
150 changed files with 31041 additions and 260 deletions
@@ -0,0 +1,50 @@
import { PartialMessages as def } from "./def.ts";
import { PartialMessages as es } from "./es.ts";
import { PartialMessages as fr } from "./fr.ts";
import { PartialMessages as he } from "./he.ts";
import { PartialMessages as ja } from "./ja.ts";
import { PartialMessages as ko } from "./ko.ts";
import { PartialMessages as ru } from "./ru.ts";
import { PartialMessages as zh } from "./zh.ts";
import { PartialMessages as zhTw } from "./zh-tw.ts";
import { expandKeywords, type MESSAGE } from "@/common/rosetta.ts";
type MessageKeys = keyof typeof def.def;
const messages = {
...def,
...es,
...fr,
...he,
...ja,
...ko,
...ru,
...zh,
...zhTw,
};
const w = Object.entries(messages)
.map(([lang, messageDefs]) => Object.entries(messageDefs).map(([key, value]) => [key, [lang, value]] as const))
.flat();
const _allMessages = w.reduce(
(acc, [key, value]) => {
if (!acc[key]) acc[key] = {};
acc[key][value[0]] = value[1];
return acc;
},
{} as Record<string, Record<string, string>>
) as Record<MessageKeys, { [key: string]: string }>;
const expandedMessage = {
...expandKeywords(_allMessages, "def"),
...expandKeywords(_allMessages, "es"),
...expandKeywords(_allMessages, "fr"),
...expandKeywords(_allMessages, "ja"),
...expandKeywords(_allMessages, "ko"),
...expandKeywords(_allMessages, "ru"),
...expandKeywords(_allMessages, "zh"),
...expandKeywords(_allMessages, "zh-tw"),
};
export const allMessages = expandedMessage as { [key: string]: MESSAGE };
export { type MessageKeys };
File diff suppressed because it is too large Load Diff
+4
View File
@@ -0,0 +1,4 @@
import de from "@/common/messagesJson/de.json";
export const PartialMessages = {
de,
} as const;
+4
View File
@@ -0,0 +1,4 @@
import def from "@/common/messagesJson/en.json";
export const PartialMessages = {
def,
} as const;
+4
View File
@@ -0,0 +1,4 @@
import es from "@/common/messagesJson/es.json";
export const PartialMessages = {
es,
} as const;
+4
View File
@@ -0,0 +1,4 @@
import fr from "@/common/messagesJson/fr.json";
export const PartialMessages = {
fr,
} as const;
+4
View File
@@ -0,0 +1,4 @@
import he from "@/common/messagesJson/he.json";
export const PartialMessages = {
he,
} as const;
+4
View File
@@ -0,0 +1,4 @@
import ja from "@/common/messagesJson/ja.json";
export const PartialMessages = {
ja,
} as const;
+4
View File
@@ -0,0 +1,4 @@
import ko from "@/common/messagesJson/ko.json";
export const PartialMessages = {
ko,
} as const;
+4
View File
@@ -0,0 +1,4 @@
import ru from "@/common/messagesJson/ru.json";
export const PartialMessages = {
ru,
} as const;
+4
View File
@@ -0,0 +1,4 @@
import zhTw from "@/common/messagesJson/zh-tw.json";
export const PartialMessages = {
"zh-tw": zhTw,
} as const;
+4
View File
@@ -0,0 +1,4 @@
import zh from "@/common/messagesJson/zh.json";
export const PartialMessages = {
zh,
} as const;