X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fimsettings.php;h=92fff45a7db6d27f506be1f50520afb717b685af;hb=0a20abf1d8a9a068df9310d6903cc303f39b25ed;hp=1b1bc0dc0dba1b651d27503dcade3ab5791d91cd;hpb=5f81f6119be8ec0a100cefcaa6f886d16f3be5c5;p=quix0rs-gnu-social.git diff --git a/actions/imsettings.php b/actions/imsettings.php index 1b1bc0dc0d..92fff45a7d 100644 --- a/actions/imsettings.php +++ b/actions/imsettings.php @@ -43,17 +43,16 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { * @see SettingsAction */ -class ImsettingsAction extends ConnectSettingsAction +class ImsettingsAction extends SettingsAction { /** * Title of the page * * @return string Title of the page */ - function title() { - // TRANS: Title for instance messaging settings. + // TRANS: Title for Instant Messaging settings. return _('IM settings'); } @@ -62,14 +61,13 @@ class ImsettingsAction extends ConnectSettingsAction * * @return instructions for use */ - 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%%). '. + '[instant messaging](%%doc.im%%). '. 'Configure your addresses and settings below.'); } @@ -82,7 +80,6 @@ class ImsettingsAction extends ConnectSettingsAction * * @return void */ - function showContent() { $transports = array(); @@ -114,8 +111,8 @@ 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', + // TRANS: Form note in IM settings form. %s is the type of IM address that was confirmed. sprintf(_('Current confirmed %s address.'),$transport_info['display'])); $this->hidden('screenname', $user_im_prefs->screenname); // TRANS: Button label to remove a confirmed IM address. @@ -127,11 +124,11 @@ class ImsettingsAction extends ConnectSettingsAction // 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. + // TRANS: %s is the IM service name, %2$s is the IM address set. sprintf(_('Awaiting confirmation on this address. '. - 'Check your %s account for a '. + 'Check your %1$s account for a '. 'message with further instructions. '. - '(Did you add %s to your buddy list?)'), + '(Did you add %2$s to your buddy list?)'), $transport_info['display'], $transport_info['daemonScreenname'])); $this->hidden('screenname', $confirm->address); @@ -140,8 +137,10 @@ class ImsettingsAction extends ConnectSettingsAction } else { $this->elementStart('ul', 'form_data'); $this->elementStart('li'); + // TRANS: Field label for IM address. $this->input('screenname', _('IM address'), ($this->arg('screenname')) ? $this->arg('screenname') : null, + // TRANS: Field title for IM address. %s is the IM service name. sprintf(_('%s screenname.'), $transport_info['display'])); $this->elementEnd('li'); @@ -210,7 +209,6 @@ class ImsettingsAction extends ConnectSettingsAction * * @return Confirm_address address object for this user */ - function getConfirmation($transport) { $user = common_current_user(); @@ -237,12 +235,12 @@ class ImsettingsAction extends ConnectSettingsAction * * @return void */ - function handlePost() { // CSRF protection $token = $this->trimmed('token'); if (!$token || $token != common_session_token()) { + // TRANS: Client error displayed when the session token does not match or is not given. $this->showForm(_('There was a problem with your session token. '. 'Try again, please.')); return; @@ -257,7 +255,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. + // TRANS: Message given submitting a form with an unknown action in Instant Messaging settings. $this->showForm(_('Unexpected form submission.')); } } @@ -270,7 +268,6 @@ class ImsettingsAction extends ConnectSettingsAction * * @return void */ - function savePreferences() { $user = common_current_user(); @@ -294,8 +291,7 @@ 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; + $this->serverError(_('Could not update IM preferences.')); } }while($user_im_prefs->fetch()); } @@ -312,7 +308,6 @@ class ImsettingsAction extends ConnectSettingsAction * * @return void */ - function addAddress() { $user = common_current_user(); @@ -329,6 +324,7 @@ class ImsettingsAction extends ConnectSettingsAction } if (!$transport) { + // TRANS: Form validation error when no transport is available setting an IM address. $this->showForm(_('No transport.')); return; } @@ -337,14 +333,14 @@ class ImsettingsAction extends ConnectSettingsAction if (!$screenname) { // TRANS: Message given saving IM address that cannot be normalised. - $this->showForm(_('Cannot normalize that screenname')); + $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')); + $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. @@ -365,9 +361,8 @@ 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; + // TRANS: Server error thrown on database error adding Instant Messaging confirmation code. + $this->serverError(_('Could not insert confirmation code.')); } Event::handle('SendImConfirmationCode', array($transport, $screenname, $confirm->code, $user)); @@ -386,7 +381,6 @@ class ImsettingsAction extends ConnectSettingsAction * * @return void */ - function cancelConfirmation() { $screenname = $this->trimmed('screenname'); @@ -395,7 +389,7 @@ class ImsettingsAction extends ConnectSettingsAction $confirm = $this->getConfirmation($transport); if (!$confirm) { - // TRANS: Message given canceling IM address confirmation that is not pending. + // TRANS: Message given canceling Instant Messaging address confirmation that is not pending. $this->showForm(_('No pending confirmation to cancel.')); return; } @@ -410,8 +404,7 @@ 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->serverError(_('Could not delete confirmation.')); } // TRANS: Message given after successfully canceling IM address confirmation. @@ -425,7 +418,6 @@ class ImsettingsAction extends ConnectSettingsAction * * @return void */ - function removeAddress() { $user = common_current_user(); @@ -449,14 +441,12 @@ 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; + $this->serverError(_('Could not update user IM preferences.')); } // XXX: unsubscribe to the old address - // TRANS: Message given after successfully removing a registered IM address. + // TRANS: Message given after successfully removing a registered Instant Messaging address. $this->showForm(_('The IM address was removed.'), true); }