From 8807705bb4b27c89d6e5367cf6ae0b11d3b65043 Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Sun, 5 Jun 2011 20:23:13 +0200 Subject: [PATCH] Update translator documentation and whitespace. --- plugins/Sample/SamplePlugin.php | 7 +++++-- plugins/Sample/User_greeting_count.php | 7 ++----- plugins/Sample/hello.php | 6 ++++++ 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/plugins/Sample/SamplePlugin.php b/plugins/Sample/SamplePlugin.php index a0d1140f37..5c34d10bd1 100644 --- a/plugins/Sample/SamplePlugin.php +++ b/plugins/Sample/SamplePlugin.php @@ -265,9 +265,11 @@ class SamplePlugin extends Plugin { // common_local_url() gets the correct URL for the action name // we provide - $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; } @@ -278,6 +280,7 @@ class SamplePlugin extends Plugin 'author' => 'Brion Vibber, Evan Prodromou', 'homepage' => 'http://status.net/wiki/Plugin:Sample', 'rawdescription' => + // TRANS: Plugin description. _m('A sample plugin to show basics of development for new hackers.')); return true; } diff --git a/plugins/Sample/User_greeting_count.php b/plugins/Sample/User_greeting_count.php index 38d68c91ed..8128343d81 100644 --- a/plugins/Sample/User_greeting_count.php +++ b/plugins/Sample/User_greeting_count.php @@ -52,7 +52,6 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php'; * * @see DB_DataObject */ - class User_greeting_count extends Memcached_DataObject { public $__table = 'user_greeting_count'; // table name @@ -68,7 +67,6 @@ class User_greeting_count extends Memcached_DataObject * @param mixed $v Value to lookup * * @return User_greeting_count object found, or null for no hits - * */ 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); if (empty($gc)) { - $gc = new User_greeting_count(); $gc->user_id = $user_id; @@ -161,7 +158,7 @@ class User_greeting_count extends Memcached_DataObject if (!$result) { // TRANS: Exception thrown when the user greeting count could not be saved in the database. // 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)); } } else { @@ -174,7 +171,7 @@ class User_greeting_count extends Memcached_DataObject if (!$result) { // TRANS: Exception thrown when the user greeting count could not be saved in the database. // 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)); } } diff --git a/plugins/Sample/hello.php b/plugins/Sample/hello.php index a793ac6de2..da5682b332 100644 --- a/plugins/Sample/hello.php +++ b/plugins/Sample/hello.php @@ -108,8 +108,10 @@ class HelloAction extends Action function title() { if (empty($this->user)) { + // TRANS: Page title for sample plugin. return _m('Hello'); } else { + // TRANS: Page title for sample plugin. %s is a user nickname. return sprintf(_m('Hello, %s!'), $this->user->nickname); } } @@ -130,11 +132,15 @@ class HelloAction extends Action { if (empty($this->user)) { $this->element('p', array('class' => 'greeting'), + // TRANS: Message in sample plugin. _m('Hello, stranger!')); } else { $this->element('p', array('class' => 'greeting'), + // TRANS: Message in sample plugin. %s is a user nickname. sprintf(_m('Hello, %s'), $this->user->nickname)); $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.', 'I have greeted you %d times.', $this->gc->greeting_count), -- 2.39.5