Remove superfluous whitespace.
Various L10n/i18n updates.
* @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
{
/**
*
* @return string page title
*/
-
function title()
{
- return _('Snapshots');
+ // TRANS: Title for admin panel to configure snapshots.
+ return _m('TITLE','Snapshots');
}
/**
*
* @return string instructions
*/
-
function getInstructions()
{
+ // TRANS: Instructions for admin panel to configure snapshots.
return _('Manage snapshot configuration');
}
*
* @return void
*/
-
function showForm()
{
$form = new SnapshotAdminPanelForm($this);
*
* @return void
*/
-
function saveSettings()
{
static $settings = array(
// 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.'));
}
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
{
/**
*
* @return int ID of the form
*/
-
function id()
{
return 'form_snapshot_admin_panel';
*
* @return string class of the form
*/
-
function formClass()
{
return 'form_settings';
*
* @return string URL of the action
*/
-
function action()
{
return common_local_url('snapshotadminpanel');
*
* @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')
);
$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();
$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();
*
* @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.')
);
}
}
if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
+// @todo FIXME: documentation missing.
class TagAction extends Action
{
-
var $notice;
function prepare($args)
$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);
}
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)));
}
function showContent()
{
if(Event::handle('StartTagShowContent', array($this))) {
-
+
$nl = new NoticeList($this->notice, $this);
$cnt = $nl->show();
{
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;
}
$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;
}
function title()
{
+ // TRANS: Title for "tag other users" page.
+ // TRANS: %s is the user nickname.
return sprintf(_('Tag %s'), $this->profile->nickname);
}
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);
'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);
$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');
!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;
}
$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;
}
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');
} 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');
}
require_once(INSTALLDIR.'/lib/rssaction.php');
// Formatting of RSS handled by Rss10Action
-
class TagrssAction extends Rss10Action
{
var $tag;
$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 {
$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;
* @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
* @link http://status.net/
*/
-
class UnsandboxAction extends ProfileFormAction
{
/**
*
* @return boolean success flag
*/
-
function prepare($args)
{
if (!parent::prepare($args)) {
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;
}
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;
}
*
* @return void
*/
-
function handlePost()
{
$this->profile->unsandbox();
* @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
* @link http://status.net/
*/
-
class UnsilenceAction extends ProfileFormAction
{
/**
*
* @return boolean success flag
*/
-
function prepare($args)
{
if (!parent::prepare($args)) {
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;
}
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;
}
*
* @return void
*/
-
function handlePost()
{
$this->profile->unsilence();