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:
Sergey Biryukov 2015-11-18 20:37:25 +00:00
parent c25efe2d52
commit 5d61c1b8d1
3 changed files with 8 additions and 4 deletions

View File

@ -69,8 +69,13 @@ class Translation_Entry {
*/
function key() {
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;
}
/**

View File

@ -82,7 +82,6 @@ class Translations {
*/
function translate_entry(&$entry) {
$key = $entry->key();
$key = str_replace( "\r\n", "\n", $key );
return isset($this->entries[$key])? $this->entries[$key] : false;
}

View File

@ -4,7 +4,7 @@
*
* @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.