* @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
* @link http://status.net/
*/
-
class RemotesubscribeAction extends Action
{
var $nickname;
parent::prepare($args);
if (common_logged_in()) {
+ // TRANS: Client error displayed when using remote subscribe for a local entity.
$this->clientError(_('You can use the local subscription!'));
return false;
}
if ($this->err) {
$this->element('div', 'error', $this->err);
} else {
+ // TRANS: Page notice for remote subscribe. This message contains Markdown links.
+ // TRANS: Ensure to keep the correct markup of [link description](link).
$inst = _('To subscribe, you can [login](%%action.login%%),' .
' or [register](%%action.register%%) a new ' .
' account. If you already have an account ' .
function title()
{
+ // TRANS: Page title for Remote subscribe.
return _('Remote subscribe');
}
'class' => 'form_settings',
'action' => common_local_url('remotesubscribe')));
$this->elementStart('fieldset');
+ // TRANS: Field legend on page for remote subscribe.
$this->element('legend', _('Subscribe to a remote user'));
$this->hidden('token', common_session_token());
$this->elementStart('ul', 'form_data');
$this->elementStart('li');
+ // TRANS: Field label on page for remote subscribe.
$this->input('nickname', _('User nickname'), $this->nickname,
- _('Nickname of the user you want to follow'));
+ // TRANS: Field title on page for remote subscribe.
+ _('Nickname of the user you want to follow.'));
$this->elementEnd('li');
$this->elementStart('li');
+ // TRANS: Field label on page for remote subscribe.
$this->input('profile_url', _('Profile URL'), $this->profile_url,
- _('URL of your profile on another compatible microblogging service'));
+ // TRANS: Field title on page for remote subscribe.
+ _('URL of your profile on another compatible microblogging service.'));
$this->elementEnd('li');
$this->elementEnd('ul');
- $this->submit('submit', _('Subscribe'));
+ // TRANS: Button text on page for remote subscribe.
+ $this->submit('submit', _m('BUTTON','Subscribe'));
$this->elementEnd('fieldset');
$this->elementEnd('form');
}
function remoteSubscription()
{
if (!$this->nickname) {
+ // TRANS: Form validation error on page for remote subscribe when no user was provided.
$this->showForm(_('No such user.'));
return;
}
$this->profile_url = $this->trimmed('profile_url');
if (!$this->profile_url) {
+ // TRANS: Form validation error on page for remote subscribe when no user profile was found.
$this->showForm(_('No such user.'));
return;
}
if (!common_valid_http_url($this->profile_url)) {
- $this->showForm(_('Invalid profile URL (bad format)'));
+ // TRANS: Form validation error on page for remote subscribe when an invalid profile URL was provided.
+ $this->showForm(_('Invalid profile URL (bad format).'));
return;
}
common_root_url(),
omb_oauth_datastore());
} catch (OMB_InvalidYadisException $e) {
+ // TRANS: Form validation error on page for remote subscribe when no the provided profile URL
+ // TRANS: does not contain expected data.
$this->showForm(_('Not a valid profile URL (no YADIS document or ' .
'invalid XRDS defined).'));
return;
if ($service->getServiceURI(OAUTH_ENDPOINT_REQUEST) ==
common_local_url('requesttoken') ||
User::staticGet('uri', $service->getRemoteUserURI())) {
- $this->showForm(_('That’s a local profile! Login to subscribe.'));
+ // TRANS: Form validation error on page for remote subscribe.
+ $this->showForm(_('That is a local profile! Login to subscribe.'));
return;
}
try {
$service->requestToken();
} catch (OMB_RemoteServiceException $e) {
- $this->showForm(_('Couldn’t get a request token.'));
+ // TRANS: Form validation error on page for remote subscribe when the remote service is not providing a request token.
+ $this->showForm(_('Could not get a request token.'));
return;
}
$profile = $user->getProfile();
if (!$profile) {
common_log_db_error($user, 'SELECT', __FILE__);
+ // TRANS: Server error displayed on page for remote subscribe when user does not have a matching profile.
$this->serverError(_('User without matching profile.'));
return;
}
common_redirect($target_url, 303);
}
}
-?>