Skip to content

LLM Wiki is a cross-platform desktop application that turns your documents into an organized, interlinked knowledge base — automatically. Instead of traditional RAG (retrieve-and-answer from scratch every time), the LLM incrementally builds and maintains a persistent wiki from your sources。

TypeScript

fix: complete Russian locale coverage

nash_su820b22d73fe6
diff --git a/src/i18n/i18n-parity.test.ts b/src/i18n/i18n-parity.test.ts
index 04537cb9..3c0740bf 100644
--- a/src/i18n/i18n-parity.test.ts
+++ b/src/i18n/i18n-parity.test.ts
@@ -15,7 +15,6 @@ import { dirname, join } from "node:path"
import { fileURLToPath } from "node:url"
import { readFileSync, readdirSync } from "node:fs"
import en from "./en.json"
-import zh from "./zh.json"
/** Flattens a nested translation object to "a.b.c" dot-path keys. */
function flattenKeys(obj: unknown, prefix = ""): string[] {
@@ -32,10 +31,29 @@ function flattenKeys(obj: unknown, prefix = ""): string[] {
return out
}
-describe("i18n bundle parity (en.json ↔ zh.json)", () => {
+function valueAtPath(bundle: unknown, path: string): string {
+ let value = bundle
+ for (const part of path.split(".")) value = (value as Record<string, unknown>)[part]
+ return value as string
+}
+
+function interpolationVariables(value: string): string[] {
+ return [...value.matchAll(/{{\s*([A-Za-z_][\w]*)/g)]
+ .map((match) => match[1])
+ .sort()
+}
+
+describe("i18n bundle parity", () => {
const i18nDir = dirname(fileURLToPath(import.meta.url))
const enKeys = new Set(flattenKeys(en))
- const zhKeys = new Set(flattenKeys(zh))
+ const locales = Object.fromEntries(
+ readdirSync(i18nDir)
+ .filter((fileName) => fileName.endsWith(".json") && fileName !== "en.json")
+ .map((fileName) => [
+ fileName.slice(0, -".json".length),
+ JSON.parse(readFileSync(join(i18nDir, fileName), "utf8")) as unknown,
+ ]),
+ )
it("does not contain duplicate top-level JSON keys", () => {
const findDuplicates = (fileName: string) => {
@@ -50,24 +68,22 @@ describe("i18n bundle parity (en.json ↔ zh.json)", () => {
return [...duplicates].sort()
}
- expect(findDuplicates("en.json"), "duplicate top-level keys in en.json").toEqual([])
- expect(findDuplicates("zh.json"), "duplicate top-level keys in zh.json").toEqual([])
- })
-
- it("every en.json key is also in zh.json", () => {
- const missing = [...enKeys].filter((k) => !zhKeys.has(k)).sort()
- expect(
- missing,
- `Keys in en.json but missing from zh.json — add Chinese translations for:\n ${missing.join("\n ")}`,
- ).toEqual([])
+ for (const locale of ["en", ...Object.keys(locales)]) {
+ expect(
+ findDuplicates(`${locale}.json`),
+ `duplicate top-level keys in ${locale}.json`,
+ ).toEqual([])
+ }
})
- it("every zh.json key is also in en.json (no orphaned zh-only strings)", () => {
- const orphaned = [...zhKeys].filter((k) => !enKeys.has(k)).sort()
- expect(
- orphaned,
- `Keys in zh.json but missing from en.json — either add English translations or remove the stale zh-only keys:\n ${orphaned.join("\n ")}`,
- ).toEqual([])
+ it("every locale has exactly the English key set", () => {
+ for (const [locale, bundle] of Object.entries(locales)) {
+ const keys = new Set(flattenKeys(bundle))
+ const missing = [...enKeys].filter((key) => !keys.has(key)).sort()
+ const orphaned = [...keys].filter((key) => !enKeys.has(key)).sort()
+ expect(missing, `${locale}.json is missing:\n ${missing.join("\n ")}`).toEqual([])
+ expect(orphaned, `${locale}.json has orphaned keys:\n ${orphaned.join("\n ")}`).toEqual([])
+ }
})
it("every leaf value is a non-empty string (no null / empty / placeholder slips)", () => {
@@ -84,7 +100,18 @@ describe("i18n bundle parity (en.json ↔ zh.json)", () => {
}
}
check(en, "en.json")
- check(zh, "zh.json")
+ for (const [locale, bundle] of Object.entries(locales)) check(bundle, `${locale}.json`)
+ })
+
+ it("translated strings preserve English interpolation variables", () => {
+ for (const [locale, bundle] of Object.entries(locales)) {
+ for (const path of enKeys) {
+ expect(
+ interpolationVariables(valueAtPath(bundle, path)),
+ `${locale}.json changes interpolation variables for ${path}`,
+ ).toEqual(interpolationVariables(valueAtPath(en, path)))
+ }
+ }
})
it("pluralization keys come in pairs: every foo_plural has a matching foo", () => {
@@ -103,7 +130,7 @@ describe("i18n bundle parity (en.json ↔ zh.json)", () => {
}
}
check(en, "en.json")
- check(zh, "zh.json")
+ for (const [locale, bundle] of Object.entries(locales)) check(bundle, `${locale}.json`)
})
it("every literal translation key used by frontend code exists", () => {
diff --git a/src/i18n/ru.json b/src/i18n/ru.json
index 065897f4..a7c5c964 100644
--- a/src/i18n/ru.json
+++ b/src/i18n/ru.json
@@ -26,6 +26,7 @@
"review": "Ревью",
"skills": "Навыки",
"settings": "Настройки",
+ "settingsShortcut": " (Cmd/Ctrl+,)",
"switchProject": "Сменить проект",
"updateAvailable": "Доступно обновление",
"updateAvailableSuffix": " · обновление"
@@ -108,6 +109,7 @@
"thinking": "Анализ",
"open": "Открыть",
"remove": "Удалить",
+ "retry": "Попробовать снова",
"status": {
"queued": "В очереди",
"searching": "Поиск источников...",
@@ -184,6 +186,8 @@
"refreshFolderHint": "Заново просканировать папку источников и обработать новые, изменённые или удалённые файлы.",
"refreshFolderTooltip": "Заново просканировать папку источников проекта по тем же правилам, что и автоматический мониторинг. Новые или изменённые разрешённые файлы ставятся в очередь обработки; удалённые источники запускают обычную очистку вики и индекса; затем дерево файлов перестраивается.",
"refreshFailed": "Не удалось обновить источники: {{error}}",
+ "openExternal": "Открыть в приложении по умолчанию",
+ "openExternalFailed": "Не удалось открыть «{{name}}»: {{error}}",
"ingest": "Обработать",
"ingestStatus": {
"not-ingested": "Не обработан",
@@ -842,7 +846,7 @@
"description": "Инструменты для очистки вики — обнаружение и объединение дубликатов сущностей/понятий, которые LLM создала под разными названиями при повторной обработке.",
"noProject": "Сначала откройте проект.",
"noLlm": "Сначала настройте провайдера LLM.",
- "projectData": {
+ "projectData": {
"title": "Данные проекта",
"description": "Пересоберите навигацию из существующих страниц или переместите весь проект вместе со скрытым состоянием обработки.",
"rebuild": "Пересобрать индекс",
@@ -850,9 +854,16 @@
"import": "Импортировать проект",
"rebuilt": "Индекс пересобран: {{pages}} страниц в {{groups}} группах.",
"exported": "Проект экспортирован в {{path}}",
- "imported": "Импортировано «{{name}}». Переключите проект, чтобы открыть его."
- },
- "dedup": {
+ "imported": "Импортировано «{{name}}». Переключите проект, чтобы открыть его."
+ },
+ "history": {
+ "title": "История версий файлов",
+ "description": "Снимки для отката хранятся в .llm-wiki/history. Текущие файлы здесь не сохраняются. Приложение автоматически хранит не более 30 версий каждого файла и ограничивает общий размер истории проекта.",
+ "usage": "{{size}} в {{files}} файлах истории (версий: {{entries}})",
+ "clear": "Очистить историю версий",
+ "confirm": "Удалить все снимки для отката в этом проекте? Текущие файлы проекта удалены не будут."
+ },
+ "dedup": {
"title": "Найти дубликаты сущностей / понятий",
"description": "Просит LLM просканировать все страницы сущностей и понятий и сгруппировать те, что, вероятно, относятся к одной теме под разными названиями (англ. против кит., ед. ч. против мн. ч., аббревиатура против полной формы). Каждую группу вы подтверждаете перед объединением. Объединения ставятся в очередь и выполняются по одному, чтобы перекрёстные ссылки оставались согласованными.",
"scanButton": "Найти дубликаты",