Number parameters in messages that have multiple parameters

Trim trailing whitespace
Leading tabs to spaces
Remove superfluous whitespace
This commit is contained in:
Siebrand Mazeland 2011-08-30 10:56:00 +02:00
parent 0e2d9432b5
commit 3e60d4cb3f
6 changed files with 146 additions and 157 deletions

View File

@ -44,7 +44,6 @@ if (!defined('STATUSNET')) {
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
* @link http://status.net/ * @link http://status.net/
*/ */
class ActivityPlugin extends Plugin class ActivityPlugin extends Plugin
{ {
const VERSION = '0.1'; const VERSION = '0.1';
@ -84,12 +83,12 @@ class ActivityPlugin extends Plugin
if (!empty($user)) { if (!empty($user)) {
$sub = Subscription::pkeyGet(array('subscriber' => $subscriber->id, $sub = Subscription::pkeyGet(array('subscriber' => $subscriber->id,
'subscribed' => $other->id)); 'subscribed' => $other->id));
$rendered = sprintf(_m('<a href="%s">%s</a> started following <a href="%s">%s</a>.'), $rendered = sprintf(_m('<a href="%1$s">%2$s</a> started following <a href="%2$s">%4$s</a>.'),
$subscriber->profileurl, $subscriber->profileurl,
$subscriber->getBestName(), $subscriber->getBestName(),
$other->profileurl, $other->profileurl,
$other->getBestName()); $other->getBestName());
$content = sprintf(_m('%s (%s) started following %s (%s).'), $content = sprintf(_m('%1$s (%2$s) started following %3$s (%4$s).'),
$subscriber->getBestName(), $subscriber->getBestName(),
$subscriber->profileurl, $subscriber->profileurl,
$other->getBestName(), $other->getBestName(),
@ -114,12 +113,12 @@ class ActivityPlugin extends Plugin
if(!$this->StopFollowUser) return true; if(!$this->StopFollowUser) return true;
$user = $subscriber->getUser(); $user = $subscriber->getUser();
if (!empty($user)) { if (!empty($user)) {
$rendered = sprintf(_m('<a href="%s">%s</a> stopped following <a href="%s">%s</a>.'), $rendered = sprintf(_m('<a href="%1$s">%2$s</a> stopped following <a href="%3$s">%4$s</a>.'),
$subscriber->profileurl, $subscriber->profileurl,
$subscriber->getBestName(), $subscriber->getBestName(),
$other->profileurl, $other->profileurl,
$other->getBestName()); $other->getBestName());
$content = sprintf(_m('%s (%s) stopped following %s (%s).'), $content = sprintf(_m('%1$s (%2$s) stopped following %3$s (%4$s).'),
$subscriber->getBestName(), $subscriber->getBestName(),
$subscriber->profileurl, $subscriber->profileurl,
$other->getBestName(), $other->getBestName(),
@ -156,12 +155,12 @@ class ActivityPlugin extends Plugin
$fave = Fave::pkeyGet(array('user_id' => $user->id, $fave = Fave::pkeyGet(array('user_id' => $user->id,
'notice_id' => $notice->id)); 'notice_id' => $notice->id));
$rendered = sprintf(_m('<a href="%s">%s</a> liked <a href="%s">%s\'s update</a>.'), $rendered = sprintf(_m('<a href="%1$s">%2$s</a> liked <a href="%3$s">%4$s\'s update</a>.'),
$profile->profileurl, $profile->profileurl,
$profile->getBestName(), $profile->getBestName(),
$notice->bestUrl(), $notice->bestUrl(),
$author->getBestName()); $author->getBestName());
$content = sprintf(_m('%s (%s) liked %s\'s status (%s)'), $content = sprintf(_m('%1$s (%2$s) liked %3$s\'s status (%4$s)'),
$profile->getBestName(), $profile->getBestName(),
$profile->profileurl, $profile->profileurl,
$author->getBestName(), $author->getBestName(),
@ -189,12 +188,12 @@ class ActivityPlugin extends Plugin
if (!empty($user)) { if (!empty($user)) {
$author = Profile::staticGet('id', $notice->profile_id); $author = Profile::staticGet('id', $notice->profile_id);
$rendered = sprintf(_m('<a href="%s">%s</a> stopped liking <a href="%s">%s\'s update</a>.'), $rendered = sprintf(_m('<a href="%1$s">%2$s</a> stopped liking <a href="%3$s">%4$s\'s update</a>.'),
$profile->profileurl, $profile->profileurl,
$profile->getBestName(), $profile->getBestName(),
$notice->bestUrl(), $notice->bestUrl(),
$author->getBestName()); $author->getBestName());
$content = sprintf(_m('%s (%s) stopped liking %s\'s status (%s)'), $content = sprintf(_m('%1$s (%2$s) stopped liking %3$s\'s status (%4$s)'),
$profile->getBestName(), $profile->getBestName(),
$profile->profileurl, $profile->profileurl,
$author->getBestName(), $author->getBestName(),
@ -230,12 +229,12 @@ class ActivityPlugin extends Plugin
return true; return true;
} }
$rendered = sprintf(_m('<a href="%s">%s</a> joined the group <a href="%s">%s</a>.'), $rendered = sprintf(_m('<a href="%1$s">%2$s</a> joined the group <a href="%3$s">%4$s</a>.'),
$profile->profileurl, $profile->profileurl,
$profile->getBestName(), $profile->getBestName(),
$group->homeUrl(), $group->homeUrl(),
$group->getBestName()); $group->getBestName());
$content = sprintf(_m('%s (%s) joined the group %s (%s).'), $content = sprintf(_m('%1$s (%2$s) joined the group %3$s (%4$s).'),
$profile->getBestName(), $profile->getBestName(),
$profile->profileurl, $profile->profileurl,
$group->getBestName(), $group->getBestName(),
@ -267,12 +266,12 @@ class ActivityPlugin extends Plugin
return true; return true;
} }
$rendered = sprintf(_m('<a href="%s">%s</a> left the group <a href="%s">%s</a>.'), $rendered = sprintf(_m('<a href="%1$s">%2$s</a> left the group <a href="%3$s">%4$s</a>.'),
$profile->profileurl, $profile->profileurl,
$profile->getBestName(), $profile->getBestName(),
$group->homeUrl(), $group->homeUrl(),
$group->getBestName()); $group->getBestName());
$content = sprintf(_m('%s (%s) left the group %s (%s)'), $content = sprintf(_m('%1$s (%2$s) left the group %3$s (%4$s)'),
$profile->getBestName(), $profile->getBestName(),
$profile->profileurl, $profile->profileurl,
$group->getBestName(), $group->getBestName(),
@ -387,6 +386,7 @@ class ActivityPlugin extends Plugin
'author' => 'Evan Prodromou', 'author' => 'Evan Prodromou',
'homepage' => 'http://status.net/wiki/Plugin:Activity', 'homepage' => 'http://status.net/wiki/Plugin:Activity',
'rawdescription' => 'rawdescription' =>
// TRANS: Plugin description.
_m('Emits notices when social activities happen.')); _m('Emits notices when social activities happen.'));
return true; return true;
} }

View File

@ -44,8 +44,6 @@ if (!defined('STATUSNET')) {
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
* @link http://status.net/ * @link http://status.net/
*/ */
class FollowListItem extends SystemListItem class FollowListItem extends SystemListItem
{ {
} }

View File

@ -44,7 +44,6 @@ if (!defined('STATUSNET')) {
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
* @link http://status.net/ * @link http://status.net/
*/ */
class JoinListItem extends SystemListItem class JoinListItem extends SystemListItem
{ {
function showContent() function showContent()
@ -58,7 +57,7 @@ class JoinListItem extends SystemListItem
$out->elementStart('div', 'join-activity'); $out->elementStart('div', 'join-activity');
$profile = $mem->getMember(); $profile = $mem->getMember();
$group = $mem->getGroup(); $group = $mem->getGroup();
$out->raw(sprintf(_m('<a href="%s">%s</a> joined the group <a href="%s">%s</a>.'), $out->raw(sprintf(_m('<a href="%1$s">%2$s</a> joined the group <a href="%3$s">%4$s</a>.'),
$profile->profileurl, $profile->profileurl,
$profile->getBestName(), $profile->getBestName(),
$group->homeUrl(), $group->homeUrl(),
@ -70,4 +69,3 @@ class JoinListItem extends SystemListItem
} }
} }
} }

View File

@ -44,8 +44,6 @@ if (!defined('STATUSNET')) {
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
* @link http://status.net/ * @link http://status.net/
*/ */
class LeaveListItem extends SystemListItem class LeaveListItem extends SystemListItem
{ {
} }

View File

@ -44,7 +44,6 @@ if (!defined('STATUSNET')) {
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
* @link http://status.net/ * @link http://status.net/
*/ */
class SystemListItem extends NoticeListItemAdapter class SystemListItem extends NoticeListItemAdapter
{ {
/** /**
@ -52,7 +51,6 @@ class SystemListItem extends NoticeListItemAdapter
* *
* @return void * @return void
*/ */
function showNotice() function showNotice()
{ {
$out = $this->nli->out; $out = $this->nli->out;

View File

@ -44,7 +44,6 @@ if (!defined('STATUSNET')) {
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
* @link http://status.net/ * @link http://status.net/
*/ */
class UnfollowListItem extends SystemListItem class UnfollowListItem extends SystemListItem
{ {
/** /**
@ -52,7 +51,6 @@ class UnfollowListItem extends SystemListItem
* *
* @return void * @return void
*/ */
function showNotice() function showNotice()
{ {
$out = $this->nli->out; $out = $this->nli->out;
@ -75,4 +73,3 @@ class UnfollowListItem extends SystemListItem
$out->elementEnd('div'); $out->elementEnd('div');
} }
} }