From f2d7c33ad3dbaaf5de09f80b04645d8e2a5c4b93 Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Tue, 29 Mar 2011 19:25:44 +0200 Subject: [PATCH 1/4] Update translator documentation. Remove superfluous whitespace. Various L10n/i18n updates. --- actions/snapshotadminpanel.php | 42 ++++++++++++++++++++-------------- actions/tag.php | 12 +++++++--- actions/tagother.php | 16 ++++++++++++- actions/tagrss.php | 4 +++- actions/unsandbox.php | 5 ++-- actions/unsilence.php | 5 ++-- 6 files changed, 56 insertions(+), 28 deletions(-) diff --git a/actions/snapshotadminpanel.php b/actions/snapshotadminpanel.php index be0a793e51..9790947071 100644 --- a/actions/snapshotadminpanel.php +++ b/actions/snapshotadminpanel.php @@ -40,7 +40,6 @@ if (!defined('STATUSNET')) { * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://status.net/ */ - class SnapshotadminpanelAction extends AdminPanelAction { /** @@ -48,10 +47,10 @@ class SnapshotadminpanelAction extends AdminPanelAction * * @return string page title */ - function title() { - return _('Snapshots'); + // TRANS: Title for admin panel to configure snapshots. + return _m('TITLE','Snapshots'); } /** @@ -59,9 +58,9 @@ class SnapshotadminpanelAction extends AdminPanelAction * * @return string instructions */ - function getInstructions() { + // TRANS: Instructions for admin panel to configure snapshots. return _('Manage snapshot configuration'); } @@ -70,7 +69,6 @@ class SnapshotadminpanelAction extends AdminPanelAction * * @return void */ - function showForm() { $form = new SnapshotAdminPanelForm($this); @@ -83,7 +81,6 @@ class SnapshotadminpanelAction extends AdminPanelAction * * @return void */ - function saveSettings() { static $settings = array( @@ -124,12 +121,14 @@ class SnapshotadminpanelAction extends AdminPanelAction // Validate snapshot run value if (!in_array($values['snapshot']['run'], array('web', 'cron', 'never'))) { + // TRANS: Client error displayed on admin panel for snapshots when providing an invalid run value. $this->clientError(_('Invalid snapshot run value.')); } // Validate snapshot frequency value if (!Validate::number($values['snapshot']['frequency'])) { + // TRANS: Client error displayed on admin panel for snapshots when providing an invalid value for frequency. $this->clientError(_('Snapshot frequency must be a number.')); } @@ -141,11 +140,13 @@ class SnapshotadminpanelAction extends AdminPanelAction array('allowed_schemes' => array('http', 'https') ) )) { + // TRANS: Client error displayed on admin panel for snapshots when providing an invalid report URL. $this->clientError(_('Invalid snapshot report URL.')); } } } +// @todo FIXME: add documentation class SnapshotAdminPanelForm extends AdminForm { /** @@ -153,7 +154,6 @@ class SnapshotAdminPanelForm extends AdminForm * * @return int ID of the form */ - function id() { return 'form_snapshot_admin_panel'; @@ -164,7 +164,6 @@ class SnapshotAdminPanelForm extends AdminForm * * @return string class of the form */ - function formClass() { return 'form_settings'; @@ -175,7 +174,6 @@ class SnapshotAdminPanelForm extends AdminForm * * @return string URL of the action */ - function action() { return common_local_url('snapshotadminpanel'); @@ -186,26 +184,31 @@ class SnapshotAdminPanelForm extends AdminForm * * @return void */ - function formData() { $this->out->elementStart( 'fieldset', array('id' => 'settings_admin_snapshots') ); - $this->out->element('legend', null, _('Snapshots')); + // TRANS: Fieldset legend on admin panel for snapshots. + $this->out->element('legend', null, _m('LEGEND','Snapshots')); $this->out->elementStart('ul', 'form_data'); $this->li(); $snapshot = array( + // TRANS: Option in dropdown for snapshot method in admin panel for snapshots. 'web' => _('Randomly during web hit'), + // TRANS: Option in dropdown for snapshot method in admin panel for snapshots. 'cron' => _('In a scheduled job'), + // TRANS: Option in dropdown for snapshot method in admin panel for snapshots. 'never' => _('Never') ); $this->out->dropdown( 'run', + // TRANS: Dropdown label for snapshot method in admin panel for snapshots. _('Data snapshots'), $snapshot, - _('When to send statistical data to status.net servers'), + // TRANS: Dropdown title for snapshot method in admin panel for snapshots. + _('When to send statistical data to status.net servers.'), false, $this->value('run', 'snapshot') ); @@ -214,8 +217,10 @@ class SnapshotAdminPanelForm extends AdminForm $this->li(); $this->input( 'frequency', + // TRANS: Input field label for snapshot frequency in admin panel for snapshots. _('Frequency'), - _('Snapshots will be sent once every N web hits'), + // TRANS: Input field title for snapshot frequency in admin panel for snapshots. + _('Snapshots will be sent once every N web hits.'), 'snapshot' ); $this->unli(); @@ -223,8 +228,10 @@ class SnapshotAdminPanelForm extends AdminForm $this->li(); $this->input( 'reporturl', + // TRANS: Input field label for snapshot report URL in admin panel for snapshots. _('Report URL'), - _('Snapshots will be sent to this URL'), + // TRANS: Input field title for snapshot report URL in admin panel for snapshots. + _('Snapshots will be sent to this URL.'), 'snapshot' ); $this->unli(); @@ -237,15 +244,16 @@ class SnapshotAdminPanelForm extends AdminForm * * @return void */ - function formActions() { $this->out->submit( 'submit', - _('Save'), + // TRANS: Button text to save snapshot settings. + _m('BUTTON','Save'), 'submit', null, - _('Save snapshot settings') + // TRANS: Title for button to save snapshot settings. + _('Save snapshot settings.') ); } } diff --git a/actions/tag.php b/actions/tag.php index 944cda1f4a..045fac97b5 100644 --- a/actions/tag.php +++ b/actions/tag.php @@ -19,9 +19,9 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } +// @todo FIXME: documentation missing. class TagAction extends Action { - var $notice; function prepare($args) @@ -48,7 +48,7 @@ class TagAction extends Action $this->notice = Notice_tag::getStream($this->tag, (($this->page-1)*NOTICES_PER_PAGE), NOTICES_PER_PAGE + 1); 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); } @@ -88,18 +88,24 @@ class TagAction extends Action return array(new Feed(Feed::RSS1, common_local_url('tagrss', array('tag' => $this->tag)), + // TRANS: Link label for feed on "notices with tag" page. + // TRANS: %s is the tag the feed is for. sprintf(_('Notice feed for tag %s (RSS 1.0)'), $this->tag)), new Feed(Feed::RSS2, common_local_url('ApiTimelineTag', array('format' => 'rss', 'tag' => $this->tag)), + // TRANS: Link label for feed on "notices with tag" page. + // TRANS: %s is the tag the feed is for. sprintf(_('Notice feed for tag %s (RSS 2.0)'), $this->tag)), new Feed(Feed::ATOM, common_local_url('ApiTimelineTag', array('format' => 'atom', 'tag' => $this->tag)), + // TRANS: Link label for feed on "notices with tag" page. + // TRANS: %s is the tag the feed is for. sprintf(_('Notice feed for tag %s (Atom)'), $this->tag))); } @@ -107,7 +113,7 @@ class TagAction extends Action function showContent() { if(Event::handle('StartTagShowContent', array($this))) { - + $nl = new NoticeList($this->notice, $this); $cnt = $nl->show(); diff --git a/actions/tagother.php b/actions/tagother.php index c3bf219f67..518c707201 100644 --- a/actions/tagother.php +++ b/actions/tagother.php @@ -31,12 +31,14 @@ class TagotherAction extends Action { parent::prepare($args); if (!common_logged_in()) { + // TRANS: Client error displayed on user tag page when trying to add tags while not logged in. $this->clientError(_('Not logged in.'), 403); return false; } $id = $this->trimmed('id'); if (!$id) { + // TRANS: Client error displayed on user tag page when trying to add tags without providing a user ID. $this->clientError(_('No ID argument.')); return false; } @@ -44,6 +46,7 @@ class TagotherAction extends Action $this->profile = Profile::staticGet('id', $id); if (!$this->profile) { + // TRANS: Client error displayed on user tag page when trying to add tags providing a non-existing user ID. $this->clientError(_('No profile with that ID.')); return false; } @@ -63,6 +66,8 @@ class TagotherAction extends Action function title() { + // TRANS: Title for "tag other users" page. + // TRANS: %s is the user nickname. return sprintf(_('Tag %s'), $this->profile->nickname); } @@ -75,6 +80,7 @@ class TagotherAction extends Action function showContent() { $this->elementStart('div', 'entity_profile vcard author'); + // TRANS: Header for user details on "tag other users" page. $this->element('h2', null, _('User profile')); $avatar = $this->profile->getAvatar(AVATAR_PROFILE_SIZE); @@ -118,6 +124,7 @@ class TagotherAction extends Action 'action' => common_local_url('tagother', array('id' => $this->profile->id)))); $this->elementStart('fieldset'); + // TRANS: Fieldset legend on "tag other users" page. $this->element('legend', null, _('Tag user')); $this->hidden('token', common_session_token()); $this->hidden('id', $this->profile->id); @@ -126,11 +133,14 @@ class TagotherAction extends Action $this->elementStart('ul', 'form_data'); $this->elementStart('li'); + // TRANS: Field label for inputting tags on "tag other users" page. $this->input('tags', _('Tags'), ($this->arg('tags')) ? $this->arg('tags') : implode(' ', Profile_tag::getTags($user->id, $this->profile->id)), + // TRANS: Title for input field for inputting tags on "tag other users" page. _('Tags for this user (letters, numbers, -, ., and _), separated by commas or spaces.')); $this->elementEnd('li'); $this->elementEnd('ul'); + // TRANS: Button text for saving tags for other users. $this->submit('save', _m('BUTTON','Save')); $this->elementEnd('fieldset'); $this->elementEnd('form'); @@ -172,6 +182,7 @@ class TagotherAction extends Action !Subscription::pkeyGet(array('subscriber' => $this->profile->id, 'subscribed' => $user->id))) { + // TRANS: Client error on "tag other users" page when tagging a user is not possible because of missing mutual subscriptions. $this->clientError(_('You can only tag people you are subscribed to or who are subscribed to you.')); return; } @@ -179,6 +190,7 @@ class TagotherAction extends Action $result = Profile_tag::setTags($user->id, $this->profile->id, $tags); if (!$result) { + // TRANS: Client error on "tag other users" page when saving tags fails server side. $this->clientError(_('Could not save tags.')); return; } @@ -188,7 +200,8 @@ class TagotherAction extends Action if ($this->boolean('ajax')) { $this->startHTML('text/xml;charset=utf-8'); $this->elementStart('head'); - $this->element('title', null, _('Tags')); + // TRANS: Title of "tag other users" page. + $this->element('title', null, _m('TITLE','Tags')); $this->elementEnd('head'); $this->elementStart('body'); $this->elementStart('p', 'subtags'); @@ -215,6 +228,7 @@ class TagotherAction extends Action } else { $this->elementStart('div', 'instructions'); $this->element('p', null, + // TRANS: Page notice on "tag other users" page. _('Use this form to add tags to your subscribers or subscriptions.')); $this->elementEnd('div'); } diff --git a/actions/tagrss.php b/actions/tagrss.php index 467a64abed..5f4831d221 100644 --- a/actions/tagrss.php +++ b/actions/tagrss.php @@ -22,7 +22,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/rssaction.php'); // Formatting of RSS handled by Rss10Action - class TagrssAction extends Rss10Action { var $tag; @@ -32,6 +31,7 @@ class TagrssAction extends Rss10Action $tag = common_canonical_tag($this->trimmed('tag')); $this->tag = Notice_tag::staticGet('tag', $tag); if (!$this->tag) { + // TRANS: Client error when requesting a tag feed for a non-existing tag. $this->clientError(_('No such tag.')); return false; } else { @@ -62,6 +62,8 @@ class TagrssAction extends Rss10Action $c = array('url' => common_local_url('tagrss', array('tag' => $tagname)), 'title' => $tagname, 'link' => common_local_url('tagrss', array('tag' => $tagname)), + // TRANS: Tag feed description. + // TRANS: %1$s is the tag name, %2$s is the StatusNet sitename. 'description' => sprintf(_('Updates tagged with %1$s on %2$s!'), $tagname, common_config('site', 'name'))); return $c; diff --git a/actions/unsandbox.php b/actions/unsandbox.php index d50b5072ee..98bd2d4f54 100644 --- a/actions/unsandbox.php +++ b/actions/unsandbox.php @@ -40,7 +40,6 @@ if (!defined('STATUSNET')) { * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3 * @link http://status.net/ */ - class UnsandboxAction extends ProfileFormAction { /** @@ -50,7 +49,6 @@ class UnsandboxAction extends ProfileFormAction * * @return boolean success flag */ - function prepare($args) { if (!parent::prepare($args)) { @@ -62,6 +60,7 @@ class UnsandboxAction extends ProfileFormAction assert(!empty($cur)); // checked by parent if (!$cur->hasRight(Right::SANDBOXUSER)) { + // TRANS: Client error on page to unsandbox a user when the feature is not enabled. $this->clientError(_('You cannot sandbox users on this site.')); return false; } @@ -69,6 +68,7 @@ class UnsandboxAction extends ProfileFormAction assert(!empty($this->profile)); // checked by parent if (!$this->profile->isSandboxed()) { + // TRANS: Client error on page to unsilence a user when the to be unsandboxed user has not been sandboxed. $this->clientError(_('User is not sandboxed.')); return false; } @@ -81,7 +81,6 @@ class UnsandboxAction extends ProfileFormAction * * @return void */ - function handlePost() { $this->profile->unsandbox(); diff --git a/actions/unsilence.php b/actions/unsilence.php index 7d282c3661..723bf1bed5 100644 --- a/actions/unsilence.php +++ b/actions/unsilence.php @@ -40,7 +40,6 @@ if (!defined('STATUSNET')) { * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3 * @link http://status.net/ */ - class UnsilenceAction extends ProfileFormAction { /** @@ -50,7 +49,6 @@ class UnsilenceAction extends ProfileFormAction * * @return boolean success flag */ - function prepare($args) { if (!parent::prepare($args)) { @@ -62,6 +60,7 @@ class UnsilenceAction extends ProfileFormAction assert(!empty($cur)); // checked by parent if (!$cur->hasRight(Right::SILENCEUSER)) { + // TRANS: Client error on page to unsilence a user when the feature is not enabled. $this->clientError(_('You cannot silence users on this site.')); return false; } @@ -69,6 +68,7 @@ class UnsilenceAction extends ProfileFormAction assert(!empty($this->profile)); // checked by parent if (!$this->profile->isSilenced()) { + // TRANS: Client error on page to unsilence a user when the to be unsilenced user has not been silenced. $this->clientError(_('User is not silenced.')); return false; } @@ -81,7 +81,6 @@ class UnsilenceAction extends ProfileFormAction * * @return void */ - function handlePost() { $this->profile->unsilence(); From a8af04feea64c0a70c8f82a88dc3d7e8eaafba7f Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Tue, 29 Mar 2011 21:30:12 +0200 Subject: [PATCH 2/4] Update translator documentation. Superfluous whitespace removed. L10n consistency updates. --- actions/unsubscribe.php | 5 ++++- actions/updateprofile.php | 7 ++++--- actions/urlsettings.php | 22 ++++++++++++---------- actions/userauthorization.php | 10 +++++----- 4 files changed, 25 insertions(+), 19 deletions(-) diff --git a/actions/unsubscribe.php b/actions/unsubscribe.php index 57ca15d687..8f90619f64 100644 --- a/actions/unsubscribe.php +++ b/actions/unsubscribe.php @@ -44,11 +44,11 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { */ class UnsubscribeAction extends Action { - function handle($args) { parent::handle($args); if (!common_logged_in()) { + // TRANS: Client error displayed when trying to unsubscribe while not logged in. $this->clientError(_('Not logged in.')); return; } @@ -74,6 +74,7 @@ class UnsubscribeAction extends Action $other_id = $this->arg('unsubscribeto'); if (!$other_id) { + // TRANS: Client error displayed when trying to unsubscribe without providing a profile ID. $this->clientError(_('No profile ID in request.')); return; } @@ -81,6 +82,7 @@ class UnsubscribeAction extends Action $other = Profile::staticGet('id', $other_id); if (!$other) { + // TRANS: Client error displayed when trying to unsubscribe while providing a non-existing profile ID. $this->clientError(_('No profile with that ID.')); return; } @@ -95,6 +97,7 @@ class UnsubscribeAction extends Action if ($this->boolean('ajax')) { $this->startHTML('text/xml;charset=utf-8'); $this->elementStart('head'); + // TRANS: Page title for page to unsubscribe. $this->element('title', null, _('Unsubscribed')); $this->elementEnd('head'); $this->elementStart('body'); diff --git a/actions/updateprofile.php b/actions/updateprofile.php index bae6108cce..e5c0803495 100644 --- a/actions/updateprofile.php +++ b/actions/updateprofile.php @@ -45,7 +45,6 @@ require_once INSTALLDIR.'/extlib/libomb/service_provider.php'; */ class UpdateprofileAction extends Action { - /** * For initializing members of the class. * @@ -61,8 +60,10 @@ class UpdateprofileAction extends Action $license = $_POST['omb_listenee_license']; $site_license = common_config('license', 'url'); if (!common_compatible_license($license, $site_license)) { - $this->clientError(sprintf(_('Listenee stream license ‘%1$s’ is not '. - 'compatible with site license ‘%2$s’.'), + // TRANS: Client error displayed when trying to update profile with an incompatible license. + // TRANS: %1$s is the license incompatible with site license %2$s. + $this->clientError(sprintf(_('Listenee stream license "%1$s" is not '. + 'compatible with site license "%2$s".'), $license, $site_license)); return false; } diff --git a/actions/urlsettings.php b/actions/urlsettings.php index 7661086aae..aaaa1b78dd 100644 --- a/actions/urlsettings.php +++ b/actions/urlsettings.php @@ -32,8 +32,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } - - /** * Miscellaneous settings actions * @@ -46,7 +44,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://status.net/ */ - class UrlsettingsAction extends SettingsAction { /** @@ -54,9 +51,9 @@ class UrlsettingsAction extends SettingsAction * * @return string Title of the page */ - function title() { + // TRANS: Title of URL settings tab in profile settings. return _('URL settings'); } @@ -65,7 +62,6 @@ class UrlsettingsAction extends SettingsAction * * @return instructions for use */ - function getInstructions() { // TRANS: Instructions for tab "Other" in user profile settings. @@ -85,7 +81,6 @@ class UrlsettingsAction extends SettingsAction * * @return void */ - function showContent() { $user = common_current_user(); @@ -118,11 +113,12 @@ class UrlsettingsAction extends SettingsAction // Include default values + // TRANS: Default value for URL shortening settings. $services['none'] = _('[none]'); + // TRANS: Default value for URL shortening settings. $services['internal'] = _('[internal]'); if ($services) { - asort($services); $this->elementStart('li'); @@ -135,16 +131,20 @@ class UrlsettingsAction extends SettingsAction } $this->elementStart('li'); $this->input('maxurllength', + // TRANS: Field label in URL settings in profile. _('URL longer than'), (!is_null($this->arg('maxurllength'))) ? $this->arg('maxurllength') : User_urlshortener_prefs::maxUrlLength($user), + // TRANS: Field title in URL settings in profile. _('URLs longer than this will be shortened, 0 means always shorten.')); $this->elementEnd('li'); $this->elementStart('li'); $this->input('maxnoticelength', + // TRANS: Field label in URL settings in profile. _('Text longer than'), (!is_null($this->arg('maxnoticelength'))) ? $this->arg('maxnoticelength') : User_urlshortener_prefs::maxNoticeLength($user), + // TRANS: Field title in URL settings in profile. _('URLs in notices longer than this will be shortened, 0 means always shorten.')); $this->elementEnd('li'); $this->elementEnd('ul'); @@ -162,7 +162,6 @@ class UrlsettingsAction extends SettingsAction * * @return void */ - function handlePost() { // CSRF protection @@ -184,13 +183,15 @@ class UrlsettingsAction extends SettingsAction $maxurllength = $this->trimmed('maxurllength'); if (!Validate::number($maxurllength, array('min' => 0))) { - throw new ClientException(_('Invalid number for max url length.')); + // TRANS: Client exception thrown when the maximum URL settings value is invalid in profile URL settings. + throw new ClientException(_('Invalid number for maximum URL length.')); } $maxnoticelength = $this->trimmed('maxnoticelength'); if (!Validate::number($maxnoticelength, array('min' => 0))) { - throw new ClientException(_('Invalid number for max notice length.')); + // TRANS: Client exception thrown when the maximum notice length settings value is invalid in profile URL settings. + throw new ClientException(_('Invalid number for maximum notice length.')); } $user = common_current_user(); @@ -235,6 +236,7 @@ class UrlsettingsAction extends SettingsAction } if (!$result) { + // TRANS: Server exception thrown in profile URL settings when preferences could not be saved. throw new ServerException(_('Error saving user URL shortening preferences.')); } diff --git a/actions/userauthorization.php b/actions/userauthorization.php index d9cdc660fd..e58a096bac 100644 --- a/actions/userauthorization.php +++ b/actions/userauthorization.php @@ -111,7 +111,7 @@ class UserauthorizationAction extends Action function showPageNotice() { - // TRANS: Page notice on "Auhtorize subscription" page. + // TRANS: Page notice on "Authorize subscription" page. $this->element('p', null, _('Please check these details to make sure '. 'that you want to subscribe to this ' . 'user’s notices. If you didn’t just ask ' . @@ -243,10 +243,10 @@ class UserauthorizationAction extends Action { // TRANS: Accept message header from Authorise subscription page. common_show_header(_('Subscription authorized')); - // TRANS: Accept message text from Authorise subscription page. $this->element('p', null, + // TRANS: Accept message text from Authorise subscription page. _('The subscription has been authorized, but no '. - 'callback URL was passed. Check with the site’s ' . + 'callback URL was passed. Check with the site\'s ' . 'instructions for details on how to authorize the ' . 'subscription. Your subscription token is:')); $this->element('blockquote', 'token', $tok); @@ -257,10 +257,10 @@ class UserauthorizationAction extends Action { // TRANS: Reject message header from Authorise subscription page. common_show_header(_('Subscription rejected')); - // TRANS: Reject message from Authorise subscription page. $this->element('p', null, + // TRANS: Reject message from Authorise subscription page. _('The subscription has been rejected, but no '. - 'callback URL was passed. Check with the site’s ' . + 'callback URL was passed. Check with the site\'s ' . 'instructions for details on how to fully reject ' . 'the subscription.')); common_show_footer(); From 700018fd09be222d9ec163965fd1a3f277d2b931 Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Tue, 29 Mar 2011 23:00:29 +0200 Subject: [PATCH 3/4] L10n/i18n updated. Translator documentation updated. FIXME added for missing class documentation. Various documentation tweaks. --- actions/approvegroup.php | 5 +++-- actions/approvesub.php | 2 +- actions/cancelsubscription.php | 6 ++++- actions/groupqueue.php | 2 ++ actions/profilesettings.php | 15 ++++++------- classes/Group_join_queue.php | 4 ++-- classes/Profile.php | 5 ++--- classes/Subscription.php | 7 ++---- classes/User.php | 1 - lib/accountprofileblock.php | 13 +++++------ lib/cancelsubscriptionform.php | 9 ++------ lib/mail.php | 4 ++-- lib/router.php | 22 +++++++++---------- lib/subgroupnav.php | 40 ++++++++++++++++++++++------------ 14 files changed, 71 insertions(+), 64 deletions(-) diff --git a/actions/approvegroup.php b/actions/approvegroup.php index 55a0a6c3fd..d46a4451c4 100644 --- a/actions/approvegroup.php +++ b/actions/approvegroup.php @@ -121,6 +121,7 @@ class ApprovegroupAction extends Action if (empty($this->request)) { // TRANS: Client error displayed trying to approve group membership for a non-existing request. + // TRANS: %s is a nickname. $this->clientError(sprintf(_('%s is not in the moderation queue for this group.'), $this->profile->nickname), 403); } @@ -176,10 +177,10 @@ class ApprovegroupAction extends Action $this->elementEnd('head'); $this->elementStart('body'); if ($this->approve) { - // TRANS: Message on page for group admin after approving a join request. + // TRANS: Message on page for group admin after approving a join request. $this->element('p', 'success', _('Join request approved.')); } elseif ($this->cancel) { - // TRANS: Message on page for group admin after rejecting a join request. + // TRANS: Message on page for group admin after rejecting a join request. $this->element('p', 'success', _('Join request canceled.')); } $this->elementEnd('body'); diff --git a/actions/approvesub.php b/actions/approvesub.php index d30da25d32..be07b6e877 100644 --- a/actions/approvesub.php +++ b/actions/approvesub.php @@ -2,7 +2,7 @@ /** * StatusNet, the distributed open-source microblogging tool * - * Leave a group + * Approve group subscription request * * PHP version 5 * diff --git a/actions/cancelsubscription.php b/actions/cancelsubscription.php index 367fbfa138..0cd922ff70 100644 --- a/actions/cancelsubscription.php +++ b/actions/cancelsubscription.php @@ -53,6 +53,7 @@ class CancelsubscriptionAction extends Action StatusNet::setApi(true); } if (!common_logged_in()) { + // TRANS: Client error displayed when trying to leave a group while not logged in. $this->clientError(_('Not logged in.')); return; } @@ -78,6 +79,7 @@ class CancelsubscriptionAction extends Action $other_id = $this->arg('unsubscribeto'); if (!$other_id) { + // TRANS: Client error displayed when trying to leave a group without specifying an ID. $this->clientError(_('No profile ID in request.')); return; } @@ -85,6 +87,7 @@ class CancelsubscriptionAction extends Action $other = Profile::staticGet('id', $other_id); if (!$other) { + // TRANS: Client error displayed when trying to leave a non-existing group. $this->clientError(_('No profile with that ID.')); return; } @@ -103,7 +106,8 @@ class CancelsubscriptionAction extends Action if ($this->boolean('ajax')) { $this->startHTML('text/xml;charset=utf-8'); $this->elementStart('head'); - $this->element('title', null, _('Unsubscribed')); + // TRANS: Title after unsubscribing from a group. + $this->element('title', null, _m('TITLE','Unsubscribed')); $this->elementEnd('head'); $this->elementStart('body'); $subscribe = new SubscribeForm($this, $other); diff --git a/actions/groupqueue.php b/actions/groupqueue.php index c6f54d57d7..7cc32a9c69 100644 --- a/actions/groupqueue.php +++ b/actions/groupqueue.php @@ -161,6 +161,7 @@ class GroupqueueAction extends GroupDesignAction } } +// @todo FIXME: documentation missing. class GroupQueueList extends GroupMemberList { function newListItem($profile) @@ -169,6 +170,7 @@ class GroupQueueList extends GroupMemberList } } +// @todo FIXME: documentation missing. class GroupQueueListItem extends GroupMemberListItem { function showActions() diff --git a/actions/profilesettings.php b/actions/profilesettings.php index 7aa987f3a5..8ce1192579 100644 --- a/actions/profilesettings.php +++ b/actions/profilesettings.php @@ -33,8 +33,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } - - /** * Change profile settings * @@ -46,7 +44,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://status.net/ */ - class ProfilesettingsAction extends SettingsAction { /** @@ -127,15 +124,15 @@ class ProfilesettingsAction extends SettingsAction // TRANS: Tooltip for field label in form for profile settings. Plural // TRANS: is decided by the number of characters available for the // TRANS: biography (%d). - $bioInstr = sprintf(_m('Describe yourself and your interests in %d character', - 'Describe yourself and your interests in %d characters', + $bioInstr = sprintf(_m('Describe yourself and your interests in %d character.', + 'Describe yourself and your interests in %d characters.', $maxBio), $maxBio); } else { // TRANS: Tooltip for field label in form for profile settings. - $bioInstr = _('Describe yourself and your interests'); + $bioInstr = _('Describe yourself and your interests.'); } - // TRANS: Text area label in form for profile settings where users can provide. + // TRANS: Text area label in form for profile settings where users can provide // TRANS: their biography. $this->textarea('bio', _('Bio'), ($this->arg('bio')) ? $this->arg('bio') : $profile->bio, @@ -146,7 +143,7 @@ class ProfilesettingsAction extends SettingsAction $this->input('location', _('Location'), ($this->arg('location')) ? $this->arg('location') : $profile->location, // TRANS: Tooltip for field label in form for profile settings. - _('Where you are, like "City, State (or Region), Country"')); + _('Where you are, like "City, State (or Region), Country".')); $this->elementEnd('li'); if (common_config('location', 'share') == 'user') { $this->elementStart('li'); @@ -196,7 +193,9 @@ class ProfilesettingsAction extends SettingsAction $this->dropdown('subscribe_policy', // TRANS: Dropdown field label on profile settings, for what policies to apply when someone else tries to subscribe to your updates. _('Subscription policy'), + // TRANS: Dropdown field option for following policy. array(User::SUBSCRIBE_POLICY_OPEN => _('Let anyone follow me'), + // TRANS: Dropdown field option for following policy. User::SUBSCRIBE_POLICY_MODERATE => _('Ask me first')), // TRANS: Dropdown field title on group edit form. _('Whether other users need your permission to follow your updates.'), diff --git a/classes/Group_join_queue.php b/classes/Group_join_queue.php index acf3a13957..38473c9b7c 100644 --- a/classes/Group_join_queue.php +++ b/classes/Group_join_queue.php @@ -63,7 +63,7 @@ class Group_join_queue extends Managed_DataObject if (empty($member)) { // TRANS: Exception thrown providing an invalid profile ID. // TRANS: %s is the invalid profile ID. - throw new Exception(sprintf(_("Profile ID %s is invalid."),$this->profile_id)); + throw new Exception(sprintf(_('Profile ID %s is invalid.'),$this->profile_id)); } return $member; @@ -76,7 +76,7 @@ class Group_join_queue extends Managed_DataObject if (empty($group)) { // TRANS: Exception thrown providing an invalid group ID. // TRANS: %s is the invalid group ID. - throw new Exception(sprintf(_("Group ID %s is invalid."),$this->group_id)); + throw new Exception(sprintf(_('Group ID %s is invalid.'),$this->group_id)); } return $group; diff --git a/classes/Profile.php b/classes/Profile.php index 3d989dd974..032a370656 100644 --- a/classes/Profile.php +++ b/classes/Profile.php @@ -168,7 +168,7 @@ class Profile extends Memcached_DataObject function getFancyName() { if ($this->fullname) { - // TRANS: Full name of a profile or group followed by nickname in parens + // TRANS: Full name of a profile or group (%1$s) followed by nickname (%2$s) in parentheses. return sprintf(_m('FANCYNAME','%1$s (%2$s)'), $this->fullname, $this->nickname); } else { return $this->nickname; @@ -180,7 +180,6 @@ class Profile extends Memcached_DataObject * * @return mixed Notice or null */ - function getCurrentNotice() { $notice = $this->getNotices(0, 1); @@ -443,7 +442,7 @@ class Profile extends Memcached_DataObject { return Subscription::exists($this, $other); } - + /** * Check if a pending subscription request is outstanding for this... * diff --git a/classes/Subscription.php b/classes/Subscription.php index 438f1dfe50..8af414b3a7 100644 --- a/classes/Subscription.php +++ b/classes/Subscription.php @@ -267,8 +267,8 @@ class Subscription extends Memcached_DataObject common_date_iso8601($this->created)); $act->time = strtotime($this->created); - // TRANS: Activity tile when subscribing to another person. - $act->title = _("Follow"); + // TRANS: Activity title when subscribing to another person. + $act->title = _m('TITLE','Follow'); // TRANS: Notification given when one person starts following another. // TRANS: %1$s is the subscriber, %2$s is the subscribed. $act->content = sprintf(_('%1$s is now following %2$s.'), @@ -301,7 +301,6 @@ class Subscription extends Memcached_DataObject * * @return Subscription stream of subscriptions; use fetch() to iterate */ - static function bySubscriber($subscriberId, $offset = 0, $limit = PROFILES_PER_PAGE) @@ -362,7 +361,6 @@ class Subscription extends Memcached_DataObject * * @return Subscription stream of subscriptions; use fetch() to iterate */ - static function bySubscribed($subscribedId, $offset = 0, $limit = PROFILES_PER_PAGE) @@ -420,7 +418,6 @@ class Subscription extends Memcached_DataObject * * @return boolean success flag. */ - function update($orig=null) { $result = parent::update($orig); diff --git a/classes/User.php b/classes/User.php index f395dc1e49..abfcb0e8e2 100644 --- a/classes/User.php +++ b/classes/User.php @@ -965,5 +965,4 @@ class User extends Memcached_DataObject return $apps; } - } diff --git a/lib/accountprofileblock.php b/lib/accountprofileblock.php index 6a4021bf04..1c3a8dc536 100644 --- a/lib/accountprofileblock.php +++ b/lib/accountprofileblock.php @@ -44,7 +44,6 @@ if (!defined('STATUSNET')) { * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 * @link http://status.net/ */ - class AccountProfileBlock extends ProfileBlock { protected $profile = null; @@ -131,9 +130,9 @@ class AccountProfileBlock extends ProfileBlock $this->out->elementStart('li', 'entity_edit'); $this->out->element('a', array('href' => common_local_url('profilesettings'), // TRANS: Link title for link on user profile. - 'title' => _('Edit profile settings')), + 'title' => _('Edit profile settings.')), // TRANS: Link text for link on user profile. - _('Edit')); + _m('BUTTON','Edit')); $this->out->elementEnd('li'); } else { // someone else's page @@ -160,9 +159,9 @@ class AccountProfileBlock extends ProfileBlock $this->out->elementStart('li', 'entity_send-a-message'); $this->out->element('a', array('href' => common_local_url('newmessage', array('to' => $this->user->id)), // TRANS: Link title for link on user profile. - 'title' => _('Send a direct message to this user')), + 'title' => _('Send a direct message to this user.')), // TRANS: Link text for link on user profile. - _('Message')); + _m('BUTTON','Message')); $this->out->elementEnd('li'); // nudge @@ -288,6 +287,6 @@ class AccountProfileBlock extends ProfileBlock $this->out->element('a', array('href' => $url, 'class' => 'entity_remote_subscribe'), // TRANS: Link text for link that will subscribe to a remote profile. - _('Subscribe')); + _m('BUTTON','Subscribe')); } -} \ No newline at end of file +} diff --git a/lib/cancelsubscriptionform.php b/lib/cancelsubscriptionform.php index 1173152c63..a7b566da7b 100644 --- a/lib/cancelsubscriptionform.php +++ b/lib/cancelsubscriptionform.php @@ -46,7 +46,6 @@ require_once INSTALLDIR.'/lib/form.php'; * * @see UnsubscribeForm */ - class CancelSubscriptionForm extends Form { /** @@ -61,7 +60,6 @@ class CancelSubscriptionForm extends Form * @param HTMLOutputter $out output channel * @param Profile $profile being subscribed to */ - function __construct($out=null, $profile=null) { parent::__construct($out); @@ -74,7 +72,6 @@ class CancelSubscriptionForm extends Form * * @return string ID of the form */ - function id() { return 'subscription-cancel-' . $this->profile->id; @@ -85,7 +82,6 @@ class CancelSubscriptionForm extends Form * * @return string of the form class */ - function formClass() { return 'form_unsubscribe ajax'; @@ -96,7 +92,6 @@ class CancelSubscriptionForm extends Form * * @return string URL of the action */ - function action() { return common_local_url('cancelsubscription', @@ -121,9 +116,9 @@ class CancelSubscriptionForm extends Form * * @return void */ - function formActions() { - $this->out->submit('submit', _('Cancel sub request')); + // TRANS: Button text for form action to cancel a subscription request. + $this->out->submit('submit', _m('BUTTON','Cancel subscription request')); } } diff --git a/lib/mail.php b/lib/mail.php index e8c5d3c4e7..eaef2285b5 100644 --- a/lib/mail.php +++ b/lib/mail.php @@ -641,7 +641,7 @@ function mail_notify_message($message, $from=null, $to=null) } /** - * notify a user that one of their notices has been chosen as a 'fave' + * Notify a user that one of their notices has been chosen as a 'fave' * * Doesn't check that the user has an email address nor if they * want to receive notification of faves. Maybe this happens higher @@ -704,7 +704,7 @@ function mail_notify_fave($other, $user, $notice) } /** - * notify a user that they have received an "attn:" message AKA "@-reply" + * Notify a user that they have received an "attn:" message AKA "@-reply" * * @param User $user The user who recevied the notice * @param Notice $notice The notice that was sent diff --git a/lib/router.php b/lib/router.php index 156bc10c7f..6533e24e57 100644 --- a/lib/router.php +++ b/lib/router.php @@ -41,7 +41,7 @@ class StatusNet_URL_Mapper extends Net_URL_Mapper private function __construct() { } - + public static function getInstance($id = '__default__') { if (empty(self::$_singleton)) { @@ -67,7 +67,7 @@ class StatusNet_URL_Mapper extends Net_URL_Mapper } return $result; } - + protected function _mapAction($action, $path) { if (!array_key_exists($action, $this->_actionToPath)) { @@ -76,19 +76,19 @@ class StatusNet_URL_Mapper extends Net_URL_Mapper $this->_actionToPath[$action][] = $path; return; } - + public function generate($values = array(), $qstring = array(), $anchor = '') { if (!array_key_exists('action', $values)) { return parent::generate($values, $qstring, $anchor); } - + $action = $values['action']; if (!array_key_exists($action, $this->_actionToPath)) { return parent::generate($values, $qstring, $anchor); } - + $oldPaths = $this->paths; $this->paths = $this->_actionToPath[$action]; $result = parent::generate($values, $qstring, $anchor); @@ -147,19 +147,19 @@ class Router /** * Create a unique hashkey for the router. - * + * * The router's url map can change based on the version of the software * you're running and the plugins that are enabled. To avoid having bad routes * get stuck in the cache, the key includes a list of plugins and the software * version. - * - * There can still be problems with a) differences in versions of the plugins and + * + * There can still be problems with a) differences in versions of the plugins and * b) people running code between official versions, but these tend to be more * sophisticated users who can grok what's going on and clear their caches. - * + * * @return string cache key string that should uniquely identify a router */ - + static function cacheKey() { $parts = array('router'); @@ -173,7 +173,7 @@ class Router return Cache::codeKey(implode(':', $parts)); } - + function initialize() { $m = StatusNet_URL_Mapper::getInstance(); diff --git a/lib/subgroupnav.php b/lib/subgroupnav.php index b0ec364bff..bd03fe3e45 100644 --- a/lib/subgroupnav.php +++ b/lib/subgroupnav.php @@ -42,7 +42,6 @@ require_once INSTALLDIR.'/lib/widget.php'; * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://status.net/ */ - class SubGroupNav extends Menu { var $user = null; @@ -52,7 +51,6 @@ class SubGroupNav extends Menu * * @param Action $action current action, used for output */ - function __construct($action=null, $user=null) { parent::__construct($action); @@ -64,7 +62,6 @@ class SubGroupNav extends Menu * * @return void */ - function show() { $cur = common_current_user(); @@ -76,23 +73,30 @@ class SubGroupNav extends Menu $this->out->menuItem(common_local_url('showstream', array('nickname' => $this->user->nickname)), - _('Profile'), + // TRANS: Menu item in local navigation menu. + _m('MENU','Profile'), (empty($profile)) ? $this->user->nickname : $profile->getBestName(), $action == 'showstream', 'nav_profile'); $this->out->menuItem(common_local_url('subscriptions', array('nickname' => $this->user->nickname)), - _('Subscriptions'), - sprintf(_('People %s subscribes to'), + // TRANS: Menu item in local navigation menu. + _m('MENU','Subscriptions'), + // TRANS: Menu item title in local navigation menu. + // TRANS: %s is a user nickname. + sprintf(_('People %s subscribes to.'), $this->user->nickname), $action == 'subscriptions', 'nav_subscriptions'); $this->out->menuItem(common_local_url('subscribers', array('nickname' => $this->user->nickname)), - _('Subscribers'), - sprintf(_('People subscribed to %s'), + // TRANS: Menu item in local navigation menu. + _m('MENU','Subscribers'), + // TRANS: Menu item title in local navigation menu. + // TRANS: %s is a user nickname. + sprintf(_('People subscribed to %s.'), $this->user->nickname), $action == 'subscribers', 'nav_subscribers'); @@ -103,8 +107,10 @@ class SubGroupNav extends Menu $this->out->menuItem(common_local_url('subqueue', array('nickname' => $this->user->nickname)), - sprintf(_('Pending (%d)'), $pending), - sprintf(_('Approve pending subscription requests'), + // TRANS: Menu item in local navigation menu. + sprintf(_m('MENU','Pending (%d)'), $pending), + // TRANS: Menu item title in local navigation menu. + sprintf(_('Approve pending subscription requests.'), $this->user->nickname), $action == 'subqueueaction', 'nav_subscribers'); @@ -113,15 +119,21 @@ class SubGroupNav extends Menu $this->out->menuItem(common_local_url('usergroups', array('nickname' => $this->user->nickname)), - _('Groups'), - sprintf(_('Groups %s is a member of'), + // TRANS: Menu item in local navigation menu. + _m('MENU','Groups'), + // TRANS: Menu item title in local navigation menu. + // TRANS: %s is a user nickname. + sprintf(_('Groups %s is a member of.'), $this->user->nickname), $action == 'usergroups', 'nav_usergroups'); if (common_config('invite', 'enabled') && !is_null($cur) && $this->user->id === $cur->id) { $this->out->menuItem(common_local_url('invite'), - _('Invite'), - sprintf(_('Invite friends and colleagues to join you on %s'), + // TRANS: Menu item in local navigation menu. + _m('MENU','Invite'), + // TRANS: Menu item title in local navigation menu. + // TRANS: %s is a user nickname. + sprintf(_('Invite friends and colleagues to join you on %s.'), common_config('site', 'name')), $action == 'invite', 'nav_invite'); From ede8fabb5502c7ac975b305a7b6f6f2a6d4d51de Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Tue, 29 Mar 2011 23:14:40 +0200 Subject: [PATCH 4/4] Fix incorrect translator documentation. Spotted by AVRS. --- actions/register.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actions/register.php b/actions/register.php index 7b3c075156..5b4e990370 100644 --- a/actions/register.php +++ b/actions/register.php @@ -531,7 +531,7 @@ class RegisterAction extends Action $this->elementEnd('li'); } $this->elementEnd('ul'); - // TRANS: Field label on account registration page. + // TRANS: Botton text to register a user on account registration page. $this->submit('submit', _m('BUTTON','Register')); $this->elementEnd('fieldset'); $this->elementEnd('form');