i18n/L10n review, plugin credits added.

This commit is contained in:
Siebrand Mazeland 2010-10-03 23:54:57 +02:00
parent 458512aafd
commit 67f97194e4
8 changed files with 53 additions and 47 deletions

View File

@ -44,7 +44,6 @@ if (!defined('STATUSNET')) {
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
* @link http://status.net/
*/
class SitemapPlugin extends Plugin
{
const USERS_PER_MAP = 50000;
@ -57,7 +56,6 @@ class SitemapPlugin extends Plugin
*
* @return boolean hook value; true means continue processing, false means stop.
*/
function onAutoload($cls)
{
$dir = dirname(__FILE__);
@ -89,7 +87,6 @@ class SitemapPlugin extends Plugin
*
* @return boolean hook value.
*/
function onEndRobotsTxt($action)
{
$url = common_local_url('sitemapindex');
@ -106,7 +103,6 @@ class SitemapPlugin extends Plugin
*
* @return boolean hook value; true means continue processing, false means stop.
*/
function onRouterInitialized($m)
{
$m->connect('sitemapindex.xml',
@ -142,7 +138,6 @@ class SitemapPlugin extends Plugin
*
* @return boolean hook value.
*/
function onStartShowHeadElements($action)
{
$actionName = $action->trimmed('action');
@ -181,7 +176,6 @@ class SitemapPlugin extends Plugin
*
* @return boolean hook value; true means continue processing, false means stop.
*/
function onCheckSchema()
{
$schema = Schema::get();
@ -214,11 +208,35 @@ class SitemapPlugin extends Plugin
function onEndAdminPanelNav($menu) {
if (AdminPanelAction::canAdmin('sitemap')) {
// TRANS: Menu item title/tooltip
$menu_title = _('Sitemap configuration');
$menu_title = _m('Sitemap configuration');
// 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');
}
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;
}
}

View File

@ -51,7 +51,6 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php';
*
* @see DB_DataObject
*/
class Sitemap_notice_count extends Memcached_DataObject
{
public $__table = 'sitemap_notice_count'; // table name
@ -72,7 +71,6 @@ class Sitemap_notice_count extends Memcached_DataObject
* @return Sitemap_notice_count object found, or null for no hits
*
*/
function staticGet($k, $v=null)
{
return Memcached_DataObject::staticGet('Sitemap_notice_count', $k, $v);
@ -86,7 +84,6 @@ class Sitemap_notice_count extends Memcached_DataObject
*
* @return array array of column definitions
*/
function table()
{
return array('notice_date' => DB_DATAOBJECT_DATE + DB_DATAOBJECT_NOTNULL,
@ -103,7 +100,6 @@ class Sitemap_notice_count extends Memcached_DataObject
*
* @return array key definitions
*/
function keys()
{
return array('notice_date' => 'K');
@ -117,7 +113,6 @@ class Sitemap_notice_count extends Memcached_DataObject
*
* @return array key definitions
*/
function keyTypes()
{
return $this->keys();
@ -128,7 +123,6 @@ class Sitemap_notice_count extends Memcached_DataObject
$noticeCounts = self::cacheGet('sitemap:notice:counts');
if ($noticeCounts === false) {
$snc = new Sitemap_notice_count();
$snc->orderBy('notice_date DESC');
@ -236,7 +230,8 @@ class Sitemap_notice_count extends Memcached_DataObject
$snc = Sitemap_notice_count::staticGet('notice_date', DB_DataObject_Cast::date($d));
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);

View File

@ -47,7 +47,6 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php';
*
* @see DB_DataObject
*/
class Sitemap_user_count extends Memcached_DataObject
{
public $__table = 'sitemap_user_count'; // table name
@ -68,7 +67,6 @@ class Sitemap_user_count extends Memcached_DataObject
* @return Sitemap_user_count object found, or null for no hits
*
*/
function staticGet($k, $v=null)
{
return Memcached_DataObject::staticGet('Sitemap_user_count', $k, $v);
@ -82,7 +80,6 @@ class Sitemap_user_count extends Memcached_DataObject
*
* @return array array of column definitions
*/
function table()
{
return array('registration_date' => DB_DATAOBJECT_DATE + DB_DATAOBJECT_NOTNULL,
@ -118,7 +115,6 @@ class Sitemap_user_count extends Memcached_DataObject
*
* @return array key definitions
*/
function keyTypes()
{
return $this->keys();
@ -235,7 +231,8 @@ class Sitemap_user_count extends Memcached_DataObject
$suc = Sitemap_user_count::staticGet('registration_date', DB_DataObject_Cast::date($d));
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);

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
* @link http://status.net/
*/
class NoticesitemapAction extends SitemapAction
{
var $notices = null;

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
* @link http://status.net/
*/
class SitemapAction extends Action
{
/**
@ -50,7 +49,6 @@ class SitemapAction extends Action
*
* @return void
*/
function handle($args)
{
parent::handle($args);

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
* @link http://status.net/
*/
class SitemapadminpanelAction extends AdminPanelAction
{
/**
@ -48,10 +47,10 @@ class SitemapadminpanelAction extends AdminPanelAction
*
* @return string page title
*/
function title()
{
return _('Sitemap');
// TRANS: Title for sitemap.
return _m('Sitemap');
}
/**
@ -59,10 +58,10 @@ class SitemapadminpanelAction extends AdminPanelAction
*
* @return string instructions
*/
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
*
* @return void
*/
function showForm()
{
$form = new SitemapAdminPanelForm($this);
@ -83,7 +81,6 @@ class SitemapadminpanelAction extends AdminPanelAction
*
* @return void
*/
function saveSettings()
{
static $settings = array('sitemap' => array('googlekey', 'yahookey', 'bingkey'));
@ -97,7 +94,6 @@ class SitemapadminpanelAction extends AdminPanelAction
}
// This throws an exception on validation errors
$this->validate($values);
// assert(all values are valid);
@ -125,7 +121,6 @@ class SitemapadminpanelAction extends AdminPanelAction
/**
* Form for the sitemap admin panel
*/
class SitemapAdminPanelForm extends AdminForm
{
/**
@ -133,7 +128,6 @@ class SitemapAdminPanelForm extends AdminForm
*
* @return int ID of the form
*/
function id()
{
return 'form_sitemap_admin_panel';
@ -144,7 +138,6 @@ class SitemapAdminPanelForm extends AdminForm
*
* @return string class of the form
*/
function formClass()
{
return 'form_sitemap';
@ -155,7 +148,6 @@ class SitemapAdminPanelForm extends AdminForm
*
* @return string URL of the action
*/
function action()
{
return common_local_url('sitemapadminpanel');
@ -166,26 +158,31 @@ class SitemapAdminPanelForm extends AdminForm
*
* @return void
*/
function formData()
{
$this->out->elementStart('ul', 'form_data');
$this->li();
$this->input('googlekey',
_('Google key'),
_('Google Webmaster Tools verification key'),
// TRANS: Field label.
_m('Google key'),
// TRANS: Title for field label.
_m('Google Webmaster Tools verification key.'),
'sitemap');
$this->unli();
$this->li();
$this->input('yahookey',
_('Yahoo key'),
_('Yahoo! Site Explorer verification key'),
// TRANS: Field label.
_m('Yahoo key'),
// TRANS: Title for field label.
_m('Yahoo! Site Explorer verification key.'),
'sitemap');
$this->unli();
$this->li();
$this->input('bingkey',
_('Bing key'),
_('Bing Webmaster Tools verification key'),
// TRANS: Field label.
_m('Bing key'),
// TRANS: Title for field label.
_m('Bing Webmaster Tools verification key.'),
'sitemap');
$this->unli();
$this->out->elementEnd('ul');
@ -196,9 +193,14 @@ class SitemapAdminPanelForm extends AdminForm
*
* @return void
*/
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.'));
}
}

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
* @link http://status.net/
*/
class SitemapindexAction extends Action
{
/**
@ -50,7 +49,6 @@ class SitemapindexAction extends Action
*
* @return void
*/
function handle($args)
{
header('Content-Type: text/xml; charset=UTF-8');

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
* @link http://status.net/
*/
class UsersitemapAction extends SitemapAction
{
var $users = null;