UI: translate Diagnostics and About cards

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
ДмитрийandClaude Sonnet 5.5 committed 2026-09-30 11:53:28 +05:00
1 parent 488a1a45c6
commit 0b975a7c42
8 files changed
+168 -23

No files matched your search

+3 -3
View File
@@ -42,10 +42,10 @@ export function lookup(locale: Locale, key: Key, vars?: Vars): string {
}
/** Plural form: tries `key_<category>` (one/few/many/other) for the locale, then `key_other`, then `key`. */
export function lookupPlural(locale: Locale, key: Key, n: number, vars?: Vars): string {
export function lookupPlural(locale: Locale, key: string, n: number, vars?: Vars): string {
const cat = new Intl.PluralRules(locale).select(n);
const d = DICTS[locale];
const text = d[`${key}_${cat}` as Key] ?? d[`${key}_other` as Key] ?? en[`${key}_${cat}` as Key] ?? en[`${key}_other` as Key] ?? en[key] ?? key;
const text = d[`${key}_${cat}` as Key] ?? d[`${key}_other` as Key] ?? en[`${key}_${cat}` as Key] ?? en[`${key}_other` as Key] ?? en[key as Key] ?? key;
return interpolate(text, { n, ...vars });
}
@@ -53,7 +53,7 @@ interface Ctx {
locale: Locale;
setLocale: (l: Locale) => void;
t: (key: Key, vars?: Vars) => string;
tn: (key: Key, n: number, vars?: Vars) => string;
tn: (key: string, n: number, vars?: Vars) => string;
}
const I18n = createContext<Ctx>({
+28
View File
@@ -198,6 +198,34 @@ const de: Partial<Record<keyof typeof en, string>> = {
"client.updateAddon": "Begleiter-Addon aktualisieren",
"client.addonNote": "Begleiter-Addon installiert. Andere Addons wurden nicht angetastet.",
"client.changeFolder": "Ordner ändern …",
// Diagnostics
"diag.title": "Diagnose",
"diag.text": "Sucht nach häufigen Problemen. Es wird nichts verändert.",
"diag.run": "Diagnose starten",
"diag.verify": "Serverdateien prüfen",
"diag.export": "Diagnosepaket exportieren",
"diag.saved": "Für Fehlerberichte gespeichert: {path}",
"diag.allGood": "Alles sieht gut aus.",
"diag.problems_one": "{n} Punkt zum Prüfen",
"diag.problems_few": "{n} Punkte zum Prüfen",
"diag.problems_many": "{n} Punkte zum Prüfen",
"diag.problems_other": "{n} Punkte zum Prüfen",
"diag.word.ok": "OK",
"diag.word.warn": "Achtung",
"diag.word.fail": "Problem",
"diag.filesOk": "Alle Programmdateien sind unversehrt.",
"diag.filesDiffer": "{n} Programmdatei(en) weichen vom Installierten ab. Deine eigenen Dateien werden hier nie aufgeführt. „Nach Updates suchen“ stellt fehlende wieder her.",
"diag.fileMissing": "fehlt",
"diag.fileChanged": "geändert",
// About Manager
"about.version": "Version {v}. Programmupdates verändern deinen Server nie.",
"about.check": "Nach neuer Version suchen",
"about.install": "{v} installieren und neu starten",
"about.upToDate": "CoA Server Manager ist auf dem neuesten Stand.",
"about.checkFailed": "Die Suche nach einer neuen Version ist fehlgeschlagen. Prüfe deine Internetverbindung und versuche es erneut.",
"about.installFailed": "Das Update konnte nicht installiert werden. Dein Server wurde nicht angetastet.",
};
export default de;
+28
View File
@@ -198,6 +198,34 @@ const en = {
"client.updateAddon": "Update companion addon",
"client.addonNote": "Companion addon installed. Other addons were not touched.",
"client.changeFolder": "Change folder…",
// Diagnostics
"diag.title": "Diagnostics",
"diag.text": "Looks for common problems. Nothing is changed.",
"diag.run": "Run diagnostics",
"diag.verify": "Check server files",
"diag.export": "Export diagnostic package",
"diag.saved": "Saved for bug reports: {path}",
"diag.allGood": "Everything looks good.",
"diag.problems_one": "{n} thing to look at",
"diag.problems_few": "{n} things to look at",
"diag.problems_many": "{n} things to look at",
"diag.problems_other": "{n} things to look at",
"diag.word.ok": "OK",
"diag.word.warn": "Attention",
"diag.word.fail": "Problem",
"diag.filesOk": "All program files are intact.",
"diag.filesDiffer": "{n} program file(s) differ from what was installed. Your own files are never listed here. \"Check for updates\" restores missing ones.",
"diag.fileMissing": "missing",
"diag.fileChanged": "changed",
// About Manager
"about.version": "Version {v}. Updates to the program never change your server.",
"about.check": "Check for a new version",
"about.install": "Install {v} and restart",
"about.upToDate": "CoA Server Manager is up to date.",
"about.checkFailed": "Could not check for a new version. Check your internet connection and try again.",
"about.installFailed": "The update could not be installed. Your server was not touched.",
} as const;
export default en;
+28
View File
@@ -198,6 +198,34 @@ const es: Partial<Record<keyof typeof en, string>> = {
"client.updateAddon": "Actualizar addon de compañeros",
"client.addonNote": "Addon de compañeros instalado. Los demás addons no se tocaron.",
"client.changeFolder": "Cambiar carpeta…",
// Diagnostics
"diag.title": "Diagnóstico",
"diag.text": "Busca problemas comunes. No se cambia nada.",
"diag.run": "Ejecutar diagnóstico",
"diag.verify": "Comprobar archivos del servidor",
"diag.export": "Exportar paquete de diagnóstico",
"diag.saved": "Guardado para informes de errores: {path}",
"diag.allGood": "Todo parece correcto.",
"diag.problems_one": "{n} cosa que revisar",
"diag.problems_few": "{n} cosas que revisar",
"diag.problems_many": "{n} cosas que revisar",
"diag.problems_other": "{n} cosas que revisar",
"diag.word.ok": "Correcto",
"diag.word.warn": "Atención",
"diag.word.fail": "Problema",
"diag.filesOk": "Todos los archivos del programa están intactos.",
"diag.filesDiffer": "{n} archivo(s) del programa difieren de lo instalado. Tus propios archivos nunca aparecen aquí. «Buscar actualizaciones» restaura los que faltan.",
"diag.fileMissing": "falta",
"diag.fileChanged": "modificado",
// About Manager
"about.version": "Versión {v}. Las actualizaciones del programa nunca cambian tu servidor.",
"about.check": "Buscar una versión nueva",
"about.install": "Instalar {v} y reiniciar",
"about.upToDate": "CoA Server Manager está actualizado.",
"about.checkFailed": "No se pudo buscar una versión nueva. Comprueba tu conexión a internet e inténtalo de nuevo.",
"about.installFailed": "No se pudo instalar la actualización. Tu servidor no se ha tocado.",
};
export default es;
+28
View File
@@ -198,6 +198,34 @@ const fr: Partial<Record<keyof typeof en, string>> = {
"client.updateAddon": "Mettre à jour l’addon des compagnons",
"client.addonNote": "Addon des compagnons installé. Les autres addons n’ont pas été touchés.",
"client.changeFolder": "Changer de dossier…",
// Diagnostics
"diag.title": "Diagnostic",
"diag.text": "Recherche les problèmes courants. Rien n’est modifié.",
"diag.run": "Lancer le diagnostic",
"diag.verify": "Vérifier les fichiers du serveur",
"diag.export": "Exporter le paquet de diagnostic",
"diag.saved": "Enregistré pour les rapports de bogue : {path}",
"diag.allGood": "Tout semble en ordre.",
"diag.problems_one": "{n} point à examiner",
"diag.problems_few": "{n} points à examiner",
"diag.problems_many": "{n} points à examiner",
"diag.problems_other": "{n} points à examiner",
"diag.word.ok": "OK",
"diag.word.warn": "Attention",
"diag.word.fail": "Problème",
"diag.filesOk": "Tous les fichiers du programme sont intacts.",
"diag.filesDiffer": "{n} fichier(s) du programme diffèrent de l’installation. Vos propres fichiers ne sont jamais listés ici. « Rechercher des mises à jour » restaure ceux qui manquent.",
"diag.fileMissing": "manquant",
"diag.fileChanged": "modifié",
// About Manager
"about.version": "Version {v}. Les mises à jour du programme ne modifient jamais votre serveur.",
"about.check": "Rechercher une nouvelle version",
"about.install": "Installer {v} et redémarrer",
"about.upToDate": "CoA Server Manager est à jour.",
"about.checkFailed": "Impossible de rechercher une nouvelle version. Vérifiez votre connexion internet et réessayez.",
"about.installFailed": "La mise à jour n’a pas pu être installée. Votre serveur n’a pas été touché.",
};
export default fr;
+28
View File
@@ -198,6 +198,34 @@ const ru: Partial<Record<keyof typeof en, string>> = {
"client.updateAddon": "Обновить аддон компаньонов",
"client.addonNote": "Аддон компаньонов установлен. Другие аддоны не затронуты.",
"client.changeFolder": "Сменить папку…",
// Diagnostics
"diag.title": "Диагностика",
"diag.text": "Ищет типичные проблемы. Ничего не изменяется.",
"diag.run": "Запустить диагностику",
"diag.verify": "Проверить файлы сервера",
"diag.export": "Экспортировать пакет диагностики",
"diag.saved": "Сохранено для отчёта об ошибке: {path}",
"diag.allGood": "Всё в порядке.",
"diag.problems_one": "Стоит проверить: {n}",
"diag.problems_few": "Стоит проверить: {n}",
"diag.problems_many": "Стоит проверить: {n}",
"diag.problems_other": "Стоит проверить: {n}",
"diag.word.ok": "В порядке",
"diag.word.warn": "Внимание",
"diag.word.fail": "Проблема",
"diag.filesOk": "Все файлы программы целы.",
"diag.filesDiffer": "Файлов программы, отличающихся от установленных: {n}. Ваши собственные файлы здесь не показываются. «Проверить обновления» восстановит отсутствующие.",
"diag.fileMissing": "отсутствует",
"diag.fileChanged": "изменён",
// About Manager
"about.version": "Версия {v}. Обновления программы никогда не меняют ваш сервер.",
"about.check": "Проверить наличие новой версии",
"about.install": "Установить {v} и перезапустить",
"about.upToDate": "У вас последняя версия CoA Server Manager.",
"about.checkFailed": "Не удалось проверить наличие новой версии. Проверьте подключение к интернету и повторите попытку.",
"about.installFailed": "Не удалось установить обновление. Ваш сервер не затронут.",
};
export default ru;