(key: string, values?: Record<string, unknown>)
| 45 | }; |
| 46 | |
| 47 | function interpolate(key: string, values?: Record<string, unknown>) { |
| 48 | let result = translations[key] ?? key; |
| 49 | for (const [name, value] of Object.entries(values ?? {})) { |
| 50 | result = result.replaceAll(`{{${name}}}`, String(value)); |
| 51 | } |
| 52 | return result; |
| 53 | } |
| 54 | |
| 55 | vi.mock("react-i18next", () => ({ |
| 56 | useTranslation: () => ({ |
no outgoing calls
no test coverage detected