From 0900138d578b27d3bc5543c7556a5c798ed2e557 Mon Sep 17 00:00:00 2001 From: Ryan Miller Date: Thu, 12 Sep 2024 10:30:12 +1000 Subject: [PATCH] chore: fix docstring --- ts/util/i18n/functions/formatMessageWithArgs.ts | 6 +++--- ts/window.d.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) 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'];