Skip to content

Commit

Permalink
Improve i18n types
Browse files Browse the repository at this point in the history
  • Loading branch information
sirreal committed Dec 6, 2019
1 parent d385221 commit 73a2abb
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions packages/i18n/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ] = {
Expand All @@ -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.
Expand All @@ -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.
*/
Expand All @@ -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.
*/
Expand All @@ -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.
*/
Expand All @@ -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.
*/
Expand Down

0 comments on commit 73a2abb

Please sign in to comment.