* Add/update translator documentation.

* Update punctuation in form validation message for consistency.
* Remove superfluous whitespace.
This commit is contained in:
Siebrand Mazeland 2011-01-30 19:01:55 +01:00
parent c29a938895
commit 691f374a52
11 changed files with 81 additions and 61 deletions

View File

@ -1,5 +1,4 @@
<?php <?php
/** /**
* Disfavor action. * Disfavor action.
* *

View File

@ -198,6 +198,7 @@ class EditApplicationAction extends OwnerDesignAction
} elseif (Oauth_application::descriptionTooLong($description)) { } elseif (Oauth_application::descriptionTooLong($description)) {
$this->showForm(sprintf( $this->showForm(sprintf(
// TRANS: Validation error shown when providing too long a description in the "Edit application" form. // 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).', _m('Description is too long (maximum %d character).',
'Description is too long (maximum %d characters).', 'Description is too long (maximum %d characters).',
Oauth_application::maxDesc()), Oauth_application::maxDesc()),
@ -223,6 +224,7 @@ class EditApplicationAction extends OwnerDesignAction
$this->showForm(_('Organization is too long (maximum 255 characters).')); $this->showForm(_('Organization is too long (maximum 255 characters).'));
return; return;
} elseif (empty($homepage)) { } 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.')); $this->showForm(_('Organization homepage is required.'));
return; return;
} elseif ((mb_strlen($homepage) > 0) } elseif ((mb_strlen($homepage) > 0)

View File

@ -46,7 +46,6 @@ require_once INSTALLDIR.'/lib/accountsettingsaction.php';
* *
* @see Widget * @see Widget
*/ */
class EmailsettingsAction extends AccountSettingsAction class EmailsettingsAction extends AccountSettingsAction
{ {
/** /**
@ -54,7 +53,6 @@ class EmailsettingsAction extends AccountSettingsAction
* *
* @return string Title of the page * @return string Title of the page
*/ */
function title() function title()
{ {
// TRANS: Title for e-mail settings. // TRANS: Title for e-mail settings.
@ -66,7 +64,6 @@ class EmailsettingsAction extends AccountSettingsAction
* *
* @return instructions for use * @return instructions for use
*/ */
function getInstructions() function getInstructions()
{ {
// XXX: For consistency of parameters in messages, this should be a // XXX: For consistency of parameters in messages, this should be a
@ -91,7 +88,6 @@ class EmailsettingsAction extends AccountSettingsAction
* *
* @return void * @return void
*/ */
function showContent() function showContent()
{ {
$user = common_current_user(); $user = common_current_user();
@ -118,8 +114,8 @@ class EmailsettingsAction extends AccountSettingsAction
$confirm = $this->getConfirmation(); $confirm = $this->getConfirmation();
if ($confirm) { if ($confirm) {
$this->element('p', array('id' => 'form_unconfirmed'), $confirm->address); $this->element('p', array('id' => 'form_unconfirmed'), $confirm->address);
// TRANS: Form note in e-mail settings form.
$this->element('p', array('class' => 'form_note'), $this->element('p', array('class' => 'form_note'),
// TRANS: Form note in e-mail settings form.
_('Awaiting confirmation on this address. '. _('Awaiting confirmation on this address. '.
'Check your inbox (and spam box!) for a message '. 'Check your inbox (and spam box!) for a message '.
'with further instructions.')); 'with further instructions.'));
@ -173,7 +169,7 @@ class EmailsettingsAction extends AccountSettingsAction
if ($user->incomingemail) { if ($user->incomingemail) {
$this->elementStart('p'); $this->elementStart('p');
$this->element('span', 'address', $user->incomingemail); $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. // Something like "xxxx@identi.ca Send email ..". Needs improvement.
$this->element('span', 'input_instructions', $this->element('span', 'input_instructions',
// TRANS: Form instructions for incoming e-mail form in e-mail settings. // 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->element('legend', null, _('Email preferences'));
$this->elementStart('ul', 'form_data'); $this->elementStart('ul', 'form_data');
if (Event::handle('StartEmailFormData', array($this))) { if (Event::handle('StartEmailFormData', array($this))) {
$this->elementStart('li'); $this->elementStart('li');
$this->checkbox('emailnotifysub', $this->checkbox('emailnotifysub',
@ -262,7 +258,6 @@ class EmailsettingsAction extends AccountSettingsAction
* *
* @return Confirm_address Email address confirmation for user, or null * @return Confirm_address Email address confirmation for user, or null
*/ */
function getConfirmation() function getConfirmation()
{ {
$user = common_current_user(); $user = common_current_user();
@ -288,7 +283,6 @@ class EmailsettingsAction extends AccountSettingsAction
* *
* @return void * @return void
*/ */
function handlePost() function handlePost()
{ {
// CSRF protection // CSRF protection
@ -322,13 +316,12 @@ class EmailsettingsAction extends AccountSettingsAction
* *
* @return void * @return void
*/ */
function savePreferences() function savePreferences()
{ {
$user = common_current_user(); $user = common_current_user();
if (Event::handle('StartEmailSaveForm', array($this, &$user))) { if (Event::handle('StartEmailSaveForm', array($this, &$user))) {
$emailnotifysub = $this->boolean('emailnotifysub'); $emailnotifysub = $this->boolean('emailnotifysub');
$emailnotifyfav = $this->boolean('emailnotifyfav'); $emailnotifyfav = $this->boolean('emailnotifyfav');
$emailnotifymsg = $this->boolean('emailnotifymsg'); $emailnotifymsg = $this->boolean('emailnotifymsg');
@ -336,13 +329,13 @@ class EmailsettingsAction extends AccountSettingsAction
$emailnotifyattn = $this->boolean('emailnotifyattn'); $emailnotifyattn = $this->boolean('emailnotifyattn');
$emailmicroid = $this->boolean('emailmicroid'); $emailmicroid = $this->boolean('emailmicroid');
$emailpost = $this->boolean('emailpost'); $emailpost = $this->boolean('emailpost');
assert(!is_null($user)); // should already be checked assert(!is_null($user)); // should already be checked
$user->query('BEGIN'); $user->query('BEGIN');
$original = clone($user); $original = clone($user);
$user->emailnotifysub = $emailnotifysub; $user->emailnotifysub = $emailnotifysub;
$user->emailnotifyfav = $emailnotifyfav; $user->emailnotifyfav = $emailnotifyfav;
$user->emailnotifymsg = $emailnotifymsg; $user->emailnotifymsg = $emailnotifymsg;
@ -350,20 +343,20 @@ class EmailsettingsAction extends AccountSettingsAction
$user->emailnotifyattn = $emailnotifyattn; $user->emailnotifyattn = $emailnotifyattn;
$user->emailmicroid = $emailmicroid; $user->emailmicroid = $emailmicroid;
$user->emailpost = $emailpost; $user->emailpost = $emailpost;
$result = $user->update($original); $result = $user->update($original);
if ($result === false) { if ($result === false) {
common_log_db_error($user, 'UPDATE', __FILE__); common_log_db_error($user, 'UPDATE', __FILE__);
// TRANS: Server error thrown on database error updating e-mail preferences. // TRANS: Server error thrown on database error updating e-mail preferences.
$this->serverError(_('Could not update user.')); $this->serverError(_('Could not update user.'));
return; return;
} }
$user->query('COMMIT'); $user->query('COMMIT');
Event::handle('EndEmailSaveForm', array($this)); Event::handle('EndEmailSaveForm', array($this));
// TRANS: Confirmation message for successful e-mail preferences save. // TRANS: Confirmation message for successful e-mail preferences save.
$this->showForm(_('Email preferences saved.'), true); $this->showForm(_('Email preferences saved.'), true);
} }
@ -374,7 +367,6 @@ class EmailsettingsAction extends AccountSettingsAction
* *
* @return void * @return void
*/ */
function addAddress() function addAddress()
{ {
$user = common_current_user(); $user = common_current_user();
@ -393,7 +385,7 @@ class EmailsettingsAction extends AccountSettingsAction
if (!$email) { if (!$email) {
// TRANS: Message given saving e-mail address that cannot be normalised. // 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; return;
} }
if (!Validate::email($email, common_config('email', 'check_domain'))) { if (!Validate::email($email, common_config('email', 'check_domain'))) {
@ -442,7 +434,6 @@ class EmailsettingsAction extends AccountSettingsAction
* *
* @return void * @return void
*/ */
function cancelConfirmation() function cancelConfirmation()
{ {
$email = $this->arg('email'); $email = $this->arg('email');
@ -478,7 +469,6 @@ class EmailsettingsAction extends AccountSettingsAction
* *
* @return void * @return void
*/ */
function removeAddress() function removeAddress()
{ {
$user = common_current_user(); $user = common_current_user();
@ -519,12 +509,12 @@ class EmailsettingsAction extends AccountSettingsAction
* *
* @return void * @return void
*/ */
function removeIncoming() function removeIncoming()
{ {
$user = common_current_user(); $user = common_current_user();
if (!$user->incomingemail) { 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.')); $this->showForm(_('No incoming email address.'));
return; return;
} }
@ -549,7 +539,6 @@ class EmailsettingsAction extends AccountSettingsAction
* *
* @return void * @return void
*/ */
function newIncoming() function newIncoming()
{ {
$user = common_current_user(); $user = common_current_user();

View File

@ -1,5 +1,4 @@
<?php <?php
/** /**
* Favor action. * Favor action.
* *
@ -59,6 +58,7 @@ class FavorAction extends Action
{ {
parent::handle($args); parent::handle($args);
if (!common_logged_in()) { 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.')); $this->clientError(_('Not logged in.'));
return; return;
} }
@ -76,11 +76,13 @@ class FavorAction extends Action
return; return;
} }
if ($user->hasFave($notice)) { 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!')); $this->clientError(_('This notice is already a favorite!'));
return; return;
} }
$fave = Fave::addNew($user->getProfile(), $notice); $fave = Fave::addNew($user->getProfile(), $notice);
if (!$fave) { if (!$fave) {
// TRANS: Server error displayed when trying to mark a notice as favorite fails in the database.
$this->serverError(_('Could not create favorite.')); $this->serverError(_('Could not create favorite.'));
return; return;
} }
@ -89,6 +91,7 @@ class FavorAction extends Action
if ($this->boolean('ajax')) { if ($this->boolean('ajax')) {
$this->startHTML('text/xml;charset=utf-8'); $this->startHTML('text/xml;charset=utf-8');
$this->elementStart('head'); $this->elementStart('head');
// TRANS: Page title for page on which favorite notices can be unfavourited.
$this->element('title', null, _('Disfavor favorite')); $this->element('title', null, _('Disfavor favorite'));
$this->elementEnd('head'); $this->elementEnd('head');
$this->elementStart('body'); $this->elementStart('body');
@ -123,4 +126,3 @@ class FavorAction extends Action
} }
} }
} }

View File

@ -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 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/ * @link http://status.net/
*/ */
class FavoritedAction extends Action class FavoritedAction extends Action
{ {
var $page = null; var $page = null;
@ -62,8 +61,11 @@ class FavoritedAction extends Action
function title() function title()
{ {
if ($this->page == 1) { if ($this->page == 1) {
// TRANS: Page title for first page of favorited notices.
return _('Popular notices'); return _('Popular notices');
} else { } 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); return sprintf(_('Popular notices, page %d'), $this->page);
} }
} }
@ -73,9 +75,9 @@ class FavoritedAction extends Action
* *
* @return instructions for use * @return instructions for use
*/ */
function getInstructions() function getInstructions()
{ {
// TRANS: Description on page displaying favorited notices.
return _('The most popular notices on the site right now.'); return _('The most popular notices on the site right now.');
} }
@ -84,7 +86,6 @@ class FavoritedAction extends Action
* *
* @return boolean true * @return boolean true
*/ */
function isReadOnly($args) function isReadOnly($args)
{ {
return true; return true;
@ -99,7 +100,6 @@ class FavoritedAction extends Action
* *
* @todo move queries from showContent() to here * @todo move queries from showContent() to here
*/ */
function prepare($args) function prepare($args)
{ {
parent::prepare($args); parent::prepare($args);
@ -119,7 +119,6 @@ class FavoritedAction extends Action
* *
* @return void * @return void
*/ */
function handle($args) function handle($args)
{ {
parent::handle($args); parent::handle($args);
@ -134,7 +133,6 @@ class FavoritedAction extends Action
* *
* @return void * @return void
*/ */
function showPageNotice() function showPageNotice()
{ {
$instr = $this->getInstructions(); $instr = $this->getInstructions();
@ -147,12 +145,16 @@ class FavoritedAction extends Action
function showEmptyList() 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.') . ' '; $message = _('Favorite notices appear on this page but no one has favorited one yet.') . ' ';
if (common_logged_in()) { 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.'); $message .= _('Be the first to add a notice to your favorites by clicking the fave button next to any notice you like.');
} }
else { 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!'); $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 * @return void
*/ */
function showLocalNav() function showLocalNav()
{ {
$nav = new PublicGroupNav($this); $nav = new PublicGroupNav($this);
@ -182,7 +183,6 @@ class FavoritedAction extends Action
* *
* @return void * @return void
*/ */
function showContent() function showContent()
{ {
$pop = new Popularity(); $pop = new Popularity();

View File

@ -1,5 +1,4 @@
<?php <?php
/** /**
* RSS feed for user favorites action class. * RSS feed for user favorites action class.
* *
@ -50,7 +49,6 @@ require_once INSTALLDIR.'/lib/rssaction.php';
*/ */
class FavoritesrssAction extends Rss10Action class FavoritesrssAction extends Rss10Action
{ {
/** The user whose favorites to display */ /** The user whose favorites to display */
var $user = null; var $user = null;
@ -62,7 +60,6 @@ class FavoritesrssAction extends Rss10Action
* *
* @return boolean success * @return boolean success
*/ */
function prepare($args) function prepare($args)
{ {
parent::prepare($args); parent::prepare($args);
@ -71,6 +68,7 @@ class FavoritesrssAction extends Rss10Action
$this->user = User::staticGet('nickname', $nickname); $this->user = User::staticGet('nickname', $nickname);
if (!$this->user) { 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.')); $this->clientError(_('No such user.'));
return false; return false;
} else { } else {
@ -108,10 +106,14 @@ class FavoritesrssAction extends Rss10Action
$c = array('url' => common_local_url('favoritesrss', $c = array('url' => common_local_url('favoritesrss',
array('nickname' => array('nickname' =>
$user->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), 'title' => sprintf(_("%s's favorite notices"), $user->nickname),
'link' => common_local_url('showfavorites', 'link' => common_local_url('showfavorites',
array('nickname' => array('nickname' =>
$user->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!'), 'description' => sprintf(_('Updates favored by %1$s on %2$s!'),
$user->nickname, common_config('site', 'name'))); $user->nickname, common_config('site', 'name')));
return $c; return $c;

View File

@ -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 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/ * @link http://status.net/
*/ */
class FeaturedAction extends Action class FeaturedAction extends Action
{ {
var $page = null; var $page = null;
@ -66,8 +65,11 @@ class FeaturedAction extends Action
function title() function title()
{ {
if ($this->page == 1) { if ($this->page == 1) {
// TRANS: Page title for first page of featured users.
return _('Featured users'); return _('Featured users');
} else { } 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); return sprintf(_('Featured users, page %d'), $this->page);
} }
} }
@ -96,7 +98,8 @@ class FeaturedAction extends Action
function getInstructions() 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')); common_config('site', 'name'));
} }

View File

@ -21,6 +21,7 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
require_once(INSTALLDIR.'/actions/shownotice.php'); require_once(INSTALLDIR.'/actions/shownotice.php');
// @todo FIXME: Add documentation.
class FileAction extends Action class FileAction extends Action
{ {
var $id = null; var $id = null;
@ -31,14 +32,17 @@ class FileAction extends Action
parent::prepare($args); parent::prepare($args);
$this->id = $this->trimmed('notice'); $this->id = $this->trimmed('notice');
if (empty($this->id)) { if (empty($this->id)) {
// TRANS: Client error displayed when no notice ID was given trying do display a file.
$this->clientError(_('No notice ID.')); $this->clientError(_('No notice ID.'));
} }
$notice = Notice::staticGet('id', $this->id); $notice = Notice::staticGet('id', $this->id);
if (empty($notice)) { if (empty($notice)) {
// TRANS: Client error displayed when an invalid notice ID was given trying do display a file.
$this->clientError(_('No notice.')); $this->clientError(_('No notice.'));
} }
$atts = $notice->attachments(); $atts = $notice->attachments();
if (empty($atts)) { if (empty($atts)) {
// TRANS: Client error displayed when trying do display a file for a notice without a file attachement.
$this->clientError(_('No attachments.')); $this->clientError(_('No attachments.'));
} }
foreach ($atts as $att) { foreach ($atts as $att) {
@ -48,6 +52,9 @@ class FileAction extends Action
} }
} }
if (empty($this->filerec)) { 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.')); $this->clientError(_('No uploaded attachments.'));
} }
return true; return true;
@ -62,11 +69,8 @@ class FileAction extends Action
* *
* @return boolean true * @return boolean true
*/ */
function isReadOnly($args) function isReadOnly($args)
{ {
return true; return true;
} }
} }

View File

@ -55,7 +55,6 @@ class NewApplicationAction extends OwnerDesignAction
/** /**
* Prepare to run * Prepare to run
*/ */
function prepare($args) function prepare($args)
{ {
parent::prepare($args); parent::prepare($args);
@ -78,7 +77,6 @@ class NewApplicationAction extends OwnerDesignAction
* *
* @return void * @return void
*/ */
function handle($args) function handle($args)
{ {
parent::handle($args); parent::handle($args);
@ -122,6 +120,7 @@ class NewApplicationAction extends OwnerDesignAction
} elseif ($this->arg('save')) { } elseif ($this->arg('save')) {
$this->trySave(); $this->trySave();
} else { } else {
// TRANS: Client error displayed when encountering an unexpected action on form submission.
$this->clientError(_('Unexpected form submission.')); $this->clientError(_('Unexpected form submission.'));
} }
} }
@ -144,6 +143,7 @@ class NewApplicationAction extends OwnerDesignAction
$this->element('p', 'error', $this->msg); $this->element('p', 'error', $this->msg);
} else { } else {
$this->element('p', 'instructions', $this->element('p', 'instructions',
// TRANS: Form instructions for registering a new application.
_('Use this form to register a new application.')); _('Use this form to register a new application.'));
} }
} }
@ -160,15 +160,19 @@ class NewApplicationAction extends OwnerDesignAction
$access_type = $this->arg('default_access_type'); $access_type = $this->arg('default_access_type');
if (empty($name)) { if (empty($name)) {
// TRANS: Validation error shown when not providing a name in the "New application" form.
$this->showForm(_('Name is required.')); $this->showForm(_('Name is required.'));
return; return;
} else if ($this->nameExists($name)) { } else if ($this->nameExists($name)) {
// TRANS: Validation error shown when providing a name for an application that already exists in the "New application" form.
$this->showForm(_('Name already in use. Try another one.')); $this->showForm(_('Name already in use. Try another one.'));
return; return;
} elseif (mb_strlen($name) > 255) { } elseif (mb_strlen($name) > 255) {
// TRANS: Validation error shown when providing too long a name in the "New application" form.
$this->showForm(_('Name is too long (maximum 255 characters).')); $this->showForm(_('Name is too long (maximum 255 characters).'));
return; return;
} elseif (empty($description)) { } elseif (empty($description)) {
// TRANS: Validation error shown when not providing a description in the "New application" form.
$this->showForm(_('Description is required.')); $this->showForm(_('Description is required.'));
return; return;
} elseif (Oauth_application::descriptionTooLong($description)) { } elseif (Oauth_application::descriptionTooLong($description)) {
@ -181,6 +185,7 @@ class NewApplicationAction extends OwnerDesignAction
Oauth_application::maxDesc())); Oauth_application::maxDesc()));
return; return;
} elseif (empty($source_url)) { } elseif (empty($source_url)) {
// TRANS: Validation error shown when not providing a source URL in the "New application" form.
$this->showForm(_('Source URL is required.')); $this->showForm(_('Source URL is required.'));
return; return;
} elseif ((strlen($source_url) > 0) } elseif ((strlen($source_url) > 0)
@ -190,15 +195,19 @@ class NewApplicationAction extends OwnerDesignAction
) )
) )
{ {
// TRANS: Validation error shown when providing an invalid source URL in the "New application" form.
$this->showForm(_('Source URL is not valid.')); $this->showForm(_('Source URL is not valid.'));
return; return;
} elseif (empty($organization)) { } elseif (empty($organization)) {
// TRANS: Validation error shown when not providing an organisation in the "New application" form.
$this->showForm(_('Organization is required.')); $this->showForm(_('Organization is required.'));
return; return;
} elseif (mb_strlen($organization) > 255) { } elseif (mb_strlen($organization) > 255) {
// TRANS: Validation error shown when providing too long an arganisation name in the "Edit application" form.
$this->showForm(_('Organization is too long (maximum 255 characters).')); $this->showForm(_('Organization is too long (maximum 255 characters).'));
return; return;
} elseif (empty($homepage)) { } elseif (empty($homepage)) {
// TRANS: Form validation error show when an organisation name has not been provided in the new application form.
$this->showForm(_('Organization homepage is required.')); $this->showForm(_('Organization homepage is required.'));
return; return;
} elseif ((strlen($homepage) > 0) } elseif ((strlen($homepage) > 0)
@ -208,9 +217,11 @@ class NewApplicationAction extends OwnerDesignAction
) )
) )
{ {
// TRANS: Validation error shown when providing an invalid homepage URL in the "New application" form.
$this->showForm(_('Homepage is not a valid URL.')); $this->showForm(_('Homepage is not a valid URL.'));
return; return;
} elseif (mb_strlen($callback_url) > 255) { } elseif (mb_strlen($callback_url) > 255) {
// TRANS: Validation error shown when providing too long a callback URL in the "New application" form.
$this->showForm(_('Callback is too long.')); $this->showForm(_('Callback is too long.'));
return; return;
} elseif (strlen($callback_url) > 0 } elseif (strlen($callback_url) > 0
@ -220,6 +231,7 @@ class NewApplicationAction extends OwnerDesignAction
) )
) )
{ {
// TRANS: Validation error shown when providing an invalid callback URL in the "New application" form.
$this->showForm(_('Callback URL is not valid.')); $this->showForm(_('Callback URL is not valid.'));
return; return;
} }
@ -263,6 +275,7 @@ class NewApplicationAction extends OwnerDesignAction
if (!$result) { if (!$result) {
common_log_db_error($consumer, 'INSERT', __FILE__); common_log_db_error($consumer, 'INSERT', __FILE__);
// TRANS: Server error displayed when an application could not be registered in the database through the "New application" form.
$this->serverError(_('Could not create application.')); $this->serverError(_('Could not create application.'));
} }
@ -272,6 +285,7 @@ class NewApplicationAction extends OwnerDesignAction
if (!$this->app_id) { if (!$this->app_id) {
common_log_db_error($app, 'INSERT', __FILE__); common_log_db_error($app, 'INSERT', __FILE__);
// TRANS: Server error displayed when an application could not be registered in the database through the "New application" form.
$this->serverError(_('Could not create application.')); $this->serverError(_('Could not create application.'));
$app->query('ROLLBACK'); $app->query('ROLLBACK');
} }
@ -281,7 +295,6 @@ class NewApplicationAction extends OwnerDesignAction
$app->query('COMMIT'); $app->query('COMMIT');
common_redirect(common_local_url('oauthappssettings'), 303); common_redirect(common_local_url('oauthappssettings'), 303);
} }
/** /**
@ -294,12 +307,9 @@ class NewApplicationAction extends OwnerDesignAction
* *
* @return boolean true if the name already exists * @return boolean true if the name already exists
*/ */
function nameExists($name) function nameExists($name)
{ {
$app = Oauth_application::staticGet('name', $name); $app = Oauth_application::staticGet('name', $name);
return !empty($app); return !empty($app);
} }
} }

View File

@ -44,7 +44,6 @@ require_once INSTALLDIR.'/lib/feedlist.php';
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/ * @link http://status.net/
*/ */
class ShowfavoritesAction extends OwnerDesignAction class ShowfavoritesAction extends OwnerDesignAction
{ {
/** User we're getting the faves of */ /** User we're getting the faves of */
@ -57,7 +56,6 @@ class ShowfavoritesAction extends OwnerDesignAction
* *
* @return boolean true * @return boolean true
*/ */
function isReadOnly($args) function isReadOnly($args)
{ {
return true; return true;
@ -70,12 +68,15 @@ class ShowfavoritesAction extends OwnerDesignAction
* *
* @return string title of page * @return string title of page
*/ */
function title() function title()
{ {
if ($this->page == 1) { if ($this->page == 1) {
// TRANS: Title for first page of favourite notices of a user.
// TRANS: %s is the user for whom the favourite notices are displayed.
return sprintf(_('%s\'s favorite notices'), $this->user->nickname); return sprintf(_('%s\'s favorite notices'), $this->user->nickname);
} else { } else {
// TRANS: Title for all but the first page of favourite notices of a user.
// TRANS: %1$s is the user for whom the favourite notices are displayed, %2$d is the page number.
return sprintf(_('%1$s\'s favorite notices, page %2$d'), return sprintf(_('%1$s\'s favorite notices, page %2$d'),
$this->user->nickname, $this->user->nickname,
$this->page); $this->page);
@ -92,7 +93,6 @@ class ShowfavoritesAction extends OwnerDesignAction
* *
* @return boolean success flag * @return boolean success flag
*/ */
function prepare($args) function prepare($args)
{ {
parent::prepare($args); parent::prepare($args);
@ -102,6 +102,7 @@ class ShowfavoritesAction extends OwnerDesignAction
$this->user = User::staticGet('nickname', $nickname); $this->user = User::staticGet('nickname', $nickname);
if (!$this->user) { if (!$this->user) {
// TRANS: Client error displayed when trying to display favourite notices for a non-existing user.
$this->clientError(_('No such user.')); $this->clientError(_('No such user.'));
return false; return false;
} }
@ -129,6 +130,7 @@ class ShowfavoritesAction extends OwnerDesignAction
} }
if (empty($this->notice)) { if (empty($this->notice)) {
// TRANS: Server error displayed when favourite notices could not be retrieved from the database.
$this->serverError(_('Could not retrieve favorite notices.')); $this->serverError(_('Could not retrieve favorite notices.'));
return; return;
} }
@ -150,7 +152,6 @@ class ShowfavoritesAction extends OwnerDesignAction
* *
* @return void * @return void
*/ */
function handle($args) function handle($args)
{ {
parent::handle($args); parent::handle($args);
@ -162,12 +163,12 @@ class ShowfavoritesAction extends OwnerDesignAction
* *
* @return array Feed objects to show * @return array Feed objects to show
*/ */
function getFeeds() function getFeeds()
{ {
return array(new Feed(Feed::RSS1, return array(new Feed(Feed::RSS1,
common_local_url('favoritesrss', common_local_url('favoritesrss',
array('nickname' => $this->user->nickname)), array('nickname' => $this->user->nickname)),
// TRANS: Feed link text. %s is a username.
sprintf(_('Feed for favorites of %s (RSS 1.0)'), sprintf(_('Feed for favorites of %s (RSS 1.0)'),
$this->user->nickname)), $this->user->nickname)),
new Feed(Feed::RSS2, new Feed(Feed::RSS2,
@ -175,6 +176,7 @@ class ShowfavoritesAction extends OwnerDesignAction
array( array(
'id' => $this->user->nickname, 'id' => $this->user->nickname,
'format' => 'rss')), 'format' => 'rss')),
// TRANS: Feed link text. %s is a username.
sprintf(_('Feed for favorites of %s (RSS 2.0)'), sprintf(_('Feed for favorites of %s (RSS 2.0)'),
$this->user->nickname)), $this->user->nickname)),
new Feed(Feed::ATOM, new Feed(Feed::ATOM,
@ -182,6 +184,7 @@ class ShowfavoritesAction extends OwnerDesignAction
array( array(
'id' => $this->user->nickname, 'id' => $this->user->nickname,
'format' => 'atom')), 'format' => 'atom')),
// TRANS: Feed link text. %s is a username.
sprintf(_('Feed for favorites of %s (Atom)'), sprintf(_('Feed for favorites of %s (Atom)'),
$this->user->nickname))); $this->user->nickname)));
} }
@ -191,7 +194,6 @@ class ShowfavoritesAction extends OwnerDesignAction
* *
* @return void * @return void
*/ */
function showLocalNav() function showLocalNav()
{ {
$nav = new PersonalGroupNav($this); $nav = new PersonalGroupNav($this);
@ -203,12 +205,18 @@ class ShowfavoritesAction extends OwnerDesignAction
if (common_logged_in()) { if (common_logged_in()) {
$current_user = common_current_user(); $current_user = common_current_user();
if ($this->user->id === $current_user->id) { if ($this->user->id === $current_user->id) {
// TRANS: Text displayed instead of favourite notices for the current logged in user that has no favourites.
$message = _('You haven\'t chosen any favorite notices yet. Click the fave button on notices you like to bookmark them for later or shed a spotlight on them.'); $message = _('You haven\'t chosen any favorite notices yet. Click the fave button on notices you like to bookmark them for later or shed a spotlight on them.');
} else { } else {
// TRANS: Text displayed instead of favourite notices for a user that has no favourites while logged in.
// TRANS: %s is a username.
$message = sprintf(_('%s hasn\'t added any favorite notices yet. Post something interesting they would add to their favorites :)'), $this->user->nickname); $message = sprintf(_('%s hasn\'t added any favorite notices yet. Post something interesting they would add to their favorites :)'), $this->user->nickname);
} }
} }
else { else {
// TRANS: Text displayed instead of favourite notices for a user that has no favourites while not logged in.
// TRANS: %s is a username, %%%%action.register%%%% is a link to the user registration page.
// TRANS: (link text)[link] is a Mark Down link.
$message = sprintf(_('%s hasn\'t added any favorite notices yet. Why not [register an account](%%%%action.register%%%%) and then post something interesting they would add to their favorites :)'), $this->user->nickname); $message = sprintf(_('%s hasn\'t added any favorite notices yet. Why not [register an account](%%%%action.register%%%%) and then post something interesting they would add to their favorites :)'), $this->user->nickname);
} }
@ -224,7 +232,6 @@ class ShowfavoritesAction extends OwnerDesignAction
* *
* @return void * @return void
*/ */
function showContent() function showContent()
{ {
$nl = new FavoritesNoticeList($this->notice, $this); $nl = new FavoritesNoticeList($this->notice, $this);
@ -240,6 +247,7 @@ class ShowfavoritesAction extends OwnerDesignAction
} }
function showPageNotice() { function showPageNotice() {
// TRANS: Page notice for show favourites page.
$this->element('p', 'instructions', _('This is a way to share what you like.')); $this->element('p', 'instructions', _('This is a way to share what you like.'));
} }
} }

View File

@ -532,7 +532,7 @@ class SmssettingsAction extends ConnectSettingsAction
if (!$code) { if (!$code) {
// TRANS: Message given saving SMS phone number confirmation code without having provided one. // TRANS: Message given saving SMS phone number confirmation code without having provided one.
$this->showForm(_('No code entered')); $this->showForm(_('No code entered.'));
return; return;
} }
@ -551,6 +551,7 @@ class SmssettingsAction extends ConnectSettingsAction
$user = common_current_user(); $user = common_current_user();
if (!$user->incomingemail) { 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.')); $this->showForm(_('No incoming email address.'));
return; return;
} }