From 5e97047f8ff328e514ae84760692e43190f131e6 Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Thu, 21 Apr 2011 20:26:58 +0200 Subject: [PATCH] Update translator documentation. i18n fixes. Whitespace updates. --- lib/microappplugin.php | 7 ++++--- lib/noticelistitemadapter.php | 4 +--- plugins/Event/EventPlugin.php | 3 ++- plugins/Event/eventlistitem.php | 8 ++++---- plugins/Event/newrsvp.php | 4 ++-- plugins/Event/rsvplistitem.php | 6 +++--- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/lib/microappplugin.php b/lib/microappplugin.php index bd8558a35f..1dfb90036e 100644 --- a/lib/microappplugin.php +++ b/lib/microappplugin.php @@ -390,7 +390,7 @@ abstract class MicroAppPlugin extends Plugin $uri = $target->getUri(); if (!in_array($uri, $activity->context->attention)) { // @todo FIXME: please document (i18n). - // TRANS: Client exception. + // TRANS: Client exception thrown when ... throw new ClientException(_('Bookmark not posted to this group.')); } } else if ($target instanceof User) { @@ -404,7 +404,7 @@ abstract class MicroAppPlugin extends Plugin (empty($original) || $original->profile_id != $target->id)) { // @todo FIXME: Please document (i18n). - // TRANS: Client exception. + // TRANS: Client exception when ... throw new ClientException(_('Object not posted to this user.')); } } else { @@ -550,6 +550,7 @@ abstract class MicroAppPlugin extends Plugin function showNotice($notice, $out) { - throw new ServerException("You must implement either adaptNoticeListItem() or showNotice()"); + // TRANS: Server exception thrown when a micro app plugin developer has not done his job too well. + throw new ServerException(_('You must implement either adaptNoticeListItem() or showNotice().')); } } diff --git a/lib/noticelistitemadapter.php b/lib/noticelistitemadapter.php index 48530a9c1a..fc230e8e3f 100644 --- a/lib/noticelistitemadapter.php +++ b/lib/noticelistitemadapter.php @@ -4,7 +4,7 @@ * Copyright (C) 2011, StatusNet, Inc. * * For use by microapps to customize notice list item output - * + * * PHP version 5 * * This program is free software: you can redistribute it and/or modify @@ -44,7 +44,6 @@ if (!defined('STATUSNET')) { * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 * @link http://status.net/ */ - class NoticeListItemAdapter { protected $nli; @@ -54,7 +53,6 @@ class NoticeListItemAdapter * * @param NoticeListItem $nli item to wrap */ - function __construct($nli) { $this->nli = $nli; diff --git a/plugins/Event/EventPlugin.php b/plugins/Event/EventPlugin.php index a9644e7a2c..dd7ce7a849 100644 --- a/plugins/Event/EventPlugin.php +++ b/plugins/Event/EventPlugin.php @@ -165,7 +165,8 @@ class EventPlugin extends MicroappPlugin function saveNoticeFromActivity($activity, $actor, $options=array()) { if (count($activity->objects) != 1) { - throw new Exception(_('Too many activity objects.')); + // TRANS: Exception thrown when there are too many activity objects. + throw new Exception(_m('Too many activity objects.')); } $happeningObj = $activity->objects[0]; diff --git a/plugins/Event/eventlistitem.php b/plugins/Event/eventlistitem.php index fa44223772..9bf34e765b 100644 --- a/plugins/Event/eventlistitem.php +++ b/plugins/Event/eventlistitem.php @@ -4,7 +4,7 @@ * Copyright (C) 2011, StatusNet, Inc. * * Notice-list representation of an event - * + * * PHP version 5 * * This program is free software: you can redistribute it and/or modify @@ -44,7 +44,6 @@ if (!defined('STATUSNET')) { * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 * @link http://status.net/ */ - class EventListItem extends NoticeListItemAdapter { function showNotice() @@ -64,7 +63,8 @@ class EventListItem extends NoticeListItemAdapter $event = Happening::fromNotice($notice); if (empty($event)) { - $out->element('p', null, _('Deleted.')); + // TRANS: Content for a deleted RSVP list item (RSVP stands for "please respond"). + $out->element('p', null, _m('Deleted.')); return; } @@ -135,7 +135,7 @@ class EventListItem extends NoticeListItemAdapter $out->element('strong', null, _m('Attending:')); $out->element('span', 'event-rsvps', // TRANS: RSVP counts. - // TRANS: %1$d, %2$d and %3$d are numbers of RSVPs. + // TRANS: %1$d, %2$d and %3$d are numbers of RSVPs. sprintf(_m('Yes: %1$d No: %2$d Maybe: %3$d'), count($rsvps[RSVP::POSITIVE]), count($rsvps[RSVP::NEGATIVE]), diff --git a/plugins/Event/newrsvp.php b/plugins/Event/newrsvp.php index b000767340..e9adf405d8 100644 --- a/plugins/Event/newrsvp.php +++ b/plugins/Event/newrsvp.php @@ -109,8 +109,8 @@ class NewrsvpAction extends Action $this->verb = RSVP::POSSIBLE; break; default: - // TRANS: Client exception thrown when using an invalud value for RSVP ("please respond"). - throw new ClientException(_('Unknown submit value.')); + // TRANS: Client exception thrown when using an invalid value for RSVP ("please respond"). + throw new ClientException(_m('Unknown submit value.')); } return true; diff --git a/plugins/Event/rsvplistitem.php b/plugins/Event/rsvplistitem.php index 7423c1c7cb..fef1c9debb 100644 --- a/plugins/Event/rsvplistitem.php +++ b/plugins/Event/rsvplistitem.php @@ -4,7 +4,7 @@ * Copyright (C) 2011, StatusNet, Inc. * * Title of module - * + * * PHP version 5 * * This program is free software: you can redistribute it and/or modify @@ -44,7 +44,6 @@ if (!defined('STATUSNET')) { * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 * @link http://status.net/ */ - class RSVPListItem extends NoticeListItemAdapter { function showNotice() @@ -63,7 +62,8 @@ class RSVPListItem extends NoticeListItemAdapter $rsvp = RSVP::fromNotice($notice); if (empty($rsvp)) { - $out->element('p', null, _('Deleted.')); + // TRANS: Content for a deleted RSVP list item (RSVP stands for "please respond"). + $out->element('p', null, _m('Deleted.')); return; }