git.gnu.io has moved to IP address 209.51.188.249 -- please double check where you are logging in.

Commit 39392e03 authored by Craig Andrews's avatar Craig Andrews

Merge branch '0.9.x' into 1.0.x

Conflicts:
	actions/confirmaddress.php
	actions/imsettings.php
parents 727ea5a5 23bad16b
......@@ -61,7 +61,7 @@ class AllAction extends ProfileAction
if ($this->page > 1 && $this->notice->N == 0) {
// TRANS: Server error when page not found (404)
$this->serverError(_('No such page'), $code = 404);
$this->serverError(_('No such page.'), $code = 404);
}
return true;
......
......@@ -112,10 +112,12 @@ class AllrssAction extends Rss10Action
$c = array('url' => common_local_url('allrss',
array('nickname' =>
$user->nickname)),
// TRANS: Message is used as link title. %s is a user nickname.
'title' => sprintf(_('%s and friends'), $user->nickname),
'link' => common_local_url('all',
array('nickname' =>
$user->nickname)),
// TRANS: Message is used as link description. %1$s is a username, %2$s is a site name.
'description' => sprintf(_('Updates from %1$s and friends on %2$s!'),
$user->nickname, common_config('site', 'name')));
return $c;
......
......@@ -103,7 +103,7 @@ class ApiAccountUpdateDeliveryDeviceAction extends ApiAuthAction
$this->clientError(
_(
'You must specify a parameter named ' .
'\'device\' with a value of one of: sms, im, none'
'\'device\' with a value of one of: sms, im, none.'
)
);
return;
......
......@@ -263,7 +263,7 @@ class ApiGroupCreateAction extends ApiAuthAction
if (!$valid) {
$this->clientError(
sprintf(_('Invalid alias: "%s"'), $alias),
sprintf(_('Invalid alias: "%s".'), $alias),
403,
$this->format
);
......
......@@ -92,7 +92,7 @@ class ApiGroupIsMemberAction extends ApiBareAuthAction
}
if (empty($this->group)) {
$this->clientError(_('Group not found!'), 404, $this->format);
$this->clientError(_('Group not found.'), 404, $this->format);
return false;
}
......
......@@ -101,7 +101,7 @@ class ApiGroupJoinAction extends ApiAuthAction
}
if (empty($this->group)) {
$this->clientError(_('Group not found!'), 404, $this->format);
$this->clientError(_('Group not found.'), 404, $this->format);
return false;
}
......
......@@ -101,7 +101,7 @@ class ApiGroupLeaveAction extends ApiAuthAction
}
if (empty($this->group)) {
$this->clientError(_('Group not found!'), 404, $this->format);
$this->clientError(_('Group not found.'), 404, $this->format);
return false;
}
......
......@@ -87,6 +87,7 @@ class ApiGroupListAllAction extends ApiPrivateAuthAction
parent::handle($args);
$sitename = common_config('site', 'name');
// TRANS: Message is used as a title. %s is a site name.
$title = sprintf(_("%s groups"), $sitename);
$taguribase = TagURI::base();
$id = "tag:$taguribase:Groups";
......
......@@ -88,7 +88,7 @@ class ApiGroupMembershipAction extends ApiPrivateAuthAction
parent::handle($args);
if (empty($this->group)) {
$this->clientError(_('Group not found!'), 404, $this->format);
$this->clientError(_('Group not found.'), 404, $this->format);
return false;
}
......
......@@ -79,7 +79,7 @@ class ApiGroupShowAction extends ApiPrivateAuthAction
common_redirect(common_local_url('ApiGroupShow', $args), 301);
} else {
$this->clientError(
_('Group not found!'),
_('Group not found.'),
404,
$this->format
);
......
......@@ -199,7 +199,7 @@ class ApiStatusesUpdateAction extends ApiAuthAction
$reply_to = $this->in_reply_to_status_id;
} else {
$this->clientError(
_('Not found'),
_('Not found.'),
$code = 404,
$this->format
);
......
......@@ -116,6 +116,7 @@ class ApiTimelineFriendsAction extends ApiBareAuthAction
$id = "tag:$taguribase:FriendsTimeline:" . $this->user->id;
$subtitle = sprintf(
// TRANS: Message is used as a subtitle. %1$s is a user nickname, %2$s is a site name.
_('Updates from %1$s and friends on %2$s!'),
$this->user->nickname,
$sitename
......
......@@ -88,7 +88,7 @@ class ApiTimelineGroupAction extends ApiPrivateAuthAction
parent::handle($args);
if (empty($this->group)) {
$this->clientError(_('Group not found!'), 404, $this->format);
$this->clientError(_('Group not found.'), 404, $this->format);
return false;
}
......
......@@ -117,6 +117,7 @@ class ApiTimelineHomeAction extends ApiBareAuthAction
$id = "tag:$taguribase:HomeTimeline:" . $this->user->id;
$subtitle = sprintf(
// TRANS: Message is used as a subtitle. %1$s is a user nickname, %2$s is a site name.
_('Updates from %1$s and friends on %2$s!'),
$this->user->nickname, $sitename
);
......
......@@ -69,7 +69,7 @@ class ApiTimelineRetweetedByMeAction extends ApiAuthAction
{
parent::prepare($args);
$this->serverError('Unimplemented', 503);
$this->serverError('Unimplemented.', 503);
return false;
}
......
......@@ -103,7 +103,7 @@ class AvatarsettingsAction extends AccountSettingsAction
if (!$profile) {
common_log_db_error($user, 'SELECT', __FILE__);
$this->serverError(_('User without matching profile'));
$this->serverError(_('User without matching profile.'));
return;
}
......@@ -182,7 +182,7 @@ class AvatarsettingsAction extends AccountSettingsAction
if (!$profile) {
common_log_db_error($user, 'SELECT', __FILE__);
$this->serverError(_('User without matching profile'));
$this->serverError(_('User without matching profile.'));
return;
}
......
......@@ -66,7 +66,7 @@ class BlockAction extends ProfileFormAction
assert(!empty($cur)); // checked by parent
if ($cur->hasBlocked($this->profile)) {
$this->clientError(_("You already blocked that user."));
$this->clientError(_('You already blocked that user.'));
return false;
}
......@@ -140,8 +140,20 @@ class BlockAction extends ProfileFormAction
$this->hidden($k, $v);
}
}
$this->submit('form_action-no', _('No'), 'submit form_action-primary', 'no', _("Do not block this user"));
$this->submit('form_action-yes', _('Yes'), 'submit form_action-secondary', 'yes', _('Block this user'));
$this->submit('form_action-no',
// TRANS: Button label on the user block form.
_m('BUTTON','No'),
'submit form_action-primary',
'no',
// TRANS: Submit button title for 'No' when blocking a user.
_('Do not block this user'));
$this->submit('form_action-yes',
// TRANS: Button label on the user block form.
_m('BUTTON','Yes'),
'submit form_action-secondary',
'yes',
// TRANS: Submit button title for 'Yes' when blocking a user.
_('Block this user'));
$this->elementEnd('fieldset');
$this->elementEnd('form');
}
......
......@@ -47,7 +47,8 @@ class BookmarkletAction extends NewnoticeAction
{
function showTitle()
{
$this->element('title', null, _('Post to ').common_config('site', 'name'));
// TRANS: Title for mini-posting window loaded from bookmarklet.
$this->element('title', null, sprintf(_('Post to %s'), common_config('site', 'name')));
}
function showHeader()
......
......@@ -89,6 +89,7 @@ class ConfirmaddressAction extends Action
$transports = array();
Event::handle('GetImTransports', array(&$transports));
if (!in_array($type, array('email', 'sms')) && !in_array($type, array_keys($transports))) {
// TRANS: Server error for an unknown address type, which can be 'email', 'sms', or the name of an IM network (such as 'xmpp' or 'aim')
$this->serverError(sprintf(_('Unrecognized address type %s'), $type));
return;
}
......
......@@ -150,13 +150,17 @@ class DeleteapplicationAction extends Action
'This will clear all data about the application from the '.
'database, including all existing user connections.'));
$this->submit('form_action-no',
_('No'),
// TRANS: Button label on the delete application form.
_m('BUTTON','No'),
'submit form_action-primary',
'no',
_("Do not delete this application"));
// TRANS: Submit button title for 'No' when deleting an application.
_('Do not delete this application'));
$this->submit('form_action-yes',
_('Yes'),
// TRANS: Button label on the delete application form.
_m('BUTTON','Yes'),
'submit form_action-secondary',
// TRANS: Submit button title for 'Yes' when deleting an application.
'yes', _('Delete this application'));
$this->elementEnd('fieldset');
$this->elementEnd('form');
......
......@@ -142,8 +142,20 @@ class DeletenoticeAction extends Action
$this->hidden('token', common_session_token());
$this->hidden('notice', $this->trimmed('notice'));
$this->element('p', null, _('Are you sure you want to delete this notice?'));
$this->submit('form_action-no', _('No'), 'submit form_action-primary', 'no', _("Do not delete this notice"));
$this->submit('form_action-yes', _('Yes'), 'submit form_action-secondary', 'yes', _('Delete this notice'));
$this->submit('form_action-no',
// TRANS: Button label on the delete notice form.
_m('BUTTON','No'),
'submit form_action-primary',
'no',
// TRANS: Submit button title for 'No' when deleting a notice.
_("Do not delete this notice"));
$this->submit('form_action-yes',
// TRANS: Button label on the delete notice form.
_m('BUTTON','Yes'),
'submit form_action-secondary',
'yes',
// TRANS: Submit button title for 'Yes' when deleting a notice.
_('Delete this notice'));
$this->elementEnd('fieldset');
$this->elementEnd('form');
}
......
......@@ -64,14 +64,14 @@ class DeleteuserAction extends ProfileFormAction
assert(!empty($cur)); // checked by parent
if (!$cur->hasRight(Right::DELETEUSER)) {
$this->clientError(_("You cannot delete users."));
$this->clientError(_('You cannot delete users.'));
return false;
}
$this->user = User::staticGet('id', $this->profile->id);
if (empty($this->user)) {
$this->clientError(_("You can only delete local users."));
$this->clientError(_('You can only delete local users.'));
return false;
}
......@@ -147,8 +147,20 @@ class DeleteuserAction extends ProfileFormAction
}
Event::handle('EndDeleteUserForm', array($this, $this->user));
}
$this->submit('form_action-no', _('No'), 'submit form_action-primary', 'no', _("Do not block this user"));
$this->submit('form_action-yes', _('Yes'), 'submit form_action-secondary', 'yes', _('Delete this user'));
$this->submit('form_action-no',
// TRANS: Button label on the delete user form.
_m('BUTTON','No'),
'submit form_action-primary',
'no',
// TRANS: Submit button title for 'No' when deleting a user.
_('Do not block this user'));
$this->submit('form_action-yes',
// TRANS: Button label on the delete user form.
_m('BUTTON','Yes'),
'submit form_action-secondary',
'yes',
// TRANS: Submit button title for 'Yes' when deleting a user.
_('Delete this user'));
$this->elementEnd('fieldset');
$this->elementEnd('form');
}
......
......@@ -59,6 +59,7 @@ class DesignadminpanelAction extends AdminPanelAction
function title()
{
// TRANS: Message used as title for design settings for the site.
return _('Design');
}
......@@ -272,11 +273,11 @@ class DesignadminpanelAction extends AdminPanelAction
{
if (!empty($values['logo']) &&
!Validate::uri($values['logo'], array('allowed_schemes' => array('http', 'https')))) {
$this->clientError(_("Invalid logo URL."));
$this->clientError(_('Invalid logo URL.'));
}
if (!in_array($values['theme'], Theme::listAvailable())) {
$this->clientError(sprintf(_("Theme not available: %s"), $values['theme']));
$this->clientError(sprintf(_("Theme not available: %s."), $values['theme']));
}
}
......@@ -454,6 +455,7 @@ class DesignAdminPanelForm extends AdminForm
$this->out->element('label', array('for' => 'design_background-image_on',
'class' => 'radio'),
// TRANS: Used as radio button label to add a background image.
_('On'));
$attrs = array('name' => 'design_background-image_onoff',
......@@ -470,6 +472,7 @@ class DesignAdminPanelForm extends AdminForm
$this->out->element('label', array('for' => 'design_background-image_off',
'class' => 'radio'),
// TRANS: Used as radio button label to not add a background image.
_('Off'));
$this->out->element('p', 'form_guide', _('Turn background image on or off.'));
$this->unli();
......
......@@ -71,7 +71,7 @@ class DisfavorAction extends Action
$notice = Notice::staticGet($id);
$token = $this->trimmed('token-'.$notice->id);
if (!$token || $token != common_session_token()) {
$this->clientError(_("There was a problem with your session token. Try again, please."));
$this->clientError(_('There was a problem with your session token. Try again, please.'));
return;
}
$fave = new Fave();
......
This diff is collapsed.
......@@ -72,7 +72,7 @@ class FavorAction extends Action
$notice = Notice::staticGet($id);
$token = $this->trimmed('token-'.$notice->id);
if (!$token || $token != common_session_token()) {
$this->clientError(_("There was a problem with your session token. Try again, please."));
$this->clientError(_('There was a problem with your session token. Try again, please.'));
return;
}
if ($user->hasFave($notice)) {
......
......@@ -135,7 +135,7 @@ class FinishremotesubscribeAction extends Action
$service->getServiceURI(OMB_ENDPOINT_UPDATEPROFILE);
if (!$remote->update($orig_remote)) {
$this->serverError(_('Error updating remote profile'));
$this->serverError(_('Error updating remote profile.'));
return;
}
......
......@@ -56,7 +56,7 @@ class FoafGroupAction extends Action
return false;
}
$local = Local_group::staticGet('nickname', $nickname);
$local = Local_group::staticGet('nickname', $this->nickname);
if (!$local) {
$this->clientError(_('No such group.'), 404);
......@@ -126,7 +126,8 @@ class FoafGroupAction extends Action
while ($members->fetch()) {
$member_uri = common_local_url('userbyid', array('id'=>$members->id));
$member_details[$member_uri] = array(
'nickname' => $members->nickname
'nickname' => $members->nickname,
'is_admin' => false,
);
$this->element('member', array('rdf:resource' => $member_uri));
}
......
......@@ -59,11 +59,11 @@ class GrantRoleAction extends ProfileFormAction
$this->role = $this->arg('role');
if (!Profile_role::isValid($this->role)) {
$this->clientError(_("Invalid role."));
$this->clientError(_('Invalid role.'));
return false;
}
if (!Profile_role::isSettable($this->role)) {
$this->clientError(_("This role is reserved and cannot be set."));
$this->clientError(_('This role is reserved and cannot be set.'));
return false;
}
......@@ -72,14 +72,14 @@ class GrantRoleAction extends ProfileFormAction
assert(!empty($cur)); // checked by parent
if (!$cur->hasRight(Right::GRANTROLE)) {
$this->clientError(_("You cannot grant user roles on this site."));
$this->clientError(_('You cannot grant user roles on this site.'));
return false;
}
assert(!empty($this->profile)); // checked by parent
if ($this->profile->hasRole($this->role)) {
$this->clientError(_("User already has this role."));
$this->clientError(_('User already has this role.'));
return false;
}
......
......@@ -41,7 +41,7 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
* @link http://status.net/
*/
class GroupblockAction extends Action
class GroupblockAction extends RedirectingAction
{
var $profile = null;
var $group = null;
......@@ -117,9 +117,7 @@ class GroupblockAction extends Action
parent::handle($args);
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
if ($this->arg('no')) {
common_redirect(common_local_url('groupmembers',
array('nickname' => $this->group->nickname)),
303);
$this->returnToArgs();
} elseif ($this->arg('yes')) {
$this->blockProfile();
} elseif ($this->arg('blockto')) {
......@@ -175,8 +173,20 @@ class GroupblockAction extends Action
$this->hidden($k, $v);
}
}
$this->submit('form_action-no', _('No'), 'submit form_action-primary', 'no', _("Do not block this user from this group"));
$this->submit('form_action-yes', _('Yes'), 'submit form_action-secondary', 'yes', _('Block this user from this group'));
$this->submit('form_action-no',
// TRANS: Button label on the form to block a user from a group.
_m('BUTTON','No'),
'submit form_action-primary',
'no',
// TRANS: Submit button title for 'No' when blocking a user from a group.
_('Do not block this user from this group'));
$this->submit('form_action-yes',
// TRANS: Button label on the form to block a user from a group.
_m('BUTTON','Yes'),
'submit form_action-secondary',
'yes',
// TRANS: Submit button title for 'Yes' when blocking a user from a group.
_('Block this user from this group'));
$this->elementEnd('fieldset');
$this->elementEnd('form');
}
......@@ -196,23 +206,20 @@ class GroupblockAction extends Action
$this->serverError(_("Database error blocking user from group."));
return false;
}
$this->returnToArgs();
}
// Now, gotta figure where we go back to
foreach ($this->args as $k => $v) {
if ($k == 'returnto-action') {
$action = $v;
} elseif (substr($k, 0, 9) == 'returnto-') {
$args[substr($k, 9)] = $v;
}
}
if ($action) {
common_redirect(common_local_url($action, $args), 303);
} else {
common_redirect(common_local_url('groupmembers',
array('nickname' => $this->group->nickname)),
303);
}
/**
* If we reached this form without returnto arguments, default to
* the top of the group's member list.
*
* @return string URL
*/
function defaultReturnTo()
{
return common_local_url('groupmembers',
array('nickname' => $this->group->nickname));
}
function showScripts()
......
......@@ -205,8 +205,7 @@ class GroupMemberListItem extends ProfileListItem
!$this->profile->isAdmin($this->group)) {
$this->out->elementStart('li', 'entity_make_admin');
$maf = new MakeAdminForm($this->out, $this->profile, $this->group,
array('action' => 'groupmembers',
'nickname' => $this->group->nickname));
$this->returnToArgs());
$maf->show();
$this->out->elementEnd('li');
}
......@@ -220,8 +219,7 @@ class GroupMemberListItem extends ProfileListItem
if (!empty($user) && $user->id != $this->profile->id && $user->isAdmin($this->group)) {
$this->out->elementStart('li', 'entity_block');
$bf = new GroupBlockForm($this->out, $this->profile, $this->group,
array('action' => 'groupmembers',
'nickname' => $this->group->nickname));
$this->returnToArgs());
$bf->show();
$this->out->elementEnd('li');
}
......@@ -240,9 +238,30 @@ class GroupMemberListItem extends ProfileListItem
function homepageAttributes()
{
$aAttrs = parent::linkAttributes();
if (common_config('nofollow', 'members')) {
$aAttrs['rel'] = 'nofollow';
}
return $aAttrs;
}
/**
* Fetch necessary return-to arguments for the profile forms
* to return to this list when they're done.
*
* @return array
*/
protected function returnToArgs()
{
$args = array('action' => 'groupmembers',
'nickname' => $this->group->nickname);
$page = $this->out->arg('page');
if ($page) {
$args['param-page'] = $page;
}
return $args;
}
}
......
......@@ -135,8 +135,10 @@ class groupRssAction extends Rss10Action
$c = array('url' => common_local_url('grouprss',
array('nickname' =>
$group->nickname)),
// TRANS: Message is used as link title. %s is a user nickname.
'title' => sprintf(_('%s timeline'), $group->nickname),
'link' => common_local_url('showgroup', array('nickname' => $group->nickname)),
// TRANS: Message is used as link description. %1$s is a username, %2$s is a site name.
'description' => sprintf(_('Updates from members of %1$s on %2$s!'),
$group->nickname, common_config('site', 'name')));
return $c;
......
This diff is collapsed.
......@@ -38,7 +38,7 @@ class InviteAction extends CurrentUserDesignAction
if (!common_config('invite', 'enabled')) {
$this->clientError(_('Invites have been disabled.'));
} else if (!common_logged_in()) {
$this->clientError(sprintf(_('You must be logged in to invite other users to use %s'),
$this->clientError(sprintf(_('You must be logged in to invite other users to use %s.'),
common_config('site', 'name')));
return;
} else if ($_SERVER['REQUEST_METHOD'] == 'POST') {
......@@ -224,8 +224,10 @@ class InviteAction extends CurrentUserDesignAction
$headers['From'] = mail_notify_from();
$headers['To'] = trim($email);
// TRANS: Subject for invitation email. Note that 'them' is correct as a gender-neutral singular 3rd-person pronoun in English.
$headers['Subject'] = sprintf(_('%1$s has invited you to join them on %2$s'), $bestname, $sitename);
// TRANS: Body text for invitation email. Note that 'them' is correct as a gender-neutral singular 3rd-person pronoun in English.
$body = sprintf(_("%1\$s has invited you to join them on %2\$s (%3\$s).\n\n".
"%2\$s is a micro-blogging service that lets you keep up-to-date with people you know and people who interest you.\n\n".
"You can also share news about yourself, your thoughts, or your life online with people who know about you. ".
......
......@@ -41,7 +41,7 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
* @link http://status.net/
*/
class MakeadminAction extends Action
class MakeadminAction extends RedirectingAction
{
var $profile = null;
var $group = null;
......@@ -148,20 +148,19 @@ class MakeadminAction extends Action
$this->group->getBestName());
}
foreach ($this->args as $k => $v) {
if ($k == 'returnto-action') {
$action = $v;
} else if (substr($k, 0, 9) == 'returnto-') {
$args[substr($k, 9)] = $v;
}
}
$this->returnToArgs();
}
if ($action) {
common_redirect(common_local_url($action, $args), 303);
} else {
common_redirect(common_local_url('groupmembers',
array('nickname' => $this->group->nickname)),
303);
}
/**
* If we reached this form without returnto arguments, default to
* the top of the group's member list.
*
* @return string URL
*/
function defaultReturnTo()
{
return common_local_url('groupmembers',
array('nickname' => $this->group->nickname));
}
}
......@@ -66,7 +66,7 @@ class MicrosummaryAction extends Action
$notice = $user->getCurrentNotice();
if (!$notice) {
$this->clientError(_('No current status'), 404);
$this->clientError(_('No current status.'), 404);
}
header('Content-Type: text/plain');
......
......@@ -183,7 +183,7 @@ class OauthconnectionssettingsAction extends ConnectSettingsAction
if (!$result) {
common_log_db_error($orig, 'DELETE', __FILE__);
$this->clientError(_('Unable to revoke access for app: ' . $app->id));
$this->clientError(sprintf(_('Unable to revoke access for app: %s.'), $app->id));
return false;
}
......@@ -195,7 +195,7 @@ class OauthconnectionssettingsAction extends ConnectSettingsAction
function showEmptyListMessage()
{
$message = sprintf(_('You have not authorized any applications to use your account.'));
$message = _('You have not authorized any applications to use your account.');
$this->elementStart('div', 'guide');
$this->raw(common_markup_to_html($message));
......
......@@ -60,7 +60,7 @@ class OembedAction extends Action
$proxy_args = $r->map($path);
if (!$proxy_args) {
$this->serverError(_("$path not found"), 404);
$this->serverError(_("$path not found."), 404);
}
$oembed=array();
$oembed['version']='1.0';
......@@ -72,11 +72,11 @@ class OembedAction extends Action