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 ...@@ -61,7 +61,7 @@ class AllAction extends ProfileAction
if ($this->page > 1 && $this->notice->N == 0) { if ($this->page > 1 && $this->notice->N == 0) {
// TRANS: Server error when page not found (404) // TRANS: Server error when page not found (404)
$this->serverError(_('No such page'), $code = 404); $this->serverError(_('No such page.'), $code = 404);
} }
return true; return true;
......
...@@ -112,10 +112,12 @@ class AllrssAction extends Rss10Action ...@@ -112,10 +112,12 @@ class AllrssAction extends Rss10Action
$c = array('url' => common_local_url('allrss', $c = array('url' => common_local_url('allrss',
array('nickname' => array('nickname' =>
$user->nickname)), $user->nickname)),
// TRANS: Message is used as link title. %s is a user nickname.
'title' => sprintf(_('%s and friends'), $user->nickname), 'title' => sprintf(_('%s and friends'), $user->nickname),
'link' => common_local_url('all', 'link' => common_local_url('all',
array('nickname' => array('nickname' =>
$user->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!'), 'description' => sprintf(_('Updates from %1$s and friends on %2$s!'),
$user->nickname, common_config('site', 'name'))); $user->nickname, common_config('site', 'name')));
return $c; return $c;
......
...@@ -103,7 +103,7 @@ class ApiAccountUpdateDeliveryDeviceAction extends ApiAuthAction ...@@ -103,7 +103,7 @@ class ApiAccountUpdateDeliveryDeviceAction extends ApiAuthAction
$this->clientError( $this->clientError(
_( _(
'You must specify a parameter named ' . '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; return;
......
...@@ -263,7 +263,7 @@ class ApiGroupCreateAction extends ApiAuthAction ...@@ -263,7 +263,7 @@ class ApiGroupCreateAction extends ApiAuthAction
if (!$valid) { if (!$valid) {
$this->clientError( $this->clientError(
sprintf(_('Invalid alias: "%s"'), $alias), sprintf(_('Invalid alias: "%s".'), $alias),
403, 403,
$this->format $this->format
); );
......
...@@ -92,7 +92,7 @@ class ApiGroupIsMemberAction extends ApiBareAuthAction ...@@ -92,7 +92,7 @@ class ApiGroupIsMemberAction extends ApiBareAuthAction
} }
if (empty($this->group)) { if (empty($this->group)) {
$this->clientError(_('Group not found!'), 404, $this->format); $this->clientError(_('Group not found.'), 404, $this->format);
return false; return false;
} }
......
...@@ -101,7 +101,7 @@ class ApiGroupJoinAction extends ApiAuthAction ...@@ -101,7 +101,7 @@ class ApiGroupJoinAction extends ApiAuthAction
} }
if (empty($this->group)) { if (empty($this->group)) {
$this->clientError(_('Group not found!'), 404, $this->format); $this->clientError(_('Group not found.'), 404, $this->format);
return false; return false;
} }
......
...@@ -101,7 +101,7 @@ class ApiGroupLeaveAction extends ApiAuthAction ...@@ -101,7 +101,7 @@ class ApiGroupLeaveAction extends ApiAuthAction
} }
if (empty($this->group)) { if (empty($this->group)) {
$this->clientError(_('Group not found!'), 404, $this->format); $this->clientError(_('Group not found.'), 404, $this->format);
return false; return false;
} }
......
...@@ -87,6 +87,7 @@ class ApiGroupListAllAction extends ApiPrivateAuthAction ...@@ -87,6 +87,7 @@ class ApiGroupListAllAction extends ApiPrivateAuthAction
parent::handle($args); parent::handle($args);
$sitename = common_config('site', 'name'); $sitename = common_config('site', 'name');
// TRANS: Message is used as a title. %s is a site name.
$title = sprintf(_("%s groups"), $sitename); $title = sprintf(_("%s groups"), $sitename);
$taguribase = TagURI::base(); $taguribase = TagURI::base();
$id = "tag:$taguribase:Groups"; $id = "tag:$taguribase:Groups";
......
...@@ -88,7 +88,7 @@ class ApiGroupMembershipAction extends ApiPrivateAuthAction ...@@ -88,7 +88,7 @@ class ApiGroupMembershipAction extends ApiPrivateAuthAction
parent::handle($args); parent::handle($args);
if (empty($this->group)) { if (empty($this->group)) {
$this->clientError(_('Group not found!'), 404, $this->format); $this->clientError(_('Group not found.'), 404, $this->format);
return false; return false;
} }
......
...@@ -79,7 +79,7 @@ class ApiGroupShowAction extends ApiPrivateAuthAction ...@@ -79,7 +79,7 @@ class ApiGroupShowAction extends ApiPrivateAuthAction
common_redirect(common_local_url('ApiGroupShow', $args), 301); common_redirect(common_local_url('ApiGroupShow', $args), 301);
} else { } else {
$this->clientError( $this->clientError(
_('Group not found!'), _('Group not found.'),
404, 404,
$this->format $this->format
); );
......
...@@ -199,7 +199,7 @@ class ApiStatusesUpdateAction extends ApiAuthAction ...@@ -199,7 +199,7 @@ class ApiStatusesUpdateAction extends ApiAuthAction
$reply_to = $this->in_reply_to_status_id; $reply_to = $this->in_reply_to_status_id;
} else { } else {
$this->clientError( $this->clientError(
_('Not found'), _('Not found.'),
$code = 404, $code = 404,
$this->format $this->format
); );
......
...@@ -116,6 +116,7 @@ class ApiTimelineFriendsAction extends ApiBareAuthAction ...@@ -116,6 +116,7 @@ class ApiTimelineFriendsAction extends ApiBareAuthAction
$id = "tag:$taguribase:FriendsTimeline:" . $this->user->id; $id = "tag:$taguribase:FriendsTimeline:" . $this->user->id;
$subtitle = sprintf( $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!'), _('Updates from %1$s and friends on %2$s!'),
$this->user->nickname, $this->user->nickname,
$sitename $sitename
......
...@@ -88,7 +88,7 @@ class ApiTimelineGroupAction extends ApiPrivateAuthAction ...@@ -88,7 +88,7 @@ class ApiTimelineGroupAction extends ApiPrivateAuthAction
parent::handle($args); parent::handle($args);
if (empty($this->group)) { if (empty($this->group)) {
$this->clientError(_('Group not found!'), 404, $this->format); $this->clientError(_('Group not found.'), 404, $this->format);
return false; return false;
} }
......
...@@ -117,6 +117,7 @@ class ApiTimelineHomeAction extends ApiBareAuthAction ...@@ -117,6 +117,7 @@ class ApiTimelineHomeAction extends ApiBareAuthAction
$id = "tag:$taguribase:HomeTimeline:" . $this->user->id; $id = "tag:$taguribase:HomeTimeline:" . $this->user->id;
$subtitle = sprintf( $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!'), _('Updates from %1$s and friends on %2$s!'),
$this->user->nickname, $sitename $this->user->nickname, $sitename
); );
......
...@@ -69,7 +69,7 @@ class ApiTimelineRetweetedByMeAction extends ApiAuthAction ...@@ -69,7 +69,7 @@ class ApiTimelineRetweetedByMeAction extends ApiAuthAction
{ {
parent::prepare($args); parent::prepare($args);
$this->serverError('Unimplemented', 503); $this->serverError('Unimplemented.', 503);
return false; return false;
} }
......
...@@ -103,7 +103,7 @@ class AvatarsettingsAction extends AccountSettingsAction ...@@ -103,7 +103,7 @@ class AvatarsettingsAction extends AccountSettingsAction
if (!$profile) { if (!$profile) {
common_log_db_error($user, 'SELECT', __FILE__); common_log_db_error($user, 'SELECT', __FILE__);
$this->serverError(_('User without matching profile')); $this->serverError(_('User without matching profile.'));
return; return;
} }
...@@ -182,7 +182,7 @@ class AvatarsettingsAction extends AccountSettingsAction ...@@ -182,7 +182,7 @@ class AvatarsettingsAction extends AccountSettingsAction
if (!$profile) { if (!$profile) {
common_log_db_error($user, 'SELECT', __FILE__); common_log_db_error($user, 'SELECT', __FILE__);
$this->serverError(_('User without matching profile')); $this->serverError(_('User without matching profile.'));
return; return;
} }
......
...@@ -66,7 +66,7 @@ class BlockAction extends ProfileFormAction ...@@ -66,7 +66,7 @@ class BlockAction extends ProfileFormAction
assert(!empty($cur)); // checked by parent assert(!empty($cur)); // checked by parent
if ($cur->hasBlocked($this->profile)) { if ($cur->hasBlocked($this->profile)) {
$this->clientError(_("You already blocked that user.")); $this->clientError(_('You already blocked that user.'));
return false; return false;
} }
...@@ -140,8 +140,20 @@ class BlockAction extends ProfileFormAction ...@@ -140,8 +140,20 @@ class BlockAction extends ProfileFormAction
$this->hidden($k, $v); $this->hidden($k, $v);
} }
} }
$this->submit('form_action-no', _('No'), 'submit form_action-primary', 'no', _("Do not block this user")); $this->submit('form_action-no',
$this->submit('form_action-yes', _('Yes'), 'submit form_action-secondary', 'yes', _('Block this user')); // 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('fieldset');
$this->elementEnd('form'); $this->elementEnd('form');
} }
......
...@@ -47,7 +47,8 @@ class BookmarkletAction extends NewnoticeAction ...@@ -47,7 +47,8 @@ class BookmarkletAction extends NewnoticeAction
{ {
function showTitle() 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() function showHeader()
......
...@@ -89,6 +89,7 @@ class ConfirmaddressAction extends Action ...@@ -89,6 +89,7 @@ class ConfirmaddressAction extends Action
$transports = array(); $transports = array();
Event::handle('GetImTransports', array(&$transports)); Event::handle('GetImTransports', array(&$transports));
if (!in_array($type, array('email', 'sms')) && !in_array($type, array_keys($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)); $this->serverError(sprintf(_('Unrecognized address type %s'), $type));
return; return;
} }
......
...@@ -150,13 +150,17 @@ class DeleteapplicationAction extends Action ...@@ -150,13 +150,17 @@ class DeleteapplicationAction extends Action
'This will clear all data about the application from the '. 'This will clear all data about the application from the '.
'database, including all existing user connections.')); 'database, including all existing user connections.'));
$this->submit('form_action-no', $this->submit('form_action-no',
_('No'), // TRANS: Button label on the delete application form.
_m('BUTTON','No'),
'submit form_action-primary', 'submit form_action-primary',
'no', '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', $this->submit('form_action-yes',
_('Yes'), // TRANS: Button label on the delete application form.
_m('BUTTON','Yes'),
'submit form_action-secondary', 'submit form_action-secondary',
// TRANS: Submit button title for 'Yes' when deleting an application.
'yes', _('Delete this application')); 'yes', _('Delete this application'));
$this->elementEnd('fieldset'); $this->elementEnd('fieldset');
$this->elementEnd('form'); $this->elementEnd('form');
......
...@@ -142,8 +142,20 @@ class DeletenoticeAction extends Action ...@@ -142,8 +142,20 @@ class DeletenoticeAction extends Action
$this->hidden('token', common_session_token()); $this->hidden('token', common_session_token());
$this->hidden('notice', $this->trimmed('notice')); $this->hidden('notice', $this->trimmed('notice'));
$this->element('p', null, _('Are you sure you want to delete this 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-no',
$this->submit('form_action-yes', _('Yes'), 'submit form_action-secondary', 'yes', _('Delete this notice')); // 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('fieldset');
$this->elementEnd('form'); $this->elementEnd('form');
} }
......
...@@ -64,14 +64,14 @@ class DeleteuserAction extends ProfileFormAction ...@@ -64,14 +64,14 @@ class DeleteuserAction extends ProfileFormAction
assert(!empty($cur)); // checked by parent assert(!empty($cur)); // checked by parent
if (!$cur->hasRight(Right::DELETEUSER)) { if (!$cur->hasRight(Right::DELETEUSER)) {
$this->clientError(_("You cannot delete users.")); $this->clientError(_('You cannot delete users.'));
return false; return false;
} }
$this->user = User::staticGet('id', $this->profile->id); $this->user = User::staticGet('id', $this->profile->id);
if (empty($this->user)) { if (empty($this->user)) {
$this->clientError(_("You can only delete local users.")); $this->clientError(_('You can only delete local users.'));
return false; return false;
} }
...@@ -147,8 +147,20 @@ class DeleteuserAction extends ProfileFormAction ...@@ -147,8 +147,20 @@ class DeleteuserAction extends ProfileFormAction
} }
Event::handle('EndDeleteUserForm', array($this, $this->user)); 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-no',
$this->submit('form_action-yes', _('Yes'), 'submit form_action-secondary', 'yes', _('Delete this user')); // 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('fieldset');
$this->elementEnd('form'); $this->elementEnd('form');
} }
......
...@@ -59,6 +59,7 @@ class DesignadminpanelAction extends AdminPanelAction ...@@ -59,6 +59,7 @@ class DesignadminpanelAction extends AdminPanelAction
function title() function title()
{ {
// TRANS: Message used as title for design settings for the site.
return _('Design'); return _('Design');
} }
...@@ -272,11 +273,11 @@ class DesignadminpanelAction extends AdminPanelAction ...@@ -272,11 +273,11 @@ class DesignadminpanelAction extends AdminPanelAction
{ {
if (!empty($values['logo']) && if (!empty($values['logo']) &&
!Validate::uri($values['logo'], array('allowed_schemes' => array('http', 'https')))) { !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())) { 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 ...@@ -454,6 +455,7 @@ class DesignAdminPanelForm extends AdminForm
$this->out->element('label', array('for' => 'design_background-image_on', $this->out->element('label', array('for' => 'design_background-image_on',
'class' => 'radio'), 'class' => 'radio'),
// TRANS: Used as radio button label to add a background image.
_('On')); _('On'));
$attrs = array('name' => 'design_background-image_onoff', $attrs = array('name' => 'design_background-image_onoff',
...@@ -470,6 +472,7 @@ class DesignAdminPanelForm extends AdminForm ...@@ -470,6 +472,7 @@ class DesignAdminPanelForm extends AdminForm
$this->out->element('label', array('for' => 'design_background-image_off', $this->out->element('label', array('for' => 'design_background-image_off',
'class' => 'radio'), 'class' => 'radio'),
// TRANS: Used as radio button label to not add a background image.
_('Off')); _('Off'));
$this->out->element('p', 'form_guide', _('Turn background image on or off.')); $this->out->element('p', 'form_guide', _('Turn background image on or off.'));
$this->unli(); $this->unli();
......
...@@ -71,7 +71,7 @@ class DisfavorAction extends Action ...@@ -71,7 +71,7 @@ class DisfavorAction extends Action
$notice = Notice::staticGet($id); $notice = Notice::staticGet($id);
$token = $this->trimmed('token-'.$notice->id); $token = $this->trimmed('token-'.$notice->id);
if (!$token || $token != common_session_token()) { 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; return;
} }
$fave = new Fave(); $fave = new Fave();
......
This diff is collapsed.
...@@ -72,7 +72,7 @@ class FavorAction extends Action ...@@ -72,7 +72,7 @@ class FavorAction extends Action
$notice = Notice::staticGet($id); $notice = Notice::staticGet($id);
$token = $this->trimmed('token-'.$notice->id); $token = $this->trimmed('token-'.$notice->id);
if (!$token || $token != common_session_token()) { 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; return;
} }
if ($user->hasFave($notice)) { if ($user->hasFave($notice)) {
......
...@@ -135,7 +135,7 @@ class FinishremotesubscribeAction extends Action ...@@ -135,7 +135,7 @@ class FinishremotesubscribeAction extends Action
$service->getServiceURI(OMB_ENDPOINT_UPDATEPROFILE); $service->getServiceURI(OMB_ENDPOINT_UPDATEPROFILE);
if (!$remote->update($orig_remote)) { if (!$remote->update($orig_remote)) {
$this->serverError(_('Error updating remote profile')); $this->serverError(_('Error updating remote profile.'));
return; return;
} }
......
...@@ -56,7 +56,7 @@ class FoafGroupAction extends Action ...@@ -56,7 +56,7 @@ class FoafGroupAction extends Action
return false; return false;
} }
$local = Local_group::staticGet('nickname', $nickname); $local = Local_group::staticGet('nickname', $this->nickname);
if (!$local) { if (!$local) {
$this->clientError(_('No such group.'), 404); $this->clientError(_('No such group.'), 404);
...@@ -126,7 +126,8 @@ class FoafGroupAction extends Action ...@@ -126,7 +126,8 @@ class FoafGroupAction extends Action
while ($members->fetch()) { while ($members->fetch()) {
$member_uri = common_local_url('userbyid', array('id'=>$members->id)); $member_uri = common_local_url('userbyid', array('id'=>$members->id));
$member_details[$member_uri] = array( $member_details[$member_uri] = array(
'nickname' => $members->nickname 'nickname' => $members->nickname,
'is_admin' => false,
); );
$this->element('member', array('rdf:resource' => $member_uri)); $this->element('member', array('rdf:resource' => $member_uri));
} }
......
...@@ -59,11 +59,11 @@ class GrantRoleAction extends ProfileFormAction ...@@ -59,11 +59,11 @@ class GrantRoleAction extends ProfileFormAction
$this->role = $this->arg('role'); $this->role = $this->arg('role');
if (!Profile_role::isValid($this->role)) { if (!Profile_role::isValid($this->role)) {
$this->clientError(_("Invalid role.")); $this->clientError(_('Invalid role.'));
return false; return false;
} }
if (!Profile_role::isSettable($this->role)) { 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; return false;
} }
...@@ -72,14 +72,14 @@ class GrantRoleAction extends ProfileFormAction ...@@ -72,14 +72,14 @@ class GrantRoleAction extends ProfileFormAction
assert(!empty($cur)); // checked by parent assert(!empty($cur)); // checked by parent
if (!$cur->hasRight(Right::GRANTROLE)) { 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; return false;
} }
assert(!empty($this->profile)); // checked by parent assert(!empty($this->profile)); // checked by parent
if ($this->profile->hasRole($this->role)) { if ($this->profile->hasRole($this->role)) {
$this->clientError(_("User already has this role.")); $this->clientError(_('User already has this role.'));
return false; return false;
} }
......
...@@ -41,7 +41,7 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { ...@@ -41,7 +41,7 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
* @link http://status.net/ * @link http://status.net/
*/ */
class GroupblockAction extends Action class GroupblockAction extends RedirectingAction