Merge remote branch 'gitorious/0.9.x' into 0.9.x

This commit is contained in:
Evan Prodromou 2010-09-13 09:29:32 -04:00
commit 9aadd3cb42
30 changed files with 126 additions and 27 deletions

View File

@ -83,6 +83,7 @@ class ApiAccountUpdateDeliveryDeviceAction extends ApiAuthAction
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
$this->clientError(
// TRANS: Client error message. POST is a HTTP command. It should not be translated.
_('This method requires a POST.'),
400, $this->format
);

View File

@ -86,6 +86,7 @@ class ApiAccountUpdateProfileAction extends ApiAuthAction
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
$this->clientError(
// TRANS: Client error. POST is a HTTP command. It should not be translated.
_('This method requires a POST.'),
400, $this->format
);

View File

@ -83,6 +83,7 @@ class ApiAccountUpdateProfileBackgroundImageAction extends ApiAuthAction
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
$this->clientError(
// TRANS: Client error. POST is a HTTP command. It should not be translated.
_('This method requires a POST.'),
400, $this->format
);

View File

@ -107,6 +107,7 @@ class ApiAccountUpdateProfileColorsAction extends ApiAuthAction
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
$this->clientError(
// TRANS: Client error. POST is a HTTP command. It should not be translated.
_('This method requires a POST.'),
400, $this->format
);

View File

@ -81,6 +81,7 @@ class ApiAccountUpdateProfileImageAction extends ApiAuthAction
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
$this->clientError(
// TRANS: Client error. POST is a HTTP command. It should not be translated.
_('This method requires a POST.'),
400, $this->format
);

View File

