(text: string, vars?: Record<string, string | number>)
| 4 | import { formatServerError, isSessionNotFoundError, parseReadableConfigInvalidError } from "./server-errors" |
| 5 | |
| 6 | function fill(text: string, vars?: Record<string, string | number>) { |
| 7 | if (!vars) return text |
| 8 | return text.replace(/{{\s*(\w+)\s*}}/g, (_, key: string) => { |
| 9 | const value = vars[key] |
| 10 | if (value === undefined) return "" |
| 11 | return String(value) |
| 12 | }) |
| 13 | } |
| 14 | |
| 15 | function useLanguageMock() { |
| 16 | const dict: Record<string, string> = { |