From 560338d15d2b84eb5b3cffaaf200c040866d4943 Mon Sep 17 00:00:00 2001
From: wei <>
Date: Tue, 1 Aug 2006 02:10:24 +0000
Subject: Fixed #306
---
.gitattributes | 2 ++
framework/I18N/core/MessageFormat.php | 4 ++++
.../tickets/protected/messages/en/messages.xml | 17 +++++++++++++++++
.../tickets/protected/pages/Ticket306.page | 12 ++++++++++++
.../FunctionalTests/tickets/protected/pages/config.xml | 8 ++++++++
5 files changed, 43 insertions(+)
create mode 100644 tests/FunctionalTests/tickets/protected/messages/en/messages.xml
create mode 100644 tests/FunctionalTests/tickets/protected/pages/Ticket306.page
diff --git a/.gitattributes b/.gitattributes
index e1677ef4..5ba1c6fb 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1614,6 +1614,7 @@ tests/FunctionalTests/quickstart/Controls/Wizard5TestCase.php -text
tests/FunctionalTests/quickstart/Fundamentals/HangmanTestCase.php -text
tests/FunctionalTests/tickets.php -text
tests/FunctionalTests/tickets/index.php -text
+tests/FunctionalTests/tickets/protected/messages/en/messages.xml -text
tests/FunctionalTests/tickets/protected/pages/Layout.php -text
tests/FunctionalTests/tickets/protected/pages/Layout.tpl -text
tests/FunctionalTests/tickets/protected/pages/TestHtmlArea.php -text
@@ -1635,6 +1636,7 @@ tests/FunctionalTests/tickets/protected/pages/Ticket284.php -text
tests/FunctionalTests/tickets/protected/pages/Ticket284Component.php -text
tests/FunctionalTests/tickets/protected/pages/Ticket284Component.tpl -text
tests/FunctionalTests/tickets/protected/pages/Ticket285.page -text
+tests/FunctionalTests/tickets/protected/pages/Ticket306.page -text
tests/FunctionalTests/tickets/protected/pages/Ticket311.page -text
tests/FunctionalTests/tickets/protected/pages/Ticket312.page -text
tests/FunctionalTests/tickets/protected/pages/Ticket54.page -text
diff --git a/framework/I18N/core/MessageFormat.php b/framework/I18N/core/MessageFormat.php
index dab7434c..3faa663d 100644
--- a/framework/I18N/core/MessageFormat.php
+++ b/framework/I18N/core/MessageFormat.php
@@ -161,6 +161,10 @@ class MessageFormat
public function format($string,$args=array(), $catalogue=null, $charset=null)
{
if(empty($charset)) $charset = $this->getCharset();
+
+ //force args as UTF-8
+ foreach($args as $k => $v)
+ $args[$k] = I18N_toUTF8($v, $charset);
$s = $this->formatString(I18N_toUTF8($string, $charset),$args,$catalogue);
return I18N_toEncoding($s, $charset);
}
diff --git a/tests/FunctionalTests/tickets/protected/messages/en/messages.xml b/tests/FunctionalTests/tickets/protected/messages/en/messages.xml
new file mode 100644
index 00000000..9b04d076
--- /dev/null
+++ b/tests/FunctionalTests/tickets/protected/messages/en/messages.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+{field} is required.
+Lütfen '{field}' alanını doldurunuz.
+
+
+
+city
+Şehir
+
+
+
+
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket306.page b/tests/FunctionalTests/tickets/protected/pages/Ticket306.page
new file mode 100644
index 00000000..6a202cc6
--- /dev/null
+++ b/tests/FunctionalTests/tickets/protected/pages/Ticket306.page
@@ -0,0 +1,12 @@
+
+
+
+ {field} is required.
+
+
+ city
+
+
+
+
+
\ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/protected/pages/config.xml b/tests/FunctionalTests/tickets/protected/pages/config.xml
index 48a0114c..9404e969 100644
--- a/tests/FunctionalTests/tickets/protected/pages/config.xml
+++ b/tests/FunctionalTests/tickets/protected/pages/config.xml
@@ -4,5 +4,13 @@
+
+
+
+
+
+
\ No newline at end of file
--
cgit v1.2.3