Commit 8a2002af authored by Siebrand Mazeland's avatar Siebrand Mazeland

Translator documentation added/updates.

L10n/i18n updates.
Superfluous whitespace removed.
parent b7178d21
......@@ -47,7 +47,6 @@ require_once INSTALLDIR.'/lib/noticelist.php';
*/
class ConversationRepliesAction extends ConversationAction
{
function handle($args)
{
if ($this->boolean('ajax')) {
......@@ -80,7 +79,8 @@ class ConversationRepliesAction extends ConversationAction
$this->xw->startDocument('1.0', 'UTF-8');
$this->elementStart('html');
$this->elementStart('head');
$this->element('title', null, _('Notice'));
// TRANS: Title for conversation page.
$this->element('title', null, _m('TITLE','Notice'));
$this->elementEnd('head');
$this->elementStart('body');
$this->showContent();
......
......@@ -4,7 +4,7 @@
* Copyright (C) 2010, StatusNet, Inc.
*
* Redirect to the given URL
*
*
* PHP version 5
*
* This program is free software: you can redistribute it and/or modify
......@@ -59,21 +59,23 @@ class RedirecturlAction extends Action
*
* @return boolean true
*/
function prepare($argarray)
{
parent::prepare($argarray);
$this->id = $this->trimmed('id');
if (empty($this->id)) {
throw new ClientException(_('No id parameter'));
// TRANS: Client exception thrown when no ID parameter was provided.
throw new ClientException(_('No id parameter.'));
}
$this->file = File::staticGet('id', $this->id);
if (empty($this->file)) {
throw new ClientException(sprintf(_('No such file "%d"'),
// TRANS: Client exception thrown when an invalid ID parameter was provided for a file.
// TRANS: %d is the provided ID for which the file is not present (number).
throw new ClientException(sprintf(_('No such file "%d".'),
$this->id),
404);
}
......@@ -88,7 +90,6 @@ class RedirecturlAction extends Action
*
* @return void
*/
function handle($argarray=null)
{
common_redirect($this->file->url, 307);
......@@ -104,7 +105,6 @@ class RedirecturlAction extends Action
*
* @return boolean is read only action?
*/
function isReadOnly($args)
{
return true;
......@@ -117,7 +117,6 @@ class RedirecturlAction extends Action
*
* @return string last modified http header
*/
function lastModified()
{
// For comparison with If-Last-Modified
......@@ -133,7 +132,6 @@ class RedirecturlAction extends Action
*
* @return string etag http header
*/
function etag()
{
return 'W/"' . implode(':', array($this->arg('action'),
......
This diff is collapsed.
......@@ -55,6 +55,7 @@ class RemotesubscribeAction extends Action
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;
}
......@@ -94,6 +95,8 @@ class RemotesubscribeAction extends Action
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 ' .
......@@ -108,6 +111,7 @@ class RemotesubscribeAction extends Action
function title()
{
// TRANS: Page title for Remote subscribe.
return _('Remote subscribe');
}
......@@ -120,20 +124,26 @@ class RemotesubscribeAction extends Action
'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,
// 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,
// 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');
}
......@@ -141,6 +151,7 @@ class RemotesubscribeAction extends Action
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;
}
......@@ -150,11 +161,13 @@ class RemotesubscribeAction extends Action
$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)) {
// TRANS: Form validation error on page for remote subscribe when an invalid profile URL was provided.
$this->showForm(_('Invalid profile URL (bad format).'));
return;
}
......@@ -164,6 +177,8 @@ class RemotesubscribeAction extends Action
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;
......@@ -172,6 +187,7 @@ class RemotesubscribeAction extends Action
if ($service->getServiceURI(OAUTH_ENDPOINT_REQUEST) ==
common_local_url('requesttoken') ||
User::staticGet('uri', $service->getRemoteUserURI())) {
// TRANS: Form validation error on page for remote subscribe.
$this->showForm(_('That is a local profile! Login to subscribe.'));
return;
}
......@@ -179,6 +195,7 @@ class RemotesubscribeAction extends Action
try {
$service->requestToken();
} catch (OMB_RemoteServiceException $e) {
// 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;
}
......@@ -187,6 +204,7 @@ class RemotesubscribeAction extends Action
$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;
}
......
<?php
/**
* Repeat action.
*
......@@ -53,6 +52,7 @@ class RepeatAction extends Action
$this->user = common_current_user();
if (empty($this->user)) {
// TRANS: Client error displayed when trying to repeat a notice while not logged in.
$this->clientError(_('Only logged-in users can repeat notices.'));
return false;
}
......@@ -60,6 +60,7 @@ class RepeatAction extends Action
$id = $this->trimmed('notice');
if (empty($id)) {
// TRANS: Client error displayed when trying to repeat a notice while not providing a notice ID.
$this->clientError(_('No notice specified.'));
return false;
}
......@@ -67,11 +68,13 @@ class RepeatAction extends Action
$this->notice = Notice::staticGet('id', $id);
if (empty($this->notice)) {
// TRANS: Client error displayed when trying to repeat a non-existing notice.
$this->clientError(_('No notice specified.'));
return false;
}
if ($this->user->id == $this->notice->profile_id) {
// TRANS: Client error displayed when trying to repeat an own notice.
$this->clientError(_('You cannot repeat your own notice.'));
return false;
}
......@@ -86,6 +89,7 @@ class RepeatAction extends Action
$profile = $this->user->getProfile();
if ($profile->hasRepeated($id)) {
// TRANS: Client error displayed when trying to repeat an already repeated notice.
$this->clientError(_('You already repeated that notice.'));
return false;
}
......@@ -104,21 +108,21 @@ class RepeatAction extends Action
{
$repeat = $this->notice->repeat($this->user->id, 'web');
if ($this->boolean('ajax')) {
$this->startHTML('text/xml;charset=utf-8');
$this->elementStart('head');
// TRANS: Title after repeating a notice.
$this->element('title', null, _('Repeated'));
$this->elementEnd('head');
$this->elementStart('body');
$this->element('p', array('id' => 'repeat_response',
'class' => 'repeated'),
// TRANS: Confirmation text after repeating a notice.
_('Repeated!'));
$this->elementEnd('body');
$this->elementEnd('html');
} else {
// FIXME!
// @todo FIXME!
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment