Commit b1d451f9 authored by Siebrand Mazeland's avatar Siebrand Mazeland

Upadte translator documentation.

Add FIXME for missing class documentation.
i18n/L10n tweaks.
Superfluous whitespace removed.
parent fec3edee
......@@ -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',
......
......@@ -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.'));
}
}
......@@ -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
}
}
}
?>
......@@ -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.)'));
}
......
......@@ -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.'));
}
}
......@@ -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';
......
......@@ -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);
}
}
......@@ -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');
}
}
......@@ -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...');
}
}
......@@ -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');
}
}
......@@ -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.'));
}
}
......@@ -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';
}
}
......@@ -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';
}
}
<?php
/**
* StatusNet, the distributed open-source microblogging tool
*
......@@ -101,8 +100,10 @@ class SubscriptionListItem extends ProfileListItem
if ($this->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)'));
}
}
......
......@@ -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';
}
}
......@@ -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';
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment