Permalink
Browse files

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

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

0 comments on commit 8af5a7f

Please sign in to comment.