Skip to content
This repository
Browse code

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
authored July 05, 2009
7  cake/basics.php
@@ -35,6 +35,13 @@
35 35
 	define('MONTH', 30 * DAY);
36 36
 	define('YEAR', 365 * DAY);
37 37
 /**
  38
+ * Add constant for LC_MESSAGES because it is not defined on windows
  39
+ */
  40
+	if (!defined('LC_MESSAGES')) {
  41
+		define('LC_MESSAGES', 6);
  42
+	}
  43
+
  44
+/**
38 45
  * Patch for PHP < 5.0
39 46
  */
40 47
 if (!function_exists('clone')) {
24  cake/tests/cases/basics.test.php
@@ -388,16 +388,16 @@ function test__dn() {
388 388
 	function test__c() {
389 389
 		Configure::write('Config.language', 'rule_1_po');
390 390
 
391  
-		$result = __c('Plural Rule 1', 5, true);
  391
+		$result = __c('Plural Rule 1', LC_MESSAGES, true);
392 392
 		$expected = 'Plural Rule 1 (translated)';
393 393
 		$this->assertEqual($result, $expected);
394 394
 
395  
-		$result = __c('Plural Rule 1 (from core)', 5, true);
  395
+		$result = __c('Plural Rule 1 (from core)', LC_MESSAGES, true);
396 396
 		$expected = 'Plural Rule 1 (from core translated)';
397 397
 		$this->assertEqual($result, $expected);
398 398
 
399 399
 		ob_start();
400  
-			__c('Plural Rule 1 (from core)', 5);
  400
+			__c('Plural Rule 1 (from core)', LC_MESSAGES);
401 401
 		$result = ob_get_clean();
402 402
 		$expected = 'Plural Rule 1 (from core translated)';
403 403
 		$this->assertEqual($result, $expected);
@@ -411,24 +411,24 @@ function test__c() {
411 411
 	function test__dc() {
412 412
 		Configure::write('Config.language', 'rule_1_po');
413 413
 
414  
-		$result = __dc('default', 'Plural Rule 1', 5, true);
  414
+		$result = __dc('default', 'Plural Rule 1', LC_MESSAGES, true);
415 415
 		$expected = 'Plural Rule 1 (translated)';
416 416
 		$this->assertEqual($result, $expected);
417 417
 
418  
-		$result = __dc('default', 'Plural Rule 1 (from core)', 5, true);
  418
+		$result = __dc('default', 'Plural Rule 1 (from core)', LC_MESSAGES, true);
419 419
 		$expected = 'Plural Rule 1 (from core translated)';
420 420
 		$this->assertEqual($result, $expected);
421 421
 
422  
-		$result = __dc('core', 'Plural Rule 1', 5, true);
  422
+		$result = __dc('core', 'Plural Rule 1', LC_MESSAGES, true);
423 423
 		$expected = 'Plural Rule 1';
424 424
 		$this->assertEqual($result, $expected);
425 425
 
426  
-		$result = __dc('core', 'Plural Rule 1 (from core)', 5, true);
  426
+		$result = __dc('core', 'Plural Rule 1 (from core)', LC_MESSAGES, true);
427 427
 		$expected = 'Plural Rule 1 (from core translated)';
428 428
 		$this->assertEqual($result, $expected);
429 429
 
430 430
 		ob_start();
431  
-			__dc('default', 'Plural Rule 1 (from core)', 5);
  431
+			__dc('default', 'Plural Rule 1 (from core)', LC_MESSAGES);
432 432
 		$result = ob_get_clean();
433 433
 		$expected = 'Plural Rule 1 (from core translated)';
434 434
 		$this->assertEqual($result, $expected);
@@ -442,20 +442,20 @@ function test__dc() {
442 442
 	function test__dcn() {
443 443
 		Configure::write('Config.language', 'rule_1_po');
444 444
 
445  
-		$result = __dcn('default', '%d = 1', '%d = 0 or > 1', 0, 5, true);
  445
+		$result = __dcn('default', '%d = 1', '%d = 0 or > 1', 0, LC_MESSAGES, true);
446 446
 		$expected = '%d = 0 or > 1 (translated)';
447 447
 		$this->assertEqual($result, $expected);
448 448
 
449  
-		$result = __dcn('default', '%d = 1 (from core)', '%d = 0 or > 1 (from core)', 1, 5, true);
  449
+		$result = __dcn('default', '%d = 1 (from core)', '%d = 0 or > 1 (from core)', 1, LC_MESSAGES, true);
450 450
 		$expected = '%d = 1 (from core translated)';
451 451
 		$this->assertEqual($result, $expected);
452 452
 
453  
-		$result = __dcn('core', '%d = 1', '%d = 0 or > 1', 0, 5, true);
  453
+		$result = __dcn('core', '%d = 1', '%d = 0 or > 1', 0, LC_MESSAGES, true);
454 454
 		$expected = '%d = 0 or > 1';
455 455
 		$this->assertEqual($result, $expected);
456 456
 
457 457
 		ob_start();
458  
-			__dcn('default', '%d = 1 (from core)', '%d = 0 or > 1 (from core)', 1, 5);
  458
+			__dcn('default', '%d = 1 (from core)', '%d = 0 or > 1 (from core)', 1, LC_MESSAGES);
459 459
 		$result = ob_get_clean();
460 460
 		$expected = '%d = 1 (from core translated)';
461 461
 		$this->assertEqual($result, $expected);

0 notes on commit 72546f3

Please sign in to comment.
Something went wrong with that request. Please try again.