* update translator documentation.

* remove superfluous whitespace.
* L10n updates.
* small refactoring in publicrss.php.
* remove PHP4-isms
This commit is contained in:
Siebrand Mazeland 2011-02-17 20:58:22 +01:00
parent 3e7e6138a8
commit 65045a26f3
11 changed files with 45 additions and 34 deletions

View File

@ -66,6 +66,7 @@ class LogoutAction extends Action
{ {
parent::handle($args); parent::handle($args);
if (!common_logged_in()) { if (!common_logged_in()) {
// TRANS: Client error displayed trying to log out when not logged in.
$this->clientError(_('Not logged in.')); $this->clientError(_('Not logged in.'));
} else { } else {
if (Event::handle('StartLogout', array($this))) { if (Event::handle('StartLogout', array($this))) {
@ -83,5 +84,4 @@ class LogoutAction extends Action
common_real_login(false); // not logged in common_real_login(false); // not logged in
common_forgetme(); // don't log back in! common_forgetme(); // don't log back in!
} }
} }

View File

@ -48,7 +48,6 @@ require_once INSTALLDIR.'/lib/searchaction.php';
*/ */
class NoticesearchAction extends SearchAction class NoticesearchAction extends SearchAction
{ {
function prepare($args) function prepare($args)
{ {
parent::prepare($args); parent::prepare($args);
@ -65,6 +64,8 @@ class NoticesearchAction extends SearchAction
*/ */
function getInstructions() function getInstructions()
{ {
// TRANS: Instructions for Notice search page.
// TRANS: %%site.name%% is the name of the StatusNet site.
return _('Search for notices on %%site.name%% by their contents. Separate search terms by spaces; they must be 3 characters or more.'); return _('Search for notices on %%site.name%% by their contents. Separate search terms by spaces; they must be 3 characters or more.');
} }
@ -75,6 +76,7 @@ class NoticesearchAction extends SearchAction
*/ */
function title() function title()
{ {
// TRANS: Title of the page where users can search for notices.
return _('Text search'); return _('Text search');
} }
@ -88,6 +90,8 @@ class NoticesearchAction extends SearchAction
return array(new Feed(Feed::RSS1, common_local_url('noticesearchrss', return array(new Feed(Feed::RSS1, common_local_url('noticesearchrss',
array('q' => $q)), array('q' => $q)),
// TRANS: Test in RSS notice search.
// TRANS: %1$s is the query, %2$s is the StatusNet site name.
sprintf(_('Search results for "%1$s" on %2$s'), sprintf(_('Search results for "%1$s" on %2$s'),
$q, common_config('site', 'name')))); $q, common_config('site', 'name'))));
} }
@ -114,13 +118,18 @@ class NoticesearchAction extends SearchAction
$cnt = $notice->find(); $cnt = $notice->find();
} }
if ($cnt === 0) { if ($cnt === 0) {
// TRANS: Text for notice search results is the query had no results.
$this->element('p', 'error', _('No results.')); $this->element('p', 'error', _('No results.'));
$this->searchSuggestions($q); $this->searchSuggestions($q);
if (common_logged_in()) { if (common_logged_in()) {
// TRANS: Text for logged in users making a query for notices without results.
// TRANS: This message contains a Markdown link.
$message = sprintf(_('Be the first to [post on this topic](%%%%action.newnotice%%%%?status_textarea=%s)!'), urlencode($q)); $message = sprintf(_('Be the first to [post on this topic](%%%%action.newnotice%%%%?status_textarea=%s)!'), urlencode($q));
} }
else { else {
// TRANS: Text for not logged in users making a query for notices without results.
// TRANS: This message contains Markdown links.
$message = sprintf(_('Why not [register an account](%%%%action.register%%%%) and be the first to [post on this topic](%%%%action.newnotice%%%%?status_textarea=%s)!'), urlencode($q)); $message = sprintf(_('Why not [register an account](%%%%action.register%%%%) and be the first to [post on this topic](%%%%action.newnotice%%%%?status_textarea=%s)!'), urlencode($q));
} }
@ -203,4 +212,3 @@ class SearchNoticeListItem extends NoticeListItem {
return $result; return $result;
} }
} }

View File

@ -48,7 +48,6 @@ require_once INSTALLDIR.'/lib/rssaction.php';
*/ */
class NoticesearchrssAction extends Rss10Action class NoticesearchrssAction extends Rss10Action
{ {
function init() function init()
{ {
return true; return true;
@ -63,7 +62,6 @@ class NoticesearchrssAction extends Rss10Action
function getNotices($limit=0) function getNotices($limit=0)
{ {
$q = $this->trimmed('q'); $q = $this->trimmed('q');
$notices = array(); $notices = array();
@ -93,9 +91,12 @@ class NoticesearchrssAction extends Rss10Action
{ {
$q = $this->trimmed('q'); $q = $this->trimmed('q');
$c = array('url' => common_local_url('noticesearchrss', array('q' => $q)), $c = array('url' => common_local_url('noticesearchrss', array('q' => $q)),
// TRANS: RSS notice search feed title. %s is the query.
'title' => sprintf(_('Updates with "%s"'), $q), 'title' => sprintf(_('Updates with "%s"'), $q),
'link' => common_local_url('noticesearch', array('q' => $q)), 'link' => common_local_url('noticesearch', array('q' => $q)),
'description' => sprintf(_('Updates matching search term "%1$s" on %2$s!'), // TRANS: RSS notice search feed description.
// TRANS: %1$s is the query, %2$s is the StatusNet site name.
'description' => sprintf(_('Updates matching search term "%1$s" on %2$s.'),
$q, common_config('site', 'name'))); $q, common_config('site', 'name')));
return $c; return $c;
} }

View File

@ -1,5 +1,4 @@
<?php <?php
/** /**
* Opensearch action class. * Opensearch action class.
* *
@ -61,8 +60,10 @@ class OpensearchAction extends Action
$short_name = ''; $short_name = '';
if ($type == 'people') { if ($type == 'people') {
$type = 'peoplesearch'; $type = 'peoplesearch';
// TRANS: ShortName in the OpenSearch interface when trying to find users.
$short_name = _('People Search'); $short_name = _('People Search');
} else { } else {
// TRANS: ShortName in the OpenSearch interface when trying to find notices.
$type = 'noticesearch'; $type = 'noticesearch';
$short_name = _('Notice Search'); $short_name = _('Notice Search');
} }
@ -89,4 +90,3 @@ class OpensearchAction extends Action
return true; return true;
} }
} }

View File

@ -49,12 +49,15 @@ class PeoplesearchAction extends SearchAction
{ {
function getInstructions() function getInstructions()
{ {
// TRANS: Instructions for the "People search" page.
// TRANS: %%site.name%% is the name of the StatusNet site.
return _('Search for people on %%site.name%% by their name, location, or interests. ' . return _('Search for people on %%site.name%% by their name, location, or interests. ' .
'Separate the terms by spaces; they must be 3 characters or more.'); 'Separate the terms by spaces; they must be 3 characters or more.');
} }
function title() function title()
{ {
// TRANS: Title of a page where users can search for other users.
return _('People search'); return _('People search');
} }
@ -80,6 +83,7 @@ class PeoplesearchAction extends SearchAction
$page, 'peoplesearch', array('q' => $q)); $page, 'peoplesearch', array('q' => $q));
} else { } else {
// TRANS: Message on the "People search" page where a query has no results.
$this->element('p', 'error', _('No results.')); $this->element('p', 'error', _('No results.'));
$this->searchSuggestions($q); $this->searchSuggestions($q);
$profile->free(); $profile->free();
@ -136,4 +140,3 @@ class PeopleSearchResultItem extends ProfileListItem
return preg_replace($this->pattern, '<strong>\\1</strong>', htmlspecialchars($text)); return preg_replace($this->pattern, '<strong>\\1</strong>', htmlspecialchars($text));
} }
} }

View File

@ -1,5 +1,4 @@
<?php <?php
/** /**
* Public RSS action class. * Public RSS action class.
* *
@ -55,7 +54,6 @@ class PublicrssAction extends Rss10Action
* @param array $args Arguments from $_REQUEST * @param array $args Arguments from $_REQUEST
* @return boolean success * @return boolean success
*/ */
function prepare($args) function prepare($args)
{ {
parent::prepare($args); parent::prepare($args);
@ -98,11 +96,14 @@ class PublicrssAction extends Rss10Action
*/ */
function getChannel() function getChannel()
{ {
$sitename = common_config('site', 'name');
$c = array( $c = array(
'url' => common_local_url('publicrss') 'url' => common_local_url('publicrss'),
, 'title' => sprintf(_('%s public timeline'), common_config('site', 'name')) // TRANS: Public RSS feed title. %s is the StatusNet site name.
, 'link' => common_local_url('public') 'title' => sprintf(_('%s public timeline'), $sitename),
, 'description' => sprintf(_('%s updates from everyone!'), common_config('site', 'name'))); 'link' => common_local_url('public'),
// TRANS: Public RSS feed description. %s is the StatusNet site name.
'description' => sprintf(_('%s updates from everyone.'), $sitename));
return $c; return $c;
} }
@ -121,4 +122,3 @@ class PublicrssAction extends Rss10Action
return true; return true;
} }
} }

View File

@ -25,7 +25,6 @@ require_once(INSTALLDIR.'/lib/rssaction.php');
class RepliesrssAction extends Rss10Action class RepliesrssAction extends Rss10Action
{ {
var $user = null; var $user = null;
function prepare($args) function prepare($args)
@ -35,6 +34,7 @@ class RepliesrssAction extends Rss10Action
$this->user = User::staticGet('nickname', $nickname); $this->user = User::staticGet('nickname', $nickname);
if (!$this->user) { if (!$this->user) {
// TRANS: Client error displayed when providing a non-existing nickname in a RSS 1.0 action.
$this->clientError(_('No such user.')); $this->clientError(_('No such user.'));
return false; return false;
} else { } else {
@ -45,7 +45,6 @@ class RepliesrssAction extends Rss10Action
function getNotices($limit=0) function getNotices($limit=0)
{ {
$user = $this->user; $user = $this->user;
$notice = $user->getReplies(0, ($limit == 0) ? 48 : $limit); $notice = $user->getReplies(0, ($limit == 0) ? 48 : $limit);
@ -65,11 +64,14 @@ class RepliesrssAction extends Rss10Action
$c = array('url' => common_local_url('repliesrss', $c = array('url' => common_local_url('repliesrss',
array('nickname' => array('nickname' =>
$user->nickname)), $user->nickname)),
// TRANS: RSS reply feed title. %s is a user nickname.
'title' => sprintf(_("Replies to %s"), $user->nickname), 'title' => sprintf(_("Replies to %s"), $user->nickname),
'link' => common_local_url('replies', 'link' => common_local_url('replies',
array('nickname' => array('nickname' =>
$user->nickname)), $user->nickname)),
'description' => sprintf(_('Replies to %1$s on %2$s!'), // TRANS: RSS reply feed description.
// TRANS: %1$s is a user nickname, %2$s is the StatusNet site name.
'description' => sprintf(_('Replies to %1$s on %2$s.'),
$user->nickname, common_config('site', 'name'))); $user->nickname, common_config('site', 'name')));
return $c; return $c;
} }

View File

@ -1,5 +1,4 @@
<?php <?php
/** /**
* Request token action class. * Request token action class.
* *
@ -77,4 +76,3 @@ class RequesttokenAction extends Action
} }
} }
} }
?>

View File

@ -42,7 +42,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
* @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 UnblockAction extends ProfileFormAction class UnblockAction extends ProfileFormAction
{ {
function prepare($args) function prepare($args)
@ -56,6 +55,7 @@ class UnblockAction extends ProfileFormAction
assert(!empty($cur)); // checked by parent assert(!empty($cur)); // checked by parent
if (!$cur->hasBlocked($this->profile)) { if (!$cur->hasBlocked($this->profile)) {
// TRANS: Client error displayed when trying to unblock a non-blocked user.
$this->clientError(_("You haven't blocked that user.")); $this->clientError(_("You haven't blocked that user."));
return false; return false;
} }
@ -68,7 +68,6 @@ class UnblockAction extends ProfileFormAction
* *
* @return void * @return void
*/ */
function handlePost() function handlePost()
{ {
$cur = common_current_user(); $cur = common_current_user();
@ -83,6 +82,7 @@ class UnblockAction extends ProfileFormAction
} }
if (!$result) { if (!$result) {
// TRANS: Server error displayed when removing a user block.
$this->serverError(_('Error removing the block.')); $this->serverError(_('Error removing the block.'));
return; return;
} }

View File

@ -1,5 +1,4 @@
<?php <?php
/** /**
* User by ID action class. * User by ID action class.
* *
@ -67,10 +66,12 @@ class UserbyidAction extends Action
parent::handle($args); parent::handle($args);
$id = $this->trimmed('id'); $id = $this->trimmed('id');
if (!$id) { if (!$id) {
// TRANS: Client error displayed trying to find a user by ID without providing an ID.
$this->clientError(_('No ID.')); $this->clientError(_('No ID.'));
} }
$user = User::staticGet($id); $user = User::staticGet($id);
if (!$user) { if (!$user) {
// TRANS: Client error displayed trying to find a user by ID for a non-existing ID.
$this->clientError(_('No such user.')); $this->clientError(_('No such user.'));
} }

View File

@ -1,5 +1,4 @@
<?php <?php
/** /**
* XRDS for OpenMicroBlogging * XRDS for OpenMicroBlogging
* *
@ -68,6 +67,7 @@ class XrdsAction extends Action
$nickname = $this->trimmed('nickname'); $nickname = $this->trimmed('nickname');
$this->user = User::staticGet('nickname', $nickname); $this->user = User::staticGet('nickname', $nickname);
if (!$this->user) { if (!$this->user) {
// TRANS: Client error displayed providing a non-existing nickname.
$this->clientError(_('No such user.')); $this->clientError(_('No such user.'));
return; return;
} }
@ -135,7 +135,5 @@ class XrdsAction extends Action
$xrdsOutputter->elementEnd('XRD'); $xrdsOutputter->elementEnd('XRD');
$xrdsOutputter->endXRDS(); $xrdsOutputter->endXRDS();
} }
} }
?>