Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixes #6455, adding define for LC_MESSAGES

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@8221 3807eeeb-6ff5-0310-8944-8be069107fe0
  • Loading branch information...
commit 72546f3839bc9c3ccd0c3c29854523a296409360 1 parent 68d333d
gwoo authored
Showing with 19 additions and 12 deletions.
  1. +7 −0 cake/basics.php
  2. +12 −12 cake/tests/cases/basics.test.php
7 cake/basics.php
View
@@ -35,6 +35,13 @@
define('MONTH', 30 * DAY);
define('YEAR', 365 * DAY);
/**
+ * Add constant for LC_MESSAGES because it is not defined on windows
+ */
+ if (!defined('LC_MESSAGES')) {
+ define('LC_MESSAGES', 6);
+ }
+
+/**
* Patch for PHP < 5.0
*/
if (!function_exists('clone')) {
24 cake/tests/cases/basics.test.php
View
@@ -388,16 +388,16 @@ function test__dn() {
function test__c() {
Configure::write('Config.language', 'rule_1_po');
- $result = __c('Plural Rule 1', 5, true);
+ $result = __c('Plural Rule 1', LC_MESSAGES, true);
$expected = 'Plural Rule 1 (translated)';
$this->assertEqual($result, $expected);
- $result = __c('Plural Rule 1 (from core)', 5, true);
+ $result = __c('Plural Rule 1 (from core)', LC_MESSAGES, true);
$expected = 'Plural Rule 1 (from core translated)';
$this->assertEqual($result, $expected);
ob_start();
- __c('Plural Rule 1 (from core)', 5);
+ __c('Plural Rule 1 (from core)', LC_MESSAGES);
$result = ob_get_clean();
$expected = 'Plural Rule 1 (from core translated)';
$this->assertEqual($result, $expected);
@@ -411,24 +411,24 @@ function test__c() {
function test__dc() {
Configure::write('Config.language', 'rule_1_po');
- $result = __dc('default', 'Plural Rule 1', 5, true);
+ $result = __dc('default', 'Plural Rule 1', LC_MESSAGES, true);
$expected = 'Plural Rule 1 (translated)';
$this->assertEqual($result, $expected);
- $result = __dc('default', 'Plural Rule 1 (from core)', 5, true);
+ $result = __dc('default', 'Plural Rule 1 (from core)', LC_MESSAGES, true);
$expected = 'Plural Rule 1 (from core translated)';
$this->assertEqual($result, $expected);
- $result = __dc('core', 'Plural Rule 1', 5, true);
+ $result = __dc('core', 'Plural Rule 1', LC_MESSAGES, true);
$expected = 'Plural Rule 1';
$this->assertEqual($result, $expected);
- $result = __dc('core', 'Plural Rule 1 (from core)', 5, true);
+ $result = __dc('core', 'Plural Rule 1 (from core)', LC_MESSAGES, true);
$expected = 'Plural Rule 1 (from core translated)';
$this->assertEqual($result, $expected);
ob_start();
- __dc('default', 'Plural Rule 1 (from core)', 5);
+ __dc('default', 'Plural Rule 1 (from core)', LC_MESSAGES);
$result = ob_get_clean();
$expected = 'Plural Rule 1 (from core translated)';
$this->assertEqual($result, $expected);
@@ -442,20 +442,20 @@ function test__dc() {
function test__dcn() {
Configure::write('Config.language', 'rule_1_po');
- $result = __dcn('default', '%d = 1', '%d = 0 or > 1', 0, 5, true);
+ $result = __dcn('default', '%d = 1', '%d = 0 or > 1', 0, LC_MESSAGES, true);
$expected = '%d = 0 or > 1 (translated)';
$this->assertEqual($result, $expected);
- $result = __dcn('default', '%d = 1 (from core)', '%d = 0 or > 1 (from core)', 1, 5, true);
+ $result = __dcn('default', '%d = 1 (from core)', '%d = 0 or > 1 (from core)', 1, LC_MESSAGES, true);
$expected = '%d = 1 (from core translated)';
$this->assertEqual($result, $expected);
- $result = __dcn('core', '%d = 1', '%d = 0 or > 1', 0, 5, true);
+ $result = __dcn('core', '%d = 1', '%d = 0 or > 1', 0, LC_MESSAGES, true);
$expected = '%d = 0 or > 1';
$this->assertEqual($result, $expected);
ob_start();
- __dcn('default', '%d = 1 (from core)', '%d = 0 or > 1 (from core)', 1, 5);
+ __dcn('default', '%d = 1 (from core)', '%d = 0 or > 1 (from core)', 1, LC_MESSAGES);
$result = ob_get_clean();
$expected = '%d = 1 (from core translated)';
$this->assertEqual($result, $expected);
Please sign in to comment.
Something went wrong with that request. Please try again.