Translator documentation updated.
Superfluous whitespace removed.
Some FIXMEs added.
$user = User::staticGet('id', $appUser->profile_id);
if (!empty($user)) {
if (!$user->hasRight(Right::API)) {
+ // TRANS: Authorization exception thrown when a user without API access tries to access the API.
throw new AuthorizationException(_('Not allowed to use API.'));
}
}
throw new OAuthException(_('Bad access token.'));
}
} else {
- // Also should not happen
+ // Also should not happen.
// TRANS: OAuth exception given when no user was found for a given token (no token was found).
throw new OAuthException(_('No user for that token.'));
}
if (!empty($user)) {
if (!$user->hasRight(Right::API)) {
+ // TRANS: Authorization exception thrown when a user without API access tries to access the API.
throw new AuthorizationException(_('Not allowed to use API.'));
}
$this->auth_user = $user;
require_once INSTALLDIR . '/lib/oauthstore.php';
+// @todo FIXME: Class documentation missing.
class ApiStatusNetOAuthDataStore extends StatusNetOAuthDataStore
{
function lookup_consumer($consumerKey)
);
if (empty($req_token)) {
- common_debug("couldn't get request token from oauth datastore");
+ common_debug("Couldn't get request token from oauth datastore");
return null;
}
if (!$result) {
common_log_db_error($appUser, 'INSERT', __FILE__);
- // TRANS: Server error displayed when a database error occurs.
throw new Exception(
+ // TRANS: Exception thrown when a database error occurs.
_('Database error inserting OAuth application user.')
);
}
if (!$result) {
common_log_db_error($appUser, 'UPDATE', __FILE__);
- // TRANS: Server error displayed when a database error occurs.
throw new Exception(
+ // TRANS: Exception thrown when a database error occurs.
_('Database error updating OAuth application user.')
);
}
$this->out->elementEnd('a');
if ($app->name == 'anonymous') {
- $this->out->element('span', 'fn', "Unknown application");
+ // TRANS: Name for an anonymous application in application list.
+ $this->out->element('span', 'fn', _('Unknown application'));
}
$this->out->elementEnd('span');
if ($app->name != 'anonymous') {
// @todo FIXME: i18n trouble.
+ // TRANS: Message has a leading space and a trailing space. Used in application list.
+ // TRANS: Before this message the application name is put, behind it the organisation that manages it.
$this->out->raw(_(' by '));
$this->out->element(
// TRANS: Used in application list. %1$s is a modified date, %2$s is access type ("read-write" or "read-only")
$txt = sprintf(_('Approved %1$s - "%2$s" access.'), $modifiedDate, $access);
+ // @todo FIXME: i18n trouble.
$this->out->raw(" - $txt");
if (!empty($app->description)) {
$this->out->element(
$this->out->elementStart('fieldset');
$this->out->hidden('oauth_token', $this->connection->token);
$this->out->hidden('token', common_session_token());
- // TRANS: Button label
+ // TRANS: Button label in application list to revoke access to user data.
$this->out->submit('revoke', _m('BUTTON','Revoke'));
$this->out->elementEnd('fieldset');
$this->out->elementEnd('form');
if (!empty($name)) {
$xs->element('name', null, $name);
} else {
- // TRANS: Atom feed exception thrown when an author element does not contain a name element.
throw new Atom10FeedException(
+ // TRANS: Atom feed exception thrown when an author element does not contain a name element.
_('Author element must contain a name element.')
);
}
function title()
{
+ // TRANS: Page title for when a database error occurs.
return _('Database error');
}
* @link http://status.net/
*
*/
-
class DesignForm extends Form
{
/**
* @param Design $design initial design
* @param Design $actionurl url of action (for form posting)
*/
-
function __construct($out, $design, $actionurl)
{
parent::__construct($out);
*
* @return int ID of the form
*/
-
function id()
{
return 'design';
*
* @return string class of the form
*/
-
function formClass()
{
return 'form_design';
*
* @return string URL of the action
*/
-
function action()
{
return $this->actionurl;
*/
function formLegend()
{
+ // TRANS: Form legend of form for changing the page design.
$this->out->element('legend', null, _('Change design'));
}
*
* @return void
*/
-
function formData()
{
$this->backgroundData();
// TRANS: Button text on profile design page to immediately reset all colour settings to default.
$this->out->submit('defaults', _('Use defaults'), 'submit form_action-default',
// TRANS: Title for button on profile design page to reset all colour settings to default.
- 'defaults', _('Restore default designs'));
+ 'defaults', _('Restore default designs.'));
$this->out->element('input', array('id' => 'settings_design_reset',
'type' => 'reset',
'value' => _m('BUTTON', 'Reset'),
'class' => 'submit form_action-primary',
// TRANS: Title for button on profile design page to reset all colour settings to default without saving.
- 'title' => _('Reset back to default')));
+ 'title' => _('Reset back to default.')));
}
function backgroundData()
'id' => 'design_background-image_file'));
// TRANS: Instructions for form on profile design page.
$this->out->element('p', 'form_guide', _('You can upload your personal ' .
- 'background image. The maximum file size is 2Mb.'));
+ 'background image. The maximum file size is 2MB.'));
$this->out->element('input', array('name' => 'MAX_FILE_SIZE',
'type' => 'hidden',
'id' => 'MAX_FILE_SIZE',
// TRANS: Button text on profile design page to save settings.
$this->out->submit('save', _m('BUTTON','Save'), 'submit form_action-secondary',
// TRANS: Title for button on profile design page to save settings.
- 'save', _('Save design'));
+ 'save', _('Save design.'));
}
}
{
switch ($this->type) {
case Feed::RSS1:
+ // TRANS: Feed type name.
return _('RSS 1.0');
case Feed::RSS2:
+ // TRANS: Feed type name.
return _('RSS 2.0');
case Feed::ATOM:
+ // TRANS: Feed type name.
return _('Atom');
case Feed::FOAF:
+ // TRANS: Feed type name. FOAF stands for Friend of a Friend.
return _('FOAF');
default:
return null;
* Copyright (C) 2010, StatusNet, Inc.
*
* Importer for feeds of activities
- *
+ *
* PHP version 5
*
* This program is free software: you can redistribute it and/or modify
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
* @link http://status.net/
*/
-
class FeedImporter extends QueueHandler
{
/**
*
* @return string identifier for this queue handler
*/
-
public function transport()
{
return 'feedimp';
if ($feed->namespaceURI != Activity::ATOM ||
$feed->localName != 'feed') {
- throw new ClientException(_("Not an atom feed."));
+ // TRANS: Client exception thrown when an imported feed is not an Atom feed.
+ throw new ClientException(_("Not an Atom feed."));
}
$author = ActivityUtils::getFeedAuthor($feed);
if (empty($author)) {
+ // TRANS: Client exception thrown when an imported feed does not have an author.
throw new ClientException(_("No author in the feed."));
}
if ($trusted) {
$user = $this->userFromAuthor($author);
} else {
- throw new ClientException(_("Can't import without a user."));
+ // TRANS: Client exception thrown when an imported feed does not have an author that
+ // TRANS: can be associated with a user.
+ throw new ClientException(_("Cannot import without a user."));
}
}
/**
* Sort activities oldest-first
*/
-
static function activitySort($a, $b)
{
if ($a->time == $b->time) {
$profile = $user->getProfile();
Ostatus_profile::updateProfile($profile, $author);
- // FIXME: Update avatar
+ // @todo FIXME: Update avatar
return $user;
}
}
define('AVATARS_PER_PAGE', 80);
+// @todo FIXME: Class documentation missing.
class GalleryAction extends OwnerDesignAction
{
var $profile = null;
$this->user = User::staticGet('nickname', $nickname);
if (!$this->user) {
+ // TRANS: Client error displayed when trying to perform a gallery action with an unknown user.
$this->clientError(_('No such user.'), 404);
return false;
}
$this->profile = $this->user->getProfile();
if (!$this->profile) {
+ // TRANS: Server error displayed when trying to perform a gallery action with a user without a profile.
$this->serverError(_('User has no profile.'));
return false;
}
common_local_url($this->trimmed('action'),
array('nickname' =>
$this->user->nickname))),
- _('All'));
+ // TRANS: List element on gallery action page to show all tags.
+ _m('TAGS','All'));
$this->elementEnd('li');
$this->elementStart('li', array('id'=>'filter_tags_item'));
$this->elementStart('form', array('name' => 'bytag',
'action' => common_path('?action=' . $this->trimmed('action')),
'method' => 'post'));
$this->elementStart('fieldset');
+ // TRANS: Fieldset legend on gallery action page.
$this->element('legend', null, _('Select tag to filter'));
+ // TRANS: Dropdown field label on gallery action page for a list containing tags.
$this->dropdown('tag', _('Tag'), $content,
- _('Choose a tag to narrow list'), false, $tag);
+ // TRANS: Dropdown field title on gallery action page for a list containing tags.
+ _('Choose a tag to narrow list.'), false, $tag);
$this->hidden('nickname', $this->user->nickname);
- $this->submit('submit', _('Go'));
+ // TRANS: Submit button text on gallery action page.
+ $this->submit('submit', _m('BUTTON','Go'));
$this->elementEnd('fieldset');
$this->elementEnd('form');
$this->elementEnd('li');
}
// Get list of tags we tagged other users with
-
function getTags($lst, $usr)
{
$profile_tag = new Notice_tag();
*
* @see UnSandboxForm
*/
-
class GrantRoleForm extends ProfileActionForm
{
function __construct($role, $label, $writer, $profile, $r2args)
*
* @return string Name of the action, lowercased.
*/
-
function target()
{
return 'grantrole';
*
* @return string Title of the form, internationalized
*/
-
function title()
{
return $this->label;
*
* @return string description of the form, internationalized
*/
-
function description()
{
+ // TRANS: Description on form for granting a role.
return sprintf(_('Grant this user the "%s" role'), $this->label);
}
}
$this->out->dropdown('join_policy',
// TRANS: Dropdown fieldd label on group edit form.
_('Membership policy'),
+ // TRANS: Group membership policy option.
array(User_group::JOIN_POLICY_OPEN => _('Open to all'),
+ // TRANS: Group membership policy option.
User_group::JOIN_POLICY_MODERATE => _('Admin must approve all members')),
// TRANS: Dropdown field title on group edit form.
_('Whether admin approval is required to join this group.'),
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
-
abstract class ImPlugin extends Plugin
{
//name of this IM transport
}
/**
- * send a confirmation code to a user
+ * Send a confirmation code to a user
*
* @param string $screenname screenname sending to
* @param string $code the confirmation code
*/
function sendConfirmationCode($screenname, $code, $user)
{
- $body = sprintf(_('User "%s" on %s has said that your %s screenname belongs to them. ' .
- 'If that\'s true, you can confirm by clicking on this URL: ' .
- '%s' .
+ // @todo FIXME: parameter 4 is not being used. Should para3 and para4 be a markdown link?
+ // TRANS: Body text for confirmation code e-mail.
+ // TRANS: %1$s is a user nickname, %2$s is the StatusNet sitename,
+ // TRANS: %3$s is the display name of an IM plugin.
+ $body = sprintf(_('User "%1$s" on %2$s has said that your %2$s screenname belongs to them. ' .
+ 'If that is true, you can confirm by clicking on this URL: ' .
+ '%3$s' .
' . (If you cannot click it, copy-and-paste it into the ' .
- 'address bar of your browser). If that user isn\'t you, ' .
- 'or if you didn\'t request this confirmation, just ignore this message.'),
+ 'address bar of your browser). If that user is not you, ' .
+ 'or if you did not request this confirmation, just ignore this message.'),
$user->nickname, common_config('site', 'name'), $this->getDisplayName(), common_local_url('confirmaddress', array('code' => $code)));
return $this->sendMessage($screenname, $body);
function broadcastNotice($notice)
{
-
$ni = $notice->whoGets();
foreach ($ni as $user_id => $reason) {
case NOTICE_INBOX_SOURCE_GROUP:
break;
default:
- throw new Exception(sprintf(_("Unknown inbox source %d."), $reason));
+ // TRANS: Exception thrown when trying to deliver a notice to an unknown inbox.
+ // TRANS: %d is the unknown inbox ID (number).
+ throw new Exception(sprintf(_('Unknown inbox source %d.'), $reason));
}
common_log(LOG_INFO,
$content_shortened = common_shorten_links($body);
if (Notice::contentTooLong($content_shortened)) {
$this->sendFromSite($screenname,
+ // TRANS: Message given when a status is too long. %1$s is the maximum number of characters,
+ // TRANS: %2$s is the number of characters sent (used for plural).
sprintf(_m('Message too long - maximum is %1$d character, you sent %2$d.',
'Message too long - maximum is %1$d characters, you sent %2$d.',
Notice::maxContent()),
{
if( ! common_config('queue', 'enabled'))
{
- throw new ServerException("Queueing must be enabled to use IM plugins");
+ // TRANS: Server exception thrown trying to initialise an IM plugin without meeting all prerequisites.
+ throw new ServerException(_('Queueing must be enabled to use IM plugins.'));
}
if(is_null($this->transport)){
- throw new ServerException('transport cannot be null');
+ // TRANS: Server exception thrown trying to initialise an IM plugin without a transport method.
+ throw new ServerException(_('Transport cannot be null.'));
}
}
}
*
* @see UnsubscribeForm
*/
-
class LeaveForm extends Form
{
/**
* @param HTMLOutputter $out output channel
* @param group $group group to leave
*/
-
function __construct($out=null, $group=null)
{
parent::__construct($out);
*
* @return string ID of the form
*/
-
function id()
{
return 'group-leave-' . $this->group->id;
*
* @return string of the form class
*/
-
function formClass()
{
return 'form_group_leave ajax';
*
* @return string URL of the action
*/
-
function action()
{
return common_local_url('leavegroup',
*
* @return void
*/
-
function formActions()
{
- $this->out->submit('submit', _('Leave'));
+ // TRANS: Button text on form to leave a group.
+ $this->out->submit('submit', _m('BUTTON','Leave'));
}
}
* Copyright (C) 2011, StatusNet, Inc.
*
* Primary nav, show on all pages
- *
+ *
* PHP version 5
*
* This program is free software: you can redistribute it and/or modify
if (Event::handle('StartPrimaryNav', array($this->action))) {
if (!empty($user)) {
$this->action->menuItem(common_local_url('profilesettings'),
- _m('Settings'),
- _m('Change your personal settings'),
+ // TRANS: Menu item in primary navigation panel.
+ _m('MENU','Settings'),
+ // TRANS: Menu item title in primary navigation panel.
+ _('Change your personal settings'),
false,
'nav_account');
if ($user->hasRight(Right::CONFIGURESITE)) {
$this->action->menuItem(common_local_url('siteadminpanel'),
- _m('Admin'),
- _m('Site configuration'),
+ // TRANS: Menu item in primary navigation panel.
+ _m('MENU','Admin'),
+ // TRANS: Menu item title in primary navigation panel.
+ _('Site configuration'),
false,
'nav_admin');
}
$this->action->menuItem(common_local_url('logout'),
- _m('Logout'),
- _m('Logout from the site'),
+ // TRANS: Menu item in primary navigation panel.
+ _m('MENU','Logout'),
+ _('Logout from the site'),
false,
'nav_logout');
} else {
$this->action->menuItem(common_local_url('login'),
- _m('Login'),
- _m('Login to the site'),
+ // TRANS: Menu item in primary navigation panel.
+ _m('MENU','Login'),
+ // TRANS: Menu item title in primary navigation panel.
+ _('Login to the site'),
false,
'nav_login');
}
if (!empty($user) || !common_config('site', 'private')) {
$this->action->menuItem(common_local_url('noticesearch'),
- _m('Search'),
- _m('Search the site'),
+ // TRANS: Menu item in primary navigation panel.
+ _m('MENU','Search'),
+ // TRANS: Menu item title in primary navigation panel.
+ _('Search the site'),
false,
'nav_search');
}
*
* @see Widget
*/
-
class PublicGroupNav extends Menu
{
/**
*
* @return void
*/
-
function show()
{
$action_name = $this->action->trimmed('action');
$this->action->elementStart('ul', array('class' => 'nav'));
if (Event::handle('StartPublicGroupNav', array($this))) {
- $this->out->menuItem(common_local_url('public'), _('Public'),
+ // TRANS: Menu item in search group navigation panel.
+ $this->out->menuItem(common_local_url('public'), _m('MENU','Public'),
+ // TRANS: Menu item title in search group navigation panel.
_('Public timeline'), $action_name == 'public', 'nav_timeline_public');
- $this->out->menuItem(common_local_url('groups'), _('Groups'),
+ // TRANS: Menu item in search group navigation panel.
+ $this->out->menuItem(common_local_url('groups'), _m('MENU','Groups'),
+ // TRANS: Menu item title in search group navigation panel.
_('User groups'), $action_name == 'groups', 'nav_groups');
- $this->out->menuItem(common_local_url('publictagcloud'), _('Recent tags'),
+ // TRANS: Menu item in search group navigation panel.
+ $this->out->menuItem(common_local_url('publictagcloud'), _m('MENU','Recent tags'),
+ // TRANS: Menu item title in search group navigation panel.
_('Recent tags'), $action_name == 'publictagcloud', 'nav_recent-tags');
if (count(common_config('nickname', 'featured')) > 0) {
- $this->out->menuItem(common_local_url('featured'), _('Featured'),
+ // TRANS: Menu item in search group navigation panel.
+ $this->out->menuItem(common_local_url('featured'), _m('MENU','Featured'),
+ // TRANS: Menu item title in search group navigation panel.
_('Featured users'), $action_name == 'featured', 'nav_featured');
}
- $this->out->menuItem(common_local_url('favorited'), _('Popular'),
- _("Popular notices"), $action_name == 'favorited', 'nav_timeline_favorited');
+ // TRANS: Menu item in search group navigation panel.
+ $this->out->menuItem(common_local_url('favorited'), _m('MENU','Popular'),
+ // TRANS: Menu item title in search group navigation panel.
+ _('Popular notices'), $action_name == 'favorited', 'nav_timeline_favorited');
Event::handle('EndPublicGroupNav', array($this));
}
*
* @see Widget
*/
-
class SearchGroupNav extends Menu
{
var $q = null;
*
* @param Action $action current action, used for output
*/
-
function __construct($action=null, $q = null)
{
parent::__construct($action);
*
* @return void
*/
-
function show()
{
$action_name = $this->action->trimmed('action');
if ($this->q) {
$args['q'] = $this->q;
}
- $this->out->menuItem(common_local_url('peoplesearch', $args), _('People'),
+ // TRANS: Menu item in search group navigation panel.
+ $this->out->menuItem(common_local_url('peoplesearch', $args), _m('MENU','People'),
+ // TRANS: Menu item title in search group navigation panel.
_('Find people on this site'), $action_name == 'peoplesearch', 'nav_search_people');
- $this->out->menuItem(common_local_url('noticesearch', $args), _('Notices'),
+ // TRANS: Menu item in search group navigation panel.
+ $this->out->menuItem(common_local_url('noticesearch', $args), _m('MENU','Notices'),
+ // TRANS: Menu item title in search group navigation panel.
_('Find content of notices'), $action_name == 'noticesearch', 'nav_search_notice');
- $this->out->menuItem(common_local_url('groupsearch', $args), _('Groups'),
+ // TRANS: Menu item in search group navigation panel.
+ $this->out->menuItem(common_local_url('groupsearch', $args), _m('MENU','Groups'),
+ // TRANS: Menu item title in search group navigation panel.
_('Find groups on this site'), $action_name == 'groupsearch', 'nav_search_group');
$this->action->elementEnd('ul');
}
}
-
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
* @link http://status.net/
*/
-
class SecondaryNav extends Menu
{
function show()
'id' => 'site_nav_global_secondary'));
if (Event::handle('StartSecondaryNav', array($this->action))) {
$this->out->menuItem(common_local_url('doc', array('title' => 'help')),
- // TRANS: Secondary navigation menu option leading to help on StatusNet.
- _('Help'));
+ // TRANS: Secondary navigation menu item leading to help on StatusNet.
+ _m('MENU','Help'));
$this->out->menuItem(common_local_url('doc', array('title' => 'about')),
- // TRANS: Secondary navigation menu option leading to text about StatusNet site.
- _('About'));
+ // TRANS: Secondary navigation menu item leading to text about StatusNet site.
+ _m('MENU','About'));
$this->out->menuItem(common_local_url('doc', array('title' => 'faq')),
- // TRANS: Secondary navigation menu option leading to Frequently Asked Questions.
- _('FAQ'));
+ // TRANS: Secondary navigation menu item leading to Frequently Asked Questions.
+ _m('MENU','FAQ'));
$bb = common_config('site', 'broughtby');
if (!empty($bb)) {
$this->out->menuItem(common_local_url('doc', array('title' => 'tos')),
- // TRANS: Secondary navigation menu option leading to Terms of Service.
- _('TOS'));
+ // TRANS: Secondary navigation menu item leading to Terms of Service.
+ _m('MENU','TOS'));
}
$this->out->menuItem(common_local_url('doc', array('title' => 'privacy')),
- // TRANS: Secondary navigation menu option leading to privacy policy.
- _('Privacy'));
+ // TRANS: Secondary navigation menu item leading to privacy policy.
+ _m('MENU','Privacy'));
$this->out->menuItem(common_local_url('doc', array('title' => 'source')),
- // TRANS: Secondary navigation menu option. Leads to information about StatusNet and its license.
- _('Source'));
+ // TRANS: Secondary navigation menu item. Leads to information about StatusNet and its license.
+ _m('MENU','Source'));
$this->out->menuItem(common_local_url('version'),
- // TRANS: Secondary navigation menu option leading to version information on the StatusNet site.
- _('Version'));
+ // TRANS: Secondary navigation menu item leading to version information on the StatusNet site.
+ _m('MENU','Version'));
$this->out->menuItem(common_local_url('doc', array('title' => 'contact')),
- // TRANS: Secondary navigation menu option leading to e-mail contact information on the
+ // TRANS: Secondary navigation menu item leading to e-mail contact information on the
// TRANS: StatusNet site, where to report bugs, ...
- _('Contact'));
+ _m('MENU','Contact'));
$this->out->menuItem(common_local_url('doc', array('title' => 'badge')),
- // TRANS: Secondary navigation menu option. Leads to information about embedding a timeline widget.
- _('Badge'));
+ // TRANS: Secondary navigation menu item. Leads to information about embedding a timeline widget.
+ _m('MENU','Badge'));
Event::handle('EndSecondaryNav', array($this->action));
}
$this->out->elementEnd('ul');
array('nickname' =>
$this->user->nickname)),
// TRANS: Menu item in local navigation menu.
+ // TRANS: %d is the number of pending subscription requests.
sprintf(_m('MENU','Pending (%d)'), $pending),
// TRANS: Menu item title in local navigation menu.
sprintf(_('Approve pending subscription requests.'),