Make WordPress Core

Changeset 63323


Ignore:
Timestamp:
08/18/2026 11:44:01 AM (7 weeks ago)
Author:
SergeyBiryukov
Message:

Docs: Add missing descriptions and declare types for Translation_Entry properties.

Developed in ​https://github.com/WordPress/wordpress-develop/pull/13126.

Follow-up to r10584, r32990, r57734.

Props pedromendonca, mukesh27, dhruvang21.
Fixes #65901.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/pomo/entry.php

    r57734 r63323  
    2424                public $is_plural = false;
    2525
    26                 public $context             = null;
    27                 public $singular            = null;
    28                 public $plural              = null;
    29                 public $translations        = array();
    30                 public $translator_comments = '';
    31                 public $extracted_comments  = '';
    32                 public $references          = array();
    33                 public $flags               = array();
     26                /**
     27                 * The string to translate.
     28                 *
     29                 * @var string|null
     30                 */
     31                public $singular = null;
    3432
    3533                /**
     34                 * The plural form of the string.
     35                 *
     36                 * @var string|null
     37                 */
     38                public $plural = null;
     39
     40                /**
     41                 * Translations of the string and possibly its plural forms.
     42                 *
     43                 * Plural forms which have not been filled in are null.
     44                 *
     45                 * @var (string|null)[]
     46                 */
     47                public $translations = array();
     48
     49                /**
     50                 * Context of the string, used to differentiate two equal strings used in different contexts.
     51                 *
     52                 * @var string|null
     53                 */
     54                public $context = null;
     55
     56                /**
     57                 * Comments left by translators.
     58                 *
     59                 * @var string
     60                 */
     61                public $translator_comments = '';
     62
     63                /**
     64                 * Comments left by developers.
     65                 *
     66                 * @var string
     67                 */
     68                public $extracted_comments = '';
     69
     70                /**
     71                 * Places in the code this string is used, in relative_to_root_path/file.php:linenum form.
     72                 *
     73                 * @var string[]
     74                 */
     75                public $references = array();
     76
     77                /**
     78                 * Flags like php-format.
     79                 *
     80                 * @var string[]
     81                 */
     82                public $flags = array();
     83
     84                /**
     85                 * Constructor.
     86                 *
     87                 * @since 2.8.0
     88                 *
    3689                 * @param array $args {
    37                  *     Arguments array, supports the following keys:
     90                 *     Optional. Array of arguments. Default empty array.
    3891                 *
    39                  *     @type string $singular            The string to translate, if omitted an
    40                  *                                       empty entry will be created.
    41                  *     @type string $plural              The plural form of the string, setting
    42                  *                                       this will set `$is_plural` to true.
    43                  *     @type array $translations        Translations of the string and possibly
    44                  *                                       its plural forms.
    45                  *     @type string $context             A string differentiating two equal strings
    46                  *                                       used in different contexts.
    47                  *     @type string $translator_comments Comments left by translators.
    48                  *     @type string $extracted_comments  Comments left by developers.
    49                  *     @type array  $references          Places in the code this string is used, in
    50                  *                                       relative_to_root_path/file.php:linenum form.
    51                  *     @type array  $flags               Flags like php-format.
     92                 *     @type string          $singular            The string to translate, if omitted an
     93                 *                                                empty entry will be created.
     94                 *     @type string          $plural              The plural form of the string, setting
     95                 *                                                this will set `$is_plural` to true.
     96                 *     @type (string|null)[] $translations        Translations of the string and possibly
     97                 *                                                its plural forms.
     98                 *     @type string          $context             A string differentiating two equal strings
     99                 *                                                used in different contexts.
     100                 *     @type string          $translator_comments Comments left by translators.
     101                 *     @type string          $extracted_comments  Comments left by developers.
     102                 *     @type string[]        $references          Places in the code this string is used, in
     103                 *                                                relative_to_root_path/file.php:linenum form.
     104                 *     @type string[]        $flags               Flags like php-format.
    52105                 * }
    53106                 */
    … …  
    82135                 *
    83136                 * @see Translation_Entry::__construct()
     137                 *
     138                 * @param array $args Optional. Array of arguments. Default empty array.
    84139                 */
    85140                public function Translation_Entry( $args = array() ) {
Note: See TracChangeset for help on using the changeset viewer.