GitHost.io will be shut down on June 1, 2019. At that point this instance will be unreachable and all data will be irrevocably deleted. More details at https://about.gitlab.com/gitlab-hosted/#githost-is-shutting-down-on-june-1st-2019

Commit 6c0e43be authored by Siebrand Mazeland's avatar Siebrand Mazeland

L10n consistency updates in wording and punctuation.

Translator documentation added/updated.
Superfluous whitespace removed.
parent 08cb576b
......@@ -43,7 +43,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 JoingroupAction extends Action
{
var $group = null;
......@@ -51,12 +50,12 @@ class JoingroupAction extends Action
/**
* Prepare to run
*/
function prepare($args)
{
parent::prepare($args);
if (!common_logged_in()) {
// TRANS: Client error displayed when trying to join a group while not logged in.
$this->clientError(_('You must be logged in to join a group.'));
return false;
}
......@@ -79,17 +78,20 @@ class JoingroupAction extends Action
$local = Local_group::staticGet('nickname', $nickname);
if (!$local) {
// TRANS: Client error displayed when trying to join a non-local group.
$this->clientError(_('No such group.'), 404);
return false;
}
$this->group = User_group::staticGet('id', $local->group_id);
} else {
// TRANS: Client error displayed when trying to join a group without providing a group name or group ID.
$this->clientError(_('No nickname or ID.'), 404);
return false;
}
if (!$this->group) {
// TRANS: Client error displayed when trying to join a non-existing group.
$this->clientError(_('No such group.'), 404);
return false;
}
......@@ -97,11 +99,13 @@ class JoingroupAction extends Action
$cur = common_current_user();
if ($cur->isMember($this->group)) {
// TRANS: Client error displayed when trying to join a group while already a member.
$this->clientError(_('You are already a member of that group.'), 403);
return false;
}
if (Group_block::isBlocked($this->group, $cur->getProfile())) {
// TRANS: Client error displayed when trying to join a group while being blocked form joining it.
$this->clientError(_('You have been blocked from that group by the admin.'), 403);
return false;
}
......@@ -118,7 +122,6 @@ class JoingroupAction extends Action
*
* @return void
*/
function handle($args)
{
parent::handle($args);
......@@ -131,6 +134,8 @@ class JoingroupAction extends Action
Event::handle('EndJoinGroup', array($this->group, $cur));
}
} catch (Exception $e) {
// TRANS: Server error displayed when joining a group failed in the database.
// TRANS: %1$s is the joining user's nickname, $2$s is the group nickname for which the join failed.
$this->serverError(sprintf(_('Could not join user %1$s to group %2$s.'),
$cur->nickname, $this->group->nickname));
}
......@@ -138,7 +143,8 @@ class JoingroupAction extends Action
if ($this->boolean('ajax')) {
$this->startHTML('text/xml;charset=utf-8');
$this->elementStart('head');
$this->element('title', null, sprintf(_('%1$s joined group %2$s'),
// TRANS: Title for join group page after joining.
$this->element('title', null, sprintf(_m('TITLE','%1$s joined group %2$s'),
$cur->nickname,
$this->group->nickname));
$this->elementEnd('head');
......@@ -153,4 +159,4 @@ class JoingroupAction extends Action
303);
}
}
}
\ No newline at end of file
}
......@@ -43,7 +43,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 LeavegroupAction extends Action
{
var $group = null;
......@@ -51,12 +50,12 @@ class LeavegroupAction extends Action
/**
* Prepare to run
*/
function prepare($args)
{
parent::prepare($args);
if (!common_logged_in()) {
// TRANS: Client error displayed when trying to leave a group while not logged in.
$this->clientError(_('You must be logged in to leave a group.'));
return false;
}
......@@ -79,17 +78,20 @@ class LeavegroupAction extends Action
$local = Local_group::staticGet('nickname', $nickname);
if (!$local) {
// TRANS: Client error displayed when trying to leave a non-local group.
$this->clientError(_('No such group.'), 404);
return false;
}
$this->group = User_group::staticGet('id', $local->group_id);
} else {
// TRANS: Client error displayed when trying to leave a group without providing a group name or group ID.
$this->clientError(_('No nickname or ID.'), 404);
return false;
}
if (!$this->group) {
// TRANS: Client error displayed when trying to leave a non-existing group.
$this->clientError(_('No such group.'), 404);
return false;
}
......@@ -97,6 +99,7 @@ class LeavegroupAction extends Action
$cur = common_current_user();
if (!$cur->isMember($this->group)) {
// TRANS: Client error displayed when trying to join a group while already a member.
$this->clientError(_('You are not a member of that group.'), 403);
return false;
}
......@@ -113,7 +116,6 @@ class LeavegroupAction extends Action
*
* @return void
*/
function handle($args)
{
parent::handle($args);
......@@ -126,6 +128,8 @@ class LeavegroupAction extends Action
Event::handle('EndLeaveGroup', array($this->group, $cur));
}
} catch (Exception $e) {
// TRANS: Server error displayed when leaving a group failed in the database.
// TRANS: %1$s is the leaving user's nickname, $2$s is the group nickname for which the leave failed.
$this->serverError(sprintf(_('Could not remove user %1$s from group %2$s.'),
$cur->nickname, $this->group->nickname));
return;
......@@ -134,7 +138,8 @@ class LeavegroupAction extends Action
if ($this->boolean('ajax')) {
$this->startHTML('text/xml;charset=utf-8');
$this->elementStart('head');
$this->element('title', null, sprintf(_('%1$s left group %2$s'),
// TRANS: Title for leave group page after leaving.
$this->element('title', null, sprintf(_m('TITLE','%1$s left group %2$s'),
$cur->nickname,
$this->group->nickname));
$this->elementEnd('head');
......
This diff is collapsed.
......@@ -430,16 +430,15 @@ class RegisterAction extends Action
if (Event::handle('StartRegistrationFormData', array($this))) {
$this->elementStart('li');
$this->input('nickname', _('Nickname'), $this->trimmed('nickname'),
_('1-64 lowercase letters or numbers, '.
'no punctuation or spaces. Required.'));
_('1-64 lowercase letters or numbers, no punctuation or spaces.'));
$this->elementEnd('li');
$this->elementStart('li');
$this->password('password', _('Password'),
_('6 or more characters. Required.'));
_('6 or more characters.'));
$this->elementEnd('li');
$this->elementStart('li');
$this->password('confirm', _('Confirm'),
_('Same as password above. Required.'));
_('Same as password above.'));
$this->elementEnd('li');
$this->elementStart('li');
if ($this->invite && $this->invite->address_type == 'email') {
......
......@@ -46,13 +46,11 @@ require_once INSTALLDIR.'/lib/form.php';
*
* @see UnsubscribeForm
*/
class GroupEditForm extends Form
{
/**
* group for user to join
*/
var $group = null;
/**
......@@ -61,7 +59,6 @@ class GroupEditForm extends Form
* @param Action $out output channel
* @param User_group $group group to join
*/
function __construct($out=null, $group=null)
{
parent::__construct($out);
......@@ -74,7 +71,6 @@ class GroupEditForm extends Form
*
* @return string ID of the form
*/
function id()
{
if ($this->group) {
......@@ -89,7 +85,6 @@ class GroupEditForm extends Form
*
* @return string of the form class
*/
function formClass()
{
return 'form_settings';
......@@ -100,7 +95,6 @@ class GroupEditForm extends Form
*
* @return string URL of the action
*/
function action()
{
if ($this->group) {
......@@ -116,7 +110,6 @@ class GroupEditForm extends Form
*
* @return void
*/
function formLegend()
{
$this->out->element('legend', null, _('Create a new group'));
......@@ -127,7 +120,6 @@ class GroupEditForm extends Form
*
* @return void
*/
function formData()
{
if ($this->group) {
......@@ -151,7 +143,7 @@ class GroupEditForm extends Form
$this->out->hidden('groupid', $id);
$this->out->input('nickname', _('Nickname'),
($this->out->arg('nickname')) ? $this->out->arg('nickname') : $nickname,
_('1-64 lowercase letters or numbers, no punctuation or spaces'));
_('1-64 lowercase letters or numbers, no punctuation or spaces.'));
$this->out->elementEnd('li');
$this->out->elementStart('li');
$this->out->input('fullname', _('Full name'),
......@@ -167,8 +159,8 @@ class GroupEditForm extends Form
if ($desclimit == 0) {
$descinstr = _('Describe the group or topic');
} else {
$descinstr = sprintf(_m('Describe the group or topic in %d character or less',
'Describe the group or topic in %d characters or less',
$descinstr = sprintf(_m('Describe the group or topic in %d character or less.',
'Describe the group or topic in %d characters or less.',
$desclimit),
$desclimit);
}
......@@ -201,7 +193,6 @@ class GroupEditForm extends Form
*
* @return void
*/
function formActions()
{
$this->out->submit('submit', _m('BUTTON','Save'));
......
......@@ -45,7 +45,6 @@ class WebColor {
*
* @return nothing
*/
function __construct($color = null)
{
if (isset($color)) {
......@@ -77,7 +76,9 @@ class WebColor {
if (preg_match('/(#([0-9A-Fa-f]{3,6})\b)/u', $color) > 0) {
$this->setHexColor($color);
} else {
$errmsg = _('%s is not a valid color!');
// TRANS: Web color exception thrown when a hexadecimal color code does not validate.
// TRANS: %s is the provided (invalid) color code.
$errmsg = _('%s is not a valid color! Use 3 or 6 hex characters.');
throw new WebColorException(sprintf($errmsg, $color));
}
}
......@@ -115,8 +116,8 @@ class WebColor {
$hexcolor[1].$hexcolor[1],
$hexcolor[2].$hexcolor[2]);
} else {
// TRANS: Validation error for a web colour.
// TRANS: %s is the provided (invalid) text for colour.
// TRANS: Web color exception thrown when a hexadecimal color code does not validate.
// TRANS: %s is the provided (invalid) color code.
$errmsg = _('%s is not a valid color! Use 3 or 6 hex characters.');
throw new WebColorException(sprintf($errmsg, $hexcolor));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment