Update translator documentation.

Remove superfluous whitespace.
L10n/I18n updates.
FIXMEs added for missing documentation or headers.
This commit is contained in:
Siebrand Mazeland 2011-03-24 11:47:57 +01:00
parent 3be26565fb
commit 78edb4bf56
4 changed files with 49 additions and 24 deletions

View File

@ -40,7 +40,6 @@ if (!defined('STATUSNET')) {
* @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3 * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
* @link http://status.net/ * @link http://status.net/
*/ */
class SandboxAction extends ProfileFormAction class SandboxAction extends ProfileFormAction
{ {
/** /**
@ -50,7 +49,6 @@ class SandboxAction extends ProfileFormAction
* *
* @return boolean success flag * @return boolean success flag
*/ */
function prepare($args) function prepare($args)
{ {
if (!parent::prepare($args)) { if (!parent::prepare($args)) {
@ -62,6 +60,7 @@ class SandboxAction extends ProfileFormAction
assert(!empty($cur)); // checked by parent assert(!empty($cur)); // checked by parent
if (!$cur->hasRight(Right::SANDBOXUSER)) { if (!$cur->hasRight(Right::SANDBOXUSER)) {
// TRANS: Client error displayed trying to sandbox users on a site where the feature is not enabled.
$this->clientError(_('You cannot sandbox users on this site.')); $this->clientError(_('You cannot sandbox users on this site.'));
return false; return false;
} }
@ -69,6 +68,7 @@ class SandboxAction extends ProfileFormAction
assert(!empty($this->profile)); // checked by parent assert(!empty($this->profile)); // checked by parent
if ($this->profile->isSandboxed()) { if ($this->profile->isSandboxed()) {
// TRANS: Client error displayed trying to sandbox an already sandboxed user.
$this->clientError(_('User is already sandboxed.')); $this->clientError(_('User is already sandboxed.'));
return false; return false;
} }
@ -81,7 +81,6 @@ class SandboxAction extends ProfileFormAction
* *
* @return void * @return void
*/ */
function handlePost() function handlePost()
{ {
$this->profile->sandbox(); $this->profile->sandbox();

View File

@ -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 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/ * @link http://status.net/
*/ */
class SessionsadminpanelAction extends AdminPanelAction class SessionsadminpanelAction extends AdminPanelAction
{ {
/** /**
@ -48,10 +47,10 @@ class SessionsadminpanelAction extends AdminPanelAction
* *
* @return string page title * @return string page title
*/ */
function title() function title()
{ {
return _('Sessions'); // TRANS: Title for the sessions administration panel.
return _m('TITLE','Sessions');
} }
/** /**
@ -59,9 +58,9 @@ class SessionsadminpanelAction extends AdminPanelAction
* *
* @return string instructions * @return string instructions
*/ */
function getInstructions() function getInstructions()
{ {
// TRANS: Instructions for the sessions administration panel.
return _('Session settings for this StatusNet site'); return _('Session settings for this StatusNet site');
} }
@ -70,7 +69,6 @@ class SessionsadminpanelAction extends AdminPanelAction
* *
* @return void * @return void
*/ */
function showForm() function showForm()
{ {
$form = new SessionsAdminPanelForm($this); $form = new SessionsAdminPanelForm($this);
@ -83,7 +81,6 @@ class SessionsadminpanelAction extends AdminPanelAction
* *
* @return void * @return void
*/ */
function saveSettings() function saveSettings()
{ {
static $booleans = array('sessions' => array('handle', 'debug')); static $booleans = array('sessions' => array('handle', 'debug'));
@ -123,6 +120,7 @@ class SessionsadminpanelAction extends AdminPanelAction
} }
} }
// @todo FIXME: Class documentation missing.
class SessionsAdminPanelForm extends AdminForm class SessionsAdminPanelForm extends AdminForm
{ {
/** /**
@ -130,7 +128,6 @@ class SessionsAdminPanelForm extends AdminForm
* *
* @return int ID of the form * @return int ID of the form
*/ */
function id() function id()
{ {
return 'sessionsadminpanel'; return 'sessionsadminpanel';
@ -141,7 +138,6 @@ class SessionsAdminPanelForm extends AdminForm
* *
* @return string class of the form * @return string class of the form
*/ */
function formClass() function formClass()
{ {
return 'form_settings'; return 'form_settings';
@ -152,7 +148,6 @@ class SessionsAdminPanelForm extends AdminForm
* *
* @return string URL of the action * @return string URL of the action
*/ */
function action() function action()
{ {
return common_local_url('sessionsadminpanel'); return common_local_url('sessionsadminpanel');
@ -163,24 +158,31 @@ class SessionsAdminPanelForm extends AdminForm
* *
* @return void * @return void
*/ */
function formData() function formData()
{ {
$this->out->elementStart('fieldset', array('id' => 'settings_user_sessions')); $this->out->elementStart('fieldset', array('id' => 'settings_user_sessions'));
$this->out->element('legend', null, _('Sessions')); // TRANS: Fieldset legend on the sessions administration panel.
$this->out->element('legend', null, _m('LEGEND','Sessions'));
$this->out->elementStart('ul', 'form_data'); $this->out->elementStart('ul', 'form_data');
$this->li(); $this->li();
// TRANS: Checkbox title on the sessions administration panel.
// TRANS: Indicates if StatusNet should handle session administration.
$this->out->checkbox('handle', _('Handle sessions'), $this->out->checkbox('handle', _('Handle sessions'),
(bool) $this->value('handle', 'sessions'), (bool) $this->value('handle', 'sessions'),
_('Whether to handle sessions ourselves.')); // TRANS: Checkbox title on the sessions administration panel.
// TRANS: Indicates if StatusNet should handle session administration.
_('Handle sessions ourselves.'));
$this->unli(); $this->unli();
$this->li(); $this->li();
// TRANS: Checkbox label on the sessions administration panel.
// TRANS: Indicates if StatusNet should write session debugging output.
$this->out->checkbox('debug', _('Session debugging'), $this->out->checkbox('debug', _('Session debugging'),
(bool) $this->value('debug', 'sessions'), (bool) $this->value('debug', 'sessions'),
_('Turn on debugging output for sessions.')); // TRANS: Checkbox title on the sessions administration panel.
_('Enable debugging output for sessions.'));
$this->unli(); $this->unli();
$this->out->elementEnd('ul'); $this->out->elementEnd('ul');
@ -193,9 +195,14 @@ class SessionsAdminPanelForm extends AdminForm
* *
* @return void * @return void
*/ */
function formActions() function formActions()
{ {
$this->out->submit('submit', _('Save'), 'submit', null, _('Save site settings')); $this->out->submit('submit',
// TRANS: Submit button text on the sessions administration panel.
_m('BUTTON','Save'),
'submit',
null,
// TRANS: Title for submit button on the sessions administration panel.
_('Save session settings'));
} }
} }

View File

@ -75,11 +75,13 @@ class ShowApplicationAction extends OwnerDesignAction
$this->owner = User::staticGet($this->application->owner); $this->owner = User::staticGet($this->application->owner);
if (!common_logged_in()) { if (!common_logged_in()) {
// TRANS: Client error displayed trying to display an OAuth application while not logged in.
$this->clientError(_('You must be logged in to view an application.')); $this->clientError(_('You must be logged in to view an application.'));
return false; return false;
} }
if (empty($this->application)) { if (empty($this->application)) {
// TRANS: Client error displayed trying to display a non-existing OAuth application.
$this->clientError(_('No such application.'), 404); $this->clientError(_('No such application.'), 404);
return false; return false;
} }
@ -87,6 +89,7 @@ class ShowApplicationAction extends OwnerDesignAction
$cur = common_current_user(); $cur = common_current_user();
if ($cur->id != $this->owner->id) { if ($cur->id != $this->owner->id) {
// TRANS: Client error displayed trying to display an OAuth application for which the logged in user is not the owner.
$this->clientError(_('You are not the owner of this application.'), 401); $this->clientError(_('You are not the owner of this application.'), 401);
return false; return false;
} }
@ -148,6 +151,7 @@ class ShowApplicationAction extends OwnerDesignAction
$consumer = $this->application->getConsumer(); $consumer = $this->application->getConsumer();
$this->elementStart('div', 'entity_profile vcard'); $this->elementStart('div', 'entity_profile vcard');
// TRANS: Header on the OAuth application page.
$this->element('h2', null, _('Application profile')); $this->element('h2', null, _('Application profile'));
if (!empty($this->application->icon)) { if (!empty($this->application->icon)) {
$this->element('img', array('src' => $this->application->icon, $this->element('img', array('src' => $this->application->icon,
@ -176,7 +180,12 @@ class ShowApplicationAction extends OwnerDesignAction
$userCnt = $appUsers->count(); $userCnt = $appUsers->count();
$this->raw(sprintf( $this->raw(sprintf(
_('Created by %1$s - %2$s access by default - %3$d users'), // TRANS: Information output on an OAuth application page.
// TRANS: %1$s is the application creator, %2$s is "read-only" or "read-write",
// TRANS: %3$d is the number of users using the OAuth application.
_m('Created by %1$s - %2$s access by default - %3$d user',
'Created by %1$s - %2$s access by default - %3$d users',
$userCnt),
$profile->getBestName(), $profile->getBestName(),
$defaultAccess, $defaultAccess,
$userCnt $userCnt
@ -186,13 +195,15 @@ class ShowApplicationAction extends OwnerDesignAction
$this->elementEnd('div'); $this->elementEnd('div');
$this->elementStart('div', 'entity_actions'); $this->elementStart('div', 'entity_actions');
// TRANS: Header on the OAuth application page.
$this->element('h2', null, _('Application actions')); $this->element('h2', null, _('Application actions'));
$this->elementStart('ul'); $this->elementStart('ul');
$this->elementStart('li', 'entity_edit'); $this->elementStart('li', 'entity_edit');
$this->element('a', $this->element('a',
array('href' => common_local_url('editapplication', array('href' => common_local_url('editapplication',
array('id' => $this->application->id))), array('id' => $this->application->id))),
'Edit'); // TRANS: Link text to edit application on the OAuth application page.
_m('EDITAPP','Edit'));
$this->elementEnd('li'); $this->elementEnd('li');
$this->elementStart('li', 'entity_reset_keysecret'); $this->elementStart('li', 'entity_reset_keysecret');
@ -209,6 +220,8 @@ class ShowApplicationAction extends OwnerDesignAction
'id' => 'reset', 'id' => 'reset',
'name' => 'reset', 'name' => 'reset',
'class' => 'submit', 'class' => 'submit',
// TRANS: Button text on the OAuth application page.
// TRANS: Resets the OAuth consumer key and secret.
'value' => _('Reset key & secret'), 'value' => _('Reset key & secret'),
'onClick' => 'return confirmReset()')); 'onClick' => 'return confirmReset()'));
$this->elementEnd('fieldset'); $this->elementEnd('fieldset');
@ -225,7 +238,8 @@ class ShowApplicationAction extends OwnerDesignAction
$this->elementStart('fieldset'); $this->elementStart('fieldset');
$this->hidden('token', common_session_token()); $this->hidden('token', common_session_token());
$this->submit('delete', _('Delete')); // TRANS: Submit button text the OAuth application page to delete an application.
$this->submit('delete', _m('BUTTON','Delete'));
$this->elementEnd('fieldset'); $this->elementEnd('fieldset');
$this->elementEnd('form'); $this->elementEnd('form');
$this->elementEnd('li'); $this->elementEnd('li');
@ -234,6 +248,7 @@ class ShowApplicationAction extends OwnerDesignAction
$this->elementEnd('div'); $this->elementEnd('div');
$this->elementStart('div', 'entity_data'); $this->elementStart('div', 'entity_data');
// TRANS: Header on the OAuth application page.
$this->element('h2', null, _('Application info')); $this->element('h2', null, _('Application info'));
$this->element('div', $this->element('div',
'entity_consumer_key', 'entity_consumer_key',
@ -252,7 +267,8 @@ class ShowApplicationAction extends OwnerDesignAction
$this->element('div', 'entity_authorize_url', common_local_url('ApiOauthAuthorize')); $this->element('div', 'entity_authorize_url', common_local_url('ApiOauthAuthorize'));
$this->element('p', 'note', $this->element('p', 'note',
_('Note: We support HMAC-SHA1 signatures. We do not support the plaintext signature method.')); // TRANS: Note on the OAuth application page about signature support.
_('Note: HMAC-SHA1 signatures are supported. The plaintext signature method is not supported.'));
$this->elementEnd('div'); $this->elementEnd('div');
$this->elementStart('p', array('id' => 'application_action')); $this->elementStart('p', array('id' => 'application_action'));
@ -272,6 +288,7 @@ class ShowApplicationAction extends OwnerDesignAction
{ {
parent::showScripts(); parent::showScripts();
// TRANS: Text in confirmation dialog to reset consumer key and secret for an OAuth application.
$msg = _('Are you sure you want to reset your consumer key and secret?'); $msg = _('Are you sure you want to reset your consumer key and secret?');
$js = 'function confirmReset() { '; $js = 'function confirmReset() { ';

View File

@ -324,6 +324,8 @@ class ShowgroupAction extends GroupDesignAction
$this->element('h2', null, _('Statistics')); $this->element('h2', null, _('Statistics'));
$this->elementStart('dl'); $this->elementStart('dl');
// TRANS: Label for group creation date.
$this->element('dt', null, _m('LABEL','Created')); $this->element('dt', null, _m('LABEL','Created'));
$this->element('dd', 'entity_created', date('j M Y', $this->element('dd', 'entity_created', date('j M Y',
strtotime($this->group->created))); strtotime($this->group->created)));
@ -382,8 +384,8 @@ class GroupAdminSection extends ProfileSection
function title() function title()
{ {
// TRANS: Header for list of group administrators on a group page (h2). // TRANS: Title for list of group administrators on a group page.
return _('Admins'); return _m('TITLE','Admins');
} }
function divId() function divId()