Skip to content

Commit 67f44bc

Browse files
committed
I18N: Revert [57386] pending further investigation.
Reverts the change for fallback string lookup due to a performance regression in the bad case scenario. See #59656. Built from https://develop.svn.wordpress.org/trunk@57505 git-svn-id: https://core.svn.wordpress.org/trunk@57006 1a063a9b-81f0-0310-95a4-ce76da25c4cd
1 parent eb7e51a commit 67f44bc

2 files changed

Lines changed: 2 additions & 19 deletions

File tree

wp-includes/l10n/class-wp-translation-file.php

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -203,24 +203,7 @@ public function translate( string $text ) {
203203
$this->parse_file();
204204
}
205205

206-
if ( isset( $this->entries[ $text ] ) ) {
207-
return $this->entries[ $text ];
208-
}
209-
210-
/*
211-
* Handle cases where a pluralized string is only used as a singular one.
212-
* For example, when both __( 'Product' ) and _n( 'Product', 'Products' )
213-
* are used, the entry key will have the format "ProductNULProducts".
214-
* Fall back to looking up just "Product" to support this edge case.
215-
*/
216-
foreach ( $this->entries as $key => $value ) {
217-
if ( str_starts_with( $key, $text . "\0" ) ) {
218-
$parts = explode( "\0", $value );
219-
return $parts[0];
220-
}
221-
}
222-
223-
return false;
206+
return $this->entries[ $text ] ?? false;
224207
}
225208

226209
/**

wp-includes/version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* @global string $wp_version
1818
*/
19-
$wp_version = '6.5-alpha-57504';
19+
$wp_version = '6.5-alpha-57505';
2020

2121
/**
2222
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

0 commit comments

Comments
 (0)