* i18n/L10n updates

* superfluous whitespace removed
This commit is contained in:
Siebrand Mazeland 2010-09-14 21:45:13 +02:00
parent 04b7af4620
commit 987651c8a4
6 changed files with 23 additions and 68 deletions

View File

@ -41,7 +41,7 @@ class AutoSandboxPlugin extends Plugin
var $contact; var $contact;
var $debug; var $debug;
function onInitializePlugin() function onInitializePlugin()
{ {
if(!isset($this->debug)) if(!isset($this->debug))
{ {
@ -53,7 +53,7 @@ class AutoSandboxPlugin extends Plugin
if (!empty($default)) { if (!empty($default)) {
$this->contact = $default; $this->contact = $default;
} }
} }
} }
function onPluginVersion(&$versions) function onPluginVersion(&$versions)
@ -69,16 +69,16 @@ class AutoSandboxPlugin extends Plugin
function onStartRegistrationFormData($action) function onStartRegistrationFormData($action)
{ {
$instr = _m('Note you will initially be "sandboxed" so your posts will not appear in the public timeline.');
$instr = 'Note you will initially be "sandboxed" so your posts will not appear in the public timeline.';
if (isset($this->contact)) { if (isset($this->contact)) {
$contactuser = User::staticGet('nickname', $this->contact); $contactuser = User::staticGet('nickname', $this->contact);
if (!empty($contactuser)) { if (!empty($contactuser)) {
$contactlink = "@<a href=\"$contactuser->uri\">$contactuser->nickname</a>"; $contactlink = "@<a href=\"$contactuser->uri\">$contactuser->nickname</a>";
$instr = $instr . " Send a message to $contactlink to speed up the unsandboxing process."; $instr = _m("Note you will initially be \"sandboxed\" so your posts will not appear in the public timeline. ".
'Send a message to $contactlink to speed up the unsandboxing process.');
} }
} }
$output = common_markup_to_html($instr); $output = common_markup_to_html($instr);
$action->elementStart('div', 'instructions'); $action->elementStart('div', 'instructions');

View File

@ -40,7 +40,7 @@ class BitlyUrlPlugin extends UrlShortenerPlugin
function onInitializePlugin(){ function onInitializePlugin(){
parent::onInitializePlugin(); parent::onInitializePlugin();
if(!isset($this->serviceUrl)){ if(!isset($this->serviceUrl)){
throw new Exception("must specify a serviceUrl"); throw new Exception(_m("You must specify a serviceUrl."));
} }
} }
@ -63,4 +63,3 @@ class BitlyUrlPlugin extends UrlShortenerPlugin
return true; return true;
} }
} }

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 * @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 BlacklistPlugin extends Plugin class BlacklistPlugin extends Plugin
{ {
const VERSION = STATUSNET_VERSION; const VERSION = STATUSNET_VERSION;
@ -76,13 +75,11 @@ class BlacklistPlugin extends Plugin
* *
* @return boolean hook value * @return boolean hook value
*/ */
function onCheckSchema() function onCheckSchema()
{ {
$schema = Schema::get(); $schema = Schema::get();
// For storing blacklist patterns for nicknames // For storing blacklist patterns for nicknames
$schema->ensureTable('nickname_blacklist', $schema->ensureTable('nickname_blacklist',
array(new ColumnDef('pattern', array(new ColumnDef('pattern',
'varchar', 'varchar',
@ -118,7 +115,6 @@ class BlacklistPlugin extends Plugin
* *
* @return array configuration values * @return array configuration values
*/ */
function _configArray($section, $setting) function _configArray($section, $setting)
{ {
$config = common_config($section, $setting); $config = common_config($section, $setting);
@ -143,14 +139,13 @@ class BlacklistPlugin extends Plugin
* *
* @return boolean hook value * @return boolean hook value
*/ */
function onStartRegistrationTry($action) function onStartRegistrationTry($action)
{ {
$homepage = strtolower($action->trimmed('homepage')); $homepage = strtolower($action->trimmed('homepage'));
if (!empty($homepage)) { if (!empty($homepage)) {
if (!$this->_checkUrl($homepage)) { if (!$this->_checkUrl($homepage)) {
$msg = sprintf(_m("You may not register with homepage '%s'"), $msg = sprintf(_m("You may not register with homepage '%s'."),
$homepage); $homepage);
throw new ClientException($msg); throw new ClientException($msg);
} }
@ -160,7 +155,7 @@ class BlacklistPlugin extends Plugin
if (!empty($nickname)) { if (!empty($nickname)) {
if (!$this->_checkNickname($nickname)) { if (!$this->_checkNickname($nickname)) {
$msg = sprintf(_m("You may not register with nickname '%s'"), $msg = sprintf(_m("You may not register with nickname '%s'."),
$nickname); $nickname);
throw new ClientException($msg); throw new ClientException($msg);
} }
@ -178,14 +173,13 @@ class BlacklistPlugin extends Plugin
* *
* @return boolean hook value * @return boolean hook value
*/ */
function onStartProfileSaveForm($action) function onStartProfileSaveForm($action)
{ {
$homepage = strtolower($action->trimmed('homepage')); $homepage = strtolower($action->trimmed('homepage'));
if (!empty($homepage)) { if (!empty($homepage)) {
if (!$this->_checkUrl($homepage)) { if (!$this->_checkUrl($homepage)) {
$msg = sprintf(_m("You may not use homepage '%s'"), $msg = sprintf(_m("You may not use homepage '%s'."),
$homepage); $homepage);
throw new ClientException($msg); throw new ClientException($msg);
} }
@ -195,7 +189,7 @@ class BlacklistPlugin extends Plugin
if (!empty($nickname)) { if (!empty($nickname)) {
if (!$this->_checkNickname($nickname)) { if (!$this->_checkNickname($nickname)) {
$msg = sprintf(_m("You may not use nickname '%s'"), $msg = sprintf(_m("You may not use nickname '%s'."),
$nickname); $nickname);
throw new ClientException($msg); throw new ClientException($msg);
} }
@ -213,7 +207,6 @@ class BlacklistPlugin extends Plugin
* *
* @return boolean hook value * @return boolean hook value
*/ */
function onStartNoticeSave(&$notice) function onStartNoticeSave(&$notice)
{ {
common_replace_urls_callback($notice->content, common_replace_urls_callback($notice->content,
@ -230,7 +223,6 @@ class BlacklistPlugin extends Plugin
* *
* @return boolean hook value * @return boolean hook value
*/ */
function checkNoticeUrl($url) function checkNoticeUrl($url)
{ {
// It comes in special'd, so we unspecial it // It comes in special'd, so we unspecial it
@ -239,7 +231,7 @@ class BlacklistPlugin extends Plugin
$url = htmlspecialchars_decode($url); $url = htmlspecialchars_decode($url);
if (!$this->_checkUrl($url)) { if (!$this->_checkUrl($url)) {
$msg = sprintf(_m("You may not use url '%s' in notices"), $msg = sprintf(_m("You may not use UTL \"%s\" in notices."),
$url); $url);
throw new ClientException($msg); throw new ClientException($msg);
} }
@ -256,7 +248,6 @@ class BlacklistPlugin extends Plugin
* *
* @return boolean true means it's OK, false means it's bad * @return boolean true means it's OK, false means it's bad
*/ */
private function _checkUrl($url) private function _checkUrl($url)
{ {
$patterns = $this->_getUrlPatterns(); $patterns = $this->_getUrlPatterns();
@ -279,7 +270,6 @@ class BlacklistPlugin extends Plugin
* *
* @return boolean true means it's OK, false means it's bad * @return boolean true means it's OK, false means it's bad
*/ */
private function _checkNickname($nickname) private function _checkNickname($nickname)
{ {
$patterns = $this->_getNicknamePatterns(); $patterns = $this->_getNicknamePatterns();
@ -300,7 +290,6 @@ class BlacklistPlugin extends Plugin
* *
* @return boolean hook return * @return boolean hook return
*/ */
function onRouterInitialized($m) function onRouterInitialized($m)
{ {
$m->connect('admin/blacklist', array('action' => 'blacklistadminpanel')); $m->connect('admin/blacklist', array('action' => 'blacklistadminpanel'));
@ -314,7 +303,6 @@ class BlacklistPlugin extends Plugin
* *
* @return boolean hook return * @return boolean hook return
*/ */
function onAutoload($cls) function onAutoload($cls)
{ {
switch (strtolower($cls)) switch (strtolower($cls))
@ -339,7 +327,6 @@ class BlacklistPlugin extends Plugin
* *
* @return boolean hook value * @return boolean hook value
*/ */
function onPluginVersion(&$versions) function onPluginVersion(&$versions)
{ {
$versions[] = array('name' => 'Blacklist', $versions[] = array('name' => 'Blacklist',
@ -348,7 +335,7 @@ class BlacklistPlugin extends Plugin
'homepage' => 'homepage' =>
'http://status.net/wiki/Plugin:Blacklist', 'http://status.net/wiki/Plugin:Blacklist',
'description' => 'description' =>
_m('Keep a blacklist of forbidden nickname '. _m('Keeps a blacklist of forbidden nickname '.
'and URL patterns.')); 'and URL patterns.'));
return true; return true;
} }
@ -379,7 +366,6 @@ class BlacklistPlugin extends Plugin
* *
* @return boolean hook value * @return boolean hook value
*/ */
function onEndAdminPanelNav($nav) function onEndAdminPanelNav($nav)
{ {
if (AdminPanelAction::canAdmin('blacklist')) { if (AdminPanelAction::canAdmin('blacklist')) {
@ -387,8 +373,8 @@ class BlacklistPlugin extends Plugin
$action_name = $nav->action->trimmed('action'); $action_name = $nav->action->trimmed('action');
$nav->out->menuItem(common_local_url('blacklistadminpanel'), $nav->out->menuItem(common_local_url('blacklistadminpanel'),
_('Blacklist'), _m('Blacklist'),
_('Blacklist configuration'), _m('Blacklist configuration'),
$action_name == 'blacklistadminpanel', $action_name == 'blacklistadminpanel',
'nav_blacklist_admin_panel'); 'nav_blacklist_admin_panel');
} }
@ -414,7 +400,7 @@ class BlacklistPlugin extends Plugin
$action->elementStart('li'); $action->elementStart('li');
$this->checkboxAndText($action, $this->checkboxAndText($action,
'blacklistnickname', 'blacklistnickname',
_('Add this nickname pattern to blacklist'), _m('Add this nickname pattern to blacklist'),
'blacklistnicknamepattern', 'blacklistnicknamepattern',
$this->patternizeNickname($user->nickname)); $this->patternizeNickname($user->nickname));
$action->elementEnd('li'); $action->elementEnd('li');
@ -423,7 +409,7 @@ class BlacklistPlugin extends Plugin
$action->elementStart('li'); $action->elementStart('li');
$this->checkboxAndText($action, $this->checkboxAndText($action,
'blacklisthomepage', 'blacklisthomepage',
_('Add this homepage pattern to blacklist'), _m('Add this homepage pattern to blacklist'),
'blacklisthomepagepattern', 'blacklisthomepagepattern',
$this->patternizeHomepage($profile->homepage)); $this->patternizeHomepage($profile->homepage));
$action->elementEnd('li'); $action->elementEnd('li');

View File

@ -44,7 +44,6 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php';
* *
* @see DB_DataObject * @see DB_DataObject
*/ */
class Homepage_blacklist extends Memcached_DataObject class Homepage_blacklist extends Memcached_DataObject
{ {
public $__table = 'homepage_blacklist'; // table name public $__table = 'homepage_blacklist'; // table name
@ -62,7 +61,6 @@ class Homepage_blacklist extends Memcached_DataObject
* @return Homepage_blacklist object found, or null for no hits * @return Homepage_blacklist object found, or null for no hits
* *
*/ */
function staticGet($k, $v=null) function staticGet($k, $v=null)
{ {
return Memcached_DataObject::staticGet('Homepage_blacklist', $k, $v); return Memcached_DataObject::staticGet('Homepage_blacklist', $k, $v);
@ -76,7 +74,6 @@ class Homepage_blacklist extends Memcached_DataObject
* *
* @return array array of column definitions * @return array array of column definitions
*/ */
function table() function table()
{ {
return array('pattern' => DB_DATAOBJECT_STR + DB_DATAOBJECT_NOTNULL, return array('pattern' => DB_DATAOBJECT_STR + DB_DATAOBJECT_NOTNULL,
@ -91,7 +88,6 @@ class Homepage_blacklist extends Memcached_DataObject
* *
* @return array key definitions * @return array key definitions
*/ */
function keys() function keys()
{ {
return array_keys($this->keyTypes()); return array_keys($this->keyTypes());
@ -105,7 +101,6 @@ class Homepage_blacklist extends Memcached_DataObject
* *
* @return array key definitions * @return array key definitions
*/ */
function keyTypes() function keyTypes()
{ {
return array('pattern' => 'K'); return array('pattern' => 'K');
@ -116,7 +111,6 @@ class Homepage_blacklist extends Memcached_DataObject
* *
* @return array string patterns to check * @return array string patterns to check
*/ */
static function getPatterns() static function getPatterns()
{ {
$patterns = self::cacheGet('homepage_blacklist:patterns'); $patterns = self::cacheGet('homepage_blacklist:patterns');
@ -144,17 +138,14 @@ class Homepage_blacklist extends Memcached_DataObject
* *
* @return array of patterns to check * @return array of patterns to check
*/ */
static function saveNew($newPatterns) static function saveNew($newPatterns)
{ {
$oldPatterns = self::getPatterns(); $oldPatterns = self::getPatterns();
// Delete stuff that's old that not in new // Delete stuff that's old that not in new
$toDelete = array_diff($oldPatterns, $newPatterns); $toDelete = array_diff($oldPatterns, $newPatterns);
// Insert stuff that's in new and not in old // Insert stuff that's in new and not in old
$toInsert = array_diff($newPatterns, $oldPatterns); $toInsert = array_diff($newPatterns, $oldPatterns);
foreach ($toDelete as $pattern) { foreach ($toDelete as $pattern) {

View File

@ -44,7 +44,6 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php';
* *
* @see DB_DataObject * @see DB_DataObject
*/ */
class Nickname_blacklist extends Memcached_DataObject class Nickname_blacklist extends Memcached_DataObject
{ {
public $__table = 'nickname_blacklist'; // table name public $__table = 'nickname_blacklist'; // table name
@ -62,7 +61,6 @@ class Nickname_blacklist extends Memcached_DataObject
* @return Nickname_blacklist object found, or null for no hits * @return Nickname_blacklist object found, or null for no hits
* *
*/ */
function staticGet($k, $v=null) function staticGet($k, $v=null)
{ {
return Memcached_DataObject::staticGet('Nickname_blacklist', $k, $v); return Memcached_DataObject::staticGet('Nickname_blacklist', $k, $v);
@ -73,7 +71,6 @@ class Nickname_blacklist extends Memcached_DataObject
* *
* @return array array of column definitions * @return array array of column definitions
*/ */
function table() function table()
{ {
return array('pattern' => DB_DATAOBJECT_STR + DB_DATAOBJECT_NOTNULL, return array('pattern' => DB_DATAOBJECT_STR + DB_DATAOBJECT_NOTNULL,
@ -85,7 +82,6 @@ class Nickname_blacklist extends Memcached_DataObject
* *
* @return array key definitions * @return array key definitions
*/ */
function keys() function keys()
{ {
return array_keys($this->keyTypes()); return array_keys($this->keyTypes());
@ -96,7 +92,6 @@ class Nickname_blacklist extends Memcached_DataObject
* *
* @return array key definitions * @return array key definitions
*/ */
function keyTypes() function keyTypes()
{ {
return array('pattern' => 'K'); return array('pattern' => 'K');
@ -107,7 +102,6 @@ class Nickname_blacklist extends Memcached_DataObject
* *
* @return array string patterns to check * @return array string patterns to check
*/ */
static function getPatterns() static function getPatterns()
{ {
$patterns = self::cacheGet('nickname_blacklist:patterns'); $patterns = self::cacheGet('nickname_blacklist:patterns');
@ -135,17 +129,14 @@ class Nickname_blacklist extends Memcached_DataObject
* *
* @return array of patterns to check * @return array of patterns to check
*/ */
static function saveNew($newPatterns) static function saveNew($newPatterns)
{ {
$oldPatterns = self::getPatterns(); $oldPatterns = self::getPatterns();
// Delete stuff that's old that not in new // Delete stuff that's old that not in new
$toDelete = array_diff($oldPatterns, $newPatterns); $toDelete = array_diff($oldPatterns, $newPatterns);
// Insert stuff that's in new and not in old // Insert stuff that's in new and not in old
$toInsert = array_diff($newPatterns, $oldPatterns); $toInsert = array_diff($newPatterns, $oldPatterns);
foreach ($toDelete as $pattern) { foreach ($toDelete as $pattern) {

View File

@ -40,7 +40,6 @@ if (!defined('STATUSNET')) {
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPLv3 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPLv3
* @link http://status.net/ * @link http://status.net/
*/ */
class BlacklistadminpanelAction extends AdminPanelAction class BlacklistadminpanelAction extends AdminPanelAction
{ {
/** /**
@ -48,10 +47,9 @@ class BlacklistadminpanelAction extends AdminPanelAction
* *
* @return string title * @return string title
*/ */
function title() function title()
{ {
return _('Blacklist'); return _m('Blacklist');
} }
/** /**
@ -59,10 +57,9 @@ class BlacklistadminpanelAction extends AdminPanelAction
* *
* @return string instructions * @return string instructions
*/ */
function getInstructions() function getInstructions()
{ {
return _('Blacklisted URLs and nicknames'); return _m('Blacklisted URLs and nicknames');
} }
/** /**
@ -72,7 +69,6 @@ class BlacklistadminpanelAction extends AdminPanelAction
* *
* @see BlacklistAdminPanelForm * @see BlacklistAdminPanelForm
*/ */
function showForm() function showForm()
{ {
$form = new BlacklistAdminPanelForm($this); $form = new BlacklistAdminPanelForm($this);
@ -85,7 +81,6 @@ class BlacklistadminpanelAction extends AdminPanelAction
* *
* @return void * @return void
*/ */
function saveSettings() function saveSettings()
{ {
$nickPatterns = $this->splitPatterns($this->trimmed('blacklist-nicknames')); $nickPatterns = $this->splitPatterns($this->trimmed('blacklist-nicknames'));
@ -116,7 +111,6 @@ class BlacklistadminpanelAction extends AdminPanelAction
* *
* @return boolean success flag * @return boolean success flag
*/ */
function validate(&$values) function validate(&$values)
{ {
return true; return true;
@ -132,7 +126,6 @@ class BlacklistadminpanelAction extends AdminPanelAction
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPLv3 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPLv3
* @link http://status.net/ * @link http://status.net/
*/ */
class BlacklistAdminPanelForm extends Form class BlacklistAdminPanelForm extends Form
{ {
/** /**
@ -140,7 +133,6 @@ class BlacklistAdminPanelForm extends Form
* *
* @return string ID * @return string ID
*/ */
function id() function id()
{ {
return 'blacklistadminpanel'; return 'blacklistadminpanel';
@ -151,7 +143,6 @@ class BlacklistAdminPanelForm extends Form
* *
* @return string class * @return string class
*/ */
function formClass() function formClass()
{ {
return 'form_settings'; return 'form_settings';
@ -162,7 +153,6 @@ class BlacklistAdminPanelForm extends Form
* *
* @return string action URL * @return string action URL
*/ */
function action() function action()
{ {
return common_local_url('blacklistadminpanel'); return common_local_url('blacklistadminpanel');
@ -173,7 +163,6 @@ class BlacklistAdminPanelForm extends Form
* *
* @return void * @return void
*/ */
function formData() function formData()
{ {
$this->out->elementStart('ul', 'form_data'); $this->out->elementStart('ul', 'form_data');
@ -184,7 +173,7 @@ class BlacklistAdminPanelForm extends Form
$this->out->textarea('blacklist-nicknames', _m('Nicknames'), $this->out->textarea('blacklist-nicknames', _m('Nicknames'),
implode("\r\n", $nickPatterns), implode("\r\n", $nickPatterns),
_('Patterns of nicknames to block, one per line')); _m('Patterns of nicknames to block, one per line'));
$this->out->elementEnd('li'); $this->out->elementEnd('li');
$urlPatterns = Homepage_blacklist::getPatterns(); $urlPatterns = Homepage_blacklist::getPatterns();
@ -192,7 +181,7 @@ class BlacklistAdminPanelForm extends Form
$this->out->elementStart('li'); $this->out->elementStart('li');
$this->out->textarea('blacklist-urls', _m('URLs'), $this->out->textarea('blacklist-urls', _m('URLs'),
implode("\r\n", $urlPatterns), implode("\r\n", $urlPatterns),
_('Patterns of URLs to block, one per line')); _m('Patterns of URLs to block, one per line'));
$this->out->elementEnd('li'); $this->out->elementEnd('li');
$this->out->elementEnd('ul'); $this->out->elementEnd('ul');
@ -203,13 +192,12 @@ class BlacklistAdminPanelForm extends Form
* *
* @return void * @return void
*/ */
function formActions() function formActions()
{ {
$this->out->submit('submit', $this->out->submit('submit',
_('Save'), _m('Save'),
'submit', 'submit',
null, null,
_('Save site settings')); _m('Save site settings'));
} }
} }