$happeningObj = $activity->objects[0];
if ($happeningObj->type != Happening::OBJECT_TYPE) {
- throw new Exception('Wrong type for object.');
+ throw new Exception(_m('Wrong type for object.'));
}
$notice = null;
$happening = Happening::staticGet('uri', $happeningObj->id);
if (empty($happening)) {
// FIXME: save the event
- throw new Exception("RSVP for unknown event.");
+ throw new Exception(_m('RSVP for unknown event.'));
}
$notice = RSVP::saveNew($actor, $happening, $activity->verb, $options);
break;
default:
- throw new Exception("Unknown verb for events");
+ throw new Exception(_m('Unknown verb for events'));
}
return $notice;
}
if (empty($happening)) {
- throw new Exception("Unknown object type.");
+ throw new Exception(_m('Unknown object type.'));
}
$notice = $happening->getNotice();
if (empty($notice)) {
- throw new Exception("Unknown event notice.");
+ throw new Exception(_m('Unknown event notice.'));
}
$obj = new ActivityObject();
return '?';
break;
default:
- throw new Exception("Unknown verb {$verb}");
+ throw new Exception(sprintf(_m('Unknown verb "%s"'),$verb));
}
}
return RSVP::POSSIBLE;
break;
default:
- throw new Exception("Unknown code {$code}");
+ throw new Exception(sprintf(_m('Unknown code "%s".'),$code));
}
}
{
$notice = Notice::staticGet('uri', $this->uri);
if (empty($notice)) {
- throw new ServerException("RSVP {$this->id} does not correspond to a notice in the DB.");
+ throw new ServerException(sprintf(_m('RSVP %s does not correspond to a notice in the database.'),$this->id));
}
return $notice;
}
{
$profile = Profile::staticGet('id', $this->profile_id);
if (empty($profile)) {
- throw new Exception("No profile with ID {$this->profile_id}");
+ throw new Exception(sprintf(_m('No profile with ID %s.'),$this->profile_id));
}
return $profile;
}
{
$event = Happening::staticGet('id', $this->event_id);
if (empty($event)) {
- throw new Exception("No event with ID {$this->event_id}");
+ throw new Exception(sprintf(_m('No event with ID %s.'),$this->event_id));
}
return $event;
}
switch ($response) {
case 'Y':
- $fmt = _m("<span class='automatic event-rsvp'><a href='%1$s'>%2$s</a> is attending <a href='%3$s'>%4$s</a>.</span>");
+ $fmt = _m("<span class='automatic event-rsvp'><a href='%1\$s'>%2\$s</a> is attending <a href='%3\$s'>%4\$s</a>.</span>");
break;
case 'N':
- $fmt = _m("<span class='automatic event-rsvp'><a href='%1$s'>%2$s</a> is not attending <a href='%3$s'>%4$s</a>.</span>");
+ $fmt = _m("<span class='automatic event-rsvp'><a href='%1\$s'>%2\$s</a> is not attending <a href='%3\$s'>%4\$s</a>.</span>");
break;
case '?':
- $fmt = _m("<span class='automatic event-rsvp'><a href='%1$s'>%2$s</a> might attend <a href='%3$s'>%4$s</a>.</span>");
+ $fmt = _m("<span class='automatic event-rsvp'><a href='%1\$s'>%2\$s</a> might attend <a href='%3\$s'>%4\$s</a>.</span>");
break;
default:
- throw new Exception(sprintf(_('Unknown response code %s.'),$response));
+ throw new Exception(sprintf(_m('Unknown response code %s.'),$response));
break;
}
switch ($response) {
case 'Y':
- $fmt = _m("%1$s is attending %2$s.");
+ $fmt = _m('%1$s is attending %2$s.');
break;
case 'N':
- $fmt = _m("%1$s is not attending %2$s.");
+ $fmt = _m('%1$s is not attending %2$s.');
break;
case '?':
- $fmt = _m("%1$s might attend %2$s.>");
+ $fmt = _m('%1$s might attend %2$s.');
break;
default:
- throw new Exception("Unknown response code {$response}");
+ throw new Exception(sprintf(_m('Unknown response code %s.'),$response));
break;
}
$this->out->input('title',
_m('LABEL','Title'),
null,
- _m('Title of the event'));
+ _m('Title of the event.'));
$this->unli();
$this->li();
$this->out->input('startdate',
_m('LABEL','Start date'),
null,
- _m('Date the event starts'));
+ _m('Date the event starts.'));
$this->unli();
$this->li();
$this->out->input('starttime',
_m('LABEL','Start time'),
null,
- _m('Time the event starts'));
+ _m('Time the event starts.'));
$this->unli();
$this->li();
$this->out->input('enddate',
_m('LABEL','End date'),
null,
- _m('Date the event ends'));
+ _m('Date the event ends.'));
$this->unli();
$this->li();
$this->out->input('endtime',
_m('LABEL','End time'),
null,
- _m('Time the event ends'));
+ _m('Time the event ends.'));
$this->unli();
$this->li();
$this->out->input('location',
_m('LABEL','Location'),
null,
- _m('Event location'));
+ _m('Event location.'));
$this->unli();
$this->li();
$this->out->input('url',
_m('LABEL','URL'),
null,
- _m('URL for more information'));
+ _m('URL for more information.'));
$this->unli();
$this->li();
$this->out->input('description',
_m('LABEL','Description'),
null,
- _m('Description of the event'));
+ _m('Description of the event.'));
$this->unli();
$this->out->elementEnd('ul');
$this->user = common_current_user();
if (empty($this->user)) {
- throw new ClientException(_m("Must be logged in to post a event."),
+ throw new ClientException(_m('Must be logged in to post a event.'),
403);
}
$this->endTime = strtotime($end);
if ($this->startTime == 0) {
- throw new Exception(sprintf(_m('Could not parse date "%s"'),
+ throw new Exception(sprintf(_m('Could not parse date "%s".'),
$start));
}
if ($this->endTime == 0) {
- throw new Exception(sprintf(_m('Could not parse date "%s"'),
+ throw new Exception(sprintf(_m('Could not parse date "%s".'),
$end));
}
if (empty($this->event)) {
// TRANS: Client exception thrown when referring to a non-existing event.
- throw new ClientException(_m('No such Event.'), 404);
+ throw new ClientException(_m('No such event.'), 404);
}
$notice = $this->rsvp->getNotice();