&& empty($_POST)
&& ($_SERVER['CONTENT_LENGTH'] > 0)
) {
- $msg = _('The server was unable to handle that much POST ' .
- 'data (%s bytes) due to its current configuration.');
-
+ // TRANS: Client error displayed when the number of bytes in a POST request exceeds a limit.
+ // TRANS: %s is the number of bytes of the CONTENT_LENGTH.
+ $msg = _m('The server was unable to handle that much POST data (%s byte) due to its current configuration.',
+ 'The server was unable to handle that much POST data (%s bytes) due to its current configuration.',
+ intval($_SERVER['CONTENT_LENGTH']));
$this->clientError(sprintf($msg, $_SERVER['CONTENT_LENGTH']));
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 ApiGroupCreateAction extends ApiAuthAction
{
var $group = null;
*
* @return void
*/
-
function handle($args)
{
parent::handle($args);
}
if (empty($this->user)) {
+ // TRANS: Client error given when a user was not found (404).
$this->clientError(_('No such user.'), 404, $this->format);
return;
}
break;
default:
$this->clientError(
+ // TRANS: Client error given when an API method was not found (404).
_('API method not found.'),
404,
$this->format
);
break;
}
-
}
/**
if (!$valid) {
$this->clientError(
+ // TRANS: Validation error in form for group creation.
_(
'Nickname must have only lowercase letters ' .
'and numbers and no spaces.'
return false;
} elseif ($this->groupNicknameExists($this->nickname)) {
$this->clientError(
+ // TRANS: Client error trying to create a group with a nickname this is already in use.
_('Nickname already in use. Try another one.'),
403,
$this->format
return false;
} else if (!User_group::allowedNickname($this->nickname)) {
$this->clientError(
+ // TRANS: Client error in form for group creation.
_('Not a valid nickname.'),
403,
$this->format
)
)) {
$this->clientError(
+ // TRANS: Client error in form for group creation.
_('Homepage is not a valid URL.'),
403,
$this->format
!is_null($this->fullname)
&& mb_strlen($this->fullname) > 255) {
$this->clientError(
- _('Full name is too long (max 255 chars).'),
+ // TRANS: Client error in form for group creation.
+ _('Full name is too long (maximum 255 characters).'),
403,
$this->format
);
!is_null($this->location)
&& mb_strlen($this->location) > 255) {
$this->clientError(
- _('Location is too long (max 255 chars).'),
+ _('Location is too long (maximum 255 characters).'),
403,
$this->format
);
&& empty($_POST)
&& ($_SERVER['CONTENT_LENGTH'] > 0)
) {
- $msg = _('The server was unable to handle that much POST ' .
- 'data (%s bytes) due to its current configuration.');
-
+ // TRANS: Client error displayed when the number of bytes in a POST request exceeds a limit.
+ // TRANS: %s is the number of bytes of the CONTENT_LENGTH.
+ $msg = _m('The server was unable to handle that much POST data (%s byte) due to its current configuration.',
+ 'The server was unable to handle that much POST data (%s bytes) due to its current configuration.',
+ intval($_SERVER['CONTENT_LENGTH']));
$this->clientError(sprintf($msg, $_SERVER['CONTENT_LENGTH']));
return;
}
&& empty($_POST)
&& ($_SERVER['CONTENT_LENGTH'] > 0)
) {
- $msg = _('The server was unable to handle that much POST ' .
- 'data (%s bytes) due to its current configuration.');
-
+ // TRANS: Client error displayed when the number of bytes in a POST request exceeds a limit.
+ // TRANS: %s is the number of bytes of the CONTENT_LENGTH.
+ $msg = _m('The server was unable to handle that much POST data (%s byte) due to its current configuration.',
+ 'The server was unable to handle that much POST data (%s bytes) due to its current configuration.',
+ intval($_SERVER['CONTENT_LENGTH']));
$this->showForm(sprintf($msg, $_SERVER['CONTENT_LENGTH']));
return;
}
&& empty($_POST)
&& ($_SERVER['CONTENT_LENGTH'] > 0)
) {
- $msg = _('The server was unable to handle that much POST ' .
- 'data (%s bytes) due to its current configuration.');
+ // TRANS: Client error displayed when the number of bytes in a POST request exceeds a limit.
+ // TRANS: %s is the number of bytes of the CONTENT_LENGTH.
+ $msg = _m('The server was unable to handle that much POST data (%s byte) due to its current configuration.',
+ 'The server was unable to handle that much POST data (%s bytes) due to its current configuration.',
+ intval($_SERVER['CONTENT_LENGTH']));
$this->clientException(sprintf($msg, $_SERVER['CONTENT_LENGTH']));
return;
}
&& empty($_POST)
&& ($_SERVER['CONTENT_LENGTH'] > 0)
) {
- // TRANS: Client exception. %s is CONTENT_LENGTH (in bytes).
- $msg = _('The server was unable to handle that much POST ' .
- 'data (%s bytes) due to its current configuration.');
+ // TRANS: Client error displayed when the number of bytes in a POST request exceeds a limit.
+ // TRANS: %s is the number of bytes of the CONTENT_LENGTH.
+ $msg = _m('The server was unable to handle that much POST data (%s byte) due to its current configuration.',
+ 'The server was unable to handle that much POST data (%s bytes) due to its current configuration.',
+ intval($_SERVER['CONTENT_LENGTH']));
$this->clientException(sprintf($msg, $_SERVER['CONTENT_LENGTH']));
return;
}
$this->showForm(_('Homepage is not a valid URL.'));
return;
} else if (!is_null($fullname) && mb_strlen($fullname) > 255) {
- $this->showForm(_('Full name is too long (max 255 chars).'));
+ $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(_('Description is too long (max %d chars).'), User_group::maxDescription()));
return;
} else if (!is_null($location) && mb_strlen($location) > 255) {
- $this->showForm(_('Location is too long (max 255 chars).'));
+ $this->showForm(_('Location is too long (maximum 255 characters).'));
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 NewApplicationAction extends OwnerDesignAction
{
var $msg;
function title()
{
- return _('New Application');
+ // TRANS: This is the title of the form for adding a new application.
+ return _('New application');
}
/**
parent::prepare($args);
if (!common_logged_in()) {
+ // TRANS: Client error displayed trying to add a new application while not logged in.
$this->clientError(_('You must be logged in to register an application.'));
return false;
}
function handlePost($args)
{
- // Workaround for PHP returning empty $_POST and $_FILES when POST
+ // Workaround for PHP returning empty $_POST and $_FILES when POST
// length > post_max_size in php.ini
if (empty($_FILES)
&& empty($_POST)
&& ($_SERVER['CONTENT_LENGTH'] > 0)
) {
- $msg = _('The server was unable to handle that much POST ' .
- 'data (%s bytes) due to its current configuration.');
+ // TRANS: Client error displayed when the number of bytes in a POST request exceeds a limit.
+ // TRANS: %s is the number of bytes of the CONTENT_LENGTH.
+ $msg = _m('The server was unable to handle that much POST data (%s byte) due to its current configuration.',
+ 'The server was unable to handle that much POST data (%s bytes) due to its current configuration.',
+ intval($_SERVER['CONTENT_LENGTH']));
$this->clientException(sprintf($msg, $_SERVER['CONTENT_LENGTH']));
return;
}
- // CSRF protection
- $token = $this->trimmed('token');
- if (!$token || $token != common_session_token()) {
- $this->clientError(_('There was a problem with your session token.'));
- return;
- }
+ // CSRF protection
+ $token = $this->trimmed('token');
+ if (!$token || $token != common_session_token()) {
+ $this->clientError(_('There was a problem with your session token.'));
+ return;
+ }
- $cur = common_current_user();
+ $cur = common_current_user();
- if ($this->arg('cancel')) {
- common_redirect(common_local_url('oauthappssettings'), 303);
- } elseif ($this->arg('save')) {
- $this->trySave();
- } else {
- $this->clientError(_('Unexpected form submission.'));
- }
+ if ($this->arg('cancel')) {
+ common_redirect(common_local_url('oauthappssettings'), 303);
+ } elseif ($this->arg('save')) {
+ $this->trySave();
+ } else {
+ $this->clientError(_('Unexpected form submission.'));
+ }
}
function showForm($msg=null)
$this->showForm(_('Name already in use. Try another one.'));
return;
} elseif (mb_strlen($name) > 255) {
- $this->showForm(_('Name is too long (max 255 chars).'));
+ $this->showForm(_('Name is too long (maximum 255 chars).'));
return;
} elseif (empty($description)) {
$this->showForm(_('Description is required.'));
return;
} elseif (Oauth_application::descriptionTooLong($description)) {
$this->showForm(sprintf(
- _('Description is too long (max %d chars).'),
+ // TRANS: Form validation error in New application form.
+ // TRANS: %d is the maximum number of characters for the description.
+ _m('Description is too long (maximum %d character).',
+ 'Description is too long (maximum %d characters).',
+ Oauth_application::maxDesc()),
Oauth_application::maxDesc()));
return;
} elseif (empty($source_url)) {
$this->showForm(_('Organization is required.'));
return;
} elseif (mb_strlen($organization) > 255) {
- $this->showForm(_('Organization is too long (max 255 chars).'));
+ $this->showForm(_('Organization is too long (maximum 255 chars).'));
return;
} elseif (empty($homepage)) {
$this->showForm(_('Organization homepage is required.'));
$this->showForm(_('Homepage is not a valid URL.'));
return;
} else if (!is_null($fullname) && mb_strlen($fullname) > 255) {
- $this->showForm(_('Full name is too long (max 255 chars).'));
+ $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()));
return;
} else if (!is_null($location) && mb_strlen($location) > 255) {
- $this->showForm(_('Location is too long (max 255 chars).'));
+ $this->showForm(_('Location is too long (maximum 255 characters).'));
return;
}
$content_shortened = common_shorten_links($this->content);
if (Message::contentTooLong($content_shortened)) {
- $this->showForm(sprintf(_('That\'s too long. ' .
- 'Max message size is %d chars.'),
+ // TRANS: Form validation error displayed when message content is too long.
+ // TRANS: %d is the maximum number of characters for a message.
+ $this->showForm(sprintf(_m('That\'s too long. Maximum message size is %d character.',
+ 'That\'s too long. Maximum message size is %d characters.',
+ Message::maxContent()),
Message::maxContent()));
return;
}
*
* @return void
*/
-
function handle($args)
{
if (!common_logged_in()) {
// check for this before token since all POST and FILES data
// is losts when size is exceeded
if (empty($_POST) && $_SERVER['CONTENT_LENGTH']) {
- $this->clientError(sprintf(_('The server was unable to handle ' .
- 'that much POST data (%s bytes) due to its current configuration.'),
- $_SERVER['CONTENT_LENGTH']));
+ // TRANS: Client error displayed when the number of bytes in a POST request exceeds a limit.
+ // TRANS: %s is the number of bytes of the CONTENT_LENGTH.
+ $msg = _m('The server was unable to handle that much POST data (%s byte) due to its current configuration.',
+ 'The server was unable to handle that much POST data (%s bytes) due to its current configuration.',
+ intval($_SERVER['CONTENT_LENGTH']));
+ $this->clientError(sprintf($msg,$_SERVER['CONTENT_LENGTH']));
}
parent::handle($args);
$nli->show();
}
}
-
return;
} else if (!is_null($fullname) && mb_strlen($fullname) > 255) {
// TRANS: Validation error in form for profile settings.
- $this->showForm(_('Full name is too long (max 255 characters).'));
+ $this->showForm(_('Full name is too long (maximum 255 characters).'));
return;
} else if (Profile::bioTooLong($bio)) {
// TRANS: Validation error in form for profile settings.
// TRANS: Plural form is used based on the maximum number of allowed
// TRANS: characters for the biography (%d).
- $this->showForm(sprintf(_m('Bio is too long (max %d character).',
- 'Bio is too long (max %d characters).',
+ $this->showForm(sprintf(_m('Bio is too long (maximum %d character).',
+ 'Bio is too long (maximum %d characters).',
Profile::maxBio()),
Profile::maxBio()));
return;
} else if (!is_null($location) && mb_strlen($location) > 255) {
// TRANS: Validation error in form for profile settings.
- $this->showForm(_('Location is too long (max 255 characters).'));
+ $this->showForm(_('Location is too long (maximum 255 characters).'));
return;
} else if (is_null($timezone) || !in_array($timezone, DateTimeZone::listIdentifiers())) {
// TRANS: Validation error in form for profile settings.
return;
} else if (!is_null($language) && strlen($language) > 50) {
// TRANS: Validation error in form for profile settings.
- $this->showForm(_('Language is too long (max 50 characters).'));
+ $this->showForm(_('Language is too long (maximum 50 characters).'));
return;
}
$this->showForm(_('Homepage is not a valid URL.'));
return;
} else if (!is_null($fullname) && mb_strlen($fullname) > 255) {
- $this->showForm(_('Full name is too long (max 255 chars).'));
+ $this->showForm(_('Full name is too long (maximum 255 characters).'));
return;
} else if (Profile::bioTooLong($bio)) {
- $this->showForm(sprintf(_('Bio is too long (max %d chars).'),
+ $this->showForm(sprintf(_m('Bio is too long (maximum %d character).',
+ 'Bio is too long (maximum %d characters).',
+ Profile::maxBio()),
Profile::maxBio()));
return;
} else if (!is_null($location) && mb_strlen($location) > 255) {
- $this->showForm(_('Location is too long (max 255 chars).'));
+ $this->showForm(_('Location is too long (maximum 255 characters).'));
return;
} else if (strlen($password) < 6) {
$this->showForm(_('Password must be 6 or more characters.'));
$this->elementStart('li');
$maxBio = Profile::maxBio();
if ($maxBio > 0) {
- $bioInstr = sprintf(_('Describe yourself and your interests in %d chars'),
+ // TRANS: Tooltip for field label in form for profile settings. Plural
+ // TRANS: is decided by the number of characters available for the
+ // TRANS: biography (%d).
+ $bioInstr = sprintf(_m('Describe yourself and your interests in %d character',
+ 'Describe yourself and your interests in %d characters',
+ $maxBio),
$maxBio);
} else {
$bioInstr = _('Describe yourself and your interests');