I18N: After [35620], move the code for standardizing on \n
line endings to Translation_Entry::key()
.
Props dd32. Fixes #22172. git-svn-id: https://develop.svn.wordpress.org/trunk@35686 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
6d01a1266d
commit
28a1b19ed1
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user