Numbered parameters when more than one used in a message.
L10n updates for consistency.
i18n for non-translatable exception.
Updated translator documentation.
Removed superfluous whitespace.
if ($this->original->scope != Notice::SITE_SCOPE &&
$this->original->scope != Notice::PUBLIC_SCOPE) {
+ // TRANS: Client error displayed when trying to repeat a private notice.
$this->clientError(_('You may not repeat a private notice.'),
403,
$this->format);
// Can the profile actually see that notice?
if (!$this->original->inScope($profile)) {
+ // TRANS: Client error displayed when trying to repeat a notice the user has no access to.
$this->clientError(_('No access to that notice.'),
403,
$this->format);
$this->elementEnd('li');
}
$this->elementEnd('ul');
- // TRANS: Botton text to register a user on account registration page.
+ // TRANS: Button text to register a user on account registration page.
$this->submit('submit', _m('BUTTON','Register'));
$this->elementEnd('fieldset');
$this->elementEnd('form');
if ($this->notice->scope != Notice::SITE_SCOPE &&
$this->notice->scope != Notice::PUBLIC_SCOPE) {
+ // TRANS: Client error displayed when trying to repeat a private notice.
$this->clientError(_('You may not repeat a private notice.'),
403);
}
// Can the profile actually see that notice?
if (!$this->notice->inScope($profile)) {
+ // TRANS: Client error displayed when trying to repeat a notice the user has no access to.
$this->clientError(_('No access to that notice.'), 403);
}
}
if (!$this->notice->inScope($curProfile)) {
+ // TRANS: Client exception thrown when trying a view a notice the user has no access to.
throw new ClientException(_('Not available.'), 403);
}
if (!empty($repeat) &&
$repeat->scope != Notice::SITE_SCOPE &&
$repeat->scope != Notice::PUBLIC_SCOPE) {
+ // TRANS: Client exception thrown when trying to repeat a private notice.
throw new ClientException(_('Cannot repeat a private notice.'), 403);
}
if (!empty($notice->reply_to)) {
$reply = Notice::staticGet('id', $notice->reply_to);
if (!$reply->inScope($profile)) {
- throw new ClientException(sprintf(_("%s has no access to notice %d"),
+ // TRANS: Client error displayed when trying to reply to a notice a the target has no access to.
+ // TRANS: %1$s is a user nickname, %2$d is a notice ID (number).
+ throw new ClientException(sprintf(_('%1$s has no access to notice %2$d.'),
$profile->nickname, $reply->id), 403);
}
$notice->conversation = $reply->conversation;
*
* @return boolean whether the profile is in the notice's scope
*/
-
function inScope($profile)
{
// If there's no scope, anyone (even anon) is in scope.
if ($notice->scope != Notice::SITE_SCOPE &&
$notice->scope != Notice::PUBLIC_SCOPE) {
+ // TRANS: Client error displayed when trying to repeat a private notice.
$channel->error($this->user, _('You may not repeat a private notice.'));
}
// Can the profile actually see that notice?
if (!$notice->inScope($profile)) {
+ // TRANS: Client error displayed when trying to repeat a notice the user has no access to.
$channel->error($this->user, _('You have no access to that notice.'));
}
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
* @link http://status.net/
*/
-
class ConversationNoticeStream extends ScopingNoticeStream
{
function __construct($id)
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
* @link http://status.net/
*/
-
class RawConversationNoticeStream extends NoticeStream
{
protected $id;
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
* @link http://status.net/
*/
-
class FaveNoticeStream extends ScopingNoticeStream
{
function __construct($user_id, $own)
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
* @link http://status.net/
*/
-
class RawFaveNoticeStream extends NoticeStream
{
protected $user_id;
* @see NoticeList
* @see ProfileNoticeListItem
*/
-
class NoticeListItem extends Widget
{
/** The notice this item will show. */
-
var $notice = null;
/** The notice that was repeated. */
-
var $repeat = null;
/** The profile of the author of the notice, extracted once for convenience. */
-
var $profile = null;
/**
*
* @param Notice $notice The notice we'll display
*/
-
function __construct($notice, $out=null)
{
parent::__construct($out);
*
* @return void
*/
-
function show()
{
if (empty($this->notice)) {
*
* @return void
*/
-
function showStart()
{
if (Event::handle('StartOpenNoticeListItemElement', array($this))) {
*
* @return void
*/
-
function showFaveForm()
{
if (Event::handle('StartShowFaveForm', array($this))) {
*
* @return void
*/
-
function showAuthor()
{
$this->out->elementStart('span', 'vcard author');
*
* @return void
*/
-
function showAvatar()
{
$avatar_size = $this->avatarSize();
*
* @return void
*/
-
function showNickname()
{
$this->out->raw('<span class="nickname fn">' .
*
* @return void
*/
-
function showContent()
{
// FIXME: URL, image, video, audio
*
* @return void
*/
-
function showNoticeLink()
{
$noticeurl = $this->notice->bestUrl();
*
* @return void
*/
-
function showNoticeLocation()
{
$id = $this->notice->id;
*
* @return void
*/
-
function showNoticeSource()
{
$ns = $this->notice->getSource();
*
* @return void
*/
-
function showContext()
{
if ($this->notice->hasConversation()) {
*
* @return void
*/
-
function showRepeat()
{
if (!empty($this->repeat)) {
*
* @return void
*/
-
function showReplyLink()
{
if (common_logged_in()) {
*
* @return void
*/
-
function showDeleteLink()
{
$user = common_current_user();
*
* @return void
*/
-
function showRepeatForm()
{
if ($this->notice->scope == Notice::PUBLIC_SCOPE ||
$profile = $user->getProfile();
if ($profile->hasRepeated($this->notice->id)) {
$this->out->element('span', array('class' => 'repeated',
- 'title' => _('Notice repeated')),
+ // TRANS: Title for repeat form status in notice list when a notice has been repeated.
+ 'title' => _('Notice repeated.')),
+ // TRANS: Repeat form status in notice list when a notice has been repeated.
_('Repeated'));
} else {
$rf = new RepeatForm($this->out, $this->notice);
*
* @return void
*/
-
function showEnd()
{
if (Event::handle('StartCloseNoticeListItemElement', array($this))) {
* Copyright (C) 2011, StatusNet, Inc.
*
* Widget showing a drop-down of potential addressees
- *
+ *
* PHP version 5
*
* This program is free software: you can redistribute it and/or modify
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
* @link http://status.net/
*/
-
class ToSelector extends Widget
{
protected $user;
$default = 'public:site';
if (!common_config('site', 'private')) {
- $choices['public:everyone'] = _('Everyone');
+ // TRANS: Option in drop-down of potential addressees.
+ $choices['public:everyone'] = _m('SENDTO','Everyone');
$default = 'public:everyone';
}
// XXX: better name...?
+ // TRANS: Option in drop-down of potential addressees.
+ // TRANS: %s is a StatusNet sitename.
$choices['public:site'] = sprintf(_('My colleagues at %s'), common_config('site', 'name'));
-
+
$groups = $this->user->getGroups();
while ($groups->fetch()) {
}
$this->out->dropdown($this->id,
- _('To:'),
+ // TRANS: Label for drop-down of potential addressees.
+ _m('LABEL','To:'),
$choices,
null,
false,
$default);
$this->out->checkbox('notice_private',
+ // TRANS: Checkbox label in widget for selecting potential addressees to mark the notice private.
_('Private'),
$this->private);
}
}
break;
default:
- throw new ClientException('Unknown to value: ' . toArg);
+ // TRANS: Client exception thrown in widget for selecting potential addressees when an invalid fill option was received.
+ throw new ClientException(sprintf(_('Unknown to value: "%s".'),$toArg));
break;
}
}
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
* @link http://status.net/
*/
-
class ShowbookmarkAction extends ShownoticeAction
{
protected $bookmark = null;
*
* @return boolean true
*/
-
function prepare($argarray)
{
OwnerDesignAction::prepare($argarray);
$this->bookmark = Bookmark::staticGet('id', $this->id);
if (empty($this->bookmark)) {
- throw new ClientException(_('No such bookmark.'), 404);
+ // TRANS: Client exception thrown when referring to a non-existing bookmark.
+ throw new ClientException(_m('No such bookmark.'), 404);
}
$this->notice = Notice::staticGet('uri', $this->bookmark->uri);
if (empty($this->notice)) {
// Did we used to have it, and it got deleted?
- throw new ClientException(_('No such bookmark.'), 404);
+ // TRANS: Client exception thrown when referring to a non-existing bookmark.
+ throw new ClientException(_m('No such bookmark.'), 404);
}
if (!empty($cur)) {
}
if (!$this->notice->inScope($curProfile)) {
- throw new ClientException(_('Not available.'), 403);
+ // TRANS: Client exception thrown when referring to a bookmark the user has no access to.
+ throw new ClientException(_m('Not available.'), 403);
}
$this->user = User::staticGet('id', $this->bookmark->profile_id);
if (empty($this->user)) {
- throw new ClientException(_('No such user.'), 404);
+ // TRANS: Client exception thrown when referring to a bookmark for a non-existing user.
+ throw new ClientException(_m('No such user.'), 404);
}
$this->profile = $this->user->getProfile();
if (empty($this->profile)) {
- throw new ServerException(_('User without a profile.'));
+ // TRANS: Client exception thrown when referring to a bookmark for a non-existing profile.
+ throw new ServerException(_m('User without a profile.'));
}
$this->avatar = $this->profile->getAvatar(AVATAR_PROFILE_SIZE);
*
* @return string page tile
*/
-
function title()
{
- return sprintf(_('%s\'s bookmark for "%s"'),
+ // TRANS: Title for bookmark.
+ // TRANS: %1$s is a user nickname, %2$s is a bookmark title.
+ return sprintf(_('%1s$\'s bookmark for "%2$s"'),
$this->user->nickname,
$this->bookmark->title);
}
*
* @return void
*/
-
function showPageTitle()
{
$this->elementStart('h1');
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
* @link http://status.net/
*/
-
class ShoweventAction extends ShownoticeAction
{
protected $id = null;
*
* @return boolean true
*/
-
function prepare($argarray)
{
OwnerDesignAction::prepare($argarray);
$this->event = Happening::staticGet('id', $this->id);
if (empty($this->event)) {
- throw new ClientException(_('No such event.'), 404);
+ // TRANS: Client exception thrown when referring to a non-existing event.
+ throw new ClientException(_m('No such event.'), 404);
}
$this->notice = $this->event->getNotice();
if (empty($this->notice)) {
// Did we used to have it, and it got deleted?
- throw new ClientException(_('No such event.'), 404);
+ // TRANS: Client exception thrown when referring to a non-existing event.
+ throw new ClientException(_m('No such event.'), 404);
}
$cur = common_current_user();
}
if (!$this->notice->inScope($curProfile)) {
- throw new ClientException(_('Not available.'), 403);
+ // TRANS: Client exception thrown when referring to an event the user has no access to.
+ throw new ClientException(_m('Not available.'), 403);
}
$this->user = User::staticGet('id', $this->event->profile_id);
if (empty($this->user)) {
- throw new ClientException(_('No such user.'), 404);
+ // TRANS: Client exception thrown when referring to a non-existing user.
+ throw new ClientException(_m('No such user.'), 404);
}
$this->profile = $this->user->getProfile();
if (empty($this->profile)) {
- throw new ServerException(_('User without a profile.'));
+ // TRANS: Server exception thrown when referring to a user without a profile.
+ throw new ServerException(_m('User without a profile.'));
}
$this->avatar = $this->profile->getAvatar(AVATAR_PROFILE_SIZE);
*
* @return string page tile
*/
-
function title()
{
return $this->event->title;
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
* @link http://status.net/
*/
-
class ShowrsvpAction extends ShownoticeAction
{
protected $rsvp = null;
*
* @return boolean true
*/
-
function prepare($argarray)
{
OwnerDesignAction::prepare($argarray);
$this->rsvp = RSVP::staticGet('id', $this->id);
if (empty($this->rsvp)) {
- throw new ClientException(_('No such RSVP.'), 404);
+ // TRANS: Client exception thrown when referring to a non-existing RSVP.
+ // TRANS: RSVP stands for "Please reply".
+ throw new ClientException(_m('No such RSVP.'), 404);
}
$this->event = $this->rsvp->getEvent();
if (empty($this->event)) {
- throw new ClientException(_('No such Event.'), 404);
+ // TRANS: Client exception thrown when referring to a non-existing event.
+ throw new ClientException(_m('No such Event.'), 404);
}
$this->notice = $this->rsvp->getNotice();
if (empty($this->notice)) {
// Did we used to have it, and it got deleted?
- throw new ClientException(_('No such RSVP.'), 404);
+ // TRANS: Client exception thrown when referring to a non-existing RSVP.
+ // TRANS: RSVP stands for "Please reply".
+ throw new ClientException(_m('No such RSVP.'), 404);
}
$cur = common_current_user();
}
if (!$this->notice->inScope($curProfile)) {
- throw new ClientException(_('Not available.'), 403);
+ // TRANS: Client exception thrown when referring to an event the user has no access to.
+ throw new ClientException(_m('Not available.'), 403);
}
$this->user = User::staticGet('id', $this->rsvp->profile_id);
if (empty($this->user)) {
- throw new ClientException(_('No such user.'), 404);
+ // TRANS: Client exception thrown when referring to a non-existing user.
+ throw new ClientException(_m('No such user.'), 404);
}
$this->profile = $this->user->getProfile();
if (empty($this->profile)) {
- throw new ServerException(_('User without a profile.'));
+ // TRANS: Server exception thrown when referring to a user without a profile.
+ throw new ServerException(_m('User without a profile.'));
}
$this->avatar = $this->profile->getAvatar(AVATAR_PROFILE_SIZE);
*
* @return string page tile
*/
-
function title()
{
- return sprintf(_('%s\'s RSVP for "%s"'),
+ // TRANS: Title for event.
+ // TRANS: %1$s is a user nickname, %2$s is an event title.
+ return sprintf(_('%1$s\'s RSVP for "%2$s"'),
$this->user->nickname,
$this->event->title);
}