I18N: After [35620], move the code for standardizing on `\n` line endings to `Translation_Entry::key()`.
Props dd32. Fixes #22172. Built from https://develop.svn.wordpress.org/trunk@35686 git-svn-id: http://core.svn.wordpress.org/trunk@35650 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
c25efe2d52
commit
5d61c1b8d1
|
@ -69,8 +69,13 @@ class Translation_Entry {
|
||||||
*/
|
*/
|
||||||
function key() {
|
function key() {
|
||||||
if (is_null($this->singular)) return false;
|
if (is_null($this->singular)) return false;
|
||||||
// prepend context and EOT, like in MO files
|
|
||||||
return is_null($this->context)? $this->singular : $this->context.chr(4).$this->singular;
|
// Prepend context and EOT, like in MO files
|
||||||
|
$key = is_null($this->context)? $this->singular : $this->context.chr(4).$this->singular;
|
||||||
|
// Standardize on \n line endings
|
||||||
|
$key = str_replace( array( "\r\n", "\r" ), "\n", $key );
|
||||||
|
|
||||||
|
return $key;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -82,7 +82,6 @@ class Translations {
|
||||||
*/
|
*/
|
||||||
function translate_entry(&$entry) {
|
function translate_entry(&$entry) {
|
||||||
$key = $entry->key();
|
$key = $entry->key();
|
||||||
$key = str_replace( "\r\n", "\n", $key );
|
|
||||||
return isset($this->entries[$key])? $this->entries[$key] : false;
|
return isset($this->entries[$key])? $this->entries[$key] : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.4-beta4-35685';
|
$wp_version = '4.4-beta4-35686';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue