]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/Sample/hello.php
Localisation updates from http://translatewiki.net.
[quix0rs-gnu-social.git] / plugins / Sample / hello.php
index 0cfd8a1c3e9d9eb7e3f33a7e1830cc7ef437db13..da5682b332a0b4e6eadace042f393b725a049df5 100644 (file)
@@ -46,7 +46,6 @@ if (!defined('STATUSNET')) {
  * @license  http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
  * @link     http://status.net/
  */
-
 class HelloAction extends Action
 {
     var $user = null;
@@ -67,7 +66,6 @@ class HelloAction extends Action
      *
      * @return boolean success flag
      */
-
     function prepare($args)
     {
         parent::prepare($args);
@@ -93,7 +91,6 @@ class HelloAction extends Action
      *
      * @return void
      */
-
     function handle($args)
     {
         parent::handle($args);
@@ -108,37 +105,45 @@ class HelloAction extends Action
      *
      * @return string Title of the page
      */
-
     function title()
     {
         if (empty($this->user)) {
+            // TRANS: Page title for sample plugin.
             return _m('Hello');
         } else {
-            return sprintf(_m('Hello, %s'), $this->user->nickname);
+            // TRANS: Page title for sample plugin. %s is a 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'),
+                           // 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'),
-                           sprintf(_m('I have greeted you %d time(s).'),
+                           // 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),
                                    $this->gc->greeting_count));
         }
     }
@@ -158,7 +163,6 @@ class HelloAction extends Action
      *
      * @return boolean is read only action?
      */
-
     function isReadOnly($args)
     {
         return false;