i18n: translate optimization names in source viewer headings

This commit is contained in:
VAIO73
2026-10-21 08:56:56 +00:00
parent 06d06041c7
commit 09f9ee18fc
5 changed files with 88 additions and 7 deletions
@@ -1,5 +1,17 @@
type Translate = (key: string, params?: Record<string, string | number>) => string
const SOURCE_TOOLS = new Set([
"subscription_banner", "time_sync", "apt_languages", "journald", "logrotate",
"system_limits", "memory_settings", "zram_swap", "kernel_panic", "apt_ipv4",
"kexec", "rpc", "motd", "system_utils", "network_optimization", "bashrc_custom",
"figurine", "fastfetch", "log2ram", "zfs_autotrim", "amd_fixes", "persistent_network",
"vfio_iommu", "lvm_repair", "repo_cleanup", "proxmox_repos", "entropy",
])
export function optimizationSourceName(tool: string, fallback: string, t: Translate): string {
return SOURCE_TOOLS.has(tool) ? t(`settings.optimizations.sourceToolNames.${tool}`) : fallback
}
export interface OptimizationSourceError {
kind: "unavailable" | "loadFailed"
detail?: string