* translator documentation added/updated.
* superfluous whitespace removed.
* @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
{
/**
}
if (empty($this->attachment)) {
+ // TRANS: Client error displayed trying to get a non-existing attachment.
$this->clientError(_('No such attachment.'), 404);
return false;
}
*
* @return boolean true
*/
-
function isReadOnly($args)
{
return true;
*
* @return void
*/
-
function handle($args)
{
parent::handle($args);
*
* @return void
*/
-
function showLocalNavBlock()
{
}
*
* @return void
*/
-
function showContent()
{
$ali = new Attachment($this->attachment, $this);
*
* @return void
*/
-
function showPageNoticeBlock()
{
}
$atcs->show();
}
}
-
* @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
{
/**
$this->elementEnd('div');
}
}
-
* @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();
}
$this->element('img', array('src' => $file_thumbnail->url, 'alt' => 'Thumbnail'));
}
-
}
-
* Class handler.
*
* @param array $args query arguments
- *
+ *
* @return boolean false if nickname or user isn't found
*/
function handle($args)
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;
}
return true;
}
}
-
* @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;
*
* @return string Title of the page
*/
-
function title()
{
+ // TRANS: Title for avatar upload page.
return _('Avatar');
}
*
* @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());
}
/**
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;
}
'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,
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,
'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');
}
$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');
}
$this->elementEnd('fieldset');
$this->elementEnd('form');
-
}
function showCropForm()
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;
}
'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());
$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']),
$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']),
'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');
-
}
/**
*
* @return void
*/
-
function handlePost()
{
// Workaround for PHP returning empty $_POST and $_FILES when POST
'Try again, please.'));
return;
}
-
+
if (Event::handle('StartAvatarSaveForm', array($this))) {
if ($this->arg('upload')) {
$this->uploadAvatar();
} 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));
*
* @return void
*/
-
function uploadAvatar()
{
try {
return;
}
if ($imagefile === null) {
+ // TRANS: Validation error on avatar upload form when no file was uploaded.
$this->showForm(_('No file uploaded.'));
return;
}
$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);
}
*
* @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;
}
$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);
$avatar = $profile->getAvatar(AVATAR_MINI_SIZE);
if($avatar) $avatar->delete();
+ // TRANS: Success message for deleting a user avatar.
$this->showForm(_('Avatar deleted.'), true);
}
*
* @return void
*/
-
function showScripts()
{
parent::showScripts();
* @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
* @link http://status.net/
*/
-
class BlockAction extends ProfileFormAction
{
var $profile = null;
*
* @return boolean success flag
*/
-
function prepare($args)
{
if (!parent::prepare($args)) {
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;
}
*
* @return void
*/
-
function handle($args)
{
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
}
function title() {
+ // TRANS: Title for block user page.
return _('Block user');
}
'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 '.
}
if (!$result) {
+ // TRANS: Server error displayed when blocking a user fails.
$this->serverError(_('Failed to save block information.'));
return;
}
* 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.
*/
/**
* If we reached this form without returnto arguments, return to the
* current user's subscription list.
- *
+ *
* @return string URL
*/
function defaultReturnTo()
* @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;
}
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;
}
$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;
}
$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;
}
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);
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.'));
}
*
* @see UnblockForm
*/
-
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);
*
* @return int ID of the form
*/
-
function id()
{
// This should be unique for the page.
*
* @return string class of the form
*/
-
function formClass()
{
return 'form_group_unblock';
*
* @return string URL of the action
*/
-
function action()
{
return common_local_url('groupunblock');
*/
function formLegend()
{
+ // TRANS: Form legend for unblocking a user from a group.
$this->out->element('legend', null, _('Unblock user from group'));
}
*
* @return void
*/
-
function formData()
{
$this->out->hidden('unblockto-' . $this->profile->id,
*
* @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'));
}
}
require_once INSTALLDIR . '/actions/newnotice.php';
/**
- * Action for posting a notice
+ * Action for posting a notice
*
* @category Bookmarklet
* @package 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 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')));
}
{
}
}
-
* @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. */
*
* @return void
*/
-
function handle($args)
{
parent::handle($args);
}
$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;
}
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;
}
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;
}
*
* @return string title
*/
-
function title()
{
+ // TRANS: Title for the contact address confirmation action.
return _('Confirm address');
}
*
* @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));
* @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
* @link http://status.net/
*/
-
class ConversationAction extends Action
{
var $id = null;
*
* @return boolean false if id not passed in
*/
-
function prepare($args)
{
parent::prepare($args);
*
* @return void
*/
-
function handle($args)
{
parent::handle($args);
*
* @return string page title
*/
-
function title()
{
- return _("Conversation");
+ // TRANS: Title for page with a conversion (multiple notices in context).
+ return _('Conversation');
}
/**
*
* @return void
*/
-
function showContent()
{
$notices = Notice::conversationStream($this->id, null, null);
* @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
* @link http://status.net/
*/
-
class ConversationTree extends NoticeList
{
var $tree = null;
*
* @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'));
*
* @return void
*/
-
function showNoticePlus($id)
{
$notice = $this->table[$id];
*
* @return NoticeListItem a list item to show
*/
-
function newListItem($notice)
{
return new ConversationTreeItem($notice, $this->out);
* @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
* @link http://status.net/
*/
-
class ConversationTreeItem extends NoticeListItem
{
/**
*
* @return void
*/
-
function showStart()
{
return;
*
* @return void
*/
-
function showEnd()
{
return;
*
* @return void
*/
-
function showContext()
{
return;
* @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);
}
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;
}
}
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;
}
}
if (!$this->group) {
+ // TRANS: Client error displayed trying to edit a non-existing group.
$this->clientError(_('No such group.'), 404);
return false;
}
$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;
}
*
* @return void
*/
-
function handle($args)
{
parent::handle($args);
$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.'));
}
}
{
$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;
}
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;
}
}
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;
}
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;
}
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.'));
}
array('nickname' => $nickname)),
303);
} else {
+ // TRANS: Group edit form success message.
$this->showForm(_('Options saved.'));
}
}
return false;
}
}
-
* @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;
}
*
* @return void
*/
-
function handle($args)
{
parent::handle($args);
$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.'));
}
}
if (!Validate::string($nickname, array('min_length' => 1,
'max_length' => 64,
'format' => NICKNAME_FMT))) {
+ // TRANS: Group create form validation error.
$this->showForm(_('Nickname must have only lowercase letters '.
'and numbers and no spaces.'));
return;
} else if ($this->nicknameExists($nickname)) {
+ // TRANS: Group create form validation error.
$this->showForm(_('Nickname already in use. Try another one.'));
return;
} else if (!User_group::allowedNickname($nickname)) {
+ // TRANS: Group create 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 create form validation error.
$this->showForm(_('Homepage is not a valid URL.'));
return;
} else if (!is_null($fullname) && mb_strlen($fullname) > 255) {
+ // TRANS: Group create form validation error.
$this->showForm(_('Full name is too long (maximum 255 characters).'));
return;
} else if (User_group::descriptionTooLong($description)) {
- // TRANS: Form validation error creating a new group because the description is too long.
+ // TRANS: Group create form validation error.
// TRANS: %d is the maximum number of allowed characters.
$this->showForm(sprintf(_m('Description is too long (maximum %d character).',
'Description is too long (maximum %d characters).',
User_group::maxDescription()));
return;
} else if (!is_null($location) && mb_strlen($location) > 255) {
+ // TRANS: Group create form validation error.
$this->showForm(_('Location is too long (maximum 255 characters).'));
return;
}
}
if (count($aliases) > common_config('group', 'maxaliases')) {
- // TRANS: Client error shown when providing too many aliases during group creation.
+ // TRANS: Group create 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.',
if (!Validate::string($alias, array('min_length' => 1,
'max_length' => 64,
'format' => NICKNAME_FMT))) {
+ // TRANS: Group create form validation error.
$this->showForm(sprintf(_('Invalid alias: "%s"'), $alias));
return;
}
if ($this->nicknameExists($alias)) {
+ // TRANS: Group create 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 create form validation error.
$this->showForm(_('Alias can\'t be the same as nickname.'));
return;
}
return false;
}
}
-
*
* @see BlockForm
*/
-
class UnblockForm extends ProfileActionForm
{
/**
*
* @return string Name of the action, lowercased.
*/
-
function target()
{
return 'unblock';
*
* @return string Title of the form, internationalized
*/
-
function title()
{
// TRANS: Title for the form to unblock a user.
- return _('Unblock');
+ return _m('TITLE','Unblock');
}
/**
*
* @return string description of the form, internationalized
*/
-
function description()
{
// TRANS: Description of the form to unblock a user.