diff --git a/src/wp-includes/pomo/entry.php b/src/wp-includes/pomo/entry.php index 67f6719b2b..3e4bc3bdd5 100644 --- a/src/wp-includes/pomo/entry.php +++ b/src/wp-includes/pomo/entry.php @@ -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; } /** diff --git a/src/wp-includes/pomo/translations.php b/src/wp-includes/pomo/translations.php index aaf9a35550..6008f4aa18 100644 --- a/src/wp-includes/pomo/translations.php +++ b/src/wp-includes/pomo/translations.php @@ -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; }