Commit 67f97194 authored by Siebrand Mazeland's avatar Siebrand Mazeland

i18n/L10n review, plugin credits added.

parent 458512aa
...@@ -44,7 +44,6 @@ if (!defined('STATUSNET')) { ...@@ -44,7 +44,6 @@ if (!defined('STATUSNET')) {
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
* @link http://status.net/ * @link http://status.net/
*/ */
class SitemapPlugin extends Plugin class SitemapPlugin extends Plugin
{ {
const USERS_PER_MAP = 50000; const USERS_PER_MAP = 50000;
...@@ -57,7 +56,6 @@ class SitemapPlugin extends Plugin ...@@ -57,7 +56,6 @@ class SitemapPlugin extends Plugin
* *
* @return boolean hook value; true means continue processing, false means stop. * @return boolean hook value; true means continue processing, false means stop.
*/ */
function onAutoload($cls) function onAutoload($cls)
{ {
$dir = dirname(__FILE__); $dir = dirname(__FILE__);
...@@ -89,7 +87,6 @@ class SitemapPlugin extends Plugin ...@@ -89,7 +87,6 @@ class SitemapPlugin extends Plugin
* *
* @return boolean hook value. * @return boolean hook value.
*/ */
function onEndRobotsTxt($action) function onEndRobotsTxt($action)
{ {
$url = common_local_url('sitemapindex'); $url = common_local_url('sitemapindex');
...@@ -106,7 +103,6 @@ class SitemapPlugin extends Plugin ...@@ -106,7 +103,6 @@ class SitemapPlugin extends Plugin
* *
* @return boolean hook value; true means continue processing, false means stop. * @return boolean hook value; true means continue processing, false means stop.
*/ */
function onRouterInitialized($m) function onRouterInitialized($m)
{ {
$m->connect('sitemapindex.xml', $m->connect('sitemapindex.xml',
...@@ -142,7 +138,6 @@ class SitemapPlugin extends Plugin ...@@ -142,7 +138,6 @@ class SitemapPlugin extends Plugin
* *
* @return boolean hook value. * @return boolean hook value.
*/ */
function onStartShowHeadElements($action) function onStartShowHeadElements($action)
{ {
$actionName = $action->trimmed('action'); $actionName = $action->trimmed('action');
...@@ -181,7 +176,6 @@ class SitemapPlugin extends Plugin ...@@ -181,7 +176,6 @@ class SitemapPlugin extends Plugin
* *
* @return boolean hook value; true means continue processing, false means stop. * @return boolean hook value; true means continue processing, false means stop.
*/ */
function onCheckSchema() function onCheckSchema()
{ {
$schema = Schema::get(); $schema = Schema::get();
...@@ -214,11 +208,35 @@ class SitemapPlugin extends Plugin ...@@ -214,11 +208,35 @@ class SitemapPlugin extends Plugin
function onEndAdminPanelNav($menu) { function onEndAdminPanelNav($menu) {
if (AdminPanelAction::canAdmin('sitemap')) { if (AdminPanelAction::canAdmin('sitemap')) {
// TRANS: Menu item title/tooltip // TRANS: Menu item title/tooltip
$menu_title = _('Sitemap configuration'); $menu_title = _m('Sitemap configuration');
// TRANS: Menu item for site administration // TRANS: Menu item for site administration
$menu->out->menuItem(common_local_url('sitemapadminpanel'), _('Sitemap'), $menu->out->menuItem(common_local_url('sitemapadminpanel'), _m('MENU','Sitemap'),
$menu_title, $action_name == 'sitemapadminpanel', 'nav_sitemap_admin_panel'); $menu_title, $action_name == 'sitemapadminpanel', 'nav_sitemap_admin_panel');
} }
return true; return true;
} }
/**
* 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:Sitemap';
$versions[] = array('name' => 'Sitemap',
'version' => STATUSNET_VERSION,
'author' => 'Evan Prodromou',
'homepage' => $url,
'rawdescription' =>
// TRANS: Plugin description.
_m('This plugin allows creation of sitemaps for Bing, Yahoo! and Google.'));
return true;
}
} }
...@@ -51,7 +51,6 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php'; ...@@ -51,7 +51,6 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php';
* *
* @see DB_DataObject * @see DB_DataObject
*/ */
class Sitemap_notice_count extends Memcached_DataObject class Sitemap_notice_count extends Memcached_DataObject
{ {
public $__table = 'sitemap_notice_count'; // table name public $__table = 'sitemap_notice_count'; // table name
...@@ -72,7 +71,6 @@ class Sitemap_notice_count extends Memcached_DataObject ...@@ -72,7 +71,6 @@ class Sitemap_notice_count extends Memcached_DataObject
* @return Sitemap_notice_count object found, or null for no hits * @return Sitemap_notice_count object found, or null for no hits
* *
*/ */
function staticGet($k, $v=null) function staticGet($k, $v=null)
{ {
return Memcached_DataObject::staticGet('Sitemap_notice_count', $k, $v); return Memcached_DataObject::staticGet('Sitemap_notice_count', $k, $v);
...@@ -86,7 +84,6 @@ class Sitemap_notice_count extends Memcached_DataObject ...@@ -86,7 +84,6 @@ class Sitemap_notice_count extends Memcached_DataObject
* *
* @return array array of column definitions * @return array array of column definitions
*/ */
function table() function table()
{ {
return array('notice_date' => DB_DATAOBJECT_DATE + DB_DATAOBJECT_NOTNULL, return array('notice_date' => DB_DATAOBJECT_DATE + DB_DATAOBJECT_NOTNULL,
...@@ -103,7 +100,6 @@ class Sitemap_notice_count extends Memcached_DataObject ...@@ -103,7 +100,6 @@ class Sitemap_notice_count extends Memcached_DataObject
* *
* @return array key definitions * @return array key definitions
*/ */
function keys() function keys()
{ {
return array('notice_date' => 'K'); return array('notice_date' => 'K');
...@@ -117,7 +113,6 @@ class Sitemap_notice_count extends Memcached_DataObject ...@@ -117,7 +113,6 @@ class Sitemap_notice_count extends Memcached_DataObject
* *
* @return array key definitions * @return array key definitions
*/ */
function keyTypes() function keyTypes()
{ {
return $this->keys(); return $this->keys();
...@@ -128,7 +123,6 @@ class Sitemap_notice_count extends Memcached_DataObject ...@@ -128,7 +123,6 @@ class Sitemap_notice_count extends Memcached_DataObject
$noticeCounts = self::cacheGet('sitemap:notice:counts'); $noticeCounts = self::cacheGet('sitemap:notice:counts');
if ($noticeCounts === false) { if ($noticeCounts === false) {
$snc = new Sitemap_notice_count(); $snc = new Sitemap_notice_count();
$snc->orderBy('notice_date DESC'); $snc->orderBy('notice_date DESC');
...@@ -236,7 +230,8 @@ class Sitemap_notice_count extends Memcached_DataObject ...@@ -236,7 +230,8 @@ class Sitemap_notice_count extends Memcached_DataObject
$snc = Sitemap_notice_count::staticGet('notice_date', DB_DataObject_Cast::date($d)); $snc = Sitemap_notice_count::staticGet('notice_date', DB_DataObject_Cast::date($d));
if (empty($snc)) { if (empty($snc)) {
throw new Exception("No such registration date: $d"); // TRANS: Exception
throw new Exception(_m("No such registration date: $d."));
} }
$orig = clone($snc); $orig = clone($snc);
......
...@@ -47,7 +47,6 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php'; ...@@ -47,7 +47,6 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php';
* *
* @see DB_DataObject * @see DB_DataObject
*/ */
class Sitemap_user_count extends Memcached_DataObject class Sitemap_user_count extends Memcached_DataObject
{ {
public $__table = 'sitemap_user_count'; // table name public $__table = 'sitemap_user_count'; // table name
...@@ -68,7 +67,6 @@ class Sitemap_user_count extends Memcached_DataObject ...@@ -68,7 +67,6 @@ class Sitemap_user_count extends Memcached_DataObject
* @return Sitemap_user_count object found, or null for no hits * @return Sitemap_user_count object found, or null for no hits
* *
*/ */
function staticGet($k, $v=null) function staticGet($k, $v=null)
{ {
return Memcached_DataObject::staticGet('Sitemap_user_count', $k, $v); return Memcached_DataObject::staticGet('Sitemap_user_count', $k, $v);
...@@ -82,7 +80,6 @@ class Sitemap_user_count extends Memcached_DataObject ...@@ -82,7 +80,6 @@ class Sitemap_user_count extends Memcached_DataObject
* *
* @return array array of column definitions * @return array array of column definitions
*/ */
function table() function table()
{ {
return array('registration_date' => DB_DATAOBJECT_DATE + DB_DATAOBJECT_NOTNULL, return array('registration_date' => DB_DATAOBJECT_DATE + DB_DATAOBJECT_NOTNULL,
...@@ -118,7 +115,6 @@ class Sitemap_user_count extends Memcached_DataObject ...@@ -118,7 +115,6 @@ class Sitemap_user_count extends Memcached_DataObject
* *
* @return array key definitions * @return array key definitions
*/ */
function keyTypes() function keyTypes()
{ {
return $this->keys(); return $this->keys();
...@@ -235,7 +231,8 @@ class Sitemap_user_count extends Memcached_DataObject ...@@ -235,7 +231,8 @@ class Sitemap_user_count extends Memcached_DataObject
$suc = Sitemap_user_count::staticGet('registration_date', DB_DataObject_Cast::date($d)); $suc = Sitemap_user_count::staticGet('registration_date', DB_DataObject_Cast::date($d));
if (empty($suc)) { if (empty($suc)) {
throw new Exception("No such registration date: $d"); // TRANS: Exception thrown when a registration date cannot be found.
throw new Exception(_m("No such registration date: $d."));
} }
$orig = clone($suc); $orig = clone($suc);
......
...@@ -40,7 +40,6 @@ if (!defined('STATUSNET')) { ...@@ -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 NoticesitemapAction extends SitemapAction class NoticesitemapAction extends SitemapAction
{ {
var $notices = null; var $notices = null;
......
...@@ -40,7 +40,6 @@ if (!defined('STATUSNET')) { ...@@ -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 SitemapAction extends Action class SitemapAction extends Action
{ {
/** /**
...@@ -50,7 +49,6 @@ class SitemapAction extends Action ...@@ -50,7 +49,6 @@ class SitemapAction extends Action
* *
* @return void * @return void
*/ */
function handle($args) function handle($args)
{ {
parent::handle($args); parent::handle($args);
......
...@@ -40,7 +40,6 @@ if (!defined('STATUSNET')) { ...@@ -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 SitemapadminpanelAction extends AdminPanelAction class SitemapadminpanelAction extends AdminPanelAction
{ {
/** /**
...@@ -48,10 +47,10 @@ class SitemapadminpanelAction extends AdminPanelAction ...@@ -48,10 +47,10 @@ class SitemapadminpanelAction extends AdminPanelAction
* *
* @return string page title * @return string page title
*/ */
function title() function title()
{ {
return _('Sitemap'); // TRANS: Title for sitemap.
return _m('Sitemap');
} }
/** /**
...@@ -59,10 +58,10 @@ class SitemapadminpanelAction extends AdminPanelAction ...@@ -59,10 +58,10 @@ class SitemapadminpanelAction extends AdminPanelAction
* *
* @return string instructions * @return string instructions
*/ */
function getInstructions() function getInstructions()
{ {
return _('Sitemap settings for this StatusNet site'); // TRANS: Instructions for sitemap.
return _m('Sitemap settings for this StatusNet site');
} }
/** /**
...@@ -70,7 +69,6 @@ class SitemapadminpanelAction extends AdminPanelAction ...@@ -70,7 +69,6 @@ class SitemapadminpanelAction extends AdminPanelAction
* *
* @return void * @return void
*/ */
function showForm() function showForm()
{ {
$form = new SitemapAdminPanelForm($this); $form = new SitemapAdminPanelForm($this);
...@@ -83,7 +81,6 @@ class SitemapadminpanelAction extends AdminPanelAction ...@@ -83,7 +81,6 @@ class SitemapadminpanelAction extends AdminPanelAction
* *
* @return void * @return void
*/ */
function saveSettings() function saveSettings()
{ {
static $settings = array('sitemap' => array('googlekey', 'yahookey', 'bingkey')); static $settings = array('sitemap' => array('googlekey', 'yahookey', 'bingkey'));
...@@ -97,7 +94,6 @@ class SitemapadminpanelAction extends AdminPanelAction ...@@ -97,7 +94,6 @@ class SitemapadminpanelAction extends AdminPanelAction
} }
// This throws an exception on validation errors // This throws an exception on validation errors
$this->validate($values); $this->validate($values);
// assert(all values are valid); // assert(all values are valid);
...@@ -125,7 +121,6 @@ class SitemapadminpanelAction extends AdminPanelAction ...@@ -125,7 +121,6 @@ class SitemapadminpanelAction extends AdminPanelAction
/** /**
* Form for the sitemap admin panel * Form for the sitemap admin panel
*/ */
class SitemapAdminPanelForm extends AdminForm class SitemapAdminPanelForm extends AdminForm
{ {
/** /**
...@@ -133,7 +128,6 @@ class SitemapAdminPanelForm extends AdminForm ...@@ -133,7 +128,6 @@ class SitemapAdminPanelForm extends AdminForm
* *
* @return int ID of the form * @return int ID of the form
*/ */
function id() function id()
{ {
return 'form_sitemap_admin_panel'; return 'form_sitemap_admin_panel';
...@@ -144,7 +138,6 @@ class SitemapAdminPanelForm extends AdminForm ...@@ -144,7 +138,6 @@ class SitemapAdminPanelForm extends AdminForm
* *
* @return string class of the form * @return string class of the form
*/ */
function formClass() function formClass()
{ {
return 'form_sitemap'; return 'form_sitemap';
...@@ -155,7 +148,6 @@ class SitemapAdminPanelForm extends AdminForm ...@@ -155,7 +148,6 @@ class SitemapAdminPanelForm extends AdminForm
* *
* @return string URL of the action * @return string URL of the action
*/ */
function action() function action()
{ {
return common_local_url('sitemapadminpanel'); return common_local_url('sitemapadminpanel');
...@@ -166,26 +158,31 @@ class SitemapAdminPanelForm extends AdminForm ...@@ -166,26 +158,31 @@ class SitemapAdminPanelForm extends AdminForm
* *
* @return void * @return void
*/ */
function formData() function formData()
{ {
$this->out->elementStart('ul', 'form_data'); $this->out->elementStart('ul', 'form_data');
$this->li(); $this->li();
$this->input('googlekey', $this->input('googlekey',
_('Google key'), // TRANS: Field label.
_('Google Webmaster Tools verification key'), _m('Google key'),
// TRANS: Title for field label.
_m('Google Webmaster Tools verification key.'),
'sitemap'); 'sitemap');
$this->unli(); $this->unli();
$this->li(); $this->li();
$this->input('yahookey', $this->input('yahookey',
_('Yahoo key'), // TRANS: Field label.
_('Yahoo! Site Explorer verification key'), _m('Yahoo key'),
// TRANS: Title for field label.
_m('Yahoo! Site Explorer verification key.'),
'sitemap'); 'sitemap');
$this->unli(); $this->unli();
$this->li(); $this->li();
$this->input('bingkey', $this->input('bingkey',
_('Bing key'), // TRANS: Field label.
_('Bing Webmaster Tools verification key'), _m('Bing key'),
// TRANS: Title for field label.
_m('Bing Webmaster Tools verification key.'),
'sitemap'); 'sitemap');
$this->unli(); $this->unli();
$this->out->elementEnd('ul'); $this->out->elementEnd('ul');
...@@ -196,9 +193,14 @@ class SitemapAdminPanelForm extends AdminForm ...@@ -196,9 +193,14 @@ class SitemapAdminPanelForm extends AdminForm
* *
* @return void * @return void
*/ */
function formActions() function formActions()
{ {
$this->out->submit('submit', _('Save'), 'submit', null, _('Save sitemap settings')); $this->out->submit('submit',
// TRANS: Submit button text to save sitemap settings.
_m('BUTTON','Save'),
'submit',
null,
// TRANS: Submit button title to save sitemap settings.
_m('Save sitemap settings.'));
} }
} }
...@@ -40,7 +40,6 @@ if (!defined('STATUSNET')) { ...@@ -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 SitemapindexAction extends Action class SitemapindexAction extends Action
{ {
/** /**
...@@ -50,7 +49,6 @@ class SitemapindexAction extends Action ...@@ -50,7 +49,6 @@ class SitemapindexAction extends Action
* *
* @return void * @return void
*/ */
function handle($args) function handle($args)
{ {
header('Content-Type: text/xml; charset=UTF-8'); header('Content-Type: text/xml; charset=UTF-8');
......
...@@ -40,7 +40,6 @@ if (!defined('STATUSNET')) { ...@@ -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 UsersitemapAction extends SitemapAction class UsersitemapAction extends SitemapAction
{ {
var $users = null; var $users = null;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment