]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Alternate pretty-title tweaks for #2668
authorBrion Vibber <brion@pobox.com>
Tue, 2 Nov 2010 20:42:33 +0000 (13:42 -0700)
committerBrion Vibber <brion@pobox.com>
Tue, 2 Nov 2010 20:42:44 +0000 (13:42 -0700)
actions/showstream.php
classes/Profile.php

index fb5b061fbe3031ef725aeb23710c9e22c2800bab..de66bc415aa0cf3c318264abddd6aca704d7e796 100644 (file)
@@ -63,18 +63,16 @@ class ShowstreamAction extends ProfileAction
 
     function title()
     {
-        if (!empty($this->profile->fullname)) {
-            $base = $this->profile->fullname . ' (' . $this->user->nickname . ') ';
-        } else {
-            $base = $this->user->nickname;
-        }
+        $base = $this->profile->getFancyName();
         if (!empty($this->tag)) {
-            $base .= sprintf(_(' tagged %s'), $this->tag);
+            // TRANS: Page title showing tagged notices in one user's stream. Param 1 is the username, 2 is the hash tag.
+            $base = sprintf(_('%1$s tagged %2$s'), $base, $this->tag);
         }
 
         if ($this->page == 1) {
             return $base;
         } else {
+            // TRANS: Extended page title showing tagged notices in one user's stream. Param 1 is the main title clause; 2 is the page number.
             return sprintf(_('%1$s, page %2$d'),
                            $base,
                            $this->page);
index 37d2c571f9391a265666aa4417bfcba3fb9fd766..064ba551c4bf6de46047989e3b7a3cad8dba1a70 100644 (file)
@@ -141,11 +141,32 @@ class Profile extends Memcached_DataObject
         return true;
     }
 
+    /**
+     * Gets either the full name (if filled) or the nickname.
+     *
+     * @return string
+     */
     function getBestName()
     {
         return ($this->fullname) ? $this->fullname : $this->nickname;
     }
 
+    /**
+     * Gets the full name (if filled) with nickname as a parenthetical, or the nickname alone
+     * if no fullname is provided.
+     *
+     * @return string
+     */
+    function getFancyName()
+    {
+        if ($this->fullname) {
+            // TRANS: Full name of a profile or group followed by nickname in parens
+            return sprintf(_('%1$s (%2$s)'), $this->fullname, $this->nickname);
+        } else {
+            return $this->nickname;
+        }
+    }
+
     /**
      * Get the most recent notice posted by this user, if any.
      *