{
// 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;
}
'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;
}
*
* @see DB_DataObject
*/
-
class User_greeting_count extends Memcached_DataObject
{
public $__table = 'user_greeting_count'; // table name
* @param mixed $v Value to lookup
*
* @return User_greeting_count object found, or null for no hits
- *
*/
function staticGet($k, $v=null)
{
$gc = User_greeting_count::staticGet('user_id', $user_id);
if (empty($gc)) {
-
$gc = new User_greeting_count();
$gc->user_id = $user_id;
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 {
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));
}
}
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);
}
}
{
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),