_nx_noop

Registers plural strings with gettext context in POT file, but does not translate them.

Description

(array) _nx_noop( (string) $singular, (string) $plural, (string) $context, (null) $domain = null ); 

Used when you want to keep structures with translatable plural strings and use them later when the number is known.

Example of a generic phrase which is disambiguated via the context parameter:

people => _nx_noop( %s group,, %s groups , people, text-domain ), animals => _nx_noop( %s group,, %s groups , animals, text-domain ),

Returns (array)

{ Array of translation information for the strings. @type string $0 Singular form to be localized. No longer used. @type string $1 Plural form to be localized. No longer used. @type string $2 Context information for the translators. No longer used. @type string $singular Singular form to be localized. @type string $plural Plural form to be localized. @type string $context Context information for the translators. @type string $domain Text domain. }

Parameters (4)

0. $singular (string)
Singular form to be localized.
1. $plural (string)
Plural form to be localized.
2. $context (string)
Context information for the translators.
3. $domain — Optional. (null) => null
Text domain. Unique identifier for retrieving translated strings. Default null.

Usage

  1. if ( !function_exists( '_nx_noop' ) ) { 
  2. require_once ABSPATH . WPINC . '/l10n.php'; 
  3.  
  4. // Singular form to be localized. 
  5. $singular = ''; 
  6.  
  7. // Plural form to be localized. 
  8. $plural = ''; 
  9.  
  10. // Context information for the translators. 
  11. $context = ''; 
  12.  
  13. // Optional. Text domain. Unique identifier for retrieving translated strings. 
  14. // Default null. 
  15. $domain = null; 
  16.  
  17. // NOTICE! Understand what this does before running. 
  18. $result = _nx_noop($singular, $plural, $context, $domain); 
  19.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/l10n.php  
  1. function _nx_noop( $singular, $plural, $context, $domain = null ) { 
  2. return array( 0 => $singular, 1 => $plural, 2 => $context, 'singular' => $singular, 'plural' => $plural, 'context' => $context, 'domain' => $domain );