Make WordPress Core

Changeset 54315

Timestamp:
09/26/2022 08:54:44 PM (22 months ago)
Author:
audrasjb
Message:

i18n: Ensure empty strings are consistently translated to ''.

This changeset fixes an edge case where empty strings were wrongly translated to '0' (falsey value) instead of '' (empty string).

Props Chouby, manooweb, rafiahmedd, lopo.
Fixes #55941.

Location:
trunk
Files:
2 edited

Legend:

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

    r54133 r54315  
    8888         * Generates a unique key for this entry.
    8989         *
    90          * @return string|false The key or false if the entry is empty.
     90         * @return string|false The key or false if the entry is .
    9191         */
    9292        public function key() {
    93             if ( null === $this->singular || '' === $this->singular ) {
     93            if ( null === $this->singular ) {
    9494                return false;
    9595            }
  • trunk/tests/phpunit/tests/pomo/translations.php

    r52010 r54315  
    128128    }
    129129
     130
     131
     132
     133
     134
     135
     136
     137
     138
     139
     140
     141
     142
     143
     144
     145
     146
     147
     148
     149
     150
     151
     152
     153
     154
     155
     156
    130157}
Note: See TracChangeset for help on using the changeset viewer.