From: Adrian Lang Date: Mon, 2 Feb 2009 00:43:41 +0000 (+0100) Subject: Fix #81: Profile and personal shows „you“ instead of username when looking at own... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=68a3139d0b86a2a716b24a481e677aa5d4699396;p=quix0rs-gnu-social.git Fix #81: Profile and personal shows „you“ instead of username when looking at own profile / personal. While doing so I fixed a wrong gettext usage were the result was not sprintf'd, but concat'd. --- diff --git a/actions/all.php b/actions/all.php index 428466f243..b03ad7ec36 100644 --- a/actions/all.php +++ b/actions/all.php @@ -101,4 +101,15 @@ class AllAction extends Action $this->pagination($this->page > 1, $cnt > NOTICES_PER_PAGE, $this->page, 'all', array('nickname' => $this->user->nickname)); } + + function showPageTitle() + { + $user =& common_current_user(); + if ($user && ($user->id == $this->user->id)) { + $this->element('h1', NULL, _("You and friends")); + } else { + $this->element('h1', NULL, sprintf(_('%s and friends'), $this->user->nickname)); + } + } + } diff --git a/actions/showstream.php b/actions/showstream.php index 90ffcacf9a..4b16799697 100644 --- a/actions/showstream.php +++ b/actions/showstream.php @@ -140,7 +140,12 @@ class ShowstreamAction extends Action function showPageTitle() { - $this->element('h1', NULL, $this->profile->nickname._("'s profile")); + $user =& common_current_user(); + if ($user && ($user->id == $this->profile->id)) { + $this->element('h1', NULL, _("Your profile")); + } else { + $this->element('h1', NULL, sprintf(_('%s\'s profile'), $this->profile->nickname)); + } } function showPageNoticeBlock()