Skip to content
This repository
Browse code

change `Message::shortHands()` to `Message::shorthands()`

  • Loading branch information...
commit 8af5a7f24ed2434d2aec06fc2165fb2fc2d38b54 1 parent 16edb88
GWoo authored February 14, 2010
4  app/config/bootstrap/g11n.php
@@ -15,6 +15,8 @@
15 15
 use \lithium\util\Inflector;
16 16
 use \lithium\util\Validator;
17 17
 use \lithium\net\http\Media;
  18
+use \lithium\action\Dispatcher as ActionDispatcher;
  19
+use \lithium\console\Dispatcher as ConsoleDispatcher;
18 20
 
19 21
 /**
20 22
  * Sets the default timezone used by all date/time functions.
@@ -111,7 +113,7 @@
111 113
  */
112 114
 Media::applyFilter('_handle', function($self, $params, $chain) {
113 115
 	$params['handler'] += array('outputFilters' => array());
114  
-	$params['handler']['outputFilters'] += Message::shortHands();
  116
+	$params['handler']['outputFilters'] += Message::shorthands();
115 117
 	return $chain->next($self, $params, $chain);
116 118
 });
117 119
 
18  libraries/lithium/g11n/Message.php
@@ -17,15 +17,15 @@
17 17
  * The `Message` class is concerned with an aspect of globalizing static message strings
18 18
  * throughout the framework and applications.  When referring to message globalization the
19 19
  * phrase of ""translating a message" is widely used. This leads to the assumption that it's
20  
- * a single step process wheras it' a multi step one. A short description of each step is
  20
+ * a single step process whereas it' a multi step one. A short description of each step is
21 21
  * given here in order to help understanding the purpose of this class through the context
22 22
  * of the process as a whole.
23 23
  *
24  
- *  1. Marking messages as translateable.  `$t()` and `$tn()` (implemented in `shortHands()`)
  24
+ *  1. Marking messages as translatable.  `$t()` and `$tn()` (implemented in `shorthands()`)
25 25
  *     are recognized as message marking and picked up by the extraction parser.
26 26
  *
27 27
  *  2. Extracting marked messages.  Messages can be extracted through the `g11n`
28  
- *     command which in turn utilizes the `Catalog` class with the builtin `Code`
  28
+ *     command which in turn utilizes the `Catalog` class with the built-in `Code`
29 29
  *     adapter or other custom adapters which are concerned with extracting
30 30
  *     translatable content.
31 31
  *
@@ -73,9 +73,11 @@ class Message extends \lithium\core\StaticObject {
73 73
 	 *              - `'count'`: Used to determine the correct plural form.
74 74
 	 *              - `'locale'`: The target locale, defaults to current locale.
75 75
 	 *              - `'scope'`: The scope of the message.
76  
-	 *              - `'default'`: Is used as a fall back if `_translated()` returns without a result.
  76
+	 *              - `'default'`: Is used as a fall back if `_translated()` returns
  77
+	 *                             without a result.
77 78
 	 *              - `'noop'`: If `true` no whatsoever lookup takes place.
78  
-	 * @return string|void The translation or the value of the `'default'` option if none could be found.
  79
+	 * @return string|void The translation or the value of the `'default'` option if none
  80
+	 *                     could be found.
79 81
 	 * @see lithium\util\String::insert()
80 82
 	 */
81 83
 	public static function translate($id, $options = array()) {
@@ -101,7 +103,7 @@ public static function translate($id, $options = array()) {
101 103
 
102 104
 	/**
103 105
 	 * Returns an array containing named closures which are short-hand aliases for `translate()`.
104  
-	 * They can be embeded as content filters in the templating layer using a filter for
  106
+	 * They can be embedded as content filters in the template layer using a filter for
105 107
 	 * `Media::_handle()` or be used in other places where needed.
106 108
 	 *
107 109
 	 * Usage:
@@ -113,7 +115,7 @@ public static function translate($id, $options = array()) {
113 115
 	 * Using in a method:
114 116
 	 * {{{
115 117
 	 * 	public function index() {
116  
-	 * 		extract(Message::shortHands());
  118
+	 * 		extract(Message::shorthands());
117 119
 	 * 		$notice = $t('look');
118 120
 	 * 	}
119 121
 	 * }}}
@@ -121,7 +123,7 @@ public static function translate($id, $options = array()) {
121 123
 	 * @return array Named short-hand (`'t'` and `'tn'`) translation functions.
122 124
 	 * @see lithium\net\http\Media::_handle()
123 125
 	 */
124  
-	public static function shortHands() {
  126
+	public static function shorthands() {
125 127
 		$t = function($message, $options = array()) {
126 128
 			return Message::translate($message, $options + array('default' => $message));
127 129
 		};
2  libraries/lithium/template/readme.wiki
Source Rendered
@@ -22,7 +22,7 @@ One special case situation to take _important_ note of, is the use of
22 22
 `<?=$this->foo()?>`. In this scenario, the code is translated to
23 23
 `<?php echo $this->foo(); ?>` rather than being filtered through `$h()` as with
24 24
 the former explanation. When direct access to a method or property on `$this` is
25  
-contained in the shorthand syntax, it will be output as normal without being
  25
+contained in the shorthands syntax, it will be output as normal without being
26 26
 filtered. This is to make it easier to work with helpers that return markup.
27 27
 
28 28
 An example would be something like: {{{
6  libraries/lithium/tests/cases/g11n/MessageTest.php
@@ -177,7 +177,7 @@ public function testShortHandsBasic() {
177 177
 		);
178 178
 		Catalog::write('message', 'de', $data, array('name' => 'runtime'));
179 179
 
180  
-		$filters = Message::shortHands();
  180
+		$filters = Message::shorthands();
181 181
 		$t = $filters['t'];
182 182
 		$tn = $filters['tn'];
183 183
 
@@ -200,7 +200,7 @@ public function testShortHandsSymmetry() {
200 200
 		);
201 201
 		Catalog::write('message', 'de', $data, array('name' => 'runtime'));
202 202
 
203  
-		$filters = Message::shortHands();
  203
+		$filters = Message::shorthands();
204 204
 		$t = $filters['t'];
205 205
 		$tn = $filters['tn'];
206 206
 
@@ -218,7 +218,7 @@ public function testShortHandsSymmetry() {
218 218
 	}
219 219
 
220 220
 	public function testShortHandsAsymmetry() {
221  
-		$filters = Message::shortHands();
  221
+		$filters = Message::shorthands();
222 222
 		$t = $filters['t'];
223 223
 		$tn = $filters['tn'];
224 224
 

0 notes on commit 8af5a7f

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