(s: string, ...args: any[])
| 579 | } |
| 580 | |
| 581 | function _(s: string, ...args: any[]): string { |
| 582 | const strings = localeStrings(currentLocale_); |
| 583 | let result = strings[s]; |
| 584 | if (result === '' || result === undefined) result = s; |
| 585 | try { |
| 586 | return sprintf(result, ...args); |
| 587 | } catch (error) { |
| 588 | return `${result} ${args.join(', ')} (Translation error: ${error.message})`; |
| 589 | } |
| 590 | } |
| 591 | |
| 592 | function _n(singular: string, plural: string, n: number, ...args: any[]) { |
| 593 | if (n > 1) return _(plural, ...args); |
no test coverage detected