@ -86,6 +86,7 @@ class ApiBlockCreateAction extends ApiAuthAction
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
$this->clientError(
// TRANS: Client error. POST is a HTTP command. It should not be translated.
_('This method requires a POST.'),
400,
$this->format

View File

@ -85,6 +85,7 @@ class ApiBlockDestroyAction extends ApiAuthAction
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
$this->clientError(
// TRANS: Client error. POST is a HTTP command. It should not be translated.
_('This method requires a POST.'),
400,
$this->format

View File

@ -106,6 +106,7 @@ class ApiDirectMessageNewAction extends ApiAuthAction
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
$this->clientError(
// TRANS: Client error. POST is a HTTP command. It should not be translated.
_('This method requires a POST.'),
400,
$this->format

View File

@ -88,6 +88,7 @@ class ApiFavoriteCreateAction extends ApiAuthAction
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
$this->clientError(
// TRANS: Client error. POST is a HTTP command. It should not be translated.
_('This method requires a POST.'),
400,
$this->format

View File

@ -89,6 +89,7 @@ class ApiFavoriteDestroyAction extends ApiAuthAction
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
$this->clientError(
// TRANS: Client error. POST is a HTTP command. It should not be translated.
_('This method requires a POST.'),
400,
$this->format

View File

@ -88,6 +88,7 @@ class ApiFriendshipsCreateAction extends ApiAuthAction
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
$this->clientError(
// TRANS: Client error. POST is a HTTP command. It should not be translated.
_('This method requires a POST.'),
400,
$this->format

View File

@ -88,6 +88,7 @@ class ApiFriendshipsDestroyAction extends ApiAuthAction
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
$this->clientError(
// TRANS: Client error. POST is a HTTP command. It should not be translated.
_('This method requires a POST.'),
400,
$this->format

View File

@ -102,6 +102,7 @@ class ApiGroupCreateAction extends ApiAuthAction
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
$this->clientError(
// TRANS: Client error. POST is a HTTP command. It should not be translated.
_('This method requires a POST.'),
400,
$this->format

View File

@ -89,6 +89,7 @@ class ApiGroupJoinAction extends ApiAuthAction
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
$this->clientError(
// TRANS: Client error. POST is a HTTP command. It should not be translated.
_('This method requires a POST.'),
400,
$this->format

View File

@ -89,6 +89,7 @@ class ApiGroupLeaveAction extends ApiAuthAction
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
$this->clientError(
// TRANS: Client error. POST is a HTTP command. It should not be translated.
_('This method requires a POST.'),
400,
$this->format

View File

@ -64,6 +64,7 @@ class ApiMediaUploadAction extends ApiAuthAction
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
$this->clientError(
// TRANS: Client error. POST is a HTTP command. It should not be translated.
_('This method requires a POST.'),
400, $this->format
);

View File

@ -62,6 +62,7 @@ class ApiStatusesRetweetAction extends ApiAuthAction
parent::prepare($args);
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
// TRANS: Client error. POST is a HTTP command. It should not be translated.
$this->clientError(_('This method requires a POST.'),
400, $this->format);
return false;

View File

@ -195,6 +195,7 @@ class ApiStatusesUpdateAction extends ApiAuthAction
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
$this->clientError(
// TRANS: Client error. POST is a HTTP command. It should not be translated.
_('This method requires a POST.'),
400,
$this->format

View File

@ -131,7 +131,11 @@ class EmailsettingsAction extends AccountSettingsAction
// TRANS: Field label for e-mail address input in e-mail settings form.
$this->input('email', _('Email address'),
($this->arg('email')) ? $this->arg('email') : null,
// TRANS: Instructions for e-mail address input form.
// TRANS: Instructions for e-mail address input form. Do not translate
// TRANS: "example.org". It is one of the domain names reserved for
// TRANS: use in examples by http://www.rfc-editor.org/rfc/rfc2606.txt.
// TRANS: Any other domain may be owned by a legitimate person or
// TRANS: organization.
_('Email address, like "UserName@example.org"'));
$this->elementEnd('li');
$this->elementEnd('ul');

View File

@ -97,9 +97,13 @@ class GroupmembersAction extends GroupDesignAction
function title()
{
if ($this->page == 1) {
// TRANS: Title of the page showing group members.
// TRANS: %s is the name of the group.
return sprintf(_('%s group members'),
$this->group->nickname);
} else {
// TRANS: Title of the page showing group members.
// TRANS: %1$s is the name of the group, %2$d is the page number of the members list.
return sprintf(_('%1$s group members, page %2$d'),
$this->group->nickname,
$this->page);
@ -389,7 +393,14 @@ class GroupBlockForm extends Form
function formActions()
{
$this->out->submit('submit', _('Block'), 'submit', null, _('Block this user'));
$this->out->submit(
'submit',
// TRANS: Button text for the form that will block a user from a group.
_m('BUTTON','Block'),
'submit',
null,
// TRANS: Submit button title.
_m('TOOLTIP',_('Block this user'));
}
}
@ -516,6 +527,13 @@ class MakeAdminForm extends Form
function formActions()
{
$this->out->submit('submit', _('Make Admin'), 'submit', null, _('Make this user an admin'));
$this->out->submit(
'submit',
// TRANS: Button text for the form that will make a user administrator.
_m('BUTTON','Make Admin'),
'submit',
null,
// TRANS: Submit button title.
_m('TOOLTIP','Make this user an admin'));
}
}

View File

@ -137,6 +137,9 @@ class ImsettingsAction extends ConnectSettingsAction
($this->arg('jabber')) ? $this->arg('jabber') : null,
// TRANS: IM address input field instructions in IM settings form.
// TRANS: %s is the IM address set for the site.
// TRANS: Do not translate "example.org". It is one of the domain names reserved for use in examples by
// TRANS: http://www.rfc-editor.org/rfc/rfc2606.txt. Any other domain may be owned by a legitimate
// TRANS: person or organization.
sprintf(_('Jabber or GTalk address, '.
'like "UserName@example.org". '.
'First, make sure to add %s to your '.

View File

@ -66,6 +66,7 @@ class BlockForm extends ProfileActionForm
function title()
{
// TRANS: Title for the form to block a user.
return _('Block');
}
@ -77,6 +78,7 @@ class BlockForm extends ProfileActionForm
function description()
{
// TRANS: Description of the form to block a user.
return _('Block this user');
}
}

View File

@ -82,14 +82,20 @@ class GroupNav extends Widget
if (Event::handle('StartGroupGroupNav', array($this))) {
$this->out->menuItem(common_local_url('showgroup', array('nickname' =>
$nickname)),
_('Group'),
sprintf(_('%s group'), $nickname),
// TRANS: Menu item in the group navigation page.
_m('MENU','Group'),
// TRANS: Tooltip for menu item in the group navigation page.
// TRANS: %s is the nickname of the group.
sprintf(_m('TOOLTIP','%s group'), $nickname),
$action_name == 'showgroup',
'nav_group_group');
$this->out->menuItem(common_local_url('groupmembers', array('nickname' =>
$nickname)),
_('Members'),
sprintf(_('%s group members'), $nickname),
// TRANS: Menu item in the group navigation page.
_m('MENU','Members'),
// TRANS: Tooltip for menu item in the group navigation page.
// TRANS: %s is the nickname of the group.
sprintf(_m('TOOLTIP','%s group members'), $nickname),
$action_name == 'groupmembers',
'nav_group_members');
@ -98,26 +104,38 @@ class GroupNav extends Widget
if ($cur && $cur->isAdmin($this->group)) {
$this->out->menuItem(common_local_url('blockedfromgroup', array('nickname' =>
$nickname)),
_('Blocked'),
sprintf(_('%s blocked users'), $nickname),
// TRANS: Menu item in the group navigation page. Only shown for group administrators.
_m('MENU','Blocked'),
// TRANS: Tooltip for menu item in the group navigation page. Only shown for group administrators.
// TRANS: %s is the nickname of the group.
sprintf(_m('TOOLTIP','%s blocked users'), $nickname),
$action_name == 'blockedfromgroup',
'nav_group_blocked');
$this->out->menuItem(common_local_url('editgroup', array('nickname' =>
$nickname)),
_('Admin'),
sprintf(_('Edit %s group properties'), $nickname),
// TRANS: Menu item in the group navigation page. Only shown for group administrators.
_m('MENU','Admin'),
// TRANS: Tooltip for menu item in the group navigation page. Only shown for group administrators.
// TRANS: %s is the nickname of the group.
sprintf(_m('TOOLTIP','Edit %s group properties'), $nickname),
$action_name == 'editgroup',
'nav_group_admin');
$this->out->menuItem(common_local_url('grouplogo', array('nickname' =>
$nickname)),
_('Logo'),
sprintf(_('Add or edit %s logo'), $nickname),
// TRANS: Menu item in the group navigation page. Only shown for group administrators.
_m('MENU','Logo'),
// TRANS: Tooltip for menu item in the group navigation page. Only shown for group administrators.
// TRANS: %s is the nickname of the group.
sprintf(_m('TOOLTIP','Add or edit %s logo'), $nickname),
$action_name == 'grouplogo',
'nav_group_logo');
$this->out->menuItem(common_local_url('groupdesignsettings', array('nickname' =>
$nickname)),
_('Design'),
sprintf(_('Add or edit %s design'), $nickname),
// TRANS: Menu item in the group navigation page. Only shown for group administrators.
_m('MENU','Design'),
// TRANS: Tooltip for menu item in the group navigation page. Only shown for group administrators.
// TRANS: %s is the nickname of the group.
sprintf(_m('TOOLTIP','Add or edit %s design'), $nickname),
$action_name == 'groupdesignsettings',
'nav_group_design');
}

View File

@ -325,6 +325,7 @@ class HTMLOutputter extends XMLOutputter
* @param string $label text of the button
* @param string $cls class of the button, default 'submit'
* @param string $name name, if different than ID
* @param string $title title text for the submit button
*
* @return void
*

View File

@ -95,6 +95,7 @@ class MediaFile
if (!$file_id) {
common_log_db_error($file, "INSERT", __FILE__);
// TRANS: Client exception thrown when a database error was thrown during a file upload operation.
throw new ClientException(_('There was a database error while saving your file. Please try again.'));
}
@ -120,6 +121,7 @@ class MediaFile
if (!$result) {
common_log_db_error($file_redir, "INSERT", __FILE__);
// TRANS: Client exception thrown when a database error was thrown during a file upload operation.
throw new ClientException(_('There was a database error while saving your file. Please try again.'));
}
}
@ -139,16 +141,19 @@ class MediaFile
case UPLOAD_ERR_OK: // success, jump out
break;
case UPLOAD_ERR_INI_SIZE:
// TRANS: Client exception thrown when an uploaded file is larger than set in php.ini.
throw new ClientException(_('The uploaded file exceeds the ' .
'upload_max_filesize directive in php.ini.'));
return;
case UPLOAD_ERR_FORM_SIZE:
throw new ClientException(
// TRANS: Client exception.
_('The uploaded file exceeds the MAX_FILE_SIZE directive' .
' that was specified in the HTML form.'));
return;
case UPLOAD_ERR_PARTIAL:
@unlink($_FILES[$param]['tmp_name']);
// TRANS: Client exception.
throw new ClientException(_('The uploaded file was only' .
' partially uploaded.'));
return;
@ -156,17 +161,21 @@ class MediaFile
// No file; probably just a non-AJAX submission.
return;
case UPLOAD_ERR_NO_TMP_DIR:
// TRANS: Client exception thrown when a temporary folder is not present to store a file upload.
throw new ClientException(_('Missing a temporary folder.'));
return;
case UPLOAD_ERR_CANT_WRITE:
// TRANS: Client exception thrown when writing to disk is not possible during a file upload operation.
throw new ClientException(_('Failed to write file to disk.'));
return;
case UPLOAD_ERR_EXTENSION:
// TRANS: Client exception thrown when a file upload operation has been stopped by an extension.
throw new ClientException(_('File upload stopped by extension.'));
return;
default:
common_log(LOG_ERR, __METHOD__ . ": Unknown upload error " .
$_FILES[$param]['error']);
// TRANS: Client exception thrown when a file upload operation has failed with an unknown reason.
throw new ClientException(_('System error uploading file.'));
return;
}
@ -176,6 +185,7 @@ class MediaFile
// Should never actually get here
@unlink($_FILES[$param]['tmp_name']);
// TRANS: Client exception thrown when a file upload operation would cause a user to exceed a set quota.
throw new ClientException(_('File exceeds user\'s quota.'));
return;
}
@ -194,11 +204,15 @@ class MediaFile
$result = move_uploaded_file($_FILES[$param]['tmp_name'], $filepath);
if (!$result) {
// TRANS: Client exception thrown when a file upload operation fails because the file could
// TRANS: not be moved from the temporary folder to the permanent file location.
throw new ClientException(_('File could not be moved to destination directory.'));
return;
}
} else {
// TRANS: Client exception thrown when a file upload operation has been stopped because the MIME
// TRANS: type of the uploaded file could not be determined.
throw new ClientException(_('Could not determine file\'s MIME type.'));
return;
}
@ -214,6 +228,7 @@ class MediaFile
// Should never actually get here
// TRANS: Client exception thrown when a file upload operation would cause a user to exceed a set quota.
throw new ClientException(_('File exceeds user\'s quota.'));
return;
}
@ -231,10 +246,14 @@ class MediaFile
$result = copy($stream['uri'], $filepath) && chmod($filepath, 0664);
if (!$result) {
// TRANS: Client exception thrown when a file upload operation fails because the file could
// TRANS: not be moved from the temporary folder to the permanent file location.
throw new ClientException(_('File could not be moved to destination directory.' .
$stream['uri'] . ' ' . $filepath));
}
} else {
// TRANS: Client exception thrown when a file upload operation has been stopped because the MIME
// TRANS: type of the uploaded file could not be determined.
throw new ClientException(_('Could not determine file\'s MIME type.'));
return;
}
@ -315,12 +334,17 @@ class MediaFile
}
$media = MIME_Type::getMedia($filetype);
if ('application' !== $media) {
$hint = sprintf(_(' Try using another %s format.'), $media);
// TRANS: Client exception thrown trying to upload a forbidden MIME type.
// TRANS: %1$s is the file type that was denied, %2$s is the application part of
// TRANS: the MIME type that was denied.
$hint = sprintf(_('"%1$s" is not a supported file type on this server. ' .
'Try using another %2$s format.'), $filetype, $media);
} else {
$hint = '';
// TRANS: Client exception thrown trying to upload a forbidden MIME type.
// TRANS: %s is the file type that was denied.
$hint = sprintf(_('"%s" is not a supported file type on this server.'), $filetype);
}
throw new ClientException(sprintf(
_('%s is not a supported file type on this server.'), $filetype) . $hint);
throw new ClientException($hint);
}
static function respectsQuota($user, $filesize)

View File

@ -280,7 +280,7 @@ class StatusNetOAuthDataStore extends OAuthDataStore
$profile->created = DB_DataObject_Cast::dateTime(); # current time
$id = $profile->insert();
if (!$id) {
throw new Exception(_('Error inserting new profile'));
throw new Exception(_('Error inserting new profile.'));
}
$remote->id = $id;
}
@ -288,7 +288,7 @@ class StatusNetOAuthDataStore extends OAuthDataStore
$avatar_url = $omb_profile->getAvatarURL();
if ($avatar_url) {
if (!$this->add_avatar($profile, $avatar_url)) {
throw new Exception(_('Error inserting avatar'));
throw new Exception(_('Error inserting avatar.'));
}
} else {
$avatar = $profile->getOriginalAvatar();
@ -303,12 +303,12 @@ class StatusNetOAuthDataStore extends OAuthDataStore
if ($exists) {
if (!$remote->update($orig_remote)) {
throw new Exception(_('Error updating remote profile'));
throw new Exception(_('Error updating remote profile.'));
}
} else {
$remote->created = DB_DataObject_Cast::dateTime(); # current time
if (!$remote->insert()) {
throw new Exception(_('Error inserting remote profile'));
throw new Exception(_('Error inserting remote profile.'));
}
}
}
@ -342,7 +342,8 @@ class StatusNetOAuthDataStore extends OAuthDataStore
**/
public function saveNotice(&$omb_notice) {
if (Notice::staticGet('uri', $omb_notice->getIdentifierURI())) {
throw new Exception(_('Duplicate notice'));
// TRANS: Exception thrown when a notice is denied because it has been sent before.
throw new Exception(_('Duplicate notice.'));
}
$author_uri = $omb_notice->getAuthor()->getIdentifierURI();
common_log(LOG_DEBUG, $author_uri, __FILE__);

View File

@ -112,9 +112,9 @@ class Plugin
$name = mb_substr($cls, 0, -6);
$versions[] = array('name' => $name,
// TRANS: Displayed as version information for a plugin if no version information was found.
'version' => _('Unknown'));
return true;
}
}

View File

@ -117,14 +117,17 @@ class SearchAction extends Action
'class' => 'form_settings',
'action' => common_local_url($this->trimmed('action'))));
$this->elementStart('fieldset');
// TRANS: Fieldset legend for the search form.
$this->element('legend', null, _('Search site'));
$this->elementStart('ul', 'form_data');
$this->elementStart('li');
if (!common_config('site', 'fancy')) {
$this->hidden('action', $this->trimmed('action'));
}
// TRANS: Used as a field label for the field where one or more keywords
// TRANS: for searching can be entered.
$this->input('q', _('Keyword(s)'), $q);
$this->submit('search', _('Search'));
$this->submit('search', _m('BUTTON','Search'));
$this->elementEnd('li');
$this->elementEnd('ul');
$this->elementEnd('fieldset');
@ -135,6 +138,8 @@ class SearchAction extends Action
}
function searchSuggestions($q) {
// @todo FIXME: This formatting does not make this string get picked up by gettext.
// TRANS: Standard search suggestions shown when a search does not give any results.
$message = _(<<<E_O_T
* Make sure all words are spelled correctly.
* Try different keywords.
@ -145,6 +150,8 @@ E_O_T
);
if (!common_config('site', 'private')) {
$qe = urlencode($q);
// @todo FIXME: This formatting does not make this string get picked up by gettext.
// TRANS: Standard search suggestions shown when a search does not give any results.
$message .= sprintf(_(<<<E_O_T
You can also try your search on other engines:
@ -159,6 +166,7 @@ E_O_T
), $qe, $qe, $qe, $qe, $qe);
}
$this->elementStart('dl', array('id' => 'help_search', 'class' => 'help'));
// TRANS: Definition list item with instructions on how to get (better) search results.
$this->element('dt', null, _('Search help'));
$this->elementStart('dd', 'instructions');
$this->raw(common_markup_to_html($message));
@ -166,4 +174,3 @@ E_O_T
$this->elementEnd('div');
}
}

View File

@ -66,6 +66,7 @@ class UnblockForm extends ProfileActionForm
function title()
{
// TRANS: Title for the form to unblock a user.
return _('Unblock');
}
@ -77,6 +78,7 @@ class UnblockForm extends ProfileActionForm
function description()
{
// TRANS: Description of the form to unblock a user.
return _('Unblock this user');
}
}

View File

@ -38,6 +38,7 @@ class SalmonAction extends Action
parent::prepare($args);
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
// TRANS: POST is a HTTP command. It should not be translated.
$this->clientError(_m('This method requires a POST.'));
}