* i18n review

* onPluginVersion
This commit is contained in:
Siebrand Mazeland 2010-10-01 22:01:18 +02:00
parent 267d7b6bff
commit f415e2353d
2 changed files with 27 additions and 4 deletions

View File

@ -76,4 +76,28 @@ class GroupFavoritedPlugin extends Plugin
$action_name == 'groupfavorited', $action_name == 'groupfavorited',
'nav_group_group'); 'nav_group_group');
} }
/**
* Provide plugin version information.
*
* This data is used when showing the version page.
*
* @param array &$versions array of version data arrays; see EVENTS.txt
*
* @return boolean hook value
*/
function onPluginVersion(&$versions)
{
$url = 'http://status.net/wiki/Plugin:GroupFavorited';
$versions[] = array('name' => 'GroupFavorited',
'version' => STATUSNET_VERSION,
'author' => 'Brion Vibber',
'homepage' => $url,
'rawdescription' =>
// TRANS: Plugin description.
_m('This plugin adds a menu item for popular notices in groups.'));
return true;
}
} }

View File

@ -32,27 +32,27 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
exit(1); exit(1);
} }
class GroupFavoritedAction extends ShowgroupAction class GroupFavoritedAction extends ShowgroupAction
{ {
/** /**
* Title of the page * Title of the page
* *
* @return string page title, with page number * @return string page title, with page number
*/ */
function title() function title()
{ {
if (!empty($this->group->fullname)) { if (!empty($this->group->fullname)) {
// @todo Create a core method to create this properly. i18n issue.
$base = $this->group->fullname . ' (' . $this->group->nickname . ')'; $base = $this->group->fullname . ' (' . $this->group->nickname . ')';
} else { } else {
$base = $this->group->nickname; $base = $this->group->nickname;
} }
if ($this->page == 1) { if ($this->page == 1) {
// TRANS: %s is a group name.
return sprintf(_m('Popular posts in %s group'), $base); return sprintf(_m('Popular posts in %s group'), $base);
} else { } else {
// TRANS: %1$s is a group name, %2$s is a group number.
return sprintf(_m('Popular posts in %1$s group, page %2$d'), return sprintf(_m('Popular posts in %1$s group, page %2$d'),
$base, $base,
$this->page); $this->page);
@ -66,7 +66,6 @@ class GroupFavoritedAction extends ShowgroupAction
* *
* @return void * @return void
*/ */
function showContent() function showContent()
{ {
$groupId = intval($this->group->id); $groupId = intval($this->group->id);