From a9fad9a7ac85270e2a45cfad28c6017b200496eb Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Sun, 12 Sep 2010 17:08:49 +0200 Subject: [PATCH 1/9] Add translator hint. --- actions/apiaccountupdatedeliverydevice.php | 1 + actions/apiaccountupdateprofile.php | 1 + actions/apiaccountupdateprofilebackgroundimage.php | 1 + actions/apiaccountupdateprofilecolors.php | 1 + actions/apiaccountupdateprofileimage.php | 1 + actions/apiblockcreate.php | 1 + actions/apiblockdestroy.php | 1 + actions/apidirectmessagenew.php | 1 + actions/apifavoritecreate.php | 1 + actions/apifavoritedestroy.php | 1 + actions/apifriendshipscreate.php | 1 + actions/apifriendshipsdestroy.php | 1 + actions/apigroupcreate.php | 1 + actions/apigroupjoin.php | 1 + actions/apigroupleave.php | 1 + actions/apimediaupload.php | 1 + actions/apistatusesretweet.php | 1 + actions/apistatusesupdate.php | 1 + plugins/OStatus/lib/salmonaction.php | 1 + 19 files changed, 19 insertions(+) diff --git a/actions/apiaccountupdatedeliverydevice.php b/actions/apiaccountupdatedeliverydevice.php index 295378aa67..2d903cb460 100644 --- a/actions/apiaccountupdatedeliverydevice.php +++ b/actions/apiaccountupdatedeliverydevice.php @@ -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 ); diff --git a/actions/apiaccountupdateprofile.php b/actions/apiaccountupdateprofile.php index 9b371ea957..92d0f6b771 100644 --- a/actions/apiaccountupdateprofile.php +++ b/actions/apiaccountupdateprofile.php @@ -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 ); diff --git a/actions/apiaccountupdateprofilebackgroundimage.php b/actions/apiaccountupdateprofilebackgroundimage.php index 3537b9f979..923fb1d114 100644 --- a/actions/apiaccountupdateprofilebackgroundimage.php +++ b/actions/apiaccountupdateprofilebackgroundimage.php @@ -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 ); diff --git a/actions/apiaccountupdateprofilecolors.php b/actions/apiaccountupdateprofilecolors.php index c666f9d759..9e07d80de3 100644 --- a/actions/apiaccountupdateprofilecolors.php +++ b/actions/apiaccountupdateprofilecolors.php @@ -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 ); diff --git a/actions/apiaccountupdateprofileimage.php b/actions/apiaccountupdateprofileimage.php index 153ef7818e..7f868a6eb3 100644 --- a/actions/apiaccountupdateprofileimage.php +++ b/actions/apiaccountupdateprofileimage.php @@ -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 ); diff --git a/actions/apiblockcreate.php b/actions/apiblockcreate.php index b355cd1c7e..53844cd2f2 100644 --- a/actions/apiblockcreate.php +++ b/actions/apiblockcreate.php @@ -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 diff --git a/actions/apiblockdestroy.php b/actions/apiblockdestroy.php index 7ea201677e..871ce66c73 100644 --- a/actions/apiblockdestroy.php +++ b/actions/apiblockdestroy.php @@ -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 diff --git a/actions/apidirectmessagenew.php b/actions/apidirectmessagenew.php index 65d065648f..44e205ebb0 100644 --- a/actions/apidirectmessagenew.php +++ b/actions/apidirectmessagenew.php @@ -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 diff --git a/actions/apifavoritecreate.php b/actions/apifavoritecreate.php index 0447a92ba2..15da010138 100644 --- a/actions/apifavoritecreate.php +++ b/actions/apifavoritecreate.php @@ -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 diff --git a/actions/apifavoritedestroy.php b/actions/apifavoritedestroy.php index 9f2efdd003..c2e1ebafc7 100644 --- a/actions/apifavoritedestroy.php +++ b/actions/apifavoritedestroy.php @@ -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 diff --git a/actions/apifriendshipscreate.php b/actions/apifriendshipscreate.php index a7ec5b28a4..64c857c70c 100644 --- a/actions/apifriendshipscreate.php +++ b/actions/apifriendshipscreate.php @@ -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 diff --git a/actions/apifriendshipsdestroy.php b/actions/apifriendshipsdestroy.php index 551d016823..21da23ef7c 100644 --- a/actions/apifriendshipsdestroy.php +++ b/actions/apifriendshipsdestroy.php @@ -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 diff --git a/actions/apigroupcreate.php b/actions/apigroupcreate.php index d216c15cd4..fa443573d6 100644 --- a/actions/apigroupcreate.php +++ b/actions/apigroupcreate.php @@ -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 diff --git a/actions/apigroupjoin.php b/actions/apigroupjoin.php index 5265ec629e..a0c069974b 100644 --- a/actions/apigroupjoin.php +++ b/actions/apigroupjoin.php @@ -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 diff --git a/actions/apigroupleave.php b/actions/apigroupleave.php index 8c100d58a8..c838f6c878 100644 --- a/actions/apigroupleave.php +++ b/actions/apigroupleave.php @@ -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 diff --git a/actions/apimediaupload.php b/actions/apimediaupload.php index 7aa88c186b..54d7fda68f 100644 --- a/actions/apimediaupload.php +++ b/actions/apimediaupload.php @@ -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 ); diff --git a/actions/apistatusesretweet.php b/actions/apistatusesretweet.php index 9aa3374854..aae98f6378 100644 --- a/actions/apistatusesretweet.php +++ b/actions/apistatusesretweet.php @@ -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; diff --git a/actions/apistatusesupdate.php b/actions/apistatusesupdate.php index fa3f611c0a..4715f70027 100644 --- a/actions/apistatusesupdate.php +++ b/actions/apistatusesupdate.php @@ -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 diff --git a/plugins/OStatus/lib/salmonaction.php b/plugins/OStatus/lib/salmonaction.php index 5fdb11abe4..f97c67edd0 100644 --- a/plugins/OStatus/lib/salmonaction.php +++ b/plugins/OStatus/lib/salmonaction.php @@ -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.')); } From 9bc4aaeca34a711e482c3f2c064bb18e65eda0be Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Sun, 12 Sep 2010 17:17:43 +0200 Subject: [PATCH 2/9] Update incomplete documentation. --- lib/htmloutputter.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/htmloutputter.php b/lib/htmloutputter.php index 5dc2b38dab..44b0296046 100644 --- a/lib/htmloutputter.php +++ b/lib/htmloutputter.php @@ -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 * From 6b010ac79c75978f6782c3058d4453e4230ec2b6 Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Sun, 12 Sep 2010 17:27:38 +0200 Subject: [PATCH 3/9] Update/add translator documentation. --- actions/emailsettings.php | 6 +++++- actions/groupmembers.php | 22 ++++++++++++++++++++-- lib/blockform.php | 2 ++ lib/unblockform.php | 2 ++ 4 files changed, 29 insertions(+), 3 deletions(-) diff --git a/actions/emailsettings.php b/actions/emailsettings.php index 6138a88f90..9c250fc8a9 100644 --- a/actions/emailsettings.php +++ b/actions/emailsettings.php @@ -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'); diff --git a/actions/groupmembers.php b/actions/groupmembers.php index 54f1d8dcda..038d1db68a 100644 --- a/actions/groupmembers.php +++ b/actions/groupmembers.php @@ -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')); } } diff --git a/lib/blockform.php b/lib/blockform.php index b6652b1f69..54552b3e57 100644 --- a/lib/blockform.php +++ b/lib/blockform.php @@ -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'); } } diff --git a/lib/unblockform.php b/lib/unblockform.php index 2a444f7cd0..b89d7ff78d 100644 --- a/lib/unblockform.php +++ b/lib/unblockform.php @@ -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'); } } From bb2a4e7aacfd4e3308ad71c21b19be47ba879735 Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Sun, 12 Sep 2010 17:43:43 +0200 Subject: [PATCH 4/9] Update translator documentation. --- actions/imsettings.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/actions/imsettings.php b/actions/imsettings.php index 6691c8dad7..29cbeb82e3 100644 --- a/actions/imsettings.php +++ b/actions/imsettings.php @@ -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 '. From 99f6a709378b9ae5e61ddec8212922bf5a7921c2 Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Sun, 12 Sep 2010 17:44:28 +0200 Subject: [PATCH 5/9] * add two FIXMEs for gettext messages not being processed. * update translator documentation. --- lib/searchaction.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/searchaction.php b/lib/searchaction.php index bb71a2ba15..14c3ed016d 100644 --- a/lib/searchaction.php +++ b/lib/searchaction.php @@ -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 = _(<<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'); } } - From 8adef3127c46dfb98b57f1b1b7cdf359e9ae5e2d Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Sun, 12 Sep 2010 17:49:56 +0200 Subject: [PATCH 6/9] Update translator documentation. --- lib/plugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/plugin.php b/lib/plugin.php index f63bdf3093..ee57f59043 100644 --- a/lib/plugin.php +++ b/lib/plugin.php @@ -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; } } - From e88ee4ec46da3519c888d0af758f3d6b349207c0 Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Sun, 12 Sep 2010 18:11:28 +0200 Subject: [PATCH 7/9] Fix i18n issue and add translator documentation. --- lib/mediafile.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/mediafile.php b/lib/mediafile.php index c96c78ab5d..5946363207 100644 --- a/lib/mediafile.php +++ b/lib/mediafile.php @@ -315,12 +315,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) From 128607a270d9aa8c6d2fac2bb07bbcb78b2abff4 Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Sun, 12 Sep 2010 18:24:44 +0200 Subject: [PATCH 8/9] Update translator documentation and add punctuation where missing to exception messages. --- lib/mediafile.php | 19 +++++++++++++++++++ lib/oauthstore.php | 11 ++++++----- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/lib/mediafile.php b/lib/mediafile.php index 5946363207..23338cc0e1 100644 --- a/lib/mediafile.php +++ b/lib/mediafile.php @@ -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; } diff --git a/lib/oauthstore.php b/lib/oauthstore.php index a6a6de7505..f3ee629fd7 100644 --- a/lib/oauthstore.php +++ b/lib/oauthstore.php @@ -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__); From 0d1b60b11df70ea97984d857bcab8dd0b694334e Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Sun, 12 Sep 2010 18:34:33 +0200 Subject: [PATCH 9/9] Update translator documentation. --- lib/groupnav.php | 42 ++++++++++++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/lib/groupnav.php b/lib/groupnav.php index 131b38fa27..ee988d0a98 100644 --- a/lib/groupnav.php +++ b/lib/groupnav.php @@ -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'); }