* @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
* @link http://status.net/
*/
-
class HelloAction extends Action
{
var $user = null;
*
* @return boolean success flag
*/
-
function prepare($args)
{
parent::prepare($args);
*
* @return void
*/
-
function handle($args)
{
parent::handle($args);
*
* @return string Title of the page
*/
-
function title()
{
if (empty($this->user)) {
return _m('Hello');
} else {
- return sprintf(_m('Hello, %s'), $this->user->nickname);
+ return sprintf(_m('Hello, %s!'), $this->user->nickname);
}
}
/**
- * show content in the content area
+ * Show content in the content area
*
* The default StatusNet page has a lot of decorations: menus,
* logos, tabs, all that jazz. This method is used to show
* content in the content area of the page; it's the main
* thing you want to overload.
*
+ * This method also demonstrates use of a plural localized string.
+ *
* @return void
*/
-
function showContent()
{
if (empty($this->user)) {
$this->element('p', array('class' => 'greeting'),
sprintf(_m('Hello, %s'), $this->user->nickname));
$this->element('p', array('class' => 'greeting_count'),
- sprintf(_m('I have greeted you %d time(s).'),
+ sprintf(_m('I have greeted you %d time.',
+ 'I have greeted you %d times.',
+ $this->gc->greeting_count),
$this->gc->greeting_count));
}
}
*
* @return boolean is read only action?
*/
-
function isReadOnly($args)
{
return false;