diff --git a/packages/i18n/src/index.js b/packages/i18n/src/index.js index dc179517312014..639325479b7101 100644 --- a/packages/i18n/src/index.js +++ b/packages/i18n/src/index.js @@ -39,8 +39,8 @@ const i18n = new Tannin( {} ); * * @see http://messageformat.github.io/Jed/ * - * @param {?Object} data Locale data configuration. - * @param {?string} domain Domain for which configuration applies. + * @param {Object} [data] Locale data configuration. + * @param {string} [domain] Domain for which configuration applies. */ export function setLocaleData( data, domain = 'default' ) { i18n.data[ domain ] = { @@ -61,12 +61,12 @@ export function setLocaleData( data, domain = 'default' ) { * Wrapper for Tannin's `dcnpgettext`. Populates default locale data if not * otherwise previously assigned. * - * @param {?string} domain Domain to retrieve the translated text. - * @param {?string} context Context information for the translators. + * @param {string|undefined} domain Domain to retrieve the translated text. + * @param {string|undefined} context Context information for the translators. * @param {string} single Text to translate if non-plural. Used as fallback * return value on a caught error. - * @param {?string} plural The text to be used if the number is plural. - * @param {?number} number The number to compare against to use either the + * @param {string} [plural] The text to be used if the number is plural. + * @param {number} [number] The number to compare against to use either the * singular or plural form. * * @return {string} The translated string. @@ -85,7 +85,7 @@ function dcnpgettext( domain = 'default', context, single, plural, number ) { * @see https://developer.wordpress.org/reference/functions/__/ * * @param {string} text Text to translate. - * @param {?string} domain Domain to retrieve the translated text. + * @param {string} [domain] Domain to retrieve the translated text. * * @return {string} Translated text. */ @@ -100,7 +100,7 @@ export function __( text, domain ) { * * @param {string} text Text to translate. * @param {string} context Context information for the translators. - * @param {?string} domain Domain to retrieve the translated text. + * @param {string} [domain] Domain to retrieve the translated text. * * @return {string} Translated context string without pipe. */ @@ -114,11 +114,11 @@ export function _x( text, context, domain ) { * * @see https://developer.wordpress.org/reference/functions/_n/ * - * @param {string} single The text to be used if the number is singular. - * @param {string} plural The text to be used if the number is plural. - * @param {number} number The number to compare against to use either the - * singular or plural form. - * @param {?string} domain Domain to retrieve the translated text. + * @param {string} single The text to be used if the number is singular. + * @param {string} plural The text to be used if the number is plural. + * @param {number} number The number to compare against to use either the + * singular or plural form. + * @param {string} [domain] Domain to retrieve the translated text. * * @return {string} The translated singular or plural form. */ @@ -137,7 +137,7 @@ export function _n( single, plural, number, domain ) { * @param {number} number The number to compare against to use either the * singular or plural form. * @param {string} context Context information for the translators. - * @param {?string} domain Domain to retrieve the translated text. + * @param {string} [domain] Domain to retrieve the translated text. * * @return {string} The translated singular or plural form. */