*/
class LicenseadminpanelAction extends AdminPanelAction
{
-
/**
* Returns the page title
*
*/
function getInstructions()
{
+ // TRANS: Form instructions for the site license admin panel.
return _('License for this StatusNet site');
}
$types = array('private', 'allrightsreserved', 'cc');
if (!in_array($values['license']['type'], $types)) {
- $this->clientError(_("Invalid license selection."));
+ // TRANS: Client error displayed selecting an invalid license in the license admin panel.
+ $this->clientError(_('Invalid license selection.'));
}
// Make sure the user has set an owner if the site has a private
&& empty($values['license']['owner'])
) {
$this->clientError(
- _("You must specify the owner of the content when using the All Rights Reserved license.")
+ // TRANS: Client error displayed when not specifying an owner for the all rights reserved license in the license admin panel.
+ _('You must specify the owner of the content when using the All Rights Reserved license.')
);
}
// Make sure the license title is not too long
if (mb_strlen($values['license']['type']) > 255) {
$this->clientError(
+ // TRANS: Client error displayed selecting a too long license title in the license admin panel.
_('Invalid license title. Maximum length is 255 characters.')
);
}
if ($values['license']['type'] == 'cc') {
if (!Validate::uri($values['license']['url'], $options)) {
- $this->clientError(_("Invalid license URL."));
+ // TRANS: Client error displayed specifying an invalid license URL in the license admin panel.
+ $this->clientError(_('Invalid license URL.'));
}
if (!Validate::uri($values['license']['image'], $options)) {
- $this->clientError(_("Invalid license image URL."));
+ // TRANS: Client error displayed specifying an invalid license image URL in the license admin panel.
+ $this->clientError(_('Invalid license image URL.'));
}
}
if (!empty($values['license']['url'])) {
if (!Validate::uri($values['license']['url'], $options)) {
- $this->clientError(_("License URL must be blank or a valid URL."));
+ // TRANS: Client error displayed specifying an invalid license URL in the license admin panel.
+ $this->clientError(_('License URL must be blank or a valid URL.'));
}
}
if (!empty($values['license']['image'])) {
if (!Validate::uri($values['license']['image'], $options)) {
- $this->clientError(_("License image must be blank or valid URL."));
+ // TRANS: Client error displayed specifying an invalid license image URL in the license admin panel.
+ $this->clientError(_('License image must be blank or valid URL.'));
}
}
}
$this->out->elementStart(
'fieldset', array('id' => 'settings_license-selection')
);
+ // TRANS: Form legend in the license admin panel.
$this->out->element('legend', null, _('License selection'));
$this->out->elementStart('ul', 'form_data');
$this->li();
$types = array(
+ // TRANS: License option in the license admin panel.
'private' => _('Private'),
+ // TRANS: License option in the license admin panel.
'allrightsreserved' => _('All Rights Reserved'),
+ // TRANS: License option in the license admin panel.
'cc' => _('Creative Commons')
);
$this->out->dropdown(
'type',
+ // TRANS: Dropdown field label in the license admin panel.
_('Type'),
$types,
- _('Select license'),
+ // TRANS: Dropdown field instructions in the license admin panel.
+ _('Select a license.'),
false,
$this->value('type', 'license')
);
'fieldset',
array('id' => 'settings_license-details')
);
+ // TRANS: Form legend in the license admin panel.
$this->out->element('legend', null, _('License details'));
$this->out->elementStart('ul', 'form_data');
$this->li();
$this->input(
'owner',
+ // TRANS: Field label in the license admin panel.
_('Owner'),
+ // TRANS: Field title in the license admin panel.
_('Name of the owner of the site\'s content (if applicable).'),
'license'
);
$this->li();
$this->input(
'title',
+ // TRANS: Field label in the license admin panel.
_('License Title'),
+ // TRANS: Field title in the license admin panel.
_('The title of the license.'),
'license'
);
$this->li();
$this->input(
'url',
+ // TRANS: Field label in the license admin panel.
_('License URL'),
+ // TRANS: Field title in the license admin panel.
_('URL for more information about the license.'),
'license'
);
$this->li();
$this->input(
+ // TRANS: Field label in the license admin panel.
'image', _('License Image URL'),
+ // TRANS: Field title in the license admin panel.
_('URL for an image to display with the license.'),
'license'
);
function formActions()
{
$this->out->submit(
- 'submit', _('Save'), 'submit', null, _('Save license settings')
+ 'submit',
+ // TRANS: Button text in the license admin panel.
+ _m('BUTTON','Save'),
+ 'submit',
+ null,
+ // TRANS: Button title in the license admin panel.
+ _('Save license settings.')
);
}
}
parent::handle($args);
if (common_is_real_login()) {
+ // TRANS: Client error displayed when trying to log in while already logged in.
$this->clientError(_('Already logged in.'));
} else if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$this->checkLogin();
$user = common_check_user($nickname, $password);
if (!$user) {
+ // TRANS: Form validation error displayed when trying to log in with incorrect credentials.
$this->showForm(_('Incorrect username or password.'));
return;
}
// success!
if (!common_set_user($user)) {
+ // TRANS: Server error displayed when during login a server error occurs.
$this->serverError(_('Error setting user. You are probably not authorized.'));
return;
}
*/
function title()
{
+ // TRANS: Page title for login page.
return _('Login');
}
'class' => 'form_settings',
'action' => common_local_url('login')));
$this->elementStart('fieldset');
+ // TRANS: Form legend on login page.
$this->element('legend', null, _('Login to site'));
$this->elementStart('ul', 'form_data');
$this->elementStart('li');
+ // TRANS: Field label on login page.
$this->input('nickname', _('Nickname'));
$this->elementEnd('li');
$this->elementStart('li');
+ // TRANS: Field label on login page.
$this->password('password', _('Password'));
$this->elementEnd('li');
$this->elementStart('li');
+ // TRANS: Checkbox label label on login page.
$this->checkbox('rememberme', _('Remember me'), false,
+ // TRANS: Checkbox title on login page.
_('Automatically login in the future; ' .
'not for shared computers!'));
$this->elementEnd('li');
$this->elementEnd('ul');
- $this->submit('submit', _('Login'));
+ // TRANS: Button text for log in on login page.
+ $this->submit('submit', _m('BUTTON','Login'));
$this->elementEnd('fieldset');
$this->elementEnd('form');
$this->elementStart('p');
$this->element('a', array('href' => common_local_url('recoverpassword')),
+ // TRANS: Link text for link to "reset password" on login page.
_('Lost or forgotten password?'));
$this->elementEnd('p');
}
common_get_returnto()) {
// rememberme logins have to reauthenticate before
// changing any profile settings (cookie-stealing protection)
+ // TRANS: Form instructions on login page before being able to change user settings.
return _('For security reasons, please re-enter your ' .
'user name and password ' .
'before changing your settings.');
} else {
+ // TRANS: Form instructions on login page.
$prompt = _('Login with your username and password.');
if (!common_config('site', 'closed') && !common_config('site', 'inviteonly')) {
$prompt .= ' ';
+ // TRANS: Form instructions on login page. This message contains Markdown links in the form [Link text](Link).
+ // TRANS: %%action.register%% is a link to the registration page.
$prompt .= _('Don\'t have a username yet? ' .
'[Register](%%action.register%%) a new account.');
}
*/
class LogoutAction extends Action
{
-
/**
* This is read only.
*
{
parent::prepare($args);
if (!common_logged_in()) {
+ // TRANS: Client error displayed when trying to access the "make admin" page while not logged in.
$this->clientError(_('Not logged in.'));
return false;
}
}
$id = $this->trimmed('profileid');
if (empty($id)) {
+ // TRANS: Client error displayed when not providing a profile ID on the Make Admin page.
$this->clientError(_('No profile specified.'));
return false;
}
$this->profile = Profile::staticGet('id', $id);
if (empty($this->profile)) {
+ // TRANS: Client error displayed when specifying an invalid profile ID on the Make Admin page.
$this->clientError(_('No profile with that ID.'));
return false;
}
$group_id = $this->trimmed('groupid');
if (empty($group_id)) {
+ // TRANS: Client error displayed when not providing a group ID on the Make Admin page.
$this->clientError(_('No group specified.'));
return false;
}
$this->group = User_group::staticGet('id', $group_id);
if (empty($this->group)) {
+ // TRANS: Client error displayed when providing an invalid group ID on the Make Admin page.
$this->clientError(_('No such group.'));
return false;
}
$user = common_current_user();
if (!$user->isAdmin($this->group) &&
!$user->hasRight(Right::MAKEGROUPADMIN)) {
+ // TRANS: Client error displayed when trying to make another user admin on the Make Admin page while not an admin.
$this->clientError(_('Only an admin can make another user an admin.'), 401);
return false;
}
if ($this->profile->isAdmin($this->group)) {
+ // TRANS: Client error displayed when trying to make another user admin on the Make Admin page who already is admin.
+ // TRANS: %1$s is the user that is already admin, %2$s is the group user is already admin for.
$this->clientError(sprintf(_('%1$s is already an admin for group "%2$s".'),
$this->profile->getBestName(),
$this->group->getBestName()),
'profile_id' => $this->profile->id));
if (empty($member)) {
+ // TRANS: Server error displayed when trying to make another user admin on the Make Admin page fails
+ // TRANS: because the group membership record could not be gotten.
+ // TRANS: %1$s is the to be admin user, %2$s is the group user should be admin for.
$this->serverError(_('Can\'t get membership record for %1$s in group %2$s.'),
$this->profile->getBestName(),
$this->group->getBestName());
if (!$result) {
common_log_db_error($member, 'UPDATE', __FILE__);
+ // TRANS: Server error displayed when trying to make another user admin on the Make Admin page fails
+ // TRANS: because the group adminship record coud not be saved properly.
+ // TRANS: %1$s is the to be admin user, %2$s is the group user is already admin for.
$this->serverError(_('Can\'t make %1$s an admin for group %2$s.'),
$this->profile->getBestName(),
$this->group->getBestName());
{
/**
* Class handler.
- *
+ *
* @param array $args array of arguments
*
* @return nothing
$user = User::staticGet('nickname', $nickname);
if (!$user) {
+ // TRANS: Client error displayed trying to make a micro summary without providing a valid user.
$this->clientError(_('No such user.'), 404);
return;
}
-
+
$notice = $user->getCurrentNotice();
-
+
if (!$notice) {
+ // TRANS: Client error displayed trying to make a micro summary without providing a status.
$this->clientError(_('No current status.'), 404);
}
-
+
header('Content-Type: text/plain');
-
+
print $user->nickname . ': ' . $notice->content;
}
function title()
{
+ // TRANS: Page title for new direct message page.
return _('New message');
}
parent::handle($args);
if (!common_logged_in()) {
+ // TRANS: Client error displayed trying to create a new direct message while not logged in.
$this->clientError(_('Not logged in.'), 403);
} else if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$this->saveNewMessage();
$this->other = User::staticGet('id', $this->to);
if (!$this->other) {
+ // TRANS: Client error displayed trying to send a direct message to a non-existing user.
$this->clientError(_('No such user.'), 404);
return false;
}
if (!$user->mutuallySubscribed($this->other)) {
- $this->clientError(_('You can\'t send a message to this user.'), 404);
+ // TRANS: Client error displayed trying to send a direct message to a user while sender and
+ // TRANS: receiver are not subscribed to each other.
+ $this->clientError(_('You cannot send a message to this user.'), 404);
return false;
}
}
assert($user); // XXX: maybe an error instead...
if (!$this->content) {
+ // TRANS: Form validator error displayed trying to send a direct message without content.
$this->showForm(_('No content!'));
return;
} else {
}
if (!$this->other) {
+ // TRANS: Form validation error displayed trying to send a direct message without specifying a recipient.
$this->showForm(_('No recipient specified.'));
return;
} else if (!$user->mutuallySubscribed($this->other)) {
- $this->clientError(_('You can\'t send a message to this user.'), 404);
+ // TRANS: Client error displayed trying to send a direct message to a user while sender and
+ // TRANS: receiver are not subscribed to each other.
+ $this->clientError(_('You cannot send a message to this user.'), 404);
return;
} else if ($user->id == $this->other->id) {
+ // TRANS: Client error displayed trying to send a direct message to self.
$this->clientError(_('Don\'t send a message to yourself; ' .
'just say it to yourself quietly instead.'), 403);
return;
if ($this->boolean('ajax')) {
$this->startHTML('text/xml;charset=utf-8');
$this->elementStart('head');
+ // TRANS: Page title after sending a direct message.
$this->element('title', null, _('Message sent'));
$this->elementEnd('head');
$this->elementStart('body');
$this->element('p', array('id' => 'command_result'),
+ // TRANS: Confirmation text after sending a direct message.
+ // TRANS: %s is the direct message recipient.
sprintf(_('Direct message to %s sent.'),
$this->other->nickname));
$this->elementEnd('body');
{
$this->startHTML('text/xml;charset=utf-8', true);
$this->elementStart('head');
+ // TRANS: Page title after an AJAX error occurred on the "send direct message" page.
$this->element('title', null, _('Ajax Error'));
$this->elementEnd('head');
$this->elementStart('body');
$this->xw->startDocument('1.0', 'UTF-8');
$this->elementStart('html');
$this->elementStart('head');
+ // TRANS: Page title on page for sending a direct message.
$this->element('title', null, _('New message'));
$this->elementEnd('head');
$this->elementStart('body');
function title()
{
+ // TRANS: Page title for sending a new notice.
return _('New notice');
}
function handle($args)
{
if (!common_logged_in()) {
+ // TRANS: Client error displayed trying to send a notice while not logged in.
$this->clientError(_('Not logged in.'));
} else if ($_SERVER['REQUEST_METHOD'] == 'POST') {
// check for this before token since all POST and FILES data
Event::handle('StartSaveNewNoticeWeb', array($this, $user, &$content, &$options));
if (!$content) {
+ // TRANS: Client error displayed trying to send a notice without content.
$this->clientError(_('No content!'));
return;
}
$this->xw->startDocument('1.0', 'UTF-8');
$this->elementStart('html');
$this->elementStart('head');
+ // TRANS: Page title after sending a notice.
$this->element('title', null, _('Notice posted'));
$this->elementEnd('head');
$this->elementStart('body');
{
$this->startHTML('text/xml;charset=utf-8', true);
$this->elementStart('head');
+ // TRANS: Page title after an AJAX error occurs on the send notice page.
$this->element('title', null, _('Ajax Error'));
$this->elementEnd('head');
$this->elementStart('body');
parent::handle($args);
if (!common_logged_in()) {
+ // TRANS: Client error displayed trying to nudge a user without being logged in.
$this->clientError(_('Not logged in.'));
return;
}
}
if (!$other->email || !$other->emailnotifynudge) {
+ // TRANS: Client error displayed trying to nudge a user that cannot be nudged.
$this->clientError(_('This user doesn\'t allow nudges or hasn\'t confirmed or set their email address yet.'));
return;
}
if ($this->boolean('ajax')) {
$this->startHTML('text/xml;charset=utf-8');
$this->elementStart('head');
+ // TRANS: Page title after sending a nudge.
$this->element('title', null, _('Nudge sent'));
$this->elementEnd('head');
$this->elementStart('body');
+ // TRANS: Confirmation text after sending a nudge.
$this->element('p', array('id' => 'nudge_response'), _('Nudge sent!'));
$this->elementEnd('body');
$this->elementEnd('html');
return true;
}
}
-
$proxy_args = $r->map($path);
if (!$proxy_args) {
+ // TRANS: Server error displayed in oEmbed action when path not found.
+ // TRANS: %s is a path.
$this->serverError(sprintf(_('"%s" not found.'),$path), 404);
}
$oembed=array();
$id = $proxy_args['notice'];
$notice = Notice::staticGet($id);
if(empty($notice)){
+ // TRANS: Server error displayed in oEmbed action when notice not found.
+ // TRANS: %s is a notice.
$this->serverError(sprintf(_("Notice %s not found."),$id), 404);
}
$profile = $notice->getProfile();
if (empty($profile)) {
+ // TRANS: Server error displayed in oEmbed action when notice has not profile.
$this->serverError(_('Notice has no profile.'), 500);
}
$authorname = $profile->getFancyName();
+ // TRANS: oEmbed title. %1$s is the author name, %2$s is the creation date.
$oembed['title'] = sprintf(_('%1$s\'s status on %2$s'),
$authorname,
common_exact_date($notice->created));
$id = $proxy_args['attachment'];
$attachment = File::staticGet($id);
if(empty($attachment)){
+ // TRANS: Server error displayed in oEmbed action when attachment not found.
+ // TRANS: %d is an attachment ID.
$this->serverError(sprintf(_('Attachment %s not found.'),$id), 404);
}
if(empty($attachment->filename) && $file_oembed = File_oembed::staticGet('file_id', $attachment->id)){
if($attachment->title) $oembed['title']=$attachment->title;
break;
default:
+ // TRANS: Server error displayed in oEmbed request when a path is not supported.
+ // TRANS: %s is a path.
$this->serverError(sprintf(_('"%s" not supported for oembed requests.'),$path), 501);
}
switch($args['format']){
}
break;
default:
+ // TRANS: Server error displayed in oEmbed action when request specifies an unsupported data format.
$this->serverError(_('Not a supported data format.'), 501);
break;
}
}
break;
default:
+ // TRANS: Server error displayed in oEmbed action when request specifies an unsupported data format.
$this->serverError(_('Not a supported data format.'), 501);
break;
}
// TRANS: ShortName in the OpenSearch interface when trying to find users.
$short_name = _('People Search');
} else {
- // TRANS: ShortName in the OpenSearch interface when trying to find notices.
$type = 'noticesearch';
+ // TRANS: ShortName in the OpenSearch interface when trying to find notices.
$short_name = _('Notice Search');
}
header('Content-Type: application/opensearchdescription+xml');