diff --git a/ts/util/i18n/functions/formatMessageWithArgs.ts b/ts/util/i18n/functions/formatMessageWithArgs.ts index 790ec5169..5890d798b 100644 --- a/ts/util/i18n/functions/formatMessageWithArgs.ts +++ b/ts/util/i18n/functions/formatMessageWithArgs.ts @@ -15,19 +15,19 @@ import type { * * @returns The formatted message string. * - * @deprecated this will eventually be replaced by LocalizedStringBuilder + * @deprecated * * @example * // The string greeting is 'Hello, {name}!' in the current locale * window.i18n.getRawMessage('greeting', { name: 'Alice' }); * // => 'Hello, {name}!' - * window.i18n.formatMessageWithArgs('greeting', { name: 'Alice' }); + * window.i18n.formatMessageWithArgs('Hello, {name}!', { name: 'Alice' }); * // => 'Hello, Alice!' * * // The string search is '{count, plural, one [{found_count} of # match] other [{found_count} of # matches]}' in the current locale * window.i18n.getRawMessage('search', { count: 1, found_count: 1 }); * // => '{found_count} of {count} match' - * window.i18n.formatMessageWithArgs('search', { count: 1, found_count: 1 }); + * window.i18n.formatMessageWithArgs('{found_count} of {count} match', { count: 1, found_count: 1 }); * // => '1 of 1 match' */ export function formatMessageWithArgs< diff --git a/ts/window.d.ts b/ts/window.d.ts index 2816bf355..97a907810 100644 --- a/ts/window.d.ts +++ b/ts/window.d.ts @@ -92,13 +92,13 @@ declare global { * // The string greeting is 'Hello, {name}!' in the current locale * window.i18n.getRawMessage('greeting', { name: 'Alice' }); * // => 'Hello, {name}!' - * window.i18n.formatMessageWithArgs('greeting', { name: 'Alice' }); + * window.i18n.formatMessageWithArgs('Hello, {name}!', { name: 'Alice' }); * // => 'Hello, Alice!' * * // The string search is '{count, plural, one [{found_count} of # match] other [{found_count} of # matches]}' in the current locale * window.i18n.getRawMessage('search', { count: 1, found_count: 1 }); * // => '{found_count} of {count} match' - * window.i18n.formatMessageWithArgs('search', { count: 1, found_count: 1 }); + * window.i18n.formatMessageWithArgs('{found_count} of {count} match', { count: 1, found_count: 1 }); * // => '1 of 1 match' */ formatMessageWithArgs: I18nMethods['formatMessageWithArgs'];