Many i18n and L10n updates.
This commit is contained in:
parent
969d80f270
commit
6e67eb3b81
@ -168,7 +168,7 @@ class EventPlugin extends MicroappPlugin
|
|||||||
$happeningObj = $activity->objects[0];
|
$happeningObj = $activity->objects[0];
|
||||||
|
|
||||||
if ($happeningObj->type != Happening::OBJECT_TYPE) {
|
if ($happeningObj->type != Happening::OBJECT_TYPE) {
|
||||||
throw new Exception('Wrong type for object.');
|
throw new Exception(_m('Wrong type for object.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$notice = null;
|
$notice = null;
|
||||||
@ -189,12 +189,12 @@ class EventPlugin extends MicroappPlugin
|
|||||||
$happening = Happening::staticGet('uri', $happeningObj->id);
|
$happening = Happening::staticGet('uri', $happeningObj->id);
|
||||||
if (empty($happening)) {
|
if (empty($happening)) {
|
||||||
// FIXME: save the event
|
// 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);
|
$notice = RSVP::saveNew($actor, $happening, $activity->verb, $options);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new Exception("Unknown verb for events");
|
throw new Exception(_m('Unknown verb for events'));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $notice;
|
return $notice;
|
||||||
@ -225,13 +225,13 @@ class EventPlugin extends MicroappPlugin
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (empty($happening)) {
|
if (empty($happening)) {
|
||||||
throw new Exception("Unknown object type.");
|
throw new Exception(_m('Unknown object type.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$notice = $happening->getNotice();
|
$notice = $happening->getNotice();
|
||||||
|
|
||||||
if (empty($notice)) {
|
if (empty($notice)) {
|
||||||
throw new Exception("Unknown event notice.");
|
throw new Exception(_m('Unknown event notice.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$obj = new ActivityObject();
|
$obj = new ActivityObject();
|
||||||
|
@ -219,7 +219,7 @@ class RSVP extends Managed_DataObject
|
|||||||
return '?';
|
return '?';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new Exception("Unknown verb {$verb}");
|
throw new Exception(sprintf(_m('Unknown verb "%s"'),$verb));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -236,7 +236,7 @@ class RSVP extends Managed_DataObject
|
|||||||
return RSVP::POSSIBLE;
|
return RSVP::POSSIBLE;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new Exception("Unknown code {$code}");
|
throw new Exception(sprintf(_m('Unknown code "%s".'),$code));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -244,7 +244,7 @@ class RSVP extends Managed_DataObject
|
|||||||
{
|
{
|
||||||
$notice = Notice::staticGet('uri', $this->uri);
|
$notice = Notice::staticGet('uri', $this->uri);
|
||||||
if (empty($notice)) {
|
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;
|
return $notice;
|
||||||
}
|
}
|
||||||
@ -278,7 +278,7 @@ class RSVP extends Managed_DataObject
|
|||||||
{
|
{
|
||||||
$profile = Profile::staticGet('id', $this->profile_id);
|
$profile = Profile::staticGet('id', $this->profile_id);
|
||||||
if (empty($profile)) {
|
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;
|
return $profile;
|
||||||
}
|
}
|
||||||
@ -287,7 +287,7 @@ class RSVP extends Managed_DataObject
|
|||||||
{
|
{
|
||||||
$event = Happening::staticGet('id', $this->event_id);
|
$event = Happening::staticGet('id', $this->event_id);
|
||||||
if (empty($event)) {
|
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;
|
return $event;
|
||||||
}
|
}
|
||||||
@ -316,16 +316,16 @@ class RSVP extends Managed_DataObject
|
|||||||
|
|
||||||
switch ($response) {
|
switch ($response) {
|
||||||
case 'Y':
|
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;
|
break;
|
||||||
case 'N':
|
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;
|
break;
|
||||||
case '?':
|
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;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new Exception(sprintf(_('Unknown response code %s.'),$response));
|
throw new Exception(sprintf(_m('Unknown response code %s.'),$response));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -351,16 +351,16 @@ class RSVP extends Managed_DataObject
|
|||||||
|
|
||||||
switch ($response) {
|
switch ($response) {
|
||||||
case 'Y':
|
case 'Y':
|
||||||
$fmt = _m("%1$s is attending %2$s.");
|
$fmt = _m('%1$s is attending %2$s.');
|
||||||
break;
|
break;
|
||||||
case 'N':
|
case 'N':
|
||||||
$fmt = _m("%1$s is not attending %2$s.");
|
$fmt = _m('%1$s is not attending %2$s.');
|
||||||
break;
|
break;
|
||||||
case '?':
|
case '?':
|
||||||
$fmt = _m("%1$s might attend %2$s.>");
|
$fmt = _m('%1$s might attend %2$s.');
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new Exception("Unknown response code {$response}");
|
throw new Exception(sprintf(_m('Unknown response code %s.'),$response));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,56 +95,56 @@ class EventForm extends Form
|
|||||||
$this->out->input('title',
|
$this->out->input('title',
|
||||||
_m('LABEL','Title'),
|
_m('LABEL','Title'),
|
||||||
null,
|
null,
|
||||||
_m('Title of the event'));
|
_m('Title of the event.'));
|
||||||
$this->unli();
|
$this->unli();
|
||||||
|
|
||||||
$this->li();
|
$this->li();
|
||||||
$this->out->input('startdate',
|
$this->out->input('startdate',
|
||||||
_m('LABEL','Start date'),
|
_m('LABEL','Start date'),
|
||||||
null,
|
null,
|
||||||
_m('Date the event starts'));
|
_m('Date the event starts.'));
|
||||||
$this->unli();
|
$this->unli();
|
||||||
|
|
||||||
$this->li();
|
$this->li();
|
||||||
$this->out->input('starttime',
|
$this->out->input('starttime',
|
||||||
_m('LABEL','Start time'),
|
_m('LABEL','Start time'),
|
||||||
null,
|
null,
|
||||||
_m('Time the event starts'));
|
_m('Time the event starts.'));
|
||||||
$this->unli();
|
$this->unli();
|
||||||
|
|
||||||
$this->li();
|
$this->li();
|
||||||
$this->out->input('enddate',
|
$this->out->input('enddate',
|
||||||
_m('LABEL','End date'),
|
_m('LABEL','End date'),
|
||||||
null,
|
null,
|
||||||
_m('Date the event ends'));
|
_m('Date the event ends.'));
|
||||||
$this->unli();
|
$this->unli();
|
||||||
|
|
||||||
$this->li();
|
$this->li();
|
||||||
$this->out->input('endtime',
|
$this->out->input('endtime',
|
||||||
_m('LABEL','End time'),
|
_m('LABEL','End time'),
|
||||||
null,
|
null,
|
||||||
_m('Time the event ends'));
|
_m('Time the event ends.'));
|
||||||
$this->unli();
|
$this->unli();
|
||||||
|
|
||||||
$this->li();
|
$this->li();
|
||||||
$this->out->input('location',
|
$this->out->input('location',
|
||||||
_m('LABEL','Location'),
|
_m('LABEL','Location'),
|
||||||
null,
|
null,
|
||||||
_m('Event location'));
|
_m('Event location.'));
|
||||||
$this->unli();
|
$this->unli();
|
||||||
|
|
||||||
$this->li();
|
$this->li();
|
||||||
$this->out->input('url',
|
$this->out->input('url',
|
||||||
_m('LABEL','URL'),
|
_m('LABEL','URL'),
|
||||||
null,
|
null,
|
||||||
_m('URL for more information'));
|
_m('URL for more information.'));
|
||||||
$this->unli();
|
$this->unli();
|
||||||
|
|
||||||
$this->li();
|
$this->li();
|
||||||
$this->out->input('description',
|
$this->out->input('description',
|
||||||
_m('LABEL','Description'),
|
_m('LABEL','Description'),
|
||||||
null,
|
null,
|
||||||
_m('Description of the event'));
|
_m('Description of the event.'));
|
||||||
$this->unli();
|
$this->unli();
|
||||||
|
|
||||||
$this->out->elementEnd('ul');
|
$this->out->elementEnd('ul');
|
||||||
|
@ -81,7 +81,7 @@ class NeweventAction extends Action
|
|||||||
$this->user = common_current_user();
|
$this->user = common_current_user();
|
||||||
|
|
||||||
if (empty($this->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);
|
403);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -135,13 +135,13 @@ class NeweventAction extends Action
|
|||||||
$this->endTime = strtotime($end);
|
$this->endTime = strtotime($end);
|
||||||
|
|
||||||
if ($this->startTime == 0) {
|
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));
|
$start));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ($this->endTime == 0) {
|
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));
|
$end));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ class ShowrsvpAction extends ShownoticeAction
|
|||||||
|
|
||||||
if (empty($this->event)) {
|
if (empty($this->event)) {
|
||||||
// TRANS: Client exception thrown when referring to a non-existing 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();
|
$notice = $this->rsvp->getNotice();
|
||||||
|
Loading…
Reference in New Issue
Block a user