chore: fix docstring

pull/3205/head
Ryan Miller 7 months ago
parent bc01be3274
commit 0900138d57
No known key found for this signature in database
GPG Key ID: 128C6E0A1246C6B3

@ -15,19 +15,19 @@ import type {
* *
* @returns The formatted message string. * @returns The formatted message string.
* *
* @deprecated this will eventually be replaced by LocalizedStringBuilder * @deprecated
* *
* @example * @example
* // The string greeting is 'Hello, {name}!' in the current locale * // The string greeting is 'Hello, {name}!' in the current locale
* window.i18n.getRawMessage('greeting', { name: 'Alice' }); * window.i18n.getRawMessage('greeting', { name: 'Alice' });
* // => 'Hello, {name}!' * // => 'Hello, {name}!'
* window.i18n.formatMessageWithArgs('greeting', { name: 'Alice' }); * window.i18n.formatMessageWithArgs('Hello, {name}!', { name: 'Alice' });
* // => 'Hello, Alice!' * // => 'Hello, Alice!'
* *
* // The string search is '{count, plural, one [{found_count} of # match] other [{found_count} of # matches]}' in the current locale * // 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 }); * window.i18n.getRawMessage('search', { count: 1, found_count: 1 });
* // => '{found_count} of {count} match' * // => '{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' * // => '1 of 1 match'
*/ */
export function formatMessageWithArgs< export function formatMessageWithArgs<

4
ts/window.d.ts vendored

@ -92,13 +92,13 @@ declare global {
* // The string greeting is 'Hello, {name}!' in the current locale * // The string greeting is 'Hello, {name}!' in the current locale
* window.i18n.getRawMessage('greeting', { name: 'Alice' }); * window.i18n.getRawMessage('greeting', { name: 'Alice' });
* // => 'Hello, {name}!' * // => 'Hello, {name}!'
* window.i18n.formatMessageWithArgs('greeting', { name: 'Alice' }); * window.i18n.formatMessageWithArgs('Hello, {name}!', { name: 'Alice' });
* // => 'Hello, Alice!' * // => 'Hello, Alice!'
* *
* // The string search is '{count, plural, one [{found_count} of # match] other [{found_count} of # matches]}' in the current locale * // 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 }); * window.i18n.getRawMessage('search', { count: 1, found_count: 1 });
* // => '{found_count} of {count} match' * // => '{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' * // => '1 of 1 match'
*/ */
formatMessageWithArgs: I18nMethods['formatMessageWithArgs']; formatMessageWithArgs: I18nMethods['formatMessageWithArgs'];

Loading…
Cancel
Save