Commit a12474a9 authored by Siebrand Mazeland's avatar Siebrand Mazeland

* i18n/L10n fixes.

* translator documentation updated.
* superfluous whitespace removed.
parent 60b66bdd
......@@ -40,7 +40,6 @@ if (!defined('STATUSNET')) {
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
class AccessadminpanelAction extends AdminPanelAction
{
/**
......@@ -48,10 +47,9 @@ class AccessadminpanelAction extends AdminPanelAction
*
* @return string page title
*/
function title()
{
// TRANS: Page title
// TRANS: Page title for Access admin panel that allows configuring site access.
return _('Access');
}
......@@ -60,10 +58,9 @@ class AccessadminpanelAction extends AdminPanelAction
*
* @return string instructions
*/
function getInstructions()
{
// TRANS: Page notice
// TRANS: Page notice.
return _('Site access settings');
}
......@@ -72,7 +69,6 @@ class AccessadminpanelAction extends AdminPanelAction
*
* @return void
*/
function showForm()
{
$form = new AccessAdminPanelForm($this);
......@@ -85,7 +81,6 @@ class AccessadminpanelAction extends AdminPanelAction
*
* @return void
*/
function saveSettings()
{
static $booleans = array('site' => array('private', 'inviteonly', 'closed'));
......@@ -110,7 +105,6 @@ class AccessadminpanelAction extends AdminPanelAction
return;
}
}
class AccessAdminPanelForm extends AdminForm
......@@ -120,7 +114,6 @@ class AccessAdminPanelForm extends AdminForm
*
* @return int ID of the form
*/
function id()
{
return 'form_site_admin_panel';
......@@ -131,7 +124,6 @@ class AccessAdminPanelForm extends AdminForm
*
* @return string class of the form
*/
function formClass()
{
return 'form_settings';
......@@ -142,7 +134,6 @@ class AccessAdminPanelForm extends AdminForm
*
* @return string URL of the action
*/
function action()
{
return common_local_url('accessadminpanel');
......@@ -153,7 +144,6 @@ class AccessAdminPanelForm extends AdminForm
*
* @return void
*/
function formData()
{
$this->out->elementStart('fieldset', array('id' => 'settings_admin_access'));
......@@ -161,7 +151,7 @@ class AccessAdminPanelForm extends AdminForm
$this->out->element('legend', null, _('Registration'));
$this->out->elementStart('ul', 'form_data');
$this->li();
// TRANS: Checkbox instructions for admin setting "Private"
// TRANS: Checkbox instructions for admin setting "Private".
$instructions = _('Prohibit anonymous users (not logged in) from viewing site?');
// TRANS: Checkbox label for prohibiting anonymous users from viewing site.
$this->out->checkbox('private', _m('LABEL', 'Private'),
......@@ -170,7 +160,7 @@ class AccessAdminPanelForm extends AdminForm
$this->unli();
$this->li();
// TRANS: Checkbox instructions for admin setting "Invite only"
// TRANS: Checkbox instructions for admin setting "Invite only".
$instructions = _('Make registration invitation only.');
// TRANS: Checkbox label for configuring site as invite only.
$this->out->checkbox('inviteonly', _('Invite only'),
......@@ -179,7 +169,7 @@ class AccessAdminPanelForm extends AdminForm
$this->unli();
$this->li();
// TRANS: Checkbox instructions for admin setting "Closed" (no new registrations)
// TRANS: Checkbox instructions for admin setting "Closed" (no new registrations).
$instructions = _('Disable new registrations.');
// TRANS: Checkbox label for disabling new user registrations.
$this->out->checkbox('closed', _('Closed'),
......@@ -195,12 +185,11 @@ class AccessAdminPanelForm extends AdminForm
*
* @return void
*/
function formActions()
{
// TRANS: Title / tooltip for button to save access settings in site admin panel
// TRANS: Title for button to save access settings in site admin panel.
$title = _('Save access settings');
// TRANS: Tooltip for button to save access settings in site admin panel.
$this->out->submit('submit', _m('BUTTON', 'Save'), 'submit', null, $title);
}
}
......@@ -67,4 +67,3 @@ class AccesstokenAction extends Action
}
}
}
?>
......@@ -64,7 +64,7 @@ class AllAction extends ProfileAction
}
if ($this->page > 1 && $this->notice->N == 0) {
// TRANS: Server error when page not found (404)
// TRANS: Server error when page not found (404).
$this->serverError(_('No such page.'), $code = 404);
}
......@@ -76,6 +76,7 @@ class AllAction extends ProfileAction
parent::handle($args);
if (!$this->user) {
// TRANS: Client error when user not found for an action.
$this->clientError(_('No such user.'));
return;
}
......@@ -103,7 +104,7 @@ class AllAction extends ProfileAction
'nickname' =>
$this->user->nickname)
),
// TRANS: %s is user nickname
// TRANS: %s is user nickname.
sprintf(_('Feed for friends of %s (RSS 1.0)'), $this->user->nickname)),
new Feed(Feed::RSS2,
common_local_url(
......@@ -112,7 +113,7 @@ class AllAction extends ProfileAction
'id' => $this->user->nickname
)
),
// TRANS: %s is user nickname
// TRANS: %s is user nickname.
sprintf(_('Feed for friends of %s (RSS 2.0)'), $this->user->nickname)),
new Feed(Feed::ATOM,
common_local_url(
......@@ -121,7 +122,7 @@ class AllAction extends ProfileAction
'id' => $this->user->nickname
)
),
// TRANS: %s is user nickname
// TRANS: %s is user nickname.
sprintf(_('Feed for friends of %s (Atom)'), $this->user->nickname))
);
}
......@@ -134,7 +135,7 @@ class AllAction extends ProfileAction
function showEmptyListMessage()
{
// TRANS: %s is user nickname
// TRANS: Empty list message. %s is a user nickname.
$message = sprintf(_('This is the timeline for %s and friends but no one has posted anything yet.'), $this->user->nickname) . ' ';
if (common_logged_in()) {
......@@ -144,7 +145,7 @@ class AllAction extends ProfileAction
// TRANS: This message contains Markdown links. Keep "](" together.
$message .= _('Try subscribing to more people, [join a group](%%action.groups%%) or post something yourself.');
} else {
// TRANS: %1$s is user nickname, %2$s is user nickname, %2$s is user nickname prefixed with "@"
// TRANS: %1$s is user nickname, %2$s is user nickname, %2$s is user nickname prefixed with "@".
// TRANS: This message contains Markdown links. Keep "](" together.
$message .= sprintf(_('You can try to [nudge %1$s](../%2$s) from their profile or [post something to them](%%%%action.newnotice%%%%?status_textarea=%3$s).'), $this->user->nickname, $this->user->nickname, '@' . $this->user->nickname);
}
......@@ -183,10 +184,10 @@ class AllAction extends ProfileAction
{
$user = common_current_user();
if ($user && ($user->id == $this->user->id)) {
// TRANS: H1 text
// TRANS: H1 text for page when viewing a list for self.
$this->element('h1', null, _("You and friends"));
} else {
// TRANS: H1 text. %s is a user nickname
// TRANS: H1 text for page. %s is a user nickname.
$this->element('h1', null, sprintf(_('%s and friends'), $this->user->nickname));
}
}
......
<?php
/**
* RSS feed for user and friends timeline action class.
*
......@@ -57,7 +56,6 @@ class AllrssAction extends Rss10Action
* @param array $args Web and URL arguments
*
* @return boolean false if user doesn't exist
*/
function prepare($args)
{
parent::prepare($args);
......@@ -65,6 +63,7 @@ class AllrssAction extends Rss10Action
$this->user = User::staticGet('nickname', $nickname);
if (!$this->user) {
// TRANS: Client error when user not found for an rss related action.
$this->clientError(_('No such user.'));
return false;
} else {
......@@ -127,7 +126,7 @@ class AllrssAction extends Rss10Action
* Get image.
*
* @return string user avatar URL or null
*/
*/
function getImage()
{
$user = $this->user;
......@@ -139,4 +138,3 @@ class AllrssAction extends Rss10Action
return $avatar ? $avatar->url : null;
}
}
......@@ -49,10 +49,8 @@ require_once INSTALLDIR . '/lib/apibareauth.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 ApiAccountRateLimitStatusAction extends ApiBareAuthAction
{
/**
* Handle the request
*
......@@ -62,7 +60,6 @@ class ApiAccountRateLimitStatusAction extends ApiBareAuthAction
*
* @return void
*/
function handle($args)
{
parent::handle($args);
......@@ -119,11 +116,8 @@ class ApiAccountRateLimitStatusAction extends ApiBareAuthAction
*
* @return boolean is read only action?
*/
function isReadOnly($args)
{
return true;
}
}
......@@ -53,7 +53,6 @@ class ApiAccountUpdateDeliveryDeviceAction extends ApiAuthAction
* @param array $args $_REQUEST args
*
* @return boolean success flag
*
*/
function prepare($args)
{
......
......@@ -51,7 +51,6 @@ class ApiAccountUpdateProfileAction extends ApiAuthAction
* @param array $args $_REQUEST args
*
* @return boolean success flag
*
*/
function prepare($args)
{
......@@ -91,6 +90,7 @@ class ApiAccountUpdateProfileAction extends ApiAuthAction
if (!in_array($this->format, array('xml', 'json'))) {
$this->clientError(
// TRANS: Client error displayed when trying to handle an unknown API method.
_('API method not found.'),
404,
$this->format
......
......@@ -114,6 +114,7 @@ class ApiAccountUpdateProfileBackgroundImageAction extends ApiAuthAction
}
if (empty($this->user)) {
// TRANS: Client error when user not found updating a profile background image.
$this->clientError(_('No such user.'), 404, $this->format);
return;
}
......
......@@ -43,10 +43,8 @@ require_once INSTALLDIR . '/lib/apiauth.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 ApiAccountUpdateProfileColorsAction extends ApiAuthAction
{
var $profile_background_color = null;
var $profile_text_color = null;
var $profile_link_color = null;
......@@ -59,9 +57,7 @@ class ApiAccountUpdateProfileColorsAction extends ApiAuthAction
* @param array $args $_REQUEST args
*
* @return boolean success flag
*
*/
function prepare($args)
{
parent::prepare($args);
......@@ -100,7 +96,6 @@ class ApiAccountUpdateProfileColorsAction extends ApiAuthAction
*
* @return void
*/
function handle($args)
{
parent::handle($args);
......@@ -116,6 +111,7 @@ class ApiAccountUpdateProfileColorsAction extends ApiAuthAction
if (!in_array($this->format, array('xml', 'json'))) {
$this->clientError(
// TRANS: Client error displayed trying to execute an unknown API method updating profile colours.
_('API method not found.'),
404,
$this->format
......@@ -126,7 +122,6 @@ class ApiAccountUpdateProfileColorsAction extends ApiAuthAction
$design = $this->user->getDesign();
if (!empty($design)) {
$original = clone($design);
try {
......@@ -140,12 +135,11 @@ class ApiAccountUpdateProfileColorsAction extends ApiAuthAction
if ($result === false) {
common_log_db_error($design, 'UPDATE', __FILE__);
// TRANS: Client error displayed when a database error occurs updating profile colours.
$this->clientError(_('Could not update your design.'));
return;
}
} else {
$this->user->query('BEGIN');
// save new design
......@@ -162,6 +156,7 @@ class ApiAccountUpdateProfileColorsAction extends ApiAuthAction
if (empty($id)) {
common_log_db_error($id, 'INSERT', __FILE__);
// TRANS: Client error displayed when a database error occurs inserting profile colours.
$this->clientError(_('Unable to save your design settings.'));
return;
}
......@@ -172,6 +167,7 @@ class ApiAccountUpdateProfileColorsAction extends ApiAuthAction
if (empty($result)) {
common_log_db_error($original, 'UPDATE', __FILE__);
// TRANS: Client error displayed when a database error occurs updating profile colours.
$this->clientError(_('Unable to save your design settings.'));
$this->user->query('ROLLBACK');
return;
......@@ -183,6 +179,7 @@ class ApiAccountUpdateProfileColorsAction extends ApiAuthAction
$profile = $this->user->getProfile();
if (empty($profile)) {
// TRANS: Client error displayed a user has no profile updating profile colours.
$this->clientError(_('User has no profile.'));
return;
}
......@@ -207,7 +204,6 @@ class ApiAccountUpdateProfileColorsAction extends ApiAuthAction
*
* @return void
*/
function setColors($design)
{
$bgcolor = empty($this->profile_background_color) ?
......@@ -243,5 +239,4 @@ class ApiAccountUpdateProfileColorsAction extends ApiAuthAction
return true;
}
}
......@@ -43,19 +43,15 @@ require_once INSTALLDIR . '/lib/apiauth.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 ApiAccountUpdateProfileImageAction extends ApiAuthAction
{
/**
* Take arguments for running
*
* @param array $args $_REQUEST args
*
* @return boolean success flag
*
*/
function prepare($args)
{
parent::prepare($args);
......@@ -74,7 +70,6 @@ class ApiAccountUpdateProfileImageAction extends ApiAuthAction
*
* @return void
*/
function handle($args)
{
parent::handle($args);
......@@ -105,6 +100,7 @@ class ApiAccountUpdateProfileImageAction extends ApiAuthAction
}
if (empty($this->user)) {
// TRANS: Client error displayed updating profile image without having a user object.
$this->clientError(_('No such user.'), 404, $this->format);
return;
}
......@@ -130,6 +126,7 @@ class ApiAccountUpdateProfileImageAction extends ApiAuthAction
$profile = $this->user->getProfile();
if (empty($profile)) {
// TRANS: Client error displayed if a user profile could not be found updating a profile image.
$this->clientError(_('User has no profile.'));
return;
}
......@@ -150,5 +147,4 @@ class ApiAccountUpdateProfileImageAction extends ApiAuthAction
$this->endDocument('json');
}
}
}
......@@ -48,10 +48,8 @@ require_once INSTALLDIR . '/lib/apiauth.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 ApiAccountVerifyCredentialsAction extends ApiAuthAction
{
/**
* Handle the request
*
......@@ -61,12 +59,12 @@ class ApiAccountVerifyCredentialsAction extends ApiAuthAction
*
* @return void
*/
function handle($args)
{
parent::handle($args);
if (!in_array($this->format, array('xml', 'json'))) {
// TRANS: Client error displayed trying to execute an unknown API method verifying user credentials.
$this->clientError(_('API method not found.'), $code = 404);
return;
}
......@@ -91,12 +89,9 @@ class ApiAccountVerifyCredentialsAction extends ApiAuthAction
* @param array $args other arguments
*
* @return boolean true
*
**/
*/
function isReadOnly($args)
{
return true;
}
}
......@@ -55,7 +55,6 @@ class ApiBlockDestroyAction extends ApiAuthAction
* @param array $args $_REQUEST args
*
* @return boolean success flag
*
*/
function prepare($args)
{
......@@ -91,6 +90,7 @@ class ApiBlockDestroyAction extends ApiAuthAction
}
if (empty($this->user) || empty($this->other)) {
// TRANS: Client error when user not found for an API action to remove a block for a user.
$this->clientError(_('No such user.'), 404, $this->format);
return;
}
......
......@@ -48,7 +48,6 @@ require_once INSTALLDIR . '/lib/apiauth.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 ApiDirectMessageAction extends ApiAuthAction
{
var $messages = null;
......@@ -64,9 +63,7 @@ class ApiDirectMessageAction extends ApiAuthAction
* @param array $args $_REQUEST args
*
* @return boolean success flag
*
*/
function prepare($args)
{
parent::prepare($args);
......@@ -87,12 +84,12 @@ class ApiDirectMessageAction extends ApiAuthAction
// Action was called by /api/direct_messages/sent.format
$this->title = sprintf(
// TRANS: %s is a user nickname.
// TRANS: Title. %s is a user nickname.
_("Direct messages from %s"),
$this->user->nickname
);
$this->subtitle = sprintf(
// TRANS: %s is a user nickname.
// TRANS: Subtitle. %s is a user nickname.
_("All the direct messages sent from %s"),
$this->user->nickname
);
......@@ -101,12 +98,12 @@ class ApiDirectMessageAction extends ApiAuthAction
$this->id = "tag:$taguribase:SentDirectMessages:" . $this->user->id;
} else {
$this->title = sprintf(
// TRANS: %s is a user nickname.
// TRANS: Title. %s is a user nickname.
_("Direct messages to %s"),
$this->user->nickname
);
$this->subtitle = sprintf(
// TRANS: %s is a user nickname.
// TRANS: Subtitle. %s is a user nickname.
_("All the direct messages sent to %s"),
$this->user->nickname
);
......@@ -129,7 +126,6 @@ class ApiDirectMessageAction extends ApiAuthAction
*
* @return void
*/
function handle($args)
{
parent::handle($args);
......@@ -141,7 +137,6 @@ class ApiDirectMessageAction extends ApiAuthAction
*
* @return void
*/
function showMessages()
{
switch($this->format) {
......@@ -169,7 +164,6 @@ class ApiDirectMessageAction extends ApiAuthAction
*
* @return array notices
*/
function getMessages()
{
$message = new Message();
......@@ -208,7 +202,6 @@ class ApiDirectMessageAction extends ApiAuthAction
*
* @return boolean true
*/
function isReadOnly($args)
{
return true;
......@@ -219,7 +212,6 @@ class ApiDirectMessageAction extends ApiAuthAction
*
* @return string datestamp of the latest notice in the stream
*/
function lastModified()
{
if (!empty($this->messages)) {
......@@ -234,7 +226,6 @@ class ApiDirectMessageAction extends ApiAuthAction
*
* @return void
*/
function showXmlDirectMessages()
{
$this->initDocument('xml');
......@@ -255,7 +246,6 @@ class ApiDirectMessageAction extends ApiAuthAction
*
* @return void
*/
function showJsonDirectMessages()
{
$this->initDocument('json');
......@@ -276,7 +266,6 @@ class ApiDirectMessageAction extends ApiAuthAction
*
* @return void
*/
function showRssDirectMessages()
{
$this->initDocument('rss');
......@@ -311,7 +300,6 @@ class ApiDirectMessageAction extends ApiAuthAction
*
* @return void
*/
function showAtomDirectMessages()
{
$this->initDocument('atom');
......@@ -353,7 +341,6 @@ class ApiDirectMessageAction extends ApiAuthAction
*
* @return string etag
*/
function etag()
{
if (!empty($this->messages)) {
......@@ -374,5 +361,4 @@ class ApiDirectMessageAction extends ApiAuthAction
return null;
}
}
......@@ -60,7 +60,6 @@ class ApiDirectMessageNewAction extends ApiAuthAction
* @param array $args $_REQUEST args
*
* @return boolean success flag
*
*/
function prepare($args)
{
......@@ -69,6 +68,7 @@ class ApiDirectMessageNewAction extends ApiAuthAction
$this->user = $this->auth_user;
if (empty($this->user)) {
// TRANS: Client error when user not found for an API direct message action.
$this->clientError(_('No such user.'), 404, $this->format);
return;
}
......@@ -113,7 +113,7 @@ class ApiDirectMessageNewAction extends ApiAuthAction
if (empty($this->content)) {
$this->clientError(
// TRANS: Client error (406).
// TRANS: Client error displayed when no message text was submitted (406).
_('No message text!'),
406,
$this->format
......
......@@ -58,7 +58,6 @@ class ApiFavoriteCreateAction extends ApiAuthAction
* @param array $args $_REQUEST args
*
* @return boolean success flag
*
*/
function prepare($args)
{
......@@ -95,6 +94,7 @@ class ApiFavoriteCreateAction extends ApiAuthAction
if (!in_array($this->format, array('xml', 'json'))) {
$this->clientError(
// TRANS: Client error displayed when trying to handle an unknown API method.
_('API method not found.'),
404,
$this->format
......
......@@ -48,10 +48,8 @@ require_once INSTALLDIR . '/lib/apiauth.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 ApiFavoriteDestroyAction extends ApiAuthAction
{
var $notice = null;
/**
......@@ -60,9 +58,7 @@ class ApiFavoriteDestroyAction extends ApiAuthAction
* @param array $args $_REQUEST args
*
* @return boolean success flag
*
*/
function prepare($args)
{
parent::prepare($args);
......@@ -82,7 +78,6 @@ class ApiFavoriteDestroyAction extends ApiAuthAction
*
* @return void
*/
function handle($args)
{
parent::handle($args);
......@@ -99,6 +94,7 @@ class ApiFavoriteDestroyAction extends ApiAuthAction
if (!in_array($this->format, array('xml', 'json'))) {
$this->clientError(
// TRANS: Client error displayed when trying to handle an unknown API method.
_('API method not found.'),
404,
$this->format
......@@ -108,6 +104,7 @@ class ApiFavoriteDestroyAction extends ApiAuthAction
if (empty($this->notice)) {
$this->clientError(
// TRANS: Client error displayed when trying to remove a favourite with an invalid ID.
_('No status found with that ID.'),
404,
$this->format
......@@ -121,6 +118,7 @@ class ApiFavoriteDestroyAction extends ApiAuthAction
if (!$fave->find(true)) {
$this->clientError(
// TRANS: Client error displayed when trying to remove a favourite that was not a favourite.
_('That status is not a favorite.'),
403,
$this->favorite
......@@ -133,6 +131,7 @@ class ApiFavoriteDestroyAction extends ApiAuthAction
if (!$result) {
common_log_db_error($fave, 'DELETE', __FILE__);
$this->clientError(
// TRANS: Client error displayed when removing a favourite has failed.
_('Could not delete favorite.'),
404,
$this->format
......@@ -148,5 +147,4 @@ class ApiFavoriteDestroyAction extends ApiAuthAction
$this->show_single_json_status($this->notice);
}
}
}
......@@ -48,7 +48,6 @@ require_once INSTALLDIR . '/lib/apiauth.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 ApiFriendshipsCreateAction extends ApiAuthAction
{
var $other = null;
......@@ -61,7 +60,6 @@ class ApiFriendshipsCreateAction extends ApiAuthAction
* @return boolean success flag
*
*/
function prepare($args)
{
parent::prepare($args);
......@@ -81,7 +79,6 @@ class ApiFriendshipsCreateAction extends ApiAuthAction
*
* @return void
*/
function handle($args)
{
parent::handle($args);
......@@ -98,6 +95,7 @@ class ApiFriendshipsCreateAction extends ApiAuthAction
if (!in_array($this->format, array('xml', 'json'))) {
$this->clientError(
// TRANS: Client error displayed when trying to handle an unknown API method.
_('API method not found.'),
404,
$this->format
......@@ -107,6 +105,7 @@ class ApiFriendshipsCreateAction extends ApiAuthAction
if (empty($this->other)) {
$this->clientError(
// TRANS: Client error displayed when trying follow who's profile could not be found.
_('Could not follow user: profile not found.'),
403,
$this->format
......@@ -116,6 +115,8 @@ class ApiFriendshipsCreateAction extends ApiAuthAction