Commit 199404c7 authored by Siebrand Mazeland's avatar Siebrand Mazeland

Update translator documentation.

Update whitespace.
i18n/L10n fixes.
parent 38916972
......@@ -71,7 +71,6 @@ class Notice_to_status extends Memcached_DataObject
* @return Notice_to_status object found, or null for no hits
*
*/
function staticGet($k, $v=null)
{
return Memcached_DataObject::staticGet('Notice_to_status', $k, $v);
......@@ -85,7 +84,6 @@ class Notice_to_status extends Memcached_DataObject
*
* @return array array of column definitions
*/
function table()
{
return array('notice_id' => DB_DATAOBJECT_INT + DB_DATAOBJECT_NOTNULL,
......@@ -102,7 +100,6 @@ class Notice_to_status extends Memcached_DataObject
*
* @return array list of key field names
*/
function keys()
{
return array_keys($this->keyTypes());
......@@ -120,7 +117,6 @@ class Notice_to_status extends Memcached_DataObject
* 'K' for primary key: for compound keys, add an entry for each component;
* 'U' for unique keys: compound keys are not well supported here.
*/
function keyTypes()
{
return array('notice_id' => 'K', 'status_id' => 'U');
......@@ -136,7 +132,6 @@ class Notice_to_status extends Memcached_DataObject
*
* @return array magic three-false array that stops auto-incrementing.
*/
function sequenceKey()
{
return array(false, false, false);
......@@ -151,7 +146,6 @@ class Notice_to_status extends Memcached_DataObject
*
* @return Notice_to_status new object for this value
*/
static function saveNew($notice_id, $status_id)
{
if (empty($notice_id)) {
......
......@@ -148,8 +148,10 @@ class TwitterBridgePlugin extends Plugin
if (self::hasKeys() && common_config('twitter', 'signin')) {
$action->menuItem(
common_local_url('twitterlogin'),
_m('Twitter'),
_m('Login or register using Twitter'),
// TRANS: Menu item in login navigation.
_m('MENU','Twitter'),
// TRANS: Title for menu item in login navigation.
_m('Login or register using Twitter.'),
'twitterlogin' === $action_name
);
}
......@@ -171,7 +173,9 @@ class TwitterBridgePlugin extends Plugin
$action->menuItem(
common_local_url('twittersettings'),
_m('Twitter'),
// TRANS: Menu item in connection settings navigation.
_m('MENU','Twitter'),
// TRANS: Title for menu item in connection settings navigation.
_m('Twitter integration options'),
$action_name === 'twittersettings'
);
......@@ -323,8 +327,8 @@ class TwitterBridgePlugin extends Plugin
'version' => self::VERSION,
'author' => 'Zach Copley, Julien C',
'homepage' => 'http://status.net/wiki/Plugin:TwitterBridge',
'rawdescription' => _m(
'The Twitter "bridge" plugin allows integration ' .
// TRANS: Plugin description.
'rawdescription' => _m('The Twitter "bridge" plugin allows integration ' .
'of a StatusNet instance with ' .
'<a href="http://twitter.com/">Twitter</a>.'
)
......
......@@ -64,7 +64,6 @@ class Twitter_synch_status extends Memcached_DataObject
* @param mixed $v Value to lookup
*
* @return Twitter_synch_status object found, or null for no hits
*
*/
function staticGet($k, $v=null)
{
......
......@@ -63,7 +63,8 @@ abstract class JsonStreamReader
} else if ($scheme == 'https') {
$rawScheme = 'ssl';
} else {
throw new ServerException('Invalid URL scheme for HTTP stream reader');
// TRANS: Server exception thrown when an invalid URL scheme is detected.
throw new ServerException(_m('Invalid URL scheme for HTTP stream reader.'));
}
$host = parse_url($url, PHP_URL_HOST);
......@@ -180,7 +181,8 @@ abstract class JsonStreamReader
public function handleInput($socket)
{
if ($this->socket !== $socket) {
throw new Exception('Got input from unexpected socket!');
// TRANS: Exception thrown when input from an inexpected socket is encountered.
throw new Exception(_m('Got input from unexpected socket!'));
}
try {
......@@ -210,7 +212,9 @@ abstract class JsonStreamReader
$this->handleLineActive($line);
break;
default:
throw new Exception('Invalid state in handleLine: ' . $this->state);
// TRANS: Exception thrown when an invalid state is encountered in handleLine.
// TRANS: %s is the invalid state.
throw new Exception(sprintf(_m('Invalid state in handleLine: %s.'),$this->state));
}
}
......@@ -222,15 +226,21 @@ abstract class JsonStreamReader
{
$bits = explode(' ', $line, 3);
if (count($bits) != 3) {
throw new Exception("Invalid HTTP response line: $line");
// TRANS: Exception thrown when an invalid response line is encountered.
// TRANS: %s is the invalid line.
throw new Exception(sprintf(_m('Invalid HTTP response line: %s.'),$line));
}
list($http, $status, $text) = $bits;
if (substr($http, 0, 5) != 'HTTP/') {
throw new Exception("Invalid HTTP response line chunk '$http': $line");
// TRANS: Exception thrown when an invalid response line part is encountered.
// TRANS: %1$s is the chunk, %2$s is the line.
throw new Exception(sprintf(_m('Invalid HTTP response line chunk "%1$s": %2$s.'),$http, $line));
}
if ($status != '200') {
throw new Exception("Bad HTTP response code $status: $line");
// TRANS: Exception thrown when an invalid response code is encountered.
// TRANS: %1$s is the response code, %2$s is the line.
throw new Exception(sprintf(_m('Bad HTTP response code %1$s: %2$s.'),$status,$line));
}
common_log(LOG_DEBUG, "$this->id $line");
$this->state = 'headers';
......
......@@ -71,7 +71,6 @@ function save_twitter_user($twitter_id, $screen_name)
$fuser = Foreign_user::getForeignUser($twitter_id, TWITTER_SERVICE);
if (!empty($fuser)) {
// Delete old record if Twitter user changed screen name
if ($fuser->nickname != $screen_name) {
......
......@@ -49,7 +49,8 @@ class TwitteradminpanelAction extends AdminPanelAction
*/
function title()
{
return _m('Twitter');
// TRANS: Page title for Twitter administration panel.
return _m('TITLE','Twitter');
}
/**
......@@ -59,6 +60,7 @@ class TwitteradminpanelAction extends AdminPanelAction
*/
function getInstructions()
{
// TRANS: Instructions for Twitter bridge administration page.
return _m('Twitter bridge settings');
}
......@@ -147,13 +149,15 @@ class TwitteradminpanelAction extends AdminPanelAction
if (mb_strlen($values['twitter']['consumer_key']) > 255) {
$this->clientError(
_m("Invalid consumer key. Max length is 255 characters.")
// TRANS: Client error displayed when a consumer key is invalid because it is too long.
_m('Invalid consumer key. Maximum length is 255 characters.')
);
}
if (mb_strlen($values['twitter']['consumer_secret']) > 255) {
$this->clientError(
_m("Invalid consumer secret. Max length is 255 characters.")
// TRANS: Client error displayed when a consumer secret is invalid because it is too long.
_m('Invalid consumer secret. Maximum length is 255 characters.')
);
}
}
......@@ -209,14 +213,17 @@ class TwitterAdminPanelForm extends AdminForm
'fieldset',
array('id' => 'settings_twitter-application')
);
// TRANS: Fieldset legend for Twitter application settings.
$this->out->element('legend', null, _m('Twitter application settings'));
$this->out->elementStart('ul', 'form_data');
$this->li();
$this->input(
'consumer_key',
// TRANS: Field label for Twitter assigned consumer key.
_m('Consumer key'),
_m('Consumer key assigned by Twitter'),
// TRANS: Field title for Twitter assigned consumer key.
_m('The consumer key assigned by Twitter.'),
'twitter'
);
$this->unli();
......@@ -224,8 +231,10 @@ class TwitterAdminPanelForm extends AdminForm
$this->li();
$this->input(
'consumer_secret',
_m('Consumer secret'),
_m('Consumer secret assigned by Twitter'),
// TRANS: Field label for Twitter assigned consumer secret.
_m('Consumer secret'),
// TRANS: Field title for Twitter assigned consumer secret.
_m('The consumer secret assigned by Twitter.'),
'twitter'
);
$this->unli();
......@@ -235,15 +244,18 @@ class TwitterAdminPanelForm extends AdminForm
if (!empty($globalConsumerKey) && !empty($globalConsumerSec)) {
$this->li();
$this->out->element('p', 'form_guide', _m('Note: a global consumer key and secret are set.'));
// TRANS: Form guide displayed when two required fields have already been provided.
$this->out->element('p', 'form_guide', _m('Note: A global consumer key and secret are set.'));
$this->unli();
}
$this->li();
$this->input(
'source',
_m('Integration source'),
_m('Name of your Twitter application'),
// TRANS: Field label for Twitter application name.
_m('Integration source'),
// TRANS: Field title for Twitter application name.
_m('The name of your Twitter application.'),
'integration'
);
$this->unli();
......@@ -255,6 +267,7 @@ class TwitterAdminPanelForm extends AdminForm
'fieldset',
array('id' => 'settings_twitter-options')
);
// TRANS: Fieldset legend for Twitter integration options.
$this->out->element('legend', null, _m('Options'));
$this->out->elementStart('ul', 'form_data');
......@@ -262,17 +275,21 @@ class TwitterAdminPanelForm extends AdminForm
$this->li();
$this->out->checkbox(
// TRANS: Checkbox label for global setting.
'signin', _m('Enable "Sign-in with Twitter"'),
(bool) $this->value('signin', 'twitter'),
_m('Allow users to login with their Twitter credentials')
// TRANS: Checkbox title.
_m('This allow users to login with their Twitter credentials.')
);
$this->unli();
if (Event::handle('TwitterBridgeAdminImportControl')) {
$this->li();
$this->out->checkbox(
// TRANS: Checkbox label for global setting.
'enabled', _m('Enable Twitter import'),
(bool) $this->value('enabled', 'twitterimport'),
// TRANS: Checkbox title for global setting.
_m('Allow users to import their Twitter friends\' timelines. Requires daemons to be manually configured.')
);
$this->unli();
......@@ -290,6 +307,9 @@ class TwitterAdminPanelForm extends AdminForm
*/
function formActions()
{
$this->out->submit('submit', _m('Save'), 'submit', null, _m('Save Twitter settings'));
// TRANS: Button text for saving the administrative Twitter bridge settings.
$this->out->submit('submit', _m('BUTTON','Save'), 'submit', null,
// TRANS: Button title for saving the administrative Twitter bridge settings.
_m('Save the Twitter bridge settings.'));
}
}
......@@ -700,4 +700,4 @@ class TwitterImport
}
}
}
}
\ No newline at end of file
}
......@@ -53,6 +53,7 @@ class TwitterloginAction extends Action
parent::handle($args);
if (common_is_real_login()) {
// TRANS: Client error displayed when trying to log in using Twitter while already logged in to StatusNet.
$this->clientError(_m('Already logged in.'));
}
......@@ -61,11 +62,13 @@ class TwitterloginAction extends Action
function title()
{
return _m('Twitter Login');
// TRANS: Title for login using Twitter page.
return _m('TITLE','Twitter Login');
}
function getInstructions()
{
// TRANS: Instructions for login using Twitter page.
return _m('Login with your Twitter account');
}
......@@ -84,6 +87,7 @@ class TwitterloginAction extends Action
null,
array('signin' => true))));
$this->element('img', array('src' => Plugin::staticPath('TwitterBridge', 'Sign-in-with-Twitter-lighter.png'),
// TRANS: Alternative text for "sign in with Twitter" image.
'alt' => _m('Sign in with Twitter')));
$this->elementEnd('a');
}
......
......@@ -54,7 +54,7 @@ abstract class TwitterStreamReader extends JsonStreamReader
*
* @param string $url
* @param array $params
* @return string
* @return string
*/
protected function oAuthUrl($url, $params=array())
{
......@@ -136,7 +136,7 @@ abstract class TwitterStreamReader extends JsonStreamReader
/**
* Call event handler callbacks for the given event.
*
*
* @param string $event
* @param mixed $arg1 ... one or more params to pass on
*/
......
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