Skip to content

Commit 28eae99

Browse files
author
AD7six
committed
translation changes in the view folder
1 parent e2dfafd commit 28eae99

33 files changed

+261
-261
lines changed

lib/Cake/View/Helper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public function __construct(View $View, $settings = array()) {
124124
* @param array $params Array of params for the method.
125125
*/
126126
public function __call($method, $params) {
127-
trigger_error(__('Method %1$s::%2$s does not exist', get_class($this), $method), E_USER_WARNING);
127+
trigger_error(__d('cake', 'Method %1$s::%2$s does not exist', get_class($this), $method), E_USER_WARNING);
128128
}
129129

130130
/**

lib/Cake/View/Helper/FormHelper.php

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ public function end($options = null) {
367367
$submitOptions = $options;
368368

369369
if (!$submit) {
370-
$submit = __('Submit');
370+
$submit = __d('cake', 'Submit');
371371
}
372372
}
373373
$out .= $this->submit($submit, $submitOptions);
@@ -509,7 +509,7 @@ public function error($field, $text = null, $options = array()) {
509509
if ($text != null) {
510510
$error = $text;
511511
} elseif (is_numeric($error)) {
512-
$error = __('Error in field %s', Inflector::humanize($this->field()));
512+
$error = __d('cake', 'Error in field %s', Inflector::humanize($this->field()));
513513
}
514514
if ($options['escape']) {
515515
$error = h($error);
@@ -552,7 +552,7 @@ function label($fieldName = null, $text = null, $options = array()) {
552552
if (substr($text, -3) == '_id') {
553553
$text = substr($text, 0, strlen($text) - 3);
554554
}
555-
$text = __(Inflector::humanize(Inflector::underscore($text)));
555+
$text = __d('cake', Inflector::humanize(Inflector::underscore($text)));
556556
}
557557

558558
if (is_string($options)) {
@@ -621,16 +621,16 @@ public function inputs($fields = null, $blacklist = null) {
621621
}
622622

623623
if ($legend === true) {
624-
$actionName = __('New %s');
624+
$actionName = __d('cake', 'New %s');
625625
$isEdit = (
626626
strpos($this->request->params['action'], 'update') !== false ||
627627
strpos($this->request->params['action'], 'edit') !== false
628628
);
629629
if ($isEdit) {
630-
$actionName = __('Edit %s');
630+
$actionName = __d('cake', 'Edit %s');
631631
}
632632
$modelName = Inflector::humanize(Inflector::underscore($model));
633-
$legend = sprintf($actionName, __($modelName));
633+
$legend = sprintf($actionName, __d('cake', $modelName));
634634
}
635635

636636
$out = null;
@@ -1046,7 +1046,7 @@ public function radio($fieldName, $options = array(), $attributes = array()) {
10461046
$legend = $attributes['legend'];
10471047
unset($attributes['legend']);
10481048
} elseif (count($options) > 1) {
1049-
$legend = __(Inflector::humanize($this->field()));
1049+
$legend = __d('cake', Inflector::humanize($this->field()));
10501050
}
10511051
$label = true;
10521052

@@ -1131,7 +1131,7 @@ public function radio($fieldName, $options = array(), $attributes = array()) {
11311131
public function __call($method, $params) {
11321132
$options = array();
11331133
if (empty($params)) {
1134-
throw new CakeException(__('Missing field name for FormHelper::%s', $method));
1134+
throw new CakeException(__d('cake', 'Missing field name for FormHelper::%s', $method));
11351135
}
11361136
if (isset($params[1])) {
11371137
$options = $params[1];
@@ -1347,7 +1347,7 @@ public function postLink($title, $url = null, $options = array(), $confirmMessag
13471347
*/
13481348
public function submit($caption = null, $options = array()) {
13491349
if (!$caption) {
1350-
$caption = __('Submit');
1350+
$caption = __d('cake', 'Submit');
13511351
}
13521352
$out = null;
13531353
$div = true;
@@ -2139,18 +2139,18 @@ function __generateOptions($name, $options = array()) {
21392139
break;
21402140
case 'month':
21412141
if ($options['monthNames'] === true) {
2142-
$data['01'] = __('January');
2143-
$data['02'] = __('February');
2144-
$data['03'] = __('March');
2145-
$data['04'] = __('April');
2146-
$data['05'] = __('May');
2147-
$data['06'] = __('June');
2148-
$data['07'] = __('July');
2149-
$data['08'] = __('August');
2150-
$data['09'] = __('September');
2151-
$data['10'] = __('October');
2152-
$data['11'] = __('November');
2153-
$data['12'] = __('December');
2142+
$data['01'] = __d('cake', 'January');
2143+
$data['02'] = __d('cake', 'February');
2144+
$data['03'] = __d('cake', 'March');
2145+
$data['04'] = __d('cake', 'April');
2146+
$data['05'] = __d('cake', 'May');
2147+
$data['06'] = __d('cake', 'June');
2148+
$data['07'] = __d('cake', 'July');
2149+
$data['08'] = __d('cake', 'August');
2150+
$data['09'] = __d('cake', 'September');
2151+
$data['10'] = __d('cake', 'October');
2152+
$data['11'] = __d('cake', 'November');
2153+
$data['12'] = __d('cake', 'December');
21542154
} else if (is_array($options['monthNames'])) {
21552155
$data = $options['monthNames'];
21562156
} else {

lib/Cake/View/Helper/HtmlHelper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -940,13 +940,13 @@ public function loadConfig($configFile, $path = CONFIGS) {
940940
$reader = $configFile[1];
941941
}
942942
} else {
943-
throw new ConfigureException(__('Cannot load the configuration file. Wrong "configFile" configuration.'));
943+
throw new ConfigureException(__d('cake', 'Cannot load the configuration file. Wrong "configFile" configuration.'));
944944
}
945945

946946
$readerClass = Inflector::camelize($reader) . 'Reader';
947947
App::uses($readerClass, 'Configure');
948948
if (!class_exists($readerClass)) {
949-
throw new ConfigureException(__('Cannot load the configuration file. Unknown reader.'));
949+
throw new ConfigureException(__d('cake', 'Cannot load the configuration file. Unknown reader.'));
950950
}
951951

952952
$readerObj = new $readerClass($path);

lib/Cake/View/Helper/JsHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ public function __call($method, $params) {
153153
if (method_exists($this, $method . '_')) {
154154
return call_user_func(array(&$this, $method . '_'), $params);
155155
}
156-
trigger_error(__('JsHelper:: Missing Method %s is undefined', $method), E_USER_WARNING);
156+
trigger_error(__d('cake', 'JsHelper:: Missing Method %s is undefined', $method), E_USER_WARNING);
157157
}
158158

159159
/**

lib/Cake/View/Helper/MootoolsEngineHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ function drag($options = array()) {
307307
function drop($options = array()) {
308308
if (empty($options['drag'])) {
309309
trigger_error(
310-
__('MootoolsEngine::drop() requires a "drag" option to properly function'), E_USER_WARNING
310+
__d('cake', 'MootoolsEngine::drop() requires a "drag" option to properly function'), E_USER_WARNING
311311
);
312312
return false;
313313
}

lib/Cake/View/Helper/NumberHelper.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,15 @@ public function precision($number, $precision = 3) {
8888
public function toReadableSize($size) {
8989
switch (true) {
9090
case $size < 1024:
91-
return __n('%d Byte', '%d Bytes', $size, $size);
91+
return __dn('cake', '%d Byte', '%d Bytes', $size, $size);
9292
case round($size / 1024) < 1024:
93-
return __('%d KB', $this->precision($size / 1024, 0));
93+
return __d('cake', '%d KB', $this->precision($size / 1024, 0));
9494
case round($size / 1024 / 1024, 2) < 1024:
95-
return __('%.2f MB', $this->precision($size / 1024 / 1024, 2));
95+
return __d('cake', '%.2f MB', $this->precision($size / 1024 / 1024, 2));
9696
case round($size / 1024 / 1024 / 1024, 2) < 1024:
97-
return __('%.2f GB', $this->precision($size / 1024 / 1024 / 1024, 2));
97+
return __d('cake', '%.2f GB', $this->precision($size / 1024 / 1024 / 1024, 2));
9898
default:
99-
return __('%.2f TB', $this->precision($size / 1024 / 1024 / 1024 / 1024, 2));
99+
return __d('cake', '%.2f TB', $this->precision($size / 1024 / 1024 / 1024 / 1024, 2));
100100
}
101101
}
102102

lib/Cake/View/Helper/PaginatorHelper.php

100755100644
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ function __construct(View $View, $settings = array()) {
102102
$classname = $ajaxProvider . 'Helper';
103103
if (!method_exists($classname, 'link')) {
104104
throw new CakeException(sprintf(
105-
__('%s does not implement a link() method, it is incompatible with PaginatorHelper'), $classname
105+
__d('cake', '%s does not implement a link() method, it is incompatible with PaginatorHelper'), $classname
106106
));
107107
}
108108
parent::__construct($View, $settings);
@@ -306,7 +306,7 @@ public function sort($key, $title = null, $options = array()) {
306306

307307
if (empty($title)) {
308308
$title = $key;
309-
$title = __(Inflector::humanize(preg_replace('/_id$/', '', $title)));
309+
$title = __d('cake', Inflector::humanize(preg_replace('/_id$/', '', $title)));
310310
}
311311
$dir = isset($options['direction']) ? $options['direction'] : 'asc';
312312
unset($options['direction']);
@@ -553,7 +553,7 @@ public function counter($options = array()) {
553553
array(
554554
'model' => $this->defaultModel(),
555555
'format' => 'pages',
556-
'separator' => __(' of ')
556+
'separator' => __d('cake', ' of ')
557557
),
558558
$options);
559559

lib/Cake/View/Helper/TimeHelper.php

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -82,19 +82,19 @@ public function convertSpecifiers($format, $time = null) {
8282
private function __translateSpecifier($specifier) {
8383
switch ($specifier[1]) {
8484
case 'a':
85-
$abday = __c('abday', 5);
85+
$abday = __cn('cake', 'abday', 5);
8686
if (is_array($abday)) {
8787
return $abday[date('w', $this->__time)];
8888
}
8989
break;
9090
case 'A':
91-
$day = __c('day', 5);
91+
$day = __cn('cake', 'day', 5);
9292
if (is_array($day)) {
9393
return $day[date('w', $this->__time)];
9494
}
9595
break;
9696
case 'c':
97-
$format = __c('d_t_fmt', 5);
97+
$format = __cn('cake', 'd_t_fmt', 5);
9898
if ($format != 'd_t_fmt') {
9999
return $this->convertSpecifiers($format, $this->__time);
100100
}
@@ -116,13 +116,13 @@ private function __translateSpecifier($specifier) {
116116
return date('jS', $this->__time);
117117
case 'b':
118118
case 'h':
119-
$months = __c('abmon', 5);
119+
$months = __cn('cake', 'abmon', 5);
120120
if (is_array($months)) {
121121
return $months[date('n', $this->__time) -1];
122122
}
123123
return '%b';
124124
case 'B':
125-
$months = __c('mon', 5);
125+
$months = __cn('cake', 'mon', 5);
126126
if (is_array($months)) {
127127
return $months[date('n', $this->__time) -1];
128128
}
@@ -133,14 +133,14 @@ private function __translateSpecifier($specifier) {
133133
case 'P':
134134
$default = array('am' => 0, 'pm' => 1);
135135
$meridiem = $default[date('a',$this->__time)];
136-
$format = __c('am_pm', 5);
136+
$format = __cn('cake', 'am_pm', 5);
137137
if (is_array($format)) {
138138
$meridiem = $format[$meridiem];
139139
return ($specifier[1] == 'P') ? strtolower($meridiem) : strtoupper($meridiem);
140140
}
141141
break;
142142
case 'r':
143-
$complete = __c('t_fmt_ampm', 5);
143+
$complete = __cn('cake', 't_fmt_ampm', 5);
144144
if ($complete != 't_fmt_ampm') {
145145
return str_replace('%p',$this->__translateSpecifier(array('%p', 'p')),$complete);
146146
}
@@ -154,13 +154,13 @@ private function __translateSpecifier($specifier) {
154154
case 'u':
155155
return ($weekDay = date('w', $this->__time)) ? $weekDay : 7;
156156
case 'x':
157-
$format = __c('d_fmt', 5);
157+
$format = __cn('cake', 'd_fmt', 5);
158158
if ($format != 'd_fmt') {
159159
return $this->convertSpecifiers($format, $this->__time);
160160
}
161161
break;
162162
case 'X':
163-
$format = __c('t_fmt', 5);
163+
$format = __cn('cake', 't_fmt', 5);
164164
if ($format != 't_fmt') {
165165
return $this->convertSpecifiers($format, $this->__time);
166166
}
@@ -265,9 +265,9 @@ public function niceShort($dateString = null, $userOffset = null) {
265265
$y = $this->isThisYear($date) ? '' : ' %Y';
266266

267267
if ($this->isToday($dateString, $userOffset)) {
268-
$ret = __('Today, %s', strftime("%H:%M", $date));
268+
$ret = __d('cake', 'Today, %s', strftime("%H:%M", $date));
269269
} elseif ($this->wasYesterday($dateString, $userOffset)) {
270-
$ret = __('Yesterday, %s', strftime("%H:%M", $date));
270+
$ret = __d('cake', 'Yesterday, %s', strftime("%H:%M", $date));
271271
} else {
272272
$format = $this->convertSpecifiers("%b %eS{$y}, %H:%M", $date);
273273
$ret = strftime($format, $date);
@@ -614,41 +614,41 @@ public function timeAgoInWords($dateTime, $options = array()) {
614614
$diff = $futureTime - $pastTime;
615615

616616
if ($diff > abs($now - $this->fromString($end))) {
617-
$relativeDate = __('on %s', date($format, $inSeconds));
617+
$relativeDate = __d('cake', 'on %s', date($format, $inSeconds));
618618
} else {
619619
if ($years > 0) {
620620
// years and months and days
621-
$relativeDate .= ($relativeDate ? ', ' : '') . $years . ' ' . __n('year', 'years', $years);
622-
$relativeDate .= $months > 0 ? ($relativeDate ? ', ' : '') . $months . ' ' . __n('month', 'months', $months) : '';
623-
$relativeDate .= $weeks > 0 ? ($relativeDate ? ', ' : '') . $weeks . ' ' . __n('week', 'weeks', $weeks) : '';
624-
$relativeDate .= $days > 0 ? ($relativeDate ? ', ' : '') . $days . ' ' . __n('day', 'days', $days) : '';
621+
$relativeDate .= ($relativeDate ? ', ' : '') . $years . ' ' . __dn('cake', 'year', 'years', $years);
622+
$relativeDate .= $months > 0 ? ($relativeDate ? ', ' : '') . $months . ' ' . __dn('cake', 'month', 'months', $months) : '';
623+
$relativeDate .= $weeks > 0 ? ($relativeDate ? ', ' : '') . $weeks . ' ' . __dn('cake', 'week', 'weeks', $weeks) : '';
624+
$relativeDate .= $days > 0 ? ($relativeDate ? ', ' : '') . $days . ' ' . __dn('cake', 'day', 'days', $days) : '';
625625
} elseif (abs($months) > 0) {
626626
// months, weeks and days
627-
$relativeDate .= ($relativeDate ? ', ' : '') . $months . ' ' . __n('month', 'months', $months);
628-
$relativeDate .= $weeks > 0 ? ($relativeDate ? ', ' : '') . $weeks . ' ' . __n('week', 'weeks', $weeks) : '';
629-
$relativeDate .= $days > 0 ? ($relativeDate ? ', ' : '') . $days . ' ' . __n('day', 'days', $days) : '';
627+
$relativeDate .= ($relativeDate ? ', ' : '') . $months . ' ' . __dn('cake', 'month', 'months', $months);
628+
$relativeDate .= $weeks > 0 ? ($relativeDate ? ', ' : '') . $weeks . ' ' . __dn('cake', 'week', 'weeks', $weeks) : '';
629+
$relativeDate .= $days > 0 ? ($relativeDate ? ', ' : '') . $days . ' ' . __dn('cake', 'day', 'days', $days) : '';
630630
} elseif (abs($weeks) > 0) {
631631
// weeks and days
632-
$relativeDate .= ($relativeDate ? ', ' : '') . $weeks . ' ' . __n('week', 'weeks', $weeks);
633-
$relativeDate .= $days > 0 ? ($relativeDate ? ', ' : '') . $days . ' ' . __n('day', 'days', $days) : '';
632+
$relativeDate .= ($relativeDate ? ', ' : '') . $weeks . ' ' . __dn('cake', 'week', 'weeks', $weeks);
633+
$relativeDate .= $days > 0 ? ($relativeDate ? ', ' : '') . $days . ' ' . __dn('cake', 'day', 'days', $days) : '';
634634
} elseif (abs($days) > 0) {
635635
// days and hours
636-
$relativeDate .= ($relativeDate ? ', ' : '') . $days . ' ' . __n('day', 'days', $days);
637-
$relativeDate .= $hours > 0 ? ($relativeDate ? ', ' : '') . $hours . ' ' . __n('hour', 'hours', $hours) : '';
636+
$relativeDate .= ($relativeDate ? ', ' : '') . $days . ' ' . __dn('cake', 'day', 'days', $days);
637+
$relativeDate .= $hours > 0 ? ($relativeDate ? ', ' : '') . $hours . ' ' . __dn('cake', 'hour', 'hours', $hours) : '';
638638
} elseif (abs($hours) > 0) {
639639
// hours and minutes
640-
$relativeDate .= ($relativeDate ? ', ' : '') . $hours . ' ' . __n('hour', 'hours', $hours);
641-
$relativeDate .= $minutes > 0 ? ($relativeDate ? ', ' : '') . $minutes . ' ' . __n('minute', 'minutes', $minutes) : '';
640+
$relativeDate .= ($relativeDate ? ', ' : '') . $hours . ' ' . __dn('cake', 'hour', 'hours', $hours);
641+
$relativeDate .= $minutes > 0 ? ($relativeDate ? ', ' : '') . $minutes . ' ' . __dn('cake', 'minute', 'minutes', $minutes) : '';
642642
} elseif (abs($minutes) > 0) {
643643
// minutes only
644-
$relativeDate .= ($relativeDate ? ', ' : '') . $minutes . ' ' . __n('minute', 'minutes', $minutes);
644+
$relativeDate .= ($relativeDate ? ', ' : '') . $minutes . ' ' . __dn('cake', 'minute', 'minutes', $minutes);
645645
} else {
646646
// seconds only
647-
$relativeDate .= ($relativeDate ? ', ' : '') . $seconds . ' ' . __n('second', 'seconds', $seconds);
647+
$relativeDate .= ($relativeDate ? ', ' : '') . $seconds . ' ' . __dn('cake', 'second', 'seconds', $seconds);
648648
}
649649

650650
if (!$backwards) {
651-
$relativeDate = __('%s ago', $relativeDate);
651+
$relativeDate = __d('cake', '%s ago', $relativeDate);
652652
}
653653
}
654654
return $relativeDate;
@@ -668,7 +668,7 @@ public function timeAgoInWords($dateTime, $options = array()) {
668668
public function wasWithinLast($timeInterval, $dateString, $userOffset = null) {
669669
$tmp = str_replace(' ', '', $timeInterval);
670670
if (is_numeric($tmp)) {
671-
$timeInterval = $tmp . ' ' . __('days');
671+
$timeInterval = $tmp . ' ' . __d('cake', 'days');
672672
}
673673

674674
$date = $this->fromString($dateString, $userOffset);

lib/Cake/View/View.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ public function render($view = null, $layout = null) {
396396
$layout = $this->layout;
397397
}
398398
if ($this->output === false) {
399-
throw new CakeException(__("Error in view %s, got no content.", $viewFileName));
399+
throw new CakeException(__d('cake', "Error in view %s, got no content.", $viewFileName));
400400
}
401401
if ($layout && $this->autoLayout) {
402402
$this->output = $this->renderLayout($this->output, $layout);
@@ -439,7 +439,7 @@ public function renderLayout($content_for_layout, $layout = null) {
439439
$this->output = $this->_render($layoutFileName);
440440

441441
if ($this->output === false) {
442-
throw new CakeException(__("Error in layout %s, got no content.", $layoutFileName));
442+
throw new CakeException(__d('cake', "Error in layout %s, got no content.", $layoutFileName));
443443
}
444444

445445
$this->Helpers->trigger('afterLayout', array($layoutFileName));

lib/Cake/View/errors/error400.ctp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
?>
1919
<h2><?php echo $name; ?></h2>
2020
<p class="error">
21-
<strong><?php echo __('Error'); ?>: </strong>
21+
<strong><?php echo __d('cake', 'Error'); ?>: </strong>
2222
<?php printf(
23-
__('The requested address %s was not found on this server.'),
23+
__d('cake', 'The requested address %s was not found on this server.'),
2424
"<strong>'{$url}'</strong>"
2525
); ?>
2626
</p>

lib/Cake/View/errors/error500.ctp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
?>
1919
<h2><?php echo $name; ?></h2>
2020
<p class="error">
21-
<strong><?php echo __('Error'); ?>: </strong>
22-
<?php echo __('An Internal Error Has Occurred.'); ?>
21+
<strong><?php echo __d('cake', 'Error'); ?>: </strong>
22+
<?php echo __d('cake', 'An Internal Error Has Occurred.'); ?>
2323
</p>
2424
<?php
2525
if (Configure::read('debug') > 0 ):

0 commit comments

Comments
 (0)