Commit 08edd1fe authored by Siebrand Mazeland's avatar Siebrand Mazeland

* i18n/L10n updates.

* translator documentation added/updated.
* superfluous whitespace removed.
parent 83233a8a
......@@ -42,7 +42,6 @@ require_once INSTALLDIR.'/lib/attachmentlist.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 AttachmentAction extends Action
{
/**
......@@ -70,6 +69,7 @@ class AttachmentAction extends Action
}
if (empty($this->attachment)) {
// TRANS: Client error displayed trying to get a non-existing attachment.
$this->clientError(_('No such attachment.'), 404);
return false;
}
......@@ -81,7 +81,6 @@ class AttachmentAction extends Action
*
* @return boolean true
*/
function isReadOnly($args)
{
return true;
......@@ -129,7 +128,6 @@ class AttachmentAction extends Action
*
* @return void
*/
function handle($args)
{
parent::handle($args);
......@@ -150,7 +148,6 @@ class AttachmentAction extends Action
*
* @return void
*/
function showLocalNavBlock()
{
}
......@@ -162,7 +159,6 @@ class AttachmentAction extends Action
*
* @return void
*/
function showContent()
{
$ali = new Attachment($this->attachment, $this);
......@@ -174,7 +170,6 @@ class AttachmentAction extends Action
*
* @return void
*/
function showPageNoticeBlock()
{
}
......@@ -191,4 +186,3 @@ class AttachmentAction extends Action
$atcs->show();
}
}
......@@ -42,7 +42,6 @@ require_once INSTALLDIR.'/actions/attachment.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 Attachment_ajaxAction extends AttachmentAction
{
/**
......@@ -80,4 +79,3 @@ class Attachment_ajaxAction extends AttachmentAction
$this->elementEnd('div');
}
}
......@@ -42,10 +42,8 @@ require_once INSTALLDIR.'/actions/attachment.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 Attachment_thumbnailAction extends AttachmentAction
{
function handle($args)
{
$this->showPage();
......@@ -79,6 +77,4 @@ class Attachment_thumbnailAction extends AttachmentAction
}
$this->element('img', array('src' => $file_thumbnail->url, 'alt' => 'Thumbnail'));
}
}
......@@ -48,7 +48,7 @@ class AvatarbynicknameAction extends Action
* Class handler.
*
* @param array $args query arguments
*
*
* @return boolean false if nickname or user isn't found
*/
function handle($args)
......@@ -56,27 +56,32 @@ class AvatarbynicknameAction extends Action
parent::handle($args);
$nickname = $this->trimmed('nickname');
if (!$nickname) {
// TRANS: Client error displayed trying to get an avatar without providing a nickname.
$this->clientError(_('No nickname.'));
return;
}
$size = $this->trimmed('size');
if (!$size) {
// TRANS: Client error displayed trying to get an avatar without providing an avatar size.
$this->clientError(_('No size.'));
return;
}
$size = strtolower($size);
if (!in_array($size, array('original', '96', '48', '24'))) {
// TRANS: Client error displayed trying to get an avatar providing an invalid avatar size.
$this->clientError(_('Invalid size.'));
return;
}
$user = User::staticGet('nickname', $nickname);
if (!$user) {
// TRANS: Client error displayed trying to get an avatar for a non-existing user.
$this->clientError(_('No such user.'));
return;
}
$profile = $user->getProfile();
if (!$profile) {
// TRANS: Client error displayed trying to get an avatar for a user without a profile.
$this->clientError(_('User has no profile.'));
return;
}
......@@ -103,4 +108,3 @@ class AvatarbynicknameAction extends Action
return true;
}
}
This diff is collapsed.
......@@ -42,7 +42,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
* @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
* @link http://status.net/
*/
class BlockAction extends ProfileFormAction
{
var $profile = null;
......@@ -54,7 +53,6 @@ class BlockAction extends ProfileFormAction
*
* @return boolean success flag
*/
function prepare($args)
{
if (!parent::prepare($args)) {
......@@ -66,6 +64,7 @@ class BlockAction extends ProfileFormAction
assert(!empty($cur)); // checked by parent
if ($cur->hasBlocked($this->profile)) {
// TRANS: Client error displayed when blocking a user that has already been blocked.
$this->clientError(_('You already blocked that user.'));
return false;
}
......@@ -82,7 +81,6 @@ class BlockAction extends ProfileFormAction
*
* @return void
*/
function handle($args)
{
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
......@@ -104,6 +102,7 @@ class BlockAction extends ProfileFormAction
}
function title() {
// TRANS: Title for block user page.
return _('Block user');
}
......@@ -133,8 +132,10 @@ class BlockAction extends ProfileFormAction
'action' => common_local_url('block')));
$this->elementStart('fieldset');
$this->hidden('token', common_session_token());
// TRANS: Legend for block user form.
$this->element('legend', _('Block user'));
$this->element('p', null,
// TRANS: Explanation of consequences when blocking a user on the block user page.
_('Are you sure you want to block this user? '.
'Afterwards, they will be unsubscribed from you, '.
'unable to subscribe to you in the future, and '.
......@@ -184,6 +185,7 @@ class BlockAction extends ProfileFormAction
}
if (!$result) {
// TRANS: Server error displayed when blocking a user fails.
$this->serverError(_('Failed to save block information.'));
return;
}
......@@ -199,7 +201,7 @@ class BlockAction extends ProfileFormAction
* Override for form session token checks; on our first hit we're just
* requesting confirmation, which doesn't need a token. We need to be
* able to take regular GET requests from email!
*
*
* @throws ClientException if token is bad on POST request or if we have
* confirmation parameters which could trigger something.
*/
......@@ -216,7 +218,7 @@ class BlockAction extends ProfileFormAction
/**
* If we reached this form without returnto arguments, return to the
* current user's subscription list.
*
*
* @return string URL
*/
function defaultReturnTo()
......
......@@ -40,7 +40,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
class BlockedfromgroupAction extends GroupDesignAction
{
var $page = null;
......@@ -70,6 +69,7 @@ class BlockedfromgroupAction extends GroupDesignAction
}
if (!$nickname) {
// TRANS: Client error displayed when requesting a list of blocked users for a group without providing a group nickname.
$this->clientError(_('No nickname.'), 404);
return false;
}
......@@ -77,6 +77,7 @@ class BlockedfromgroupAction extends GroupDesignAction
$local = Local_group::staticGet('nickname', $nickname);
if (!$local) {
// TRANS: Client error displayed when requesting a list of blocked users for a non-local group.
$this->clientError(_('No such group.'), 404);
return false;
}
......@@ -84,6 +85,7 @@ class BlockedfromgroupAction extends GroupDesignAction
$this->group = User_group::staticGet('id', $local->group_id);
if (!$this->group) {
// TRANS: Client error displayed when requesting a list of blocked users for a non-existing group.
$this->clientError(_('No such group.'), 404);
return false;
}
......@@ -94,9 +96,13 @@ class BlockedfromgroupAction extends GroupDesignAction
function title()
{
if ($this->page == 1) {
// TRANS: Title for first page with list of users blocked from a group.
// TRANS: %s is a group nickname.
return sprintf(_('%s blocked profiles'),
$this->group->nickname);
} else {
// TRANS: Title for any but the first page with list of users blocked from a group.
// TRANS: %1$s is a group nickname, %2$d is a page number.
return sprintf(_('%1$s blocked profiles, page %2$d'),
$this->group->nickname,
$this->page);
......@@ -112,6 +118,7 @@ class BlockedfromgroupAction extends GroupDesignAction
function showPageNotice()
{
$this->element('p', 'instructions',
// TRANS: Instructions for list of users blocked from a group.
_('A list of the users blocked from joining this group.'));
}
......@@ -205,7 +212,6 @@ class GroupBlockListItem extends ProfileListItem
*
* @see UnblockForm
*/
class GroupUnblockForm extends Form
{
/**
......@@ -234,7 +240,6 @@ class GroupUnblockForm extends Form
* @param User_group $group group to block user from
* @param array $args return-to args
*/
function __construct($out=null, $profile=null, $group=null, $args=null)
{
parent::__construct($out);
......@@ -249,7 +254,6 @@ class GroupUnblockForm extends Form
*
* @return int ID of the form
*/
function id()
{
// This should be unique for the page.
......@@ -261,7 +265,6 @@ class GroupUnblockForm extends Form
*
* @return string class of the form
*/
function formClass()
{
return 'form_group_unblock';
......@@ -272,7 +275,6 @@ class GroupUnblockForm extends Form
*
* @return string URL of the action
*/
function action()
{
return common_local_url('groupunblock');
......@@ -285,6 +287,7 @@ class GroupUnblockForm extends Form
*/
function formLegend()
{
// TRANS: Form legend for unblocking a user from a group.
$this->out->element('legend', null, _('Unblock user from group'));
}
......@@ -293,7 +296,6 @@ class GroupUnblockForm extends Form
*
* @return void
*/
function formData()
{
$this->out->hidden('unblockto-' . $this->profile->id,
......@@ -314,9 +316,14 @@ class GroupUnblockForm extends Form
*
* @return void
*/
function formActions()
{
$this->out->submit('submit', _('Unblock'), 'submit', null, _('Unblock this user'));
$this->out->submit('submit',
// TRANS: Button text for unblocking a user from a group.
_m('BUTTON','Unblock'),
'submit',
null,
// TRANS: Tooltip for button for unblocking a user from a group.
_('Unblock this user'));
}
}
......@@ -34,7 +34,7 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
require_once INSTALLDIR . '/actions/newnotice.php';
/**
* Action for posting a notice
* Action for posting a notice
*
* @category Bookmarklet
* @package StatusNet
......@@ -42,12 +42,12 @@ require_once INSTALLDIR . '/actions/newnotice.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 BookmarkletAction extends NewnoticeAction
{
function showTitle()
{
// TRANS: Title for mini-posting window loaded from bookmarklet.
// TRANS: %s is the StatusNet site name.
$this->element('title', null, sprintf(_('Post to %s'), common_config('site', 'name')));
}
......@@ -73,4 +73,3 @@ class BookmarkletAction extends NewnoticeAction
{
}
}
......@@ -44,7 +44,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
class ConfirmaddressAction extends Action
{
/** type of confirmation. */
......@@ -61,7 +60,6 @@ class ConfirmaddressAction extends Action
*
* @return void
*/
function handle($args)
{
parent::handle($args);
......@@ -72,27 +70,30 @@ class ConfirmaddressAction extends Action
}
$code = $this->trimmed('code');
if (!$code) {
// TRANS: Client error displayed when not providing a confirmation code in the contact address confirmation action.
$this->clientError(_('No confirmation code.'));
return;
}
$confirm = Confirm_address::staticGet('code', $code);
if (!$confirm) {
// TRANS: Client error displayed when providing a non-existing confirmation code in the contact address confirmation action.
$this->clientError(_('Confirmation code not found.'));
return;
}
$cur = common_current_user();
if ($cur->id != $confirm->user_id) {
// TRANS: Client error displayed when not providing a confirmation code for another user in the contact address confirmation action.
$this->clientError(_('That confirmation code is not for you!'));
return;
}
$type = $confirm->address_type;
if (!in_array($type, array('email', 'jabber', 'sms'))) {
// TRANS: Server error for an unknow address type, which can be 'email', 'jabber', or 'sms'.
// TRANS: Server error for a unknow address type %s, which can be 'email', 'jabber', or 'sms'.
$this->serverError(sprintf(_('Unrecognized address type %s.'), $type));
return;
}
if ($cur->$type == $confirm->address) {
// TRANS: Client error for an already confirmed email/jabbel/sms address.
// TRANS: Client error for an already confirmed email/jabber/sms address.
$this->clientError(_('That address has already been confirmed.'));
return;
}
......@@ -113,6 +114,7 @@ class ConfirmaddressAction extends Action
if (!$result) {
common_log_db_error($cur, 'UPDATE', __FILE__);
// TRANS: Server error displayed when a user update to the database fails in the contact address confirmation action.
$this->serverError(_('Couldn\'t update user.'));
return;
}
......@@ -125,7 +127,9 @@ class ConfirmaddressAction extends Action
if (!$result) {
common_log_db_error($confirm, 'DELETE', __FILE__);
$this->serverError(_('Couldn\'t delete email confirmation.'));
// TRANS: Server error displayed when an address confirmation code deletion from the
// TRANS: database fails in the contact address confirmation action.
$this->serverError(_('Could not delete address confirmation.'));
return;
}
......@@ -140,9 +144,9 @@ class ConfirmaddressAction extends Action
*
* @return string title
*/
function title()
{
// TRANS: Title for the contact address confirmation action.
return _('Confirm address');
}
......@@ -151,13 +155,14 @@ class ConfirmaddressAction extends Action
*
* @return void
*/
function showContent()
{
$cur = common_current_user();
$type = $this->type;
$this->element('p', null,
// TRANS: Success message for the contact address confirmation action.
// TRANS: %s can be 'email', 'jabber', or 'sms'.
sprintf(_('The address "%s" has been '.
'confirmed for your account.'),
$cur->$type));
......
......@@ -45,7 +45,6 @@ require_once INSTALLDIR.'/lib/noticelist.php';
* @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
* @link http://status.net/
*/
class ConversationAction extends Action
{
var $id = null;
......@@ -58,7 +57,6 @@ class ConversationAction extends Action
*
* @return boolean false if id not passed in
*/
function prepare($args)
{
parent::prepare($args);
......@@ -81,7 +79,6 @@ class ConversationAction extends Action
*
* @return void
*/
function handle($args)
{
parent::handle($args);
......@@ -93,10 +90,10 @@ class ConversationAction extends Action
*
* @return string page title
*/
function title()
{
return _("Conversation");
// TRANS: Title for page with a conversion (multiple notices in context).
return _('Conversation');
}
/**
......@@ -107,7 +104,6 @@ class ConversationAction extends Action
*
* @return void
*/
function showContent()
{
$notices = Notice::conversationStream($this->id, null, null);
......@@ -134,7 +130,6 @@ class ConversationAction extends Action
* @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
* @link http://status.net/
*/
class ConversationTree extends NoticeList
{
var $tree = null;
......@@ -145,12 +140,12 @@ class ConversationTree extends NoticeList
*
* @return void
*/
function show()
{
$cnt = $this->_buildTree();
$this->out->elementStart('div', array('id' =>'notices_primary'));
// TRANS: Header on conversation page. Hidden by default (h2).
$this->out->element('h2', null, _('Notices'));
$this->out->elementStart('ol', array('class' => 'notices xoxo'));
......@@ -200,7 +195,6 @@ class ConversationTree extends NoticeList
*
* @return void
*/
function showNoticePlus($id)
{
$notice = $this->table[$id];
......@@ -237,7 +231,6 @@ class ConversationTree extends NoticeList
*
* @return NoticeListItem a list item to show
*/
function newListItem($notice)
{
return new ConversationTreeItem($notice, $this->out);
......@@ -255,7 +248,6 @@ class ConversationTree extends NoticeList
* @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
* @link http://status.net/
*/
class ConversationTreeItem extends NoticeListItem
{
/**
......@@ -266,7 +258,6 @@ class ConversationTreeItem extends NoticeListItem
*
* @return void
*/
function showStart()
{
return;
......@@ -280,7 +271,6 @@ class ConversationTreeItem extends NoticeListItem
*
* @return void
*/
function showEnd()
{
return;
......@@ -293,7 +283,6 @@ class ConversationTreeItem extends NoticeListItem
*
* @return void
*/
function showContext()
{
return;
......
......@@ -45,14 +45,13 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
class EditgroupAction extends GroupDesignAction
{
var $msg;
function title()
{
// TRANS: Title for form to edit a group. %s is a group nickname.
return sprintf(_('Edit %s group'), $this->group->nickname);
}
......@@ -65,6 +64,7 @@ class EditgroupAction extends GroupDesignAction
parent::prepare($args);
if (!common_logged_in()) {
// TRANS: Client error displayed trying to edit a group while not logged in.
$this->clientError(_('You must be logged in to create a group.'));
return false;
}
......@@ -81,6 +81,7 @@ class EditgroupAction extends GroupDesignAction
}
if (!$nickname) {
// TRANS: Client error displayed trying to edit a group while not proving a nickname for the group to edit.
$this->clientError(_('No nickname.'), 404);
return false;
}
......@@ -97,6 +98,7 @@ class EditgroupAction extends GroupDesignAction
}
if (!$this->group) {
// TRANS: Client error displayed trying to edit a non-existing group.
$this->clientError(_('No such group.'), 404);
return false;
}
......@@ -104,6 +106,7 @@ class EditgroupAction extends GroupDesignAction
$cur = common_current_user();
if (!$cur->isAdmin($this->group)) {
// TRANS: Client error displayed trying to edit a group while not being a group admin.
$this->clientError(_('You must be an admin to edit the group.'), 403);
return false;
}
......@@ -120,7 +123,6 @@ class EditgroupAction extends GroupDesignAction
*
* @return void
*/
function handle($args)
{
parent::handle($args);
......@@ -155,6 +157,7 @@ class EditgroupAction extends GroupDesignAction
$this->element('p', 'error', $this->msg);
} else {
$this->element('p', 'instructions',
// TRANS: Form instructions for group edit form.
_('Use this form to edit the group.'));
}
}
......@@ -169,6 +172,7 @@ class EditgroupAction extends GroupDesignAction
{
$cur = common_current_user();
if (!$cur->isAdmin($this->group)) {
// TRANS: Client error displayed trying to edit a group while not being a group admin.
$this->clientError(_('You must be an admin to edit the group.'), 403);
return;
}
......@@ -183,28 +187,39 @@ class EditgroupAction extends GroupDesignAction
if (!Validate::string($nickname, array('min_length' => 1,
'max_length' => 64,
'format' => NICKNAME_FMT))) {
// TRANS: Group edit form validation error.
$this->showForm(_('Nickname must have only lowercase letters '.
'and numbers and no spaces.'));
return;
} else if ($this->nicknameExists($nickname)) {
// TRANS: Group edit form validation error.
$this->showForm(_('Nickname already in use. Try another one.'));
return;
} else if (!User_group::allowedNickname($nickname)) {
// TRANS: Group edit form validation error.
$this->showForm(_('Not a valid nickname.'));
return;
} else if (!is_null($homepage) && (strlen($homepage) > 0) &&
!Validate::uri($homepage,
array('allowed_schemes' =>
array('http', 'https')))) {
// TRANS: Group edit form validation error.
$this->showForm(_('Homepage is not a valid URL.'));
return;
} else if (!is_null($fullname) && mb_strlen($fullname) > 255) {
// TRANS: Group edit form validation error.
$this->showForm(_('Full name is too long (maximum 255 characters).'));
return;
} else if (User_group::descriptionTooLong($description)) {
$this->showForm(sprintf(_('Description is too long (max %d chars).'), User_group::maxDescription()));
$this->showForm(sprintf(
// TRANS: Group edit form validation error.
_m('Description is too long (maximum %d character).',
'Description is too long (maximum %d characters).',
User_group::maxDescription()),
User_group::maxDescription()));
return;
} else if (!is_null($location) && mb_strlen($location) > 255) {
// TRANS: Group edit form validation error.
$this->showForm(_('Location is too long (maximum 255 characters).'));
return;
}
......@@ -216,7 +231,11 @@ class EditgroupAction extends GroupDesignAction
}
if (count($aliases) > common_config('group', 'maxaliases')) {
$this->showForm(sprintf(_('Too many aliases! Maximum %d.'),
// TRANS: Group edit form validation error.
// TRANS: %d is the maximum number of allowed aliases.
$this->showForm(sprintf(_m('Too many aliases! Maximum %d allowed.',
'Too many aliases! Maximum %d allowed.',
common_config('group', 'maxaliases')),
common_config('group', 'maxaliases')));
return;
}
......@@ -225,16 +244,19 @@ class EditgroupAction extends GroupDesignAction
if (!Validate::string($alias, array('min_length' => 1,
'max_length' => 64,
'format' => NICKNAME_FMT))) {
// TRANS: Group edit form validation error.
$this->showForm(sprintf(_('Invalid alias: "%s"'), $alias));
return;
}
if ($this->nicknameExists($alias)) {
// TRANS: Group edit form validation error.
$this->showForm(sprintf(_('Alias "%s" already in use. Try another one.'),
$alias));
return;
}
// XXX assumes alphanum nicknames
if (strcmp($alias, $nickname) == 0) {
// TRANS: Group edit form validation error.
$this->showForm(_('Alias can\'t be the same as nickname.'));
return;
}
......@@ -255,12 +277,14 @@ class EditgroupAction extends GroupDesignAction
if (!$result) {
common_log_db_error($this->group, 'UPDATE', __FILE__);
// TRANS: Server error displayed when editing a group fails.
$this->serverError(_('Could not update group.'));
}
$result = $this->group->setAliases($aliases);
if (!$result) {
// TRANS: Server error displayed when group aliases could not be added.
$this->serverError(_('Could not create aliases.'));
}
......@@ -277,6 +301,7 @@ class EditgroupAction extends GroupDesignAction
array('nickname' => $nickname)),
303);
} else {
// TRANS: Group edit form success message.
$this->showForm(_('Options saved.'));
}
}
......@@ -300,4 +325,3 @@ class EditgroupAction extends GroupDesignAction
return false;
}
}
......@@ -43,25 +43,25 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
class NewgroupAction extends Action
{
var $msg;
function title()
{
// TRANS: Title for form to create a group.
return _('New group');
}
/**
* Prepare to run
*/
function prepare($args)
{
parent::prepare($args);
if (!common_logged_in()) {
// TRANS: Client error displayed trying to create a group while not logged in.
$this->clientError(_('You must be logged in to create a group.'));
return false;
}
......@@ -78,7 +78,6 @@ class NewgroupAction extends Action
*
* @return void
*/
function handle($args)
{
parent::handle($args);
......@@ -107,6 +106,7 @@ class NewgroupAction extends Action
$this->element('p', 'error', $this->msg);
} else {
$this->element('p', 'instructions',
// TRANS: Form instructions for group create form.
_('Use this form to create a new group.'));
}
}
......@@ -123,26 +123,31 @@ class NewgroupAction extends Action
if (!Validate::string($nickname, array('min_length' => 1,
'max_length' => 64,
'format' => NICKNAME_FMT))) {
// TRANS: Group create form validation error.