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

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;
}
}
......@@ -49,7 +49,6 @@ define('MAX_ORIGINAL', 480);
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
class AvatarsettingsAction extends AccountSettingsAction
{
var $mode = null;
......@@ -61,9 +60,9 @@ class AvatarsettingsAction extends AccountSettingsAction
*
* @return string Title of the page
*/
function title()
{
// TRANS: Title for avatar upload page.
return _('Avatar');
}
......@@ -72,10 +71,12 @@ class AvatarsettingsAction extends AccountSettingsAction
*
* @return instructions for use
*/
function getInstructions()
{
return sprintf(_('You can upload your personal avatar. The maximum file size is %s.'), ImageFile::maxFileSize());
// TRANS: Instruction for avatar upload page.
// TRANS: %s is the maximum file size, for example "500b", "10kB" or "2MB".
return sprintf(_('You can upload your personal avatar. The maximum file size is %s.'),
ImageFile::maxFileSize());
}
/**
......@@ -103,6 +104,7 @@ class AvatarsettingsAction extends AccountSettingsAction
if (!$profile) {
common_log_db_error($user, 'SELECT', __FILE__);
// TRANS: Server error displayed in avatar upload page when no matching profile can be found for a user.
$this->serverError(_('User without matching profile.'));
return;
}
......@@ -116,14 +118,16 @@ class AvatarsettingsAction extends AccountSettingsAction
'action' =>
common_local_url('avatarsettings')));
$this->elementStart('fieldset');
// TRANS: Avatar upload page form legend.
$this->element('legend', null, _('Avatar settings'));
$this->hidden('token', common_session_token());
if (Event::handle('StartAvatarFormData', array($this))) {
$this->elementStart('ul', 'form_data');
if ($original) {
$this->elementStart('li', array('id' => 'avatar_original',
'class' => 'avatar_view'));
// TRANS: Header on avatar upload page for thumbnail of originally uploaded avatar (h2).
$this->element('h2', null, _("Original"));
$this->elementStart('div', array('id'=>'avatar_original_view'));
$this->element('img', array('src' => $original->url,
......@@ -139,6 +143,7 @@ class AvatarsettingsAction extends AccountSettingsAction
if ($avatar) {
$this->elementStart('li', array('id' => 'avatar_preview',
'class' => 'avatar_view'));
// TRANS: Header on avatar upload page for thumbnail of to be used rendition of uploaded avatar (h2).
$this->element('h2', null, _("Preview"));
$this->elementStart('div', array('id'=>'avatar_preview_view'));
$this->element('img', array('src' => $original->url,
......@@ -146,7 +151,8 @@ class AvatarsettingsAction extends AccountSettingsAction
'height' => AVATAR_PROFILE_SIZE,
'alt' => $user->nickname));
$this->elementEnd('div');
$this->submit('delete', _('Delete'));
// TRANS: Button on avatar upload page to delete current avatar.
$this->submit('delete', _m('BUTTON','Delete'));
$this->elementEnd('li');
}
......@@ -163,7 +169,8 @@ class AvatarsettingsAction extends AccountSettingsAction
$this->elementStart('ul', 'form_actions');
$this->elementStart('li');
$this->submit('upload', _('Upload'));
// TRANS: Button on avatar upload page to upload an avatar.
$this->submit('upload', _m('BUTTON','Upload'));
$this->elementEnd('li');
$this->elementEnd('ul');
}
......@@ -171,7 +178,6 @@ class AvatarsettingsAction extends AccountSettingsAction
$this->elementEnd('fieldset');
$this->elementEnd('form');
}
function showCropForm()
......@@ -182,6 +188,7 @@ class AvatarsettingsAction extends AccountSettingsAction
if (!$profile) {
common_log_db_error($user, 'SELECT', __FILE__);
// TRANS: Server error displayed in avatar upload page when no matching profile can be found for a user.
$this->serverError(_('User without matching profile.'));
return;
}
......@@ -194,6 +201,7 @@ class AvatarsettingsAction extends AccountSettingsAction
'action' =>
common_local_url('avatarsettings')));
$this->elementStart('fieldset');
// TRANS: Avatar upload page crop form legend.
$this->element('legend', null, _('Avatar settings'));
$this->hidden('token', common_session_token());
......@@ -202,6 +210,7 @@ class AvatarsettingsAction extends AccountSettingsAction
$this->elementStart('li',
array('id' => 'avatar_original',
'class' => 'avatar_view'));
// TRANS: Header on avatar upload crop form for thumbnail of originally uploaded avatar (h2).
$this->element('h2', null, _("Original"));
$this->elementStart('div', array('id'=>'avatar_original_view'));
$this->element('img', array('src' => Avatar::url($this->filedata['filename']),
......@@ -214,6 +223,7 @@ class AvatarsettingsAction extends AccountSettingsAction
$this->elementStart('li',
array('id' => 'avatar_preview',
'class' => 'avatar_view'));
// TRANS: Header on avatar upload crop form for thumbnail of to be used rendition of uploaded avatar (h2).
$this->element('h2', null, _("Preview"));
$this->elementStart('div', array('id'=>'avatar_preview_view'));
$this->element('img', array('src' => Avatar::url($this->filedata['filename']),
......@@ -228,13 +238,14 @@ class AvatarsettingsAction extends AccountSettingsAction
'type' => 'hidden',
'id' => $crop_info));
}
$this->submit('crop', _('Crop'));
// TRANS: Button on avatar upload crop form to confirm a selected crop as avatar.
$this->submit('crop', _m('BUTTON','Crop'));
$this->elementEnd('li');
$this->elementEnd('ul');
$this->elementEnd('fieldset');
$this->elementEnd('form');
}
/**
......@@ -244,7 +255,6 @@ class AvatarsettingsAction extends AccountSettingsAction
*
* @return void
*/
function handlePost()
{
// Workaround for PHP returning empty $_POST and $_FILES when POST
......@@ -271,7 +281,7 @@ class AvatarsettingsAction extends AccountSettingsAction
'Try again, please.'));
return;
}
if (Event::handle('StartAvatarSaveForm', array($this))) {
if ($this->arg('upload')) {
$this->uploadAvatar();
......@@ -280,6 +290,7 @@ class AvatarsettingsAction extends AccountSettingsAction
} else if ($this->arg('delete')) {
$this->deleteAvatar();
} else {
// TRANS: Unexpected validation error on avatar upload form.
$this->showForm(_('Unexpected form submission.'));
}
Event::handle('EndAvatarSaveForm', array($this));
......@@ -294,7 +305,6 @@ class AvatarsettingsAction extends AccountSettingsAction
*
* @return void
*/
function uploadAvatar()
{
try {
......@@ -304,6 +314,7 @@ class AvatarsettingsAction extends AccountSettingsAction
return;
}
if ($imagefile === null) {
// TRANS: Validation error on avatar upload form when no file was uploaded.
$this->showForm(_('No file uploaded.'));
return;
}
......@@ -331,6 +342,7 @@ class AvatarsettingsAction extends AccountSettingsAction
$this->mode = 'crop';
// TRANS: Avatar upload form unstruction after uploading a file.
$this->showForm(_('Pick a square area of the image to be your avatar'),
true);
}
......@@ -340,12 +352,12 @@ class AvatarsettingsAction extends AccountSettingsAction
*
* @return void
*/
function cropAvatar()
{
$filedata = $_SESSION['FILEDATA'];
if (!$filedata) {
// TRANS: Server error displayed if an avatar upload went wrong somehow server side.
$this->serverError(_('Lost our file data.'));
return;
}
......@@ -372,21 +384,21 @@ class AvatarsettingsAction extends AccountSettingsAction
$this->showForm(_('Avatar updated.'), true);
common_broadcast_profile($profile);
} else {
// TRANS: Error displayed on the avatar upload page if the avatar could not be updated for an unknown reason.
$this->showForm(_('Failed updating avatar.'));
}
}
/**
* Get rid of the current avatar.
*
* @return void
*/
function deleteAvatar()
{
$user = common_current_user();
$profile = $user->getProfile();
$avatar = $profile->getOriginalAvatar();
if($avatar) $avatar->delete();
$avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE);
......@@ -396,6 +408,7 @@ class AvatarsettingsAction extends AccountSettingsAction
$avatar = $profile->getAvatar(AVATAR_MINI_SIZE);
if($avatar) $avatar->delete();
// TRANS: Success message for deleting a user avatar.
$this->showForm(_('Avatar deleted.'), true);
}
......@@ -416,7 +429,6 @@ class AvatarsettingsAction extends AccountSettingsAction
*
* @return void
*/
function showScripts()
{
parent::showScripts();
......
......@@ -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