diff options
author | Evan Prodromou <evan@status.net> | 2010-04-26 02:43:33 -0400 |
---|---|---|
committer | Evan Prodromou <evan@status.net> | 2010-04-26 02:43:33 -0400 |
commit | 5c05cd2b1a93d360bde7cb7dfc9ba39e5a5a7624 (patch) | |
tree | 5b4092e365023c7729fcdd8260431d3ffb28b519 /actions/imsettings.php | |
parent | 14adb7cc41e3d5d4e543c1f13f7a60d3cadb5c71 (diff) | |
parent | d7d3a50d8751f071aa95541813af1d190e71430e (diff) |
Merge branch '1.0.x' of gitorious.org:statusnet/mainline into 1.0.x
Diffstat (limited to 'actions/imsettings.php')
-rw-r--r-- | actions/imsettings.php | 58 |
1 files changed, 49 insertions, 9 deletions
diff --git a/actions/imsettings.php b/actions/imsettings.php index fe1864f0d..2c2606b76 100644 --- a/actions/imsettings.php +++ b/actions/imsettings.php @@ -53,6 +53,7 @@ class ImsettingsAction extends ConnectSettingsAction function title() { + // TRANS: Title for instance messaging settings. return _('IM settings'); } @@ -64,6 +65,9 @@ class ImsettingsAction extends ConnectSettingsAction function getInstructions() { + // TRANS: Instant messaging settings page instructions. + // TRANS: [instant messages] is link text, "(%%doc.im%%)" is the link. + // TRANS: the order and formatting of link text and link should remain unchanged. return _('You can send and receive notices through '. 'instant messaging [instant messages](%%doc.im%%). '. 'Configure your addresses and settings below.'); @@ -85,6 +89,7 @@ class ImsettingsAction extends ConnectSettingsAction Event::handle('GetImTransports', array(&$transports)); if (! $transports) { $this->element('div', array('class' => 'error'), + // TRANS: Message given in the IM settings if IM is not enabled on the site. _('IM is not available.')); return; } @@ -101,6 +106,7 @@ class ImsettingsAction extends ConnectSettingsAction 'action' => common_local_url('imsettings'))); $this->elementStart('fieldset', array('id' => 'settings_im_address')); + // TRANS: Form legend for IM settings form. $this->element('legend', null, $transport_info['display']); $this->hidden('token', common_session_token()); $this->hidden('transport', $transport); @@ -108,21 +114,30 @@ class ImsettingsAction extends ConnectSettingsAction if ($user_im_prefs = User_im_prefs::pkeyGet( array('transport' => $transport, 'user_id' => $user->id) )) { $user_im_prefs_by_transport[$transport] = $user_im_prefs; $this->element('p', 'form_confirmed', $user_im_prefs->screenname); + // TRANS: Form note in IM settings form. $this->element('p', 'form_note', sprintf(_('Current confirmed %s address.'),$transport_info['display'])); $this->hidden('screenname', $user_im_prefs->screenname); - $this->submit('remove', _('Remove')); + // TRANS: Button label to remove a confirmed IM address. + $this->submit('remove', _m('BUTTON','Remove')); } else { $confirm = $this->getConfirmation($transport); if ($confirm) { $this->element('p', 'form_unconfirmed', $confirm->address); + // TRANS: Form note in IM settings form. $this->element('p', 'form_note', + // TRANS: Form note in IM settings form. + // TRANS: %s is the IM address set for the site. sprintf(_('Awaiting confirmation on this address. '. 'Check your %s account for a '. - 'message with further instructions.'), - $transport_info['display'])); + 'message with further instructions. '. + '(Did you add %s to your buddy list?)'), + $transport_info['display'], + $transport_info['daemon_screenname'], + jabber_daemon_address())); $this->hidden('screenname', $confirm->address); - $this->submit('cancel', _('Cancel')); + // TRANS: Button label to cancel an IM address confirmation procedure. + $this->submit('cancel', _m('BUTTON','Cancel')); } else { $this->elementStart('ul', 'form_data'); $this->elementStart('li'); @@ -132,7 +147,8 @@ class ImsettingsAction extends ConnectSettingsAction $transport_info['display'])); $this->elementEnd('li'); $this->elementEnd('ul'); - $this->submit('add', _('Add')); + // TRANS: Button label for adding an IM address in IM settings form. + $this->submit('add', _m('BUTTON','Add')); } } $this->elementEnd('fieldset'); @@ -151,17 +167,22 @@ class ImsettingsAction extends ConnectSettingsAction $this->hidden('token', common_session_token()); $this->elementStart('table'); $this->elementStart('tr'); - $this->element('th', null, _('Preferences')); + // TRANS: Header for IM preferences form. + $this->element('th', null, _('IM Preferences')); foreach($user_im_prefs_by_transport as $transport=>$user_im_prefs) { $this->element('th', null, $transports[$transport]['display']); } $this->elementEnd('tr'); $preferences = array( + // TRANS: Checkbox label in IM preferences form. array('name'=>'notify', 'description'=>_('Send me notices')), + // TRANS: Checkbox label in IM preferences form. array('name'=>'updatefrompresence', 'description'=>_('Post a notice when my status changes.')), + // TRANS: Checkbox label in IM preferences form. array('name'=>'replies', 'description'=>_('Send me replies '. 'from people I\'m not subscribed to.')), + // TRANS: Checkbox label in IM preferences form. array('name'=>'microid', 'description'=>_('Publish a MicroID')) ); foreach($preferences as $preference) @@ -179,7 +200,8 @@ class ImsettingsAction extends ConnectSettingsAction $this->elementEnd('tr'); } $this->elementEnd('table'); - $this->submit('save', _('Save')); + // TRANS: Button label to save IM preferences. + $this->submit('save', _m('BUTTON','Save')); $this->elementEnd('fieldset'); $this->elementEnd('form'); } @@ -237,6 +259,7 @@ class ImsettingsAction extends ConnectSettingsAction } else if ($this->arg('remove')) { $this->removeAddress(); } else { + // TRANS: Message given submitting a form with an unknown action in IM settings. $this->showForm(_('Unexpected form submission.')); } } @@ -271,12 +294,14 @@ class ImsettingsAction extends ConnectSettingsAction if ($result === false) { common_log_db_error($user, 'UPDATE', __FILE__); + // TRANS: Server error thrown on database error updating IM preferences. $this->serverError(_('Couldn\'t update IM preferences.')); return; } }while($user_im_prefs->fetch()); $user_im_prefs->query('COMMIT'); } + // TRANS: Confirmation message for successful IM preferences save. $this->showForm(_('Preferences saved.'), true); } @@ -299,6 +324,7 @@ class ImsettingsAction extends ConnectSettingsAction // Some validation if (!$screenname) { + // TRANS: Message given saving IM address without having provided one. $this->showForm(_('No screenname.')); return; } @@ -311,15 +337,18 @@ class ImsettingsAction extends ConnectSettingsAction Event::handle('NormalizeImScreenname', array($transport, &$screenname)); if (!$screenname) { + // TRANS: Message given saving IM address that cannot be normalised. $this->showForm(_('Cannot normalize that screenname')); return; } $valid = false; Event::handle('ValidateImScreenname', array($transport, $screenname, &$valid)); if (!$valid) { + // TRANS: Message given saving IM address that not valid. $this->showForm(_('Not a valid screenname')); return; } else if ($this->screennameExists($transport, $screenname)) { + // TRANS: Message given saving IM address that is already set for another user. $this->showForm(_('Screenname already belongs to another user.')); return; } @@ -337,12 +366,14 @@ class ImsettingsAction extends ConnectSettingsAction if ($result === false) { common_log_db_error($confirm, 'INSERT', __FILE__); + // TRANS: Server error thrown on database error adding IM confirmation code. $this->serverError(_('Couldn\'t insert confirmation code.')); return; } Event::handle('SendImConfirmationCode', array($transport, $screenname, $confirm->code, $user)); + // TRANS: Message given saving valid IM address that is to be confirmed. $msg = _('A confirmation code was sent '. 'to the IM address you added.'); @@ -365,10 +396,12 @@ class ImsettingsAction extends ConnectSettingsAction $confirm = $this->getConfirmation($transport); if (!$confirm) { + // TRANS: Message given canceling IM address confirmation that is not pending. $this->showForm(_('No pending confirmation to cancel.')); return; } if ($confirm->address != $screenname) { + // TRANS: Message given canceling IM address confirmation for the wrong IM address. $this->showForm(_('That is the wrong IM address.')); return; } @@ -377,11 +410,13 @@ class ImsettingsAction extends ConnectSettingsAction if (!$result) { common_log_db_error($confirm, 'DELETE', __FILE__); + // TRANS: Server error thrown on database error canceling IM address confirmation. $this->serverError(_('Couldn\'t delete confirmation.')); return; } - $this->showForm(_('Confirmation cancelled.'), true); + // TRANS: Message given after successfully canceling IM address confirmation. + $this->showForm(_('IM confirmation cancelled.'), true); } /** @@ -404,6 +439,8 @@ class ImsettingsAction extends ConnectSettingsAction $user_im_prefs = new User_im_prefs(); $user_im_prefs->user_id = $user->id; if(! ($user_im_prefs->find() && $user_im_prefs->fetch())) { + // TRANS: Message given trying to remove an IM address that is not + // TRANS: registered for the active user. $this->showForm(_('That is not your screenname.')); return; } @@ -412,13 +449,16 @@ class ImsettingsAction extends ConnectSettingsAction if (!$result) { common_log_db_error($user, 'UPDATE', __FILE__); + // TRANS: Server error thrown on database error removing a registered IM address. $this->serverError(_('Couldn\'t update user im prefs.')); + $this->serverError(_('Couldn\'t update user.')); return; } // XXX: unsubscribe to the old address - $this->showForm(_('The address was removed.'), true); + // TRANS: Message given after successfully removing a registered IM address. + $this->showForm(_('The IM address was removed.'), true); } /** |