(
language: TranslationLanguage,
id: TranslationKey,
...args: React.ReactNode[]
)
| 49 | * Version of `t` that returns a string. |
| 50 | */ |
| 51 | export function tString( |
| 52 | language: TranslationLanguage, |
| 53 | id: TranslationKey, |
| 54 | ...args: React.ReactNode[] |
| 55 | ): string { |
| 56 | const result = t(language, id, ...args); |
| 57 | return reactToString(result); |
| 58 | } |
| 59 | |
| 60 | function reactToString(el: React.ReactNode): string { |
| 61 | if (typeof el === 'string' || typeof el === 'number' || typeof el === 'boolean') { |
no test coverage detected