|
|
@@ -24,6 +24,13 @@ App::uses('CakePlugin', 'Core');
|
|
|
App::uses('L10n', 'I18n');
|
|
|
App::uses('Multibyte', 'I18n');
|
|
|
|
|
|
+if (function_exists('mb_internal_encoding')) {
|
|
|
+ $encoding = Configure::read('App.encoding');
|
|
|
+ if (!empty($encoding)) {
|
|
|
+ mb_internal_encoding($encoding);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* I18n handles translation of Text and time format strings.
|
|
|
*
|
|
|
@@ -111,7 +118,7 @@ class I18n {
|
|
|
*/
|
|
|
public static function translate($singular, $plural = null, $domain = null, $category = 6, $count = null) {
|
|
|
$_this = I18n::getInstance();
|
|
|
-
|
|
|
+
|
|
|
if (strpos($singular, "\r\n") !== false) {
|
|
|
$singular = str_replace("\r\n", "\n", $singular);
|
|
|
}
|
|
|
@@ -320,10 +327,10 @@ class I18n {
|
|
|
$this->__domains[$domain][$this->__lang][$this->category] = array();
|
|
|
return $domain;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (isset($this->__domains[$domain][$this->__lang][$this->category][""])) {
|
|
|
$head = $this->__domains[$domain][$this->__lang][$this->category][""];
|
|
|
-
|
|
|
+
|
|
|
foreach (explode("\n", $head) as $line) {
|
|
|
$header = strtok($line,":");
|
|
|
$line = trim(strtok("\n"));
|