* translator documentation updated.

* superfluous whitespace removed.
* small refactoring in noticeform.php to allow proper translator hints.
This commit is contained in:
Siebrand Mazeland 2011-03-05 00:24:19 +01:00
parent b37e12ed34
commit a127ba78a8
2 changed files with 15 additions and 22 deletions

View File

@ -47,13 +47,11 @@ require_once INSTALLDIR . '/lib/mediafile.php';
* @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 NewnoticeAction extends Action class NewnoticeAction extends Action
{ {
/** /**
* Error message, if any * Error message, if any
*/ */
var $msg = null; var $msg = null;
/** /**
@ -63,7 +61,6 @@ class NewnoticeAction extends Action
* *
* @return string page title * @return string page title
*/ */
function title() function title()
{ {
// TRANS: Page title for sending a new notice. // TRANS: Page title for sending a new notice.
@ -129,7 +126,6 @@ class NewnoticeAction extends Action
* *
* @return void * @return void
*/ */
function saveNewNotice() function saveNewNotice()
{ {
$user = common_current_user(); $user = common_current_user();
@ -260,7 +256,6 @@ class NewnoticeAction extends Action
* *
* @return void * @return void
*/ */
function ajaxErrorMsg($msg) function ajaxErrorMsg($msg)
{ {
$this->startHTML('text/xml;charset=utf-8', true); $this->startHTML('text/xml;charset=utf-8', true);
@ -283,7 +278,6 @@ class NewnoticeAction extends Action
* *
* @return void * @return void
*/ */
function ajaxShowForm() function ajaxShowForm()
{ {
$this->startHTML('text/xml;charset=utf-8', true); $this->startHTML('text/xml;charset=utf-8', true);
@ -313,7 +307,6 @@ class NewnoticeAction extends Action
* *
* @return void * @return void
*/ */
function showForm($msg=null) function showForm($msg=null)
{ {
if ($this->boolean('ajax')) { if ($this->boolean('ajax')) {
@ -336,7 +329,6 @@ class NewnoticeAction extends Action
* *
* @return void * @return void
*/ */
function showNoticeForm() function showNoticeForm()
{ {
$content = $this->trimmed('status_textarea'); $content = $this->trimmed('status_textarea');
@ -365,7 +357,6 @@ class NewnoticeAction extends Action
* *
* @todo maybe show some instructions? * @todo maybe show some instructions?
*/ */
function showPageNotice() function showPageNotice()
{ {
if ($this->msg) { if ($this->msg) {
@ -382,7 +373,6 @@ class NewnoticeAction extends Action
* *
* @return void * @return void
*/ */
function showNotice($notice) function showNotice($notice)
{ {
$nli = new NoticeListItem($notice, $this); $nli = new NoticeListItem($notice, $this);

View File

@ -48,31 +48,26 @@ require_once INSTALLDIR.'/lib/form.php';
* *
* @see HTMLOutputter * @see HTMLOutputter
*/ */
class NoticeForm extends Form class NoticeForm extends Form
{ {
/** /**
* Current action, used for returning to this page. * Current action, used for returning to this page.
*/ */
var $action = null; var $action = null;
/** /**
* Pre-filled content of the form * Pre-filled content of the form
*/ */
var $content = null; var $content = null;
/** /**
* The current user * The current user
*/ */
var $user = null; var $user = null;
/** /**
* The notice being replied to * The notice being replied to
*/ */
var $inreplyto = null; var $inreplyto = null;
/** /**
@ -91,7 +86,6 @@ class NoticeForm extends Form
* @param string $action action to return to, if any * @param string $action action to return to, if any
* @param string $content content to pre-fill * @param string $content content to pre-fill
*/ */
function __construct($out=null, $action=null, $content=null, $user=null, $inreplyto=null, $lat=null, $lon=null, $location_id=null, $location_ns=null) function __construct($out=null, $action=null, $content=null, $user=null, $inreplyto=null, $lat=null, $lon=null, $location_id=null, $location_ns=null)
{ {
$this->id_suffix = time(); $this->id_suffix = time();
@ -159,6 +153,7 @@ class NoticeForm extends Form
*/ */
function formLegend() function formLegend()
{ {
// TRANS: Form legend for notice form.
$this->out->element('legend', null, _('Send a notice')); $this->out->element('legend', null, _('Send a notice'));
} }
@ -167,12 +162,12 @@ class NoticeForm extends Form
* *
* @return void * @return void
*/ */
function formData() function formData()
{ {
if (Event::handle('StartShowNoticeFormData', array($this))) { if (Event::handle('StartShowNoticeFormData', array($this))) {
$this->out->element('label', array('for' => 'notice_data-text', $this->out->element('label', array('for' => 'notice_data-text',
'id' => 'notice_data-text-label'), 'id' => 'notice_data-text-label'),
// TRANS: Title for notice label. %s is the user's nickname.
sprintf(_('What\'s up, %s?'), $this->user->nickname)); sprintf(_('What\'s up, %s?'), $this->user->nickname));
// XXX: vary by defined max size // XXX: vary by defined max size
$this->out->element('textarea', array('id' => 'notice_data-text', $this->out->element('textarea', array('id' => 'notice_data-text',
@ -184,18 +179,20 @@ class NoticeForm extends Form
$contentLimit = Notice::maxContent(); $contentLimit = Notice::maxContent();
if ($contentLimit > 0) { if ($contentLimit > 0) {
$this->out->element('span', $this->out->element('span',
array('class' => 'count'), array('class' => 'count'),
$contentLimit); $contentLimit);
} }
if (common_config('attachments', 'uploads')) { if (common_config('attachments', 'uploads')) {
$this->out->hidden('MAX_FILE_SIZE', common_config('attachments', 'file_quota')); $this->out->hidden('MAX_FILE_SIZE', common_config('attachments', 'file_quota'));
// TRANS: Input label in notice form for adding an attachment.
$this->out->element('label', array('for' => 'notice_data-attach'),_('Attach')); $this->out->element('label', array('for' => 'notice_data-attach'),_('Attach'));
$this->out->element('input', array('id' => 'notice_data-attach', $this->out->element('input', array('id' => 'notice_data-attach',
'type' => 'file', 'type' => 'file',
'name' => 'attach', 'name' => 'attach',
'title' => _('Attach a file'))); // TRANS: Title for input field to attach a file to a notice.
'title' => _('Attach a file.')));
} }
if ($this->action) { if ($this->action) {
$this->out->hidden('notice_return-to', $this->action, 'returnto'); $this->out->hidden('notice_return-to', $this->action, 'returnto');
@ -223,12 +220,17 @@ class NoticeForm extends Form
$this->out->text(' '); $this->out->text(' ');
$this->out->element('label', array('class' => 'notice_data-geo', $this->out->element('label', array('class' => 'notice_data-geo',
'for' => $this->id() . '-notice_data-geo'), 'for' => $this->id() . '-notice_data-geo'),
// TRANS: Field label to add location to a notice.
_('Share my location')); _('Share my location'));
$this->out->elementEnd('div'); $this->out->elementEnd('div');
// TRANS: Text to not share location for a notice in notice form.
$share_disable_text = _('Do not share my location');
// TRANS: Timeout error text for location retrieval in notice form.
$error_timeout_text = _('Sorry, retrieving your geo location is taking longer than expected, please try again later');
$this->out->inlineScript(' var NoticeDataGeo_text = {'. $this->out->inlineScript(' var NoticeDataGeo_text = {'.
'ShareDisable: ' .json_encode(_('Do not share my location')).','. 'ShareDisable: ' .json_encode($share_disable_text).','.
'ErrorTimeout: ' .json_encode(_('Sorry, retrieving your geo location is taking longer than expected, please try again later')). 'ErrorTimeout: ' .json_encode($error_timeout_text).
'}'); '}');
} }
@ -248,6 +250,7 @@ class NoticeForm extends Form
'class' => 'submit', 'class' => 'submit',
'name' => 'status_submit', 'name' => 'status_submit',
'type' => 'submit', 'type' => 'submit',
'value' => _m('Send button for sending notice', 'Send'))); // TRANS: Button text for sending notice.
'value' => _m('BUTTON', 'Send')));
} }
} }