We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 9573f725 authored by Brion Vibber's avatar Brion Vibber

Merge branch '0.9.x' into testing

parents 9567308b f41dcb64

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.
......@@ -331,8 +331,7 @@ class ApiTimelineUserAction extends ApiBareAuthAction
if (Event::handle('StartAtomPubNewActivity', array(&$activity, $this->user, &$saved))) {
if ($activity->verb != ActivityVerb::POST) {
// TRANS: Client error displayed when not using the POST verb.
// TRANS: Do not translate POST.
// TRANS: Client error displayed when not using the POST verb. Do not translate POST.
$this->clientError(_('Can only handle POST activities.'));
return;
}
......
......@@ -244,8 +244,7 @@ class AtompubsubscriptionfeedAction extends ApiAuthAction
if (Event::handle('StartAtomPubNewActivity', array(&$activity))) {
if ($activity->verb != ActivityVerb::FOLLOW) {
// TRANS: Client error displayed when not using the POST verb.
// TRANS: Do not translate POST.
// TRANS: Client error displayed when not using the follow verb.
$this->clientError(_('Can only handle Follow activities.'));
return;
}
......@@ -264,14 +263,17 @@ class AtompubsubscriptionfeedAction extends ApiAuthAction
if (empty($profile)) {
// TRANS: Client exception thrown when subscribing to a non-existing profile.
// TRANS: %s is the unknown profile ID.
$this->clientError(sprintf(_('Unknown profile %s.'), $person->id));
return;
}
if (Subscription::exists($this->_profile, $profile)) {
// 409 Conflict
$this->clientError(sprintf(_('Already subscribed to %s'),
$person->id),
// TRANS: Client error displayed trying to subscribe to an already subscribed profile.
// TRANS: %s is the profile the user already has a subscription on.
$this->clientError(sprintf(_('Already subscribed to %s.'),
$person->id),
409);
return;
}
......
<?php
/**
* Disfavor action.
*
......
......@@ -198,6 +198,7 @@ class EditApplicationAction extends OwnerDesignAction
} elseif (Oauth_application::descriptionTooLong($description)) {
$this->showForm(sprintf(
// TRANS: Validation error shown when providing too long a description in the "Edit application" form.
// TRANS: %d is the maximum number of allowed characters.
_m('Description is too long (maximum %d character).',
'Description is too long (maximum %d characters).',
Oauth_application::maxDesc()),
......@@ -223,6 +224,7 @@ class EditApplicationAction extends OwnerDesignAction
$this->showForm(_('Organization is too long (maximum 255 characters).'));
return;
} elseif (empty($homepage)) {
// TRANS: Form validation error show when an organisation name has not been provided in the edit application form.
$this->showForm(_('Organization homepage is required.'));
return;
} elseif ((mb_strlen($homepage) > 0)
......
......@@ -46,7 +46,6 @@ require_once INSTALLDIR.'/lib/accountsettingsaction.php';
*
* @see Widget
*/
class EmailsettingsAction extends AccountSettingsAction
{
/**
......@@ -54,7 +53,6 @@ class EmailsettingsAction extends AccountSettingsAction
*
* @return string Title of the page
*/
function title()
{
// TRANS: Title for e-mail settings.
......@@ -66,7 +64,6 @@ class EmailsettingsAction extends AccountSettingsAction
*
* @return instructions for use
*/
function getInstructions()
{
// XXX: For consistency of parameters in messages, this should be a
......@@ -91,7 +88,6 @@ class EmailsettingsAction extends AccountSettingsAction
*
* @return void
*/
function showContent()
{
$user = common_current_user();
......@@ -118,8 +114,8 @@ class EmailsettingsAction extends AccountSettingsAction
$confirm = $this->getConfirmation();
if ($confirm) {
$this->element('p', array('id' => 'form_unconfirmed'), $confirm->address);
// TRANS: Form note in e-mail settings form.
$this->element('p', array('class' => 'form_note'),
// TRANS: Form note in e-mail settings form.
_('Awaiting confirmation on this address. '.
'Check your inbox (and spam box!) for a message '.
'with further instructions.'));
......@@ -173,7 +169,7 @@ class EmailsettingsAction extends AccountSettingsAction
if ($user->incomingemail) {
$this->elementStart('p');
$this->element('span', 'address', $user->incomingemail);
// XXX: Looks a little awkward in the UI.
// @todo XXX: Looks a little awkward in the UI.
// Something like "xxxx@identi.ca Send email ..". Needs improvement.
$this->element('span', 'input_instructions',
// TRANS: Form instructions for incoming e-mail form in e-mail settings.
......@@ -208,7 +204,7 @@ class EmailsettingsAction extends AccountSettingsAction
$this->element('legend', null, _('Email preferences'));
$this->elementStart('ul', 'form_data');
if (Event::handle('StartEmailFormData', array($this))) {
$this->elementStart('li');
$this->checkbox('emailnotifysub',
......@@ -262,7 +258,6 @@ class EmailsettingsAction extends AccountSettingsAction
*
* @return Confirm_address Email address confirmation for user, or null
*/
function getConfirmation()
{
$user = common_current_user();
......@@ -288,7 +283,6 @@ class EmailsettingsAction extends AccountSettingsAction
*
* @return void
*/
function handlePost()
{
// CSRF protection
......@@ -322,13 +316,12 @@ class EmailsettingsAction extends AccountSettingsAction
*
* @return void
*/
function savePreferences()
{
$user = common_current_user();
if (Event::handle('StartEmailSaveForm', array($this, &$user))) {
$emailnotifysub = $this->boolean('emailnotifysub');
$emailnotifyfav = $this->boolean('emailnotifyfav');
$emailnotifymsg = $this->boolean('emailnotifymsg');
......@@ -336,13 +329,13 @@ class EmailsettingsAction extends AccountSettingsAction
$emailnotifyattn = $this->boolean('emailnotifyattn');
$emailmicroid = $this->boolean('emailmicroid');
$emailpost = $this->boolean('emailpost');
assert(!is_null($user)); // should already be checked
$user->query('BEGIN');
$original = clone($user);
$user->emailnotifysub = $emailnotifysub;
$user->emailnotifyfav = $emailnotifyfav;
$user->emailnotifymsg = $emailnotifymsg;
......@@ -350,20 +343,20 @@ class EmailsettingsAction extends AccountSettingsAction
$user->emailnotifyattn = $emailnotifyattn;
$user->emailmicroid = $emailmicroid;
$user->emailpost = $emailpost;
$result = $user->update($original);
if ($result === false) {
common_log_db_error($user, 'UPDATE', __FILE__);
// TRANS: Server error thrown on database error updating e-mail preferences.
$this->serverError(_('Could not update user.'));
return;
}
$user->query('COMMIT');
Event::handle('EndEmailSaveForm', array($this));
// TRANS: Confirmation message for successful e-mail preferences save.
$this->showForm(_('Email preferences saved.'), true);
}
......@@ -374,7 +367,6 @@ class EmailsettingsAction extends AccountSettingsAction
*
* @return void
*/
function addAddress()
{
$user = common_current_user();
......@@ -393,7 +385,7 @@ class EmailsettingsAction extends AccountSettingsAction
if (!$email) {
// TRANS: Message given saving e-mail address that cannot be normalised.
$this->showForm(_('Cannot normalize that email address'));
$this->showForm(_('Cannot normalize that email address.'));
return;
}
if (!Validate::email($email, common_config('email', 'check_domain'))) {
......@@ -442,7 +434,6 @@ class EmailsettingsAction extends AccountSettingsAction
*
* @return void
*/
function cancelConfirmation()
{
$email = $this->arg('email');
......@@ -478,7 +469,6 @@ class EmailsettingsAction extends AccountSettingsAction
*
* @return void
*/
function removeAddress()
{
$user = common_current_user();
......@@ -519,12 +509,12 @@ class EmailsettingsAction extends AccountSettingsAction
*
* @return void
*/
function removeIncoming()
{
$user = common_current_user();
if (!$user->incomingemail) {
// TRANS: Form validation error displayed when trying to remove an incoming e-mail address while no address has been set.
$this->showForm(_('No incoming email address.'));
return;
}
......@@ -549,7 +539,6 @@ class EmailsettingsAction extends AccountSettingsAction
*
* @return void
*/
function newIncoming()
{
$user = common_current_user();
......
<?php
/**
* Favor action.
*
......@@ -59,6 +58,7 @@ class FavorAction extends Action
{
parent::handle($args);
if (!common_logged_in()) {
// TRANS: Client error displayed when trying to mark a notice as favorite without being logged in.
$this->clientError(_('Not logged in.'));
return;
}
......@@ -76,11 +76,13 @@ class FavorAction extends Action
return;
}
if ($user->hasFave($notice)) {
// TRANS: Client error displayed when trying to mark a notice as favorite that already is a favorite.
$this->clientError(_('This notice is already a favorite!'));
return;
}
$fave = Fave::addNew($user->getProfile(), $notice);
if (!$fave) {
// TRANS: Server error displayed when trying to mark a notice as favorite fails in the database.
$this->serverError(_('Could not create favorite.'));
return;
}
......@@ -89,6 +91,7 @@ class FavorAction extends Action
if ($this->boolean('ajax')) {
$this->startHTML('text/xml;charset=utf-8');
$this->elementStart('head');
// TRANS: Page title for page on which favorite notices can be unfavourited.
$this->element('title', null, _('Disfavor favorite'));
$this->elementEnd('head');
$this->elementStart('body');
......@@ -123,4 +126,3 @@ class FavorAction extends Action
}
}
}
......@@ -48,7 +48,6 @@ require_once INSTALLDIR.'/lib/noticelist.php';
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
class FavoritedAction extends Action
{
var $page = null;
......@@ -62,8 +61,11 @@ class FavoritedAction extends Action
function title()
{
if ($this->page == 1) {
// TRANS: Page title for first page of favorited notices.
return _('Popular notices');
} else {
// TRANS: Page title for all but first page of favorited notices.
// TRANS: %d is the page number being displayed.
return sprintf(_('Popular notices, page %d'), $this->page);
}
}
......@@ -73,9 +75,9 @@ class FavoritedAction extends Action
*
* @return instructions for use
*/
function getInstructions()
{
// TRANS: Description on page displaying favorited notices.
return _('The most popular notices on the site right now.');
}
......@@ -84,7 +86,6 @@ class FavoritedAction extends Action
*
* @return boolean true
*/
function isReadOnly($args)
{
return true;
......@@ -99,7 +100,6 @@ class FavoritedAction extends Action
*
* @todo move queries from showContent() to here
*/
function prepare($args)
{
parent::prepare($args);
......@@ -119,7 +119,6 @@ class FavoritedAction extends Action
*
* @return void
*/
function handle($args)
{
parent::handle($args);
......@@ -134,7 +133,6 @@ class FavoritedAction extends Action
*
* @return void
*/
function showPageNotice()
{
$instr = $this->getInstructions();
......@@ -147,12 +145,16 @@ class FavoritedAction extends Action
function showEmptyList()
{
// TRANS: Text displayed instead of a list when a site does not yet have any favourited notices.
$message = _('Favorite notices appear on this page but no one has favorited one yet.') . ' ';
if (common_logged_in()) {
// TRANS: Additional text displayed instead of a list when a site does not yet have any favourited notices for logged in users.
$message .= _('Be the first to add a notice to your favorites by clicking the fave button next to any notice you like.');
}
else {
// TRANS: Additional text displayed instead of a list when a site does not yet have any favourited notices for not logged in users.
// TRANS: %%action.register%% is a registration link. "[link text](link)" is Mark Down. Do not change the formatting.
$message .= _('Why not [register an account](%%action.register%%) and be the first to add a notice to your favorites!');
}
......@@ -168,7 +170,6 @@ class FavoritedAction extends Action
*
* @return void
*/
function showLocalNav()
{
$nav = new PublicGroupNav($this);
......@@ -182,7 +183,6 @@ class FavoritedAction extends Action
*
* @return void
*/
function showContent()
{
$pop = new Popularity();
......
<?php
/**
* RSS feed for user favorites action class.
*
......@@ -50,7 +49,6 @@ require_once INSTALLDIR.'/lib/rssaction.php';
*/
class FavoritesrssAction extends Rss10Action
{
/** The user whose favorites to display */
var $user = null;
......@@ -62,7 +60,6 @@ class FavoritesrssAction extends Rss10Action
*
* @return boolean success
*/
function prepare($args)
{
parent::prepare($args);
......@@ -71,6 +68,7 @@ class FavoritesrssAction extends Rss10Action
$this->user = User::staticGet('nickname', $nickname);
if (!$this->user) {
// TRANS: Client error displayed when trying to get the RSS feed with favorites of a user that does not exist.
$this->clientError(_('No such user.'));
return false;
} else {
......@@ -108,10 +106,14 @@ class FavoritesrssAction extends Rss10Action
$c = array('url' => common_local_url('favoritesrss',
array('nickname' =>
$user->nickname)),
// TRANS: Title of RSS feed with favourite notices of a user.
// TRANS: %s is a user's nickname.
'title' => sprintf(_("%s's favorite notices"), $user->nickname),
'link' => common_local_url('showfavorites',
array('nickname' =>
$user->nickname)),
// TRANS: Desciption of RSS feed with favourite notices of a user.
// TRANS: %1$s is a user's nickname, %2$s is the name of the StatusNet site.
'description' => sprintf(_('Updates favored by %1$s on %2$s!'),
$user->nickname, common_config('site', 'name')));
return $c;
......
......@@ -45,7 +45,6 @@ require_once INSTALLDIR.'/lib/publicgroupnav.php';
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
class FeaturedAction extends Action
{
var $page = null;
......@@ -66,8 +65,11 @@ class FeaturedAction extends Action
function title()
{
if ($this->page == 1) {
// TRANS: Page title for first page of featured users.
return _('Featured users');
} else {
// TRANS: Page title for all but first page of featured users.
// TRANS: %d is the page number being displayed.
return sprintf(_('Featured users, page %d'), $this->page);
}
}
......@@ -96,7 +98,8 @@ class FeaturedAction extends Action
function getInstructions()
{
return sprintf(_('A selection of some great users on %s'),
// TRANS: Description on page displaying featured users.
return sprintf(_('A selection of some great users on %s.'),
common_config('site', 'name'));
}
......
......@@ -21,6 +21,7 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
require_once(INSTALLDIR.'/actions/shownotice.php');
// @todo FIXME: Add documentation.
class FileAction extends Action
{
var $id = null;
......@@ -31,14 +32,17 @@ class FileAction extends Action
parent::prepare($args);
$this->id = $this->trimmed('notice');
if (empty($this->id)) {
// TRANS: Client error displayed when no notice ID was given trying do display a file.
$this->clientError(_('No notice ID.'));
}
$notice = Notice::staticGet('id', $this->id);
if (empty($notice)) {
// TRANS: Client error displayed when an invalid notice ID was given trying do display a file.
$this->clientError(_('No notice.'));
}
$atts = $notice->attachments();
if (empty($atts)) {
// TRANS: Client error displayed when trying do display a file for a notice without a file attachement.
$this->clientError(_('No attachments.'));
}
foreach ($atts as $att) {
......@@ -48,6 +52,9 @@ class FileAction extends Action
}
}
if (empty($this->filerec)) {
// XXX: Is this translation hint correct? If yes, please remove comment, if no, please correct and remove comment.
// TRANS: Client error displayed when trying do display a file for a notice with file attachements
// TRANS: that could not be found.
$this->clientError(_('No uploaded attachments.'));
}
return true;
......@@ -62,11 +69,8 @@ class FileAction extends Action
*
* @return boolean true
*/
function isReadOnly($args)
{
return true;
}
}
......@@ -48,7 +48,6 @@ require_once INSTALLDIR.'/lib/omb.php';
*/
class FinishremotesubscribeAction extends Action
{
/**
* Class handler.
*
......@@ -56,7 +55,7 @@ class FinishremotesubscribeAction extends Action
*
* @return nothing
*
**/
*/
function handle($args)
{
parent::handle($args);
......@@ -66,6 +65,7 @@ class FinishremotesubscribeAction extends Action
$service = unserialize($_SESSION['oauth_authorization_request']);
if (!$service) {
// TRANS: Client error displayed when subscribing to a remote profile and an unexpected response is received.
$this->clientError(_('Not expecting this response!'));
return;
}
......@@ -77,6 +77,7 @@ class FinishremotesubscribeAction extends Action
$user = User::staticGet('uri', $service->getListeneeURI());
if (!$user) {
// TRANS: Client error displayed when subscribing to a remote profile that does not exist.
$this->clientError(_('User being listened to does not exist.'));
return;
}
......@@ -84,6 +85,7 @@ class FinishremotesubscribeAction extends Action
$other = User::staticGet('uri', $service->getListenerURI());
if ($other) {
// TRANS: Client error displayed when subscribing to a remote profile that is a local profile.
$this->clientError(_('You can use the local subscription!'));
return;
}
......@@ -96,6 +98,7 @@ class FinishremotesubscribeAction extends Action
$profile = Profile::staticGet($remote->id);
if ($user->hasBlocked($profile)) {
// TRANS: Client error displayed when subscribing to a remote profile that is blocked form subscribing to.
$this->clientError(_('That user has blocked you from subscribing.'));
return;
}
......@@ -107,14 +110,17 @@ class FinishremotesubscribeAction extends Action
} catch (OAuthException $e) {
if ($e->getMessage() == 'The authorized token does not equal the ' .
'submitted token.') {
// TRANS: Client error displayed when subscribing to a remote profile without providing an authorised token.
$this->clientError(_('You are not authorized.'));
return;
} else {
// TRANS: Client error displayed when subscribing to a remote profile and conversion of the request token to access token fails.
$this->clientError(_('Could not convert request token to ' .
'access token.'));
return;
}
} catch (OMB_RemoteServiceException $e) {
// TRANS: Client error displayed when subscribing to a remote profile fails because of an unsupported version of the OMB protocol.
$this->clientError(_('Remote service uses unknown version of ' .
'OMB protocol.'));
return;
......@@ -135,6 +141,7 @@ class FinishremotesubscribeAction extends Action
$service->getServiceURI(OMB_ENDPOINT_UPDATEPROFILE);
if (!$remote->update($orig_remote)) {
// TRANS: Server error displayed when subscribing to a remote profile fails because the remote profile could not be updated.
$this->serverError(_('Error updating remote profile.'));
return;
}
......
......@@ -23,6 +23,7 @@ define('LISTENER', 1);
define('LISTENEE', -1);
define('BOTH', 0);
// @todo XXX: Documentation missing.
class FoafAction extends Action
{
function isReadOnly($args)
......@@ -37,6 +38,7 @@ class FoafAction extends Action
$nickname_arg = $this->arg('nickname');
if (empty($nickname_arg)) {
// TRANS: Client error displayed when requesting Friends of a Friend feed without providing a user nickname.
$this->clientError(_('No such user.'), 404);
return false;
}
......@@ -55,6 +57,7 @@ class FoafAction extends Action
$this->user = User::staticGet('nickname', $this->nickname);
if (!$this->user) {
// TRANS: Client error displayed when requesting Friends of a Friend feed for an object that is not a user.
$this->clientError(_('No such user.'), 404);
return false;
}
......@@ -62,6 +65,7 @@ class FoafAction extends Action
$this->profile = $this->user->getProfile();
if (!$this->profile) {
// TRANS: Server error displayed when requesting Friends of a Friend feed for a user for which the profile could not be found.
$this->serverError(_('User has no profile.'), 500);
return false;
}
......@@ -110,7 +114,7 @@ class FoafAction extends Action
if ($this->profile->bio) {
$this->element('bio:olb', null, $this->profile->bio);
}
$location = $this->profile->getLocation();
if ($location) {
$attr = array();
......@@ -118,7 +122,7 @@ class FoafAction extends Action
$attr['rdf:about'] = $location->getRdfURL();
}
$location_name = $location->getName();
$this->elementStart('based_near');
$this->elementStart('geo:SpatialThing', $attr);
if ($location_name) {
......@@ -193,7 +197,7 @@ class FoafAction extends Action
$t