Many i18n and L10n updates.

This commit is contained in:
Siebrand Mazeland 2011-04-01 22:08:38 +02:00
parent 969d80f270
commit 6e67eb3b81
5 changed files with 30 additions and 30 deletions

View File

@ -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();

View File

@ -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("<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;
}
@ -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;
}

View File

@ -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');

View File

@ -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));
}

View File

@ -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();