Update translator documentation.

L10n/i18n updates.
Whitespace updates.
Break long lines in README files.
This commit is contained in:
Siebrand Mazeland 2011-04-24 19:28:26 +02:00
parent 413d9e2fd0
commit e6d053ac41
17 changed files with 82 additions and 50 deletions

View File

@ -39,7 +39,7 @@ if (!defined('STATUSNET')) {
*
* This plugin adds an extra level of in-process caching to any regular
* cache system like APC, XCache, or Memcache.
*
*
* Note that since most caching plugins return false for StartCache*
* methods, you should add this plugin before them, i.e.
*
@ -53,7 +53,6 @@ if (!defined('STATUSNET')) {
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
* @link http://status.net/
*/
class InProcessCachePlugin extends Plugin
{
private $_items = array();
@ -77,7 +76,7 @@ class InProcessCachePlugin extends Plugin
/**
* Get an item from the cache
*
*
* Called before other cache systems are called (iif this
* plugin was loaded correctly, see class comment). If we
* have the data, return it, and don't hit the other cache
@ -88,7 +87,6 @@ class InProcessCachePlugin extends Plugin
*
* @return boolean false if found, else true
*/
function onStartCacheGet(&$key, &$value)
{
if ($this->active && array_key_exists($key, $this->_items)) {
@ -116,7 +114,6 @@ class InProcessCachePlugin extends Plugin
*
* @return boolean hook value, true
*/
function onEndCacheGet($key, &$value)
{
if ($this->active && (!array_key_exists($key, $this->_items) ||
@ -128,7 +125,7 @@ class InProcessCachePlugin extends Plugin
/**
* Called at the end of setting a cache element
*
*
* Always set the cache element; may overwrite existing
* data.
*
@ -139,7 +136,6 @@ class InProcessCachePlugin extends Plugin
*
* @return boolean true
*/
function onEndCacheSet($key, $value, $flag, $expiry)
{
if ($this->active) {
@ -159,7 +155,6 @@ class InProcessCachePlugin extends Plugin
*
* @return boolean true
*/
function onStartCacheDelete(&$key, &$success)
{
if ($this->active && array_key_exists($key, $this->_items)) {
@ -175,7 +170,6 @@ class InProcessCachePlugin extends Plugin
*
* @return boolean true
*/
function onPluginVersion(&$versions)
{
$url = 'http://status.net/wiki/Plugin:InProcessCache';
@ -185,6 +179,7 @@ class InProcessCachePlugin extends Plugin
'author' => 'Evan Prodromou',
'homepage' => $url,
'description' =>
// TRANS: Plugin dscription.
_m('Additional in-process cache for plugins.'));
return true;
}
@ -197,17 +192,16 @@ class InProcessCachePlugin extends Plugin
*
* @return boolean true
*/
function cleanup()
{
if ($this->active && common_config('inprocess', 'stats')) {
$this->log(LOG_INFO, "cache size: " .
$this->log(LOG_INFO, "cache size: " .
count($this->_items));
$sum = 0;
foreach ($this->_hits as $hitcount) {
$sum += $hitcount;
}
$this->log(LOG_INFO, $sum . " hits on " .
$this->log(LOG_INFO, $sum . " hits on " .
count($this->_hits) . " keys");
}
return true;

View File

@ -51,6 +51,7 @@ class InfiniteScrollPlugin extends Plugin
'author' => 'Craig Andrews',
'homepage' => 'http://status.net/wiki/Plugin:InfiniteScroll',
'rawdescription' =>
// TRANS: Plugin dscription.
_m('Infinite Scroll adds the following functionality to your StatusNet installation: When a user scrolls towards the bottom of the page, the next page of notices is automatically retrieved and appended. This means they never need to click "Next Page", which dramatically increases stickiness.'));
return true;
}

View File

@ -1,4 +1,7 @@
Infinite Scroll adds the following functionality to your StatusNet installation: When a user scrolls towards the bottom of the page, the next page of notices is automatically retrieved and appended. This means they never need to click "Next Page", which dramatically increases stickiness.
Infinite Scroll adds the following functionality to your StatusNet installation:
When a user scrolls towards the bottom of the page, the next page of notices is
automatically retrieved and appended. This means they never need to click "Next
Page", which dramatically increases stickiness.
Installation
============

View File

@ -58,4 +58,4 @@ class ChannelResponseChannel extends IMChannel {
$text = $user->nickname.': ['.common_config('site', 'name') . '] ' . $text;
$this->imPlugin->sendMessage($this->ircChannel, $text);
}
}
}

View File

@ -44,4 +44,4 @@ class Fake_Irc extends Phergie_Driver_Streams {
protected function send($command, $args = '') {
$this->would_be_sent = array('command' => $command, 'args' => $args);
}
}
}

View File

@ -47,7 +47,6 @@ set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__FILE__) . '/ext
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
* @link http://status.net/
*/
class IrcPlugin extends ImPlugin {
public $host = null;
public $port = null;
@ -76,6 +75,7 @@ class IrcPlugin extends ImPlugin {
* @return string Name of service
*/
public function getDisplayName() {
// TRANS: Service name for IRC.
return _m('IRC');
}
@ -290,6 +290,9 @@ class IrcPlugin extends ImPlugin {
* @return boolean success value
*/
public function sendConfirmationCode($screenname, $code, $user, $checked = false) {
// TRANS: Body text for e-mail confirmation message for IRC.
// TRANS: %1$s is a user nickname, %2$s is the StatusNet sitename,
// TRANS: %3$s is the plugin display name ("IRC"), %4$s is the confirm address URL.
$body = sprintf(_m('User "%1$s" on %2$s has said that your %3$s screenname belongs to them. ' .
'If that\'s true, you can confirm by clicking on this URL: ' .
'%4$s' .
@ -339,16 +342,20 @@ class IrcPlugin extends ImPlugin {
*/
public function initialize() {
if (!isset($this->host)) {
throw new Exception('must specify a host');
// TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
throw new Exception(_m('You must specify a host.'));
}
if (!isset($this->username)) {
throw new Exception('must specify a username');
// TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
throw new Exception(_m('You must specify a username.'));
}
if (!isset($this->realname)) {
throw new Exception('must specify a "real name"');
// TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
throw new Exception(_m('You must specify a "real name".'));
}
if (!isset($this->nick)) {
throw new Exception('must specify a nickname');
// TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
throw new Exception(_m('You must specify a nickname.'));
}
if (!isset($this->port)) {
@ -390,6 +397,7 @@ class IrcPlugin extends ImPlugin {
'author' => 'Luke Fitzgerald',
'homepage' => 'http://status.net/wiki/Plugin:IRC',
'rawdescription' =>
// TRANS: Plugin description.
_m('The IRC plugin allows users to send and receive notices over an IRC network.'));
return true;
}

View File

@ -2,6 +2,7 @@
/**
* Table Definition for irc_waiting_message
*/
require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
class Irc_waiting_message extends Memcached_DataObject {
@ -124,7 +125,9 @@ class Irc_waiting_message extends Memcached_DataObject {
$result = $this->update($orig);
if (!$result) {
throw Exception(sprintf(_m("Could not increment attempts count for %d"), $this->id));
// TRANS: Exception thrown when an IRC attempts count could not be updated.
// TRANS: %d is the object ID for which the count could not be updated.
throw Exception(sprintf(_m('Could not increment attempts count for %d.'), $this->id));
}
}

View File

@ -28,7 +28,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
* In a multi-site queuedaemon.php run, one connection will be instantiated
* for each site being handled by the current process that has IRC enabled.
*/
class IrcManager extends ImManager {
protected $conn = null;
protected $lastPing = null;
@ -231,7 +230,8 @@ class IrcManager extends ImManager {
// Send message
$this->plugin->sendConfirmationCode($screenname, $nickdata['code'], $nickdata['user'], true);
} else {
$this->plugin->sendMessage($screenname, _m('Your nickname is not registered so IRC connectivity cannot be enabled'));
// TRANS: Message given when using an unregistered IRC nickname.
$this->plugin->sendMessage($screenname, _m('Your nickname is not registered so IRC connectivity cannot be enabled.'));
$confirm = new Confirm_address();
@ -243,7 +243,7 @@ class IrcManager extends ImManager {
if (!$result) {
common_log_db_error($confirm, 'DELETE', __FILE__);
// TRANS: Server error thrown on database error canceling IM address confirmation.
// TRANS: Server error thrown on database error when deleting IRC nickname confirmation.
$this->serverError(_m('Could not delete confirmation.'));
return;
}
@ -285,7 +285,8 @@ class IrcManager extends ImManager {
if (!$result) {
common_log_db_error($wm, 'INSERT', __FILE__);
throw new ServerException('DB error inserting IRC waiting queue item');
// TRANS: Server exception thrown when an IRC waiting queue item could not be added to the database.
throw new ServerException(_m('Database error inserting IRC waiting queue item.'));
}
return true;

View File

@ -36,16 +36,18 @@ class LdapAuthenticationPlugin extends AuthenticationPlugin
function onInitializePlugin(){
parent::onInitializePlugin();
if(!isset($this->attributes['nickname'])){
throw new Exception("must specify a nickname attribute");
// TRANS: Exception thrown when initialising the LDAP Auth plugin fails because of an incorrect configuration.
throw new Exception(_m('You must specify a nickname attribute.'));
}
if($this->password_changeable && (! isset($this->attributes['password']) || !isset($this->password_encoding))){
throw new Exception("if password_changeable is set, the password attribute and password_encoding must also be specified");
// TRANS: Exception thrown when initialising the LDAP Auth plugin fails because of an incorrect configuration.
throw new Exception(_m('If password_changeable is set, the password attribute and password_encoding must also be specified.'));
}
$this->ldapCommon = new LdapCommon(get_object_vars($this));
}
function onAutoload($cls)
{
{
switch ($cls)
{
case 'LdapCommon':
@ -63,11 +65,13 @@ class LdapAuthenticationPlugin extends AuthenticationPlugin
{
case 'register':
if($this->autoregistration) {
$instr = 'Have an LDAP account? Use your standard username and password.';
// TRANS: Instructions for LDAP authentication.
$instr = _m('Do you have an LDAP account? Use your standard username and password.');
}
break;
case 'login':
$instr = 'Have an LDAP account? Use your standard username and password.';
// TRANS: Instructions for LDAP authentication.
$instr = _m('Do you have an LDAP account? Use your standard username and password.');
break;
default:
return true;
@ -79,7 +83,7 @@ class LdapAuthenticationPlugin extends AuthenticationPlugin
}
return true;
}
//---interface implementation---//
function checkPassword($username, $password)
@ -143,6 +147,7 @@ class LdapAuthenticationPlugin extends AuthenticationPlugin
'author' => 'Craig Andrews',
'homepage' => 'http://status.net/wiki/Plugin:LdapAuthentication',
'rawdescription' =>
// TRANS: Plugin description.
_m('The LDAP Authentication plugin allows for StatusNet to handle authentication through LDAP.'));
return true;
}

View File

@ -11,8 +11,9 @@ Settings
========
provider_name*: This is a identifier designated to the connection.
It's how StatusNet will refer to the authentication source.
For the most part, any name can be used, so long as each authentication source has a different identifier.
In most cases there will be only one authentication source used.
For the most part, any name can be used, so long as each authentication
source has a different identifier. In most cases there will be only one
authentication source used.
authoritative (false): Set to true if LDAP's responses are authoritative
(if authorative and LDAP fails, no other password checking will be done).
autoregistration (false): Set to true if users should be automatically created
@ -84,4 +85,3 @@ addPlugin('ldapAuthentication', array(
'fullname'=>'displayName',
'password'=>'unicodePwd')
));

View File

@ -38,10 +38,12 @@ class LdapAuthorizationPlugin extends AuthorizationPlugin
function onInitializePlugin(){
if(!isset($this->provider_name)){
throw new Exception("provider_name must be set. Use the provider_name from the LDAP Authentication plugin.");
// TRANS: Exception thrown when initialising the LDAP Auth plugin fails because of an incorrect configuration.
throw new Exception(_m('provider_name must be set. Use the provider_name from the LDAP Authentication plugin.'));
}
if(!isset($this->uniqueMember_attribute)){
throw new Exception("uniqueMember_attribute must be set.");
// TRANS: Exception thrown when initialising the LDAP Auth plugin fails because of an incorrect configuration.
throw new Exception(_m('uniqueMember_attribute must be set.'));
}
$this->ldapCommon = new LdapCommon(get_object_vars($this));
}
@ -121,6 +123,7 @@ class LdapAuthorizationPlugin extends AuthorizationPlugin
'author' => 'Craig Andrews',
'homepage' => 'http://status.net/wiki/Plugin:LdapAuthorization',
'rawdescription' =>
// TRANS: Plugin description.
_m('The LDAP Authorization plugin allows for StatusNet to handle authorization through LDAP.'));
return true;
}

View File

@ -13,8 +13,9 @@ Settings
========
provider_name*: This is a identifier designated to the connection.
It's how StatusNet will refer to the authentication source.
For the most part, any name can be used, so long as each authentication source has a different identifier.
In most cases there will be only one authentication source used.
For the most part, any name can be used, so long as each authentication
source has a different identifier. In most cases there will be only one
authentication source used.
authoritative (false): should this plugin be authoritative for
authorization?
uniqueMember_attribute ('uniqueMember')*: the attribute of a group
@ -23,10 +24,10 @@ roles_to_groups: array that maps StatusNet roles to LDAP groups
some StatusNet roles are: moderator, administrator, sandboxed, silenced
login_group: if this is set to a group DN, only members of that group will be
allowed to login
The below settings must be exact copies of the settings used for the
corresponding LDAP Authentication plugin.
host*: LDAP server name to connect to. You can provide several hosts in an
array in which case the hosts are tried from left to right.
See http://pear.php.net/manual/en/package.networking.net-ldap2.connecting.php
@ -91,4 +92,3 @@ addPlugin('ldapAuthorization', array(
'attributes'=>array(
'username'=>'sAMAccountName')
));

View File

@ -60,12 +60,15 @@ class LdapCommon
$this->ldap_config = $this->get_ldap_config();
if(!isset($this->host)){
throw new Exception(_m("A host must be specified."));
// TRANS: Exception thrown when initialising the LDAP Common plugin fails because of an incorrect configuration.
throw new Exception(_m('A host must be specified.'));
}
if(!isset($this->basedn)){
// TRANS: Exception thrown when initialising the LDAP Common plugin fails because of an incorrect configuration.
throw new Exception(_m('"basedn" must be specified.'));
}
if(!isset($this->attributes['username'])){
// TRANS: Exception thrown when initialising the LDAP Common plugin fails because of an incorrect configuration.
throw new Exception(_m('The username attribute must be set.'));
}
}
@ -122,9 +125,13 @@ class LdapCommon
// if we were called with a config, assume caller will handle
// incorrect username/password (LDAP_INVALID_CREDENTIALS)
if (isset($config) && $err->getCode() == 0x31) {
throw new LdapInvalidCredentialsException('Could not connect to LDAP server: '.$err->getMessage());
// TRANS: Exception thrown in the LDAP Common plugin when LDAP server is not available.
// TRANS: %s is the error message.
throw new LdapInvalidCredentialsException(sprintf(_m('Could not connect to LDAP server: %s'),$err->getMessage()));
}
throw new Exception('Could not connect to LDAP server: '.$err->getMessage());
// TRANS: Exception thrown in the LDAP Common plugin when LDAP server is not available.
// TRANS: %s is the error message.
throw new Exception(sprintf(_m('Could not connect to LDAP server: %s.'),$err->getMessage()));
}
$c = Cache::instance();
if (!empty($c)) {

View File

@ -38,6 +38,7 @@ class LilUrlPlugin extends UrlShortenerPlugin
function onInitializePlugin(){
parent::onInitializePlugin();
if(!isset($this->serviceUrl)){
// TRANS: Exception thrown when URL shortening plugin was configured incorrectly.
throw new Exception(_m('A serviceUrl must be specified.'));
}
}
@ -63,6 +64,8 @@ class LilUrlPlugin extends UrlShortenerPlugin
'author' => 'Craig Andrews',
'homepage' => 'http://status.net/wiki/Plugin:LilUrl',
'rawdescription' =>
// TRANS: Plugin description.
// TRANS: %1$s is the service URL.
sprintf(_m('Uses <a href="http://%1$s/">%1$s</a> URL-shortener service.'),
$this->shortenerName));

View File

@ -36,7 +36,8 @@ class LinkPreviewPlugin extends Plugin
'author' => 'Brion Vibber',
'homepage' => 'http://status.net/wiki/Plugin:LinkPreview',
'rawdescription' =>
_m('UI extensions previewing thumbnails from links.'));
// TRANS: Plugin description.
_m('UI extension for previewing thumbnails from links.'));
return true;
}

View File

@ -44,10 +44,8 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
class OembedproxyAction extends OembedAction
{
function handle($args)
{
// Trigger short error responses; not a human-readable web page.
@ -56,18 +54,21 @@ class OembedproxyAction extends OembedAction
// We're not a general oEmbed proxy service; limit to valid sessions.
$token = $this->trimmed('token');
if (!$token || $token != common_session_token()) {
// TRANS: Client error displayed when the session token does not match or is not given.
$this->clientError(_m('There was a problem with your session token. '.
'Try again, please.'));
}
$format = $this->arg('format');
if ($format && $format != 'json') {
throw new ClientException('Invalid format; only JSON supported.');
// TRANS: Client exception thrown when requesting a different format than JSON.
throw new ClientException(_m('Invalid format; only JSON supported.'));
}
$url = $this->arg('url');
if (!common_valid_http_url($url)) {
throw new ClientException('Invalid URL.');
// TRANS: Client exception thrown when not providing a valid URL.
throw new ClientException(_m('Invalid URL.'));
}
$params = array();
@ -83,5 +84,4 @@ class OembedproxyAction extends OembedAction
$this->init_document('json');
print json_encode($data);
}
}

View File

@ -201,6 +201,8 @@ class LinkbackPlugin extends Plugin
{
$profile = $this->notice->getProfile();
// TRANS: Trackback title.
// TRANS: %1$s is a profile nickname, %2$s is a timestamp.
$args = array('title' => sprintf(_m('%1$s\'s status on %2$s'),
$profile->nickname,
common_exact_date($this->notice->created)),
@ -238,6 +240,7 @@ class LinkbackPlugin extends Plugin
'author' => 'Evan Prodromou',
'homepage' => 'http://status.net/wiki/Plugin:Linkback',
'rawdescription' =>
// TRANS: Plugin description.
_m('Notify blog authors when their posts have been linked in '.
'microblog notices using '.
'<a href="http://www.hixie.ch/specs/pingback/pingback">Pingback</a> '.