From 6e67eb3b819869478ff1868d0fa2b2b3075bd85a Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Fri, 1 Apr 2011 22:08:38 +0200 Subject: [PATCH] Many i18n and L10n updates. --- plugins/Event/EventPlugin.php | 10 +++++----- plugins/Event/RSVP.php | 26 +++++++++++++------------- plugins/Event/eventform.php | 16 ++++++++-------- plugins/Event/newevent.php | 6 +++--- plugins/Event/showrsvp.php | 2 +- 5 files changed, 30 insertions(+), 30 deletions(-) diff --git a/plugins/Event/EventPlugin.php b/plugins/Event/EventPlugin.php index d1dda6336d..528c855bda 100644 --- a/plugins/Event/EventPlugin.php +++ b/plugins/Event/EventPlugin.php @@ -168,7 +168,7 @@ class EventPlugin extends MicroappPlugin $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; @@ -189,12 +189,12 @@ class EventPlugin extends MicroappPlugin $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; @@ -225,13 +225,13 @@ class EventPlugin extends MicroappPlugin } 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(); diff --git a/plugins/Event/RSVP.php b/plugins/Event/RSVP.php index cce0f6ee56..314d297a36 100644 --- a/plugins/Event/RSVP.php +++ b/plugins/Event/RSVP.php @@ -219,7 +219,7 @@ class RSVP extends Managed_DataObject return '?'; break; 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; break; 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); 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; } @@ -278,7 +278,7 @@ class RSVP extends Managed_DataObject { $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; } @@ -287,7 +287,7 @@ class RSVP extends Managed_DataObject { $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; } @@ -316,16 +316,16 @@ class RSVP extends Managed_DataObject switch ($response) { case 'Y': - $fmt = _m("%2$s is attending %4$s."); + $fmt = _m("%2\$s is attending %4\$s."); break; case 'N': - $fmt = _m("%2$s is not attending %4$s."); + $fmt = _m("%2\$s is not attending %4\$s."); break; case '?': - $fmt = _m("%2$s might attend %4$s."); + $fmt = _m("%2\$s might attend %4\$s."); break; default: - throw new Exception(sprintf(_('Unknown response code %s.'),$response)); + throw new Exception(sprintf(_m('Unknown response code %s.'),$response)); break; } @@ -351,16 +351,16 @@ class RSVP extends Managed_DataObject 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; } diff --git a/plugins/Event/eventform.php b/plugins/Event/eventform.php index 327c8a31e6..31fecb1278 100644 --- a/plugins/Event/eventform.php +++ b/plugins/Event/eventform.php @@ -95,56 +95,56 @@ class EventForm extends Form $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'); diff --git a/plugins/Event/newevent.php b/plugins/Event/newevent.php index 7fe80f0857..082f12bb4b 100644 --- a/plugins/Event/newevent.php +++ b/plugins/Event/newevent.php @@ -81,7 +81,7 @@ class NeweventAction extends Action $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); } @@ -135,13 +135,13 @@ class NeweventAction extends Action $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)); } diff --git a/plugins/Event/showrsvp.php b/plugins/Event/showrsvp.php index f08857dcc4..7b129177e1 100644 --- a/plugins/Event/showrsvp.php +++ b/plugins/Event/showrsvp.php @@ -65,7 +65,7 @@ class ShowrsvpAction extends ShownoticeAction 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(); -- 2.39.5