( template: string, params: Record<string, string | number>, )
| 147 | * // => 'Storage low! Model 4 GB > 2 GB free' |
| 148 | */ |
| 149 | export function t( |
| 150 | template: string, |
| 151 | params: Record<string, string | number>, |
| 152 | ): string { |
| 153 | return template.replace(/\{\{(\w+)\}\}/g, (_match, key) => |
| 154 | String(params[key] ?? `{{${key}}}`), |
| 155 | ); |
| 156 | } |
| 157 | |
| 158 | // ─── Dayjs locale ─────────────────────────────────────────────────── |
| 159 | export const initLocale = (locale?: AvailableLanguage) => { |
no outgoing calls
no test coverage detected