From b1d451f98bb1ac7567be68cb1168b69447b3bef0 Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Sun, 3 Apr 2011 14:24:55 +0200 Subject: [PATCH] Upadte translator documentation. Add FIXME for missing class documentation. i18n/L10n tweaks. Superfluous whitespace removed. --- lib/noticeplaceholderform.php | 1 + lib/nudgeform.php | 16 ++++++++-------- lib/oauthstore.php | 17 +++++++++-------- lib/pluginlist.php | 4 ++-- lib/redirectingaction.php | 14 ++++++-------- lib/repeatform.php | 15 +++++---------- lib/revokeroleform.php | 5 +---- lib/sandboxform.php | 8 +++----- lib/section.php | 5 +++-- lib/silenceform.php | 8 +++----- lib/subscribeform.php | 17 +++++------------ lib/subscriberspeopleselftagcloudsection.php | 8 +------- lib/subscriberspeopletagcloudsection.php | 3 +-- lib/subscriptionlist.php | 4 +++- lib/subscriptionspeopleselftagcloudsection.php | 7 +------ lib/subscriptionspeopletagcloudsection.php | 3 +-- 16 files changed, 53 insertions(+), 82 deletions(-) diff --git a/lib/noticeplaceholderform.php b/lib/noticeplaceholderform.php index 788a2021d9..87e64fb8d0 100644 --- a/lib/noticeplaceholderform.php +++ b/lib/noticeplaceholderform.php @@ -51,6 +51,7 @@ class NoticePlaceholderForm extends Widget function show() { // Similar to that for inline replies, but not quite! + // TRANS: Field label for notice text. $placeholder = _('Update your status...'); $this->out->elementStart('div', 'form_notice_placeholder'); $this->out->element('input', array('class' => 'placeholder', diff --git a/lib/nudgeform.php b/lib/nudgeform.php index 18a008122d..9a86576a89 100644 --- a/lib/nudgeform.php +++ b/lib/nudgeform.php @@ -46,13 +46,11 @@ require_once INSTALLDIR.'/lib/form.php'; * * @see DisfavorForm */ - class NudgeForm extends Form { /** * Profile of user to nudge */ - var $profile = null; /** @@ -61,7 +59,6 @@ class NudgeForm extends Form * @param HTMLOutputter $out output channel * @param Profile $profile profile of user to nudge */ - function __construct($out=null, $profile=null) { parent::__construct($out); @@ -74,7 +71,6 @@ class NudgeForm extends Form * * @return int ID of the form */ - function id() { return 'form_user_nudge'; @@ -86,7 +82,6 @@ class NudgeForm extends Form * * @return string of the form class */ - function formClass() { return 'form_user_nudge ajax'; @@ -98,7 +93,6 @@ class NudgeForm extends Form * * @return string URL of the action */ - function action() { return common_local_url('nudge', @@ -113,6 +107,7 @@ class NudgeForm extends Form */ function formLegend() { + // TRANS: Form legend of form to nudge/ping another user. $this->out->element('legend', null, _('Nudge this user')); } @@ -122,9 +117,14 @@ class NudgeForm extends Form * * @return void */ - function formActions() { - $this->out->submit('submit', _('Nudge'), 'submit', null, _('Send a nudge to this user')); + $this->out->submit('submit', + // TRANS: Button text to nudge/ping another user. + _m('BUTTON','Nudge'), + 'submit', + null, + // TRANS: Button title to nudge/ping another user. + _('Send a nudge to this user.')); } } diff --git a/lib/oauthstore.php b/lib/oauthstore.php index a52f6cee33..570343b82d 100644 --- a/lib/oauthstore.php +++ b/lib/oauthstore.php @@ -21,9 +21,9 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } require_once 'libomb/datastore.php'; +// @todo FIXME: Class documentation missing. class StatusNetOAuthDataStore extends OAuthDataStore { - // We keep a record of who's contacted us function lookup_consumer($consumer_key) { @@ -69,9 +69,7 @@ class StatusNetOAuthDataStore extends OAuthDataStore // http://oauth.net/core/1.0/#nonce // "The Consumer SHALL then generate a Nonce value that is unique for // all requests with that timestamp." - // XXX: It's not clear why the token is here - function lookup_nonce($consumer, $token, $nonce, $timestamp) { $n = new Nonce(); @@ -104,7 +102,6 @@ class StatusNetOAuthDataStore extends OAuthDataStore } // defined in OAuthDataStore, but not implemented anywhere - function fetch_request_token($consumer) { return $this->new_request_token($consumer); @@ -161,7 +158,6 @@ class StatusNetOAuthDataStore extends OAuthDataStore } // defined in OAuthDataStore, but not implemented anywhere - function fetch_access_token($consumer) { return $this->new_access_token($consumer); @@ -232,7 +228,7 @@ class StatusNetOAuthDataStore extends OAuthDataStore **/ public function getProfile($identifier_uri) { /* getProfile is only used for remote profiles by libomb. - TODO: Make it work with local ones anyway. */ + @TODO: Make it work with local ones anyway. */ $remote = Remote_profile::staticGet('uri', $identifier_uri); if (!$remote) throw new Exception('No such remote profile'); $profile = Profile::staticGet('id', $remote->id); @@ -291,6 +287,7 @@ class StatusNetOAuthDataStore extends OAuthDataStore $profile->created = DB_DataObject_Cast::dateTime(); # current time $id = $profile->insert(); if (!$id) { + // TRANS: Exception thrown when creating a new profile fails in OAuth store. throw new Exception(_('Error inserting new profile.')); } $remote->id = $id; @@ -299,6 +296,7 @@ class StatusNetOAuthDataStore extends OAuthDataStore $avatar_url = $omb_profile->getAvatarURL(); if ($avatar_url) { if (!$this->add_avatar($profile, $avatar_url)) { + // TRANS: Exception thrown when creating a new avatar fails in OAuth store. throw new Exception(_('Error inserting avatar.')); } } else { @@ -314,11 +312,13 @@ class StatusNetOAuthDataStore extends OAuthDataStore if ($exists) { if (!$remote->update($orig_remote)) { + // TRANS: Exception thrown when updating a remote profile fails in OAuth store. throw new Exception(_('Error updating remote profile.')); } } else { $remote->created = DB_DataObject_Cast::dateTime(); # current time if (!$remote->insert()) { + // TRANS: Exception thrown when creating a remote profile fails in OAuth store. throw new Exception(_('Error inserting remote profile.')); } } @@ -479,6 +479,7 @@ class StatusNetOAuthDataStore extends OAuthDataStore if (!$subscriber->hasRight(Right::SUBSCRIBE)) { common_log(LOG_INFO, __METHOD__ . ": remote subscriber banned ($subscriber_uri subbing to $subscribed_user_uri)"); + // TRANS: Error message displayed to a banned user when they try to subscribe. return _('You have been banned from subscribing.'); } @@ -504,7 +505,8 @@ class StatusNetOAuthDataStore extends OAuthDataStore if (!$result) { common_log_db_error($sub, ($sub_exists) ? 'UPDATE' : 'INSERT', __FILE__); - throw new Exception(_('Couldn\'t insert new subscription.')); + // TRANS: Exception thrown when creating a new subscription fails in OAuth store. + throw new Exception(_('Could not insert new subscription.')); return; } @@ -516,4 +518,3 @@ class StatusNetOAuthDataStore extends OAuthDataStore } } } -?> diff --git a/lib/pluginlist.php b/lib/pluginlist.php index 07a17ba397..0bd1a15355 100644 --- a/lib/pluginlist.php +++ b/lib/pluginlist.php @@ -43,7 +43,6 @@ require INSTALLDIR . "/lib/plugindisableform.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 PluginList extends Widget { var $plugins = array(); @@ -116,7 +115,7 @@ class PluginListItem extends Widget $this->out->elementEnd('a'); } $this->out->elementEnd('div'); - + $form = $this->getControlForm(); $form->show(); @@ -192,6 +191,7 @@ class PluginListItem extends Widget return $found; } else { return array('name' => $this->plugin, + // TRANS: Plugin description for a disabled plugin. 'rawdescription' => _m('plugin-description', '(Plugin descriptions unavailable when disabled.)')); } diff --git a/lib/redirectingaction.php b/lib/redirectingaction.php index 3a358f891c..0827f11a0a 100644 --- a/lib/redirectingaction.php +++ b/lib/redirectingaction.php @@ -42,21 +42,18 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3 * @link http://status.net/ */ - - class RedirectingAction extends Action { - /** * Redirect browser to the page our hidden parameters requested, * or if none given, to the url given by $this->defaultReturnTo(). - * + * * To be called only after successful processing. - * + * * Note: this was named returnToArgs() up through 0.9.2, which * caused problems because there's an Action::returnToArgs() * already which does something different. - * + * * @return void */ function returnToPrevious() @@ -87,11 +84,12 @@ class RedirectingAction extends Action * If we reached this form without returnto arguments, where should * we go? May be overridden by subclasses to a reasonable destination * for that action; default implementation throws an exception. - * + * * @return string URL */ function defaultReturnTo() { - $this->clientError(_("No return-to arguments.")); + // TRANS: Client error displayed when return-to was defined without a target. + $this->clientError(_('No return-to arguments.')); } } diff --git a/lib/repeatform.php b/lib/repeatform.php index 4f1c8aa320..67fc47b8de 100644 --- a/lib/repeatform.php +++ b/lib/repeatform.php @@ -40,13 +40,11 @@ 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 RepeatForm extends Form { /** * Notice to repeat */ - var $notice = null; /** @@ -55,7 +53,6 @@ class RepeatForm extends Form * @param HTMLOutputter $out output channel * @param Notice $notice notice to repeat */ - function __construct($out=null, $notice=null) { parent::__construct($out); @@ -68,7 +65,6 @@ class RepeatForm extends Form * * @return int ID of the form */ - function id() { return 'repeat-' . $this->notice->id; @@ -79,7 +75,6 @@ class RepeatForm extends Form * * @return string URL of the action */ - function action() { return common_local_url('repeat'); @@ -90,7 +85,6 @@ class RepeatForm extends Form * * @return void */ - function sessionToken() { $this->out->hidden('token-' . $this->notice->id, @@ -104,6 +98,7 @@ class RepeatForm extends Form */ function formLegend() { + // TRANS: For legend for notice repeat form. $this->out->element('legend', null, _('Repeat this notice?')); } @@ -112,7 +107,6 @@ class RepeatForm extends Form * * @return void */ - function formData() { $this->out->hidden('notice-n'.$this->notice->id, @@ -125,11 +119,13 @@ class RepeatForm extends Form * * @return void */ - function formActions() { $this->out->submit('repeat-submit-' . $this->notice->id, - _('Yes'), 'submit', null, _('Repeat this notice')); + // TRANS: Button text to repeat a notice on notice repeat form. + _m('BUTTON','Yes'), 'submit', null, + // TRANS: Button title to repeat a notice on notice repeat form. + _('Repeat this notice.')); } /** @@ -137,7 +133,6 @@ class RepeatForm extends Form * * @return string the form's class */ - function formClass() { return 'form_repeat'; diff --git a/lib/revokeroleform.php b/lib/revokeroleform.php index ec24b99101..f33951bb40 100644 --- a/lib/revokeroleform.php +++ b/lib/revokeroleform.php @@ -42,7 +42,6 @@ if (!defined('STATUSNET')) { * * @see UnSandboxForm */ - class RevokeRoleForm extends ProfileActionForm { function __construct($role, $label, $writer, $profile, $r2args) @@ -57,7 +56,6 @@ class RevokeRoleForm extends ProfileActionForm * * @return string Name of the action, lowercased. */ - function target() { return 'revokerole'; @@ -68,7 +66,6 @@ class RevokeRoleForm extends ProfileActionForm * * @return string Title of the form, internationalized */ - function title() { return $this->label; @@ -85,9 +82,9 @@ class RevokeRoleForm extends ProfileActionForm * * @return string description of the form, internationalized */ - function description() { + // TRANS: Description of role revoke form. %s is the role to be revoked. return sprintf(_('Revoke the "%s" role from this user'), $this->label); } } diff --git a/lib/sandboxform.php b/lib/sandboxform.php index 7a98e0a5f9..d1e4fea963 100644 --- a/lib/sandboxform.php +++ b/lib/sandboxform.php @@ -42,7 +42,6 @@ if (!defined('STATUSNET')) { * * @see UnSandboxForm */ - class SandboxForm extends ProfileActionForm { /** @@ -50,7 +49,6 @@ class SandboxForm extends ProfileActionForm * * @return string Name of the action, lowercased. */ - function target() { return 'sandbox'; @@ -61,10 +59,10 @@ class SandboxForm extends ProfileActionForm * * @return string Title of the form, internationalized */ - function title() { - return _('Sandbox'); + // TRANS: Title of form to sandbox a user. + return _m('TITLE','Sandbox'); } /** @@ -72,9 +70,9 @@ class SandboxForm extends ProfileActionForm * * @return string description of the form, internationalized */ - function description() { + // TRANS: Description of form to sandbox a user. return _('Sandbox this user'); } } diff --git a/lib/section.php b/lib/section.php index 53a3a70fa7..753a37efa4 100644 --- a/lib/section.php +++ b/lib/section.php @@ -45,7 +45,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 Section extends Widget { /** @@ -56,7 +55,6 @@ class Section extends Widget * @return void * @see Widget::show() */ - function show() { $this->out->elementStart('div', @@ -86,12 +84,14 @@ class Section extends Widget function title() { + // TRANS: Default title for section/sidebar widget. return _('Untitled section'); } function showContent() { $this->out->element('p', null, + // TRANS: Default content for section/sidebar widget. _('(None)')); return false; } @@ -103,6 +103,7 @@ class Section extends Widget function moreTitle() { + // TRANS: Default "More..." title for section/sidebar widget. return _('More...'); } } diff --git a/lib/silenceform.php b/lib/silenceform.php index 9673fa1208..9d05f5d09f 100644 --- a/lib/silenceform.php +++ b/lib/silenceform.php @@ -42,7 +42,6 @@ if (!defined('STATUSNET')) { * * @see UnSilenceForm */ - class SilenceForm extends ProfileActionForm { /** @@ -50,7 +49,6 @@ class SilenceForm extends ProfileActionForm * * @return string Name of the action, lowercased. */ - function target() { return 'silence'; @@ -61,10 +59,10 @@ class SilenceForm extends ProfileActionForm * * @return string Title of the form, internationalized */ - function title() { - return _('Silence'); + // TRANS: Title of form to silence a user. + return _m('TITLE','Silence'); } /** @@ -72,9 +70,9 @@ class SilenceForm extends ProfileActionForm * * @return string description of the form, internationalized */ - function description() { + // TRANS: Description of form to silence a user. return _('Silence this user'); } } diff --git a/lib/subscribeform.php b/lib/subscribeform.php index 1cc5b4e48e..f10d884ed8 100644 --- a/lib/subscribeform.php +++ b/lib/subscribeform.php @@ -46,13 +46,11 @@ require_once INSTALLDIR.'/lib/form.php'; * * @see UnsubscribeForm */ - class SubscribeForm extends Form { /** * Profile of user to subscribe to */ - var $profile = null; /** @@ -61,7 +59,6 @@ class SubscribeForm extends Form * @param HTMLOutputter $out output channel * @param Profile $profile profile of user to subscribe to */ - function __construct($out=null, $profile=null) { parent::__construct($out); @@ -74,37 +71,31 @@ class SubscribeForm extends Form * * @return int ID of the form */ - function id() { return 'subscribe-' . $this->profile->id; } - /** * class of the form * * @return string of the form class */ - function formClass() { return 'form_user_subscribe ajax'; } - /** * Action of the form * * @return string URL of the action */ - function action() { return common_local_url('subscribe'); } - /** * Legend of the Form * @@ -112,6 +103,7 @@ class SubscribeForm extends Form */ function formLegend() { + // TRANS: Form of form to subscribe to a user. $this->out->element('legend', null, _('Subscribe to this user')); } @@ -120,7 +112,6 @@ class SubscribeForm extends Form * * @return void */ - function formData() { $this->out->hidden('subscribeto-' . $this->profile->id, @@ -133,9 +124,11 @@ class SubscribeForm extends Form * * @return void */ - function formActions() { - $this->out->submit('submit', _('Subscribe'), 'submit', null, _('Subscribe to this user')); + // TRANS: Button text to subscribe to a user. + $this->out->submit('submit', _m('BUTTON','Subscribe'), 'submit', null, + // TRANS: Button title to subscribe to a user. + _('Subscribe to this user.')); } } diff --git a/lib/subscriberspeopleselftagcloudsection.php b/lib/subscriberspeopleselftagcloudsection.php index 5a570ae282..47b94227e8 100644 --- a/lib/subscriberspeopleselftagcloudsection.php +++ b/lib/subscriberspeopleselftagcloudsection.php @@ -40,23 +40,17 @@ 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 SubscribersPeopleSelfTagCloudSection extends SubPeopleTagCloudSection { function title() { + // TRANS: Title of personal tag cloud section. return _('People Tagcloud as self-tagged'); } function query() { // return 'select tag, count(tag) as weight from subscription left join profile_tag on tagger = subscriber where subscribed=%d and subscribed != subscriber and tagger = tagged group by tag order by weight desc'; - - return 'select tag, count(tag) as weight from subscription left join profile_tag on tagger = subscriber where subscribed=%d and subscribed != subscriber and tagger = tagged and tag is not null group by tag order by weight desc'; - // return 'select tag, count(tag) as weight from subscription left join profile_tag on tagger = subscribed where subscriber=%d and subscribed != subscriber and tagger = tagged and tag is not null group by tag order by weight desc'; - - } } - diff --git a/lib/subscriberspeopletagcloudsection.php b/lib/subscriberspeopletagcloudsection.php index 284996b591..93cf4aa5df 100644 --- a/lib/subscriberspeopletagcloudsection.php +++ b/lib/subscriberspeopletagcloudsection.php @@ -40,11 +40,11 @@ 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 SubscribersPeopleTagCloudSection extends SubPeopleTagCloudSection { function title() { + // TRANS: Title of personal tag cloud section. return _('People Tagcloud as tagged'); } @@ -58,4 +58,3 @@ class SubscribersPeopleTagCloudSection extends SubPeopleTagCloudSection return 'select tag, count(tag) as weight from subscription left join profile_tag on subscriber=tagged and subscribed=tagger where subscribed=%d and subscriber != subscribed and tag is not null group by tag order by weight desc'; } } - diff --git a/lib/subscriptionlist.php b/lib/subscriptionlist.php index 3ca4603948..ea0aa7f1ab 100644 --- a/lib/subscriptionlist.php +++ b/lib/subscriptionlist.php @@ -1,5 +1,4 @@ isOwn()) { $this->out->element('a', array('href' => common_local_url('tagother', array('id' => $this->profile->id))), + // TRANS: Description for link to "tag other users" in widget to show a list of profiles. _('Tags')); } else { + // TRANS: Text widget to show a list of profiles with their tags. $this->out->text(_('Tags')); } if ($tags) { @@ -120,6 +121,7 @@ class SubscriptionListItem extends ProfileListItem } $this->out->elementEnd('ul'); } else { + // TRANS: Text if there are no tags in widget to show a list of profiles by tag. $this->out->text(_('(None)')); } } diff --git a/lib/subscriptionspeopleselftagcloudsection.php b/lib/subscriptionspeopleselftagcloudsection.php index 9be60dfa14..134b5c4456 100644 --- a/lib/subscriptionspeopleselftagcloudsection.php +++ b/lib/subscriptionspeopleselftagcloudsection.php @@ -40,22 +40,17 @@ 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 SubscriptionsPeopleSelfTagCloudSection extends SubPeopleTagCloudSection { function title() { + // TRANS: Title of personal tag cloud section. return _('People Tagcloud as self-tagged'); } function query() { // return 'select tag, count(tag) as weight from subscription left join profile_tag on tagger = subscriber where subscribed=%d and subscriber != subscribed and tagger = tagged group by tag order by weight desc'; - - - return 'select tag, count(tag) as weight from subscription left join profile_tag on tagger = subscribed where subscriber=%d and subscribed != subscriber and tagger = tagged and tag is not null group by tag order by weight desc'; - // return 'select tag, count(tag) as weight from subscription left join profile_tag on tagger = subscriber where subscribed=%d and subscribed != subscriber and tagger = tagged and tag is not null group by tag order by weight desc'; } } - diff --git a/lib/subscriptionspeopletagcloudsection.php b/lib/subscriptionspeopletagcloudsection.php index fde24b282e..6b888894ef 100644 --- a/lib/subscriptionspeopletagcloudsection.php +++ b/lib/subscriptionspeopletagcloudsection.php @@ -40,11 +40,11 @@ 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 SubscriptionsPeopleTagCloudSection extends SubPeopleTagCloudSection { function title() { + // TRANS: Title of personal tag cloud section. return _('People Tagcloud as tagged'); } @@ -58,4 +58,3 @@ class SubscriptionsPeopleTagCloudSection extends SubPeopleTagCloudSection return 'select tag, count(tag) as weight from subscription left join profile_tag on subscriber=tagger and subscribed=tagged where subscriber=%d and subscriber != subscribed and tag is not null group by tag order by weight desc'; } } - -- 2.39.5