Update translator documentation and whitespace.

This commit is contained in:
Siebrand Mazeland 2011-06-05 20:23:13 +02:00
parent 4110266b68
commit 8807705bb4
3 changed files with 13 additions and 7 deletions

View File

@ -265,9 +265,11 @@ class SamplePlugin extends Plugin
{ {
// common_local_url() gets the correct URL for the action name // common_local_url() gets the correct URL for the action name
// we provide // we provide
$action->menuItem(common_local_url('hello'), $action->menuItem(common_local_url('hello'),
_m('Hello'), _m('A warm greeting'), false, 'nav_hello'); // TRANS: Menu item in sample plugin.
_m('Hello'),
// TRANS: Menu item title in sample plugin.
_m('A warm greeting'), false, 'nav_hello');
return true; return true;
} }
@ -278,6 +280,7 @@ class SamplePlugin extends Plugin
'author' => 'Brion Vibber, Evan Prodromou', 'author' => 'Brion Vibber, Evan Prodromou',
'homepage' => 'http://status.net/wiki/Plugin:Sample', 'homepage' => 'http://status.net/wiki/Plugin:Sample',
'rawdescription' => 'rawdescription' =>
// TRANS: Plugin description.
_m('A sample plugin to show basics of development for new hackers.')); _m('A sample plugin to show basics of development for new hackers.'));
return true; return true;
} }

View File

@ -52,7 +52,6 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php';
* *
* @see DB_DataObject * @see DB_DataObject
*/ */
class User_greeting_count extends Memcached_DataObject class User_greeting_count extends Memcached_DataObject
{ {
public $__table = 'user_greeting_count'; // table name public $__table = 'user_greeting_count'; // table name
@ -68,7 +67,6 @@ class User_greeting_count extends Memcached_DataObject
* @param mixed $v Value to lookup * @param mixed $v Value to lookup
* *
* @return User_greeting_count object found, or null for no hits * @return User_greeting_count object found, or null for no hits
*
*/ */
function staticGet($k, $v=null) function staticGet($k, $v=null)
{ {
@ -150,7 +148,6 @@ class User_greeting_count extends Memcached_DataObject
$gc = User_greeting_count::staticGet('user_id', $user_id); $gc = User_greeting_count::staticGet('user_id', $user_id);
if (empty($gc)) { if (empty($gc)) {
$gc = new User_greeting_count(); $gc = new User_greeting_count();
$gc->user_id = $user_id; $gc->user_id = $user_id;
@ -161,7 +158,7 @@ class User_greeting_count extends Memcached_DataObject
if (!$result) { if (!$result) {
// TRANS: Exception thrown when the user greeting count could not be saved in the database. // TRANS: Exception thrown when the user greeting count could not be saved in the database.
// TRANS: %d is a user ID (number). // TRANS: %d is a user ID (number).
throw Exception(sprintf(_m("Could not save new greeting count for %d."), throw Exception(sprintf(_m('Could not save new greeting count for %d.'),
$user_id)); $user_id));
} }
} else { } else {
@ -174,7 +171,7 @@ class User_greeting_count extends Memcached_DataObject
if (!$result) { if (!$result) {
// TRANS: Exception thrown when the user greeting count could not be saved in the database. // TRANS: Exception thrown when the user greeting count could not be saved in the database.
// TRANS: %d is a user ID (number). // TRANS: %d is a user ID (number).
throw Exception(sprintf(_m("Could not increment greeting count for %d."), throw Exception(sprintf(_m('Could not increment greeting count for %d.'),
$user_id)); $user_id));
} }
} }

View File

@ -108,8 +108,10 @@ class HelloAction extends Action
function title() function title()
{ {
if (empty($this->user)) { if (empty($this->user)) {
// TRANS: Page title for sample plugin.
return _m('Hello'); return _m('Hello');
} else { } else {
// TRANS: Page title for sample plugin. %s is a user nickname.
return sprintf(_m('Hello, %s!'), $this->user->nickname); return sprintf(_m('Hello, %s!'), $this->user->nickname);
} }
} }
@ -130,11 +132,15 @@ class HelloAction extends Action
{ {
if (empty($this->user)) { if (empty($this->user)) {
$this->element('p', array('class' => 'greeting'), $this->element('p', array('class' => 'greeting'),
// TRANS: Message in sample plugin.
_m('Hello, stranger!')); _m('Hello, stranger!'));
} else { } else {
$this->element('p', array('class' => 'greeting'), $this->element('p', array('class' => 'greeting'),
// TRANS: Message in sample plugin. %s is a user nickname.
sprintf(_m('Hello, %s'), $this->user->nickname)); sprintf(_m('Hello, %s'), $this->user->nickname));
$this->element('p', array('class' => 'greeting_count'), $this->element('p', array('class' => 'greeting_count'),
// TRANS: Message in sample plugin.
// TRANS: %d is the number of times a user is greeted.
sprintf(_m('I have greeted you %d time.', sprintf(_m('I have greeted you %d time.',
'I have greeted you %d times.', 'I have greeted you %d times.',
$this->gc->greeting_count), $this->gc->greeting_count),