Update translator documentation.

L10n/i18n updates.
This commit is contained in:
Siebrand Mazeland 2011-04-08 10:59:10 +02:00
parent 8d99a5f949
commit 3e8bf13aab
8 changed files with 98 additions and 102 deletions

View File

@ -101,7 +101,6 @@ class FacebookBridgePlugin extends Plugin
*/ */
function onAutoload($cls) function onAutoload($cls)
{ {
$dir = dirname(__FILE__); $dir = dirname(__FILE__);
//common_debug("class = " . $cls); //common_debug("class = " . $cls);
@ -128,7 +127,6 @@ class FacebookBridgePlugin extends Plugin
default: default:
return true; return true;
} }
} }
/** /**
@ -214,10 +212,11 @@ class FacebookBridgePlugin extends Plugin
if ($this->hasApplication()) { if ($this->hasApplication()) {
$action->menuItem( $action->menuItem(
// TRANS: Menu item for "Facebook" login.
common_local_url('facebooklogin'), common_local_url('facebooklogin'),
_m('MENU', 'Facebook'), _m('MENU', 'Facebook'),
// TRANS: Tooltip for menu item "Facebook". // TRANS: Menu title for "Facebook" login.
_m('Login or register using Facebook'), _m('Login or register using Facebook.'),
'facebooklogin' === $action_name 'facebooklogin' === $action_name
); );
} }
@ -253,10 +252,10 @@ class FacebookBridgePlugin extends Plugin
$nav->out->menuItem( $nav->out->menuItem(
common_local_url('facebookadminpanel'), common_local_url('facebookadminpanel'),
// TRANS: Menu item. // TRANS: Menu item for "Facebook" in administration panel.
_m('MENU','Facebook'), _m('MENU','Facebook'),
// TRANS: Tooltip for menu item "Facebook". // TRANS: Menu title for "Facebook" in administration panel.
_m('Facebook integration configuration'), _m('Facebook integration configuration.'),
$action_name == 'facebookadminpanel', $action_name == 'facebookadminpanel',
'nav_facebook_admin_panel' 'nav_facebook_admin_panel'
); );
@ -294,16 +293,14 @@ class FacebookBridgePlugin extends Plugin
$action->menuItem( $action->menuItem(
common_local_url('facebooksettings'), common_local_url('facebooksettings'),
// TRANS: Menu item tab. // TRANS: Menu item for "Facebook" in user settings.
_m('MENU','Facebook'), _m('MENU','Facebook'),
// TRANS: Tooltip for menu item "Facebook". // TRANS: Menu title for "Facebook" in user settings.
_m('Facebook settings'), _m('Facebook settings.'),
$action_name === 'facebooksettings' $action_name === 'facebooksettings'
); );
} }
} }
} }
/* /*
@ -324,7 +321,6 @@ class FacebookBridgePlugin extends Plugin
if (!empty($appId) && !empty($secret)) { if (!empty($appId) && !empty($secret)) {
return true; return true;
} }
} }
return false; return false;
@ -420,7 +416,6 @@ ENDOFSCRIPT;
common_debug("LOGOUT URL = $logoutUrl"); common_debug("LOGOUT URL = $logoutUrl");
common_redirect($logoutUrl, 303); common_redirect($logoutUrl, 303);
} }
} }
} }
@ -561,6 +556,7 @@ ENDOFSCRIPT;
'author' => 'Craig Andrews, Zach Copley', 'author' => 'Craig Andrews, Zach Copley',
'homepage' => 'http://status.net/wiki/Plugin:FacebookBridge', 'homepage' => 'http://status.net/wiki/Plugin:FacebookBridge',
'rawdescription' => 'rawdescription' =>
// TRANS: Plugin description.
_m('A plugin for integrating StatusNet with Facebook.') _m('A plugin for integrating StatusNet with Facebook.')
); );

View File

@ -49,7 +49,8 @@ class FacebookadminpanelAction extends AdminPanelAction
*/ */
function title() function title()
{ {
return _m('Facebook'); // TRANS: Title for Facebook administration panel.
return _m('TITLE','Facebook integration settings');
} }
/** /**
@ -59,6 +60,7 @@ class FacebookadminpanelAction extends AdminPanelAction
*/ */
function getInstructions() function getInstructions()
{ {
// TRANS: Instruction for Facebook administration panel.
return _m('Facebook integration settings'); return _m('Facebook integration settings');
} }
@ -120,12 +122,14 @@ class FacebookadminpanelAction extends AdminPanelAction
if (mb_strlen($values['facebook']['appid']) > 255) { if (mb_strlen($values['facebook']['appid']) > 255) {
$this->clientError( $this->clientError(
// TRANS: Client error displayed when providing too long a Facebook application ID.
_m("Invalid Facebook ID. Maximum length is 255 characters.") _m("Invalid Facebook ID. Maximum length is 255 characters.")
); );
} }
if (mb_strlen($values['facebook']['secret']) > 255) { if (mb_strlen($values['facebook']['secret']) > 255) {
$this->clientError( $this->clientError(
// TRANS: Client error displayed when providing too long a Facebook secret key.
_m("Invalid Facebook secret. Maximum length is 255 characters.") _m("Invalid Facebook secret. Maximum length is 255 characters.")
); );
} }
@ -175,13 +179,16 @@ class FacebookAdminPanelForm extends AdminForm
'fieldset', 'fieldset',
array('id' => 'settings_facebook-application') array('id' => 'settings_facebook-application')
); );
// TRANS: Fieldset legend.
$this->out->element('legend', null, _m('Facebook application settings')); $this->out->element('legend', null, _m('Facebook application settings'));
$this->out->elementStart('ul', 'form_data'); $this->out->elementStart('ul', 'form_data');
$this->li(); $this->li();
$this->input( $this->input(
'appid', 'appid',
// TRANS: Field label for Facebook application ID.
_m('Application ID'), _m('Application ID'),
// TRANS: Field title for Facebook application ID.
_m('ID of your Facebook application.'), _m('ID of your Facebook application.'),
'facebook' 'facebook'
); );
@ -190,7 +197,9 @@ class FacebookAdminPanelForm extends AdminForm
$this->li(); $this->li();
$this->input( $this->input(
'secret', 'secret',
_m('Secret'), // TRANS: Field label for Facebook secret key.
_m('Secret'),
// TRANS: Field title for Facebook secret key.
_m('Application secret.'), _m('Application secret.'),
'facebook' 'facebook'
); );
@ -207,6 +216,9 @@ class FacebookAdminPanelForm extends AdminForm
*/ */
function formActions() function formActions()
{ {
$this->out->submit('submit', _m('BUTTON','Save'), 'submit', null, _m('Save Facebook settings.')); // TRANS: Button text to save Facebook integration settings.
$this->out->submit('submit', _m('BUTTON','Save'),
// TRANS: Button title to save Facebook integration settings.
'submit', null, _m('Save Facebook settings.'));
} }
} }

View File

@ -140,5 +140,4 @@ class FacebookdeauthorizeAction extends Action
} }
} }
} }
}
}

View File

@ -38,7 +38,6 @@ class FacebookfinishloginAction extends Action
private $fbuser = null; // Facebook user object (JSON) private $fbuser = null; // Facebook user object (JSON)
function prepare($args) { function prepare($args) {
parent::prepare($args); parent::prepare($args);
$this->facebook = new Facebook( $this->facebook = new Facebook(
@ -64,7 +63,6 @@ class FacebookfinishloginAction extends Action
} }
if (!empty($this->fbuser)) { if (!empty($this->fbuser)) {
// OKAY, all is well... proceed to register // OKAY, all is well... proceed to register
common_debug("Found a valid Facebook user.", __FILE__); common_debug("Found a valid Facebook user.", __FILE__);
@ -85,6 +83,7 @@ class FacebookfinishloginAction extends Action
); );
$this->clientError( $this->clientError(
// TRANS: Client error displayed when trying to connect to Facebook while not logged in.
_m('You must be logged into Facebook to register a local account using Facebook.') _m('You must be logged into Facebook to register a local account using Facebook.')
); );
} }
@ -115,6 +114,8 @@ class FacebookfinishloginAction extends Action
); );
$this->clientError( $this->clientError(
// TRANS: Client error displayed when trying to connect to a Facebook account that is already linked
// TRANS: in the same StatusNet site.
_m('There is already a local account linked with that Facebook account.') _m('There is already a local account linked with that Facebook account.')
); );
@ -138,6 +139,7 @@ class FacebookfinishloginAction extends Action
if (!$token || $token != common_session_token()) { if (!$token || $token != common_session_token()) {
$this->showForm( $this->showForm(
// TRANS: Client error displayed when the session token does not match or is not given.
_m('There was a problem with your session token. Try again, please.') _m('There was a problem with your session token. Try again, please.')
); );
return; return;
@ -147,6 +149,7 @@ class FacebookfinishloginAction extends Action
if (!$this->boolean('license')) { if (!$this->boolean('license')) {
$this->showForm( $this->showForm(
// TRANS: Form validation error displayed when user has not agreed to the license.
_m('You cannot register if you do not agree to the license.'), _m('You cannot register if you do not agree to the license.'),
$this->trimmed('newname') $this->trimmed('newname')
); );
@ -164,6 +167,7 @@ class FacebookfinishloginAction extends Action
} else { } else {
$this->showForm( $this->showForm(
// TRANS: Form validation error displayed when an unhandled error occurs.
_m('An unknown error has occured.'), _m('An unknown error has occured.'),
$this->trimmed('newname') $this->trimmed('newname')
); );
@ -180,8 +184,9 @@ class FacebookfinishloginAction extends Action
$this->element( $this->element(
'div', 'instructions', 'div', 'instructions',
// TRANS: %s is the site name.
sprintf( sprintf(
// TRANS: Form instructions for connecting to Facebook.
// TRANS: %s is the site name.
_m('This is the first time you have logged into %s so we must connect your Facebook to a local account. You can either create a new local account, or connect with an existing local account.'), _m('This is the first time you have logged into %s so we must connect your Facebook to a local account. You can either create a new local account, or connect with an existing local account.'),
common_config('site', 'name') common_config('site', 'name')
) )
@ -209,7 +214,7 @@ class FacebookfinishloginAction extends Action
} }
/** /**
* @fixme much of this duplicates core code, which is very fragile. * @todo FIXME: Much of this duplicates core code, which is very fragile.
* Should probably be replaced with an extensible mini version of * Should probably be replaced with an extensible mini version of
* the core registration form. * the core registration form.
*/ */
@ -225,7 +230,7 @@ class FacebookfinishloginAction extends Action
'class' => 'form_settings', 'class' => 'form_settings',
'action' => common_local_url('facebookfinishlogin'))); 'action' => common_local_url('facebookfinishlogin')));
$this->elementStart('fieldset', array('id' => 'settings_facebook_connect_options')); $this->elementStart('fieldset', array('id' => 'settings_facebook_connect_options'));
// TRANS: Legend. // TRANS: Fieldset legend.
$this->element('legend', null, _m('Connection options')); $this->element('legend', null, _m('Connection options'));
$this->elementStart('ul', 'form_data'); $this->elementStart('ul', 'form_data');
$this->elementStart('li'); $this->elementStart('li');
@ -252,9 +257,10 @@ class FacebookfinishloginAction extends Action
$this->elementStart('fieldset'); $this->elementStart('fieldset');
$this->hidden('token', common_session_token()); $this->hidden('token', common_session_token());
$this->element('legend', null, $this->element('legend', null,
// TRANS: Legend. // TRANS: Fieldset legend.
_m('Create new account')); _m('Create new account'));
$this->element('p', null, $this->element('p', null,
// TRANS: Form instructions.
_m('Create a new user with this nickname.')); _m('Create a new user with this nickname.'));
$this->elementStart('ul', 'form_data'); $this->elementStart('ul', 'form_data');
@ -265,6 +271,7 @@ class FacebookfinishloginAction extends Action
// TRANS: Field label. // TRANS: Field label.
$this->input('newname', _m('New nickname'), $this->input('newname', _m('New nickname'),
($this->username) ? $this->username : '', ($this->username) ? $this->username : '',
// TRANS: Field title.
_m('1-64 lowercase letters or numbers, no punctuation or spaces.')); _m('1-64 lowercase letters or numbers, no punctuation or spaces.'));
$this->elementEnd('li'); $this->elementEnd('li');
@ -272,15 +279,16 @@ class FacebookfinishloginAction extends Action
Event::handle('EndRegistrationFormData', array($this)); Event::handle('EndRegistrationFormData', array($this));
$this->elementEnd('ul'); $this->elementEnd('ul');
// TRANS: Submit button. // TRANS: Submit button to create a new account.
$this->submit('create', _m('BUTTON','Create')); $this->submit('create', _m('BUTTON','Create'));
$this->elementEnd('fieldset'); $this->elementEnd('fieldset');
$this->elementStart('fieldset'); $this->elementStart('fieldset');
// TRANS: Legend.
$this->element('legend', null, $this->element('legend', null,
// TRANS: Fieldset legend.
_m('Connect existing account')); _m('Connect existing account'));
$this->element('p', null, $this->element('p', null,
// TRANS: Form instructions.
_m('If you already have an account, login with your username and password to connect it to your Facebook.')); _m('If you already have an account, login with your username and password to connect it to your Facebook.'));
$this->elementStart('ul', 'form_data'); $this->elementStart('ul', 'form_data');
$this->elementStart('li'); $this->elementStart('li');
@ -288,10 +296,11 @@ class FacebookfinishloginAction extends Action
$this->input('nickname', _m('Existing nickname')); $this->input('nickname', _m('Existing nickname'));
$this->elementEnd('li'); $this->elementEnd('li');
$this->elementStart('li'); $this->elementStart('li');
// TRANS: Field label.
$this->password('password', _m('Password')); $this->password('password', _m('Password'));
$this->elementEnd('li'); $this->elementEnd('li');
$this->elementEnd('ul'); $this->elementEnd('ul');
// TRANS: Submit button. // TRANS: Submit button to connect a Facebook account to an existing StatusNet account.
$this->submit('connect', _m('BUTTON','Connect')); $this->submit('connect', _m('BUTTON','Connect'));
$this->elementEnd('fieldset'); $this->elementEnd('fieldset');
@ -344,11 +353,13 @@ class FacebookfinishloginAction extends Action
} }
if (!User::allowed_nickname($nickname)) { if (!User::allowed_nickname($nickname)) {
// TRANS: Form validation error displayed when picking a nickname that is not allowed.
$this->showForm(_m('Nickname not allowed.')); $this->showForm(_m('Nickname not allowed.'));
return; return;
} }
if (User::staticGet('nickname', $nickname)) { if (User::staticGet('nickname', $nickname)) {
// TRANS: Form validation error displayed when picking a nickname that is already in use.
$this->showForm(_m('Nickname already in use. Try another one.')); $this->showForm(_m('Nickname already in use. Try another one.'));
return; return;
} }
@ -377,6 +388,7 @@ class FacebookfinishloginAction extends Action
$result = $this->flinkUser($user->id, $this->fbuid); $result = $this->flinkUser($user->id, $this->fbuid);
if (!$result) { if (!$result) {
// TRANS: Server error displayed when connecting to Facebook fails.
$this->serverError(_m('Error connecting user to Facebook.')); $this->serverError(_m('Error connecting user to Facebook.'));
return; return;
} }
@ -479,6 +491,7 @@ class FacebookfinishloginAction extends Action
$password = $this->trimmed('password'); $password = $this->trimmed('password');
if (!common_check_user($nickname, $password)) { if (!common_check_user($nickname, $password)) {
// TRANS: Form validation error displayed when username/password combination is incorrect.
$this->showForm(_m('Invalid username or password.')); $this->showForm(_m('Invalid username or password.'));
return; return;
} }
@ -516,6 +529,7 @@ class FacebookfinishloginAction extends Action
$result = $this->flinkUser($user->id, $this->fbuid); $result = $this->flinkUser($user->id, $this->fbuid);
if (empty($result)) { if (empty($result)) {
// TRANS: Server error displayed when connecting to Facebook fails.
$this->serverError(_m('Error connecting user to Facebook.')); $this->serverError(_m('Error connecting user to Facebook.'));
return; return;
} }
@ -687,5 +701,4 @@ class FacebookfinishloginAction extends Action
return false; return false;
} }
} }

View File

@ -34,12 +34,12 @@ if (!defined('STATUSNET')) {
class FacebookloginAction extends Action class FacebookloginAction extends Action
{ {
function handle($args) function handle($args)
{ {
parent::handle($args); parent::handle($args);
if (common_is_real_login()) { if (common_is_real_login()) {
// TRANS: Client error displayed when trying to login while already logged in.
$this->clientError(_m('Already logged in.')); $this->clientError(_m('Already logged in.'));
} else { } else {
$this->showPage(); $this->showPage();
@ -48,7 +48,7 @@ class FacebookloginAction extends Action
function getInstructions() function getInstructions()
{ {
// TRANS: Instructions. // TRANS: Form instructions.
return _m('Login with your Facebook Account'); return _m('Login with your Facebook Account');
} }
@ -68,7 +68,6 @@ class FacebookloginAction extends Action
} }
function showContent() { function showContent() {
$this->elementStart('fieldset'); $this->elementStart('fieldset');
$facebook = Facebookclient::getFacebook(); $facebook = Facebookclient::getFacebook();
@ -90,8 +89,10 @@ class FacebookloginAction extends Action
$attrs = array( $attrs = array(
'src' => Plugin::staticPath('FacebookBridge', 'images/login-button.png'), 'src' => Plugin::staticPath('FacebookBridge', 'images/login-button.png'),
'alt' => 'Login with Facebook', // TRANS: Alt text for "Login with Facebook" image.
'title' => 'Login with Facebook' 'alt' => _m('Login with Facebook'),
// TRANS: Title for "Login with Facebook" image.
'title' => _m('Login with Facebook.')
); );
$this->element('img', $attrs); $this->element('img', $attrs);
@ -117,4 +118,3 @@ class FacebookloginAction extends Action
$nav->show(); $nav->show();
} }
} }

View File

@ -83,6 +83,7 @@ class FacebooksettingsAction extends SettingsAction {
$token = $this->trimmed('token'); $token = $this->trimmed('token');
if (!$token || $token != common_session_token()) { if (!$token || $token != common_session_token()) {
$this->showForm( $this->showForm(
// TRANS: Client error displayed when the session token does not match or is not given.
_m('There was a problem with your session token. Try again, please.') _m('There was a problem with your session token. Try again, please.')
); );
return; return;
@ -102,7 +103,7 @@ class FacebooksettingsAction extends SettingsAction {
*/ */
function title() { function title() {
// TRANS: Page title for Facebook settings. // TRANS: Page title for Facebook settings.
return _m('Facebook settings'); return _m('TITLE','Facebook settings');
} }
/** /**
@ -111,6 +112,7 @@ class FacebooksettingsAction extends SettingsAction {
* @return instructions for use * @return instructions for use
*/ */
function getInstructions() { function getInstructions() {
// TRANS: Instructions for Facebook settings.
return _m('Facebook settings'); return _m('Facebook settings');
} }
@ -134,6 +136,7 @@ class FacebooksettingsAction extends SettingsAction {
$this->hidden('token', common_session_token()); $this->hidden('token', common_session_token());
// TRANS: Form note. User is connected to facebook.
$this->element('p', 'form_note', _m('Connected Facebook user')); $this->element('p', 'form_note', _m('Connected Facebook user'));
$this->elementStart('p', array('class' => 'facebook-user-display')); $this->elementStart('p', array('class' => 'facebook-user-display'));
@ -161,6 +164,7 @@ class FacebooksettingsAction extends SettingsAction {
$this->checkbox( $this->checkbox(
'noticesync', 'noticesync',
// TRANS: Checkbox label in Facebook settings.
_m('Publish my notices to Facebook.'), _m('Publish my notices to Facebook.'),
($this->flink) ? ($this->flink->noticesync & FOREIGN_NOTICE_SEND) : true ($this->flink) ? ($this->flink->noticesync & FOREIGN_NOTICE_SEND) : true
); );
@ -171,6 +175,7 @@ class FacebooksettingsAction extends SettingsAction {
$this->checkbox( $this->checkbox(
'replysync', 'replysync',
// TRANS: Checkbox label in Facebook settings.
_m('Send "@" replies to Facebook.'), _m('Send "@" replies to Facebook.'),
($this->flink) ? ($this->flink->noticesync & FOREIGN_NOTICE_SEND_REPLY) : true ($this->flink) ? ($this->flink->noticesync & FOREIGN_NOTICE_SEND_REPLY) : true
); );
@ -188,13 +193,14 @@ class FacebooksettingsAction extends SettingsAction {
$this->elementStart('fieldset'); $this->elementStart('fieldset');
// TRANS: Legend. // TRANS: Fieldset legend for form to disconnect from Facebook.
$this->element('legend', null, _m('Disconnect my account from Facebook')); $this->element('legend', null, _m('Disconnect my account from Facebook'));
if (empty($this->user->password)) { if (empty($this->user->password)) {
$this->elementStart('p', array('class' => 'form_guide')); $this->elementStart('p', array('class' => 'form_guide'));
$msg = sprintf( $msg = sprintf(
// TRANS: Notice in disconnect from Facebook form if user has no local StatusNet password.
_m( _m(
'Disconnecting your Faceboook would make it impossible to ' 'Disconnecting your Faceboook would make it impossible to '
. 'log in! Please [set a password](%s) first.' . 'log in! Please [set a password](%s) first.'
@ -206,14 +212,11 @@ class FacebooksettingsAction extends SettingsAction {
$this->elementEnd('p'); $this->elementEnd('p');
} else { } else {
// @todo FIXME: i18n: This message is not being used. // @todo FIXME: i18n: This message is not being used.
$msg = sprintf( // TRANS: Message displayed when initiating disconnect of a StatusNet user
// TRANS: Message displayed when initiating disconnect of a StatusNet user // TRANS: from a Facebook account. %1$s is the StatusNet site name.
// TRANS: from a Facebook account. %1$s is the StatusNet site name. $msg = sprintf(_m('Keep your %1$s account but disconnect from Facebook. ' .
_m( 'You\'ll use your %1$s password to log in.'),
'Keep your %1$s account but disconnect from Facebook. ' . common_config('site', 'name')
'You\'ll use your %1$s password to log in.'
),
common_config('site', 'name')
); );
// TRANS: Submit button. // TRANS: Submit button.
@ -240,6 +243,7 @@ class FacebooksettingsAction extends SettingsAction {
$result = $this->flink->update($original); $result = $this->flink->update($original);
if ($result === false) { if ($result === false) {
// TRANS: Notice in case saving of synchronisation preferences fail.
$this->showForm(_m('There was a problem saving your sync preferences.')); $this->showForm(_m('There was a problem saving your sync preferences.'));
} else { } else {
// TRANS: Confirmation that synchronisation settings have been saved into the system. // TRANS: Confirmation that synchronisation settings have been saved into the system.
@ -257,10 +261,12 @@ class FacebooksettingsAction extends SettingsAction {
if ($result === false) { if ($result === false) {
common_log_db_error($user, 'DELETE', __FILE__); common_log_db_error($user, 'DELETE', __FILE__);
// TRANS: Server error displayed when deleting the link to a Facebook account fails.
$this->serverError(_m('Could not delete link to Facebook.')); $this->serverError(_m('Could not delete link to Facebook.'));
return; return;
} }
// TRANS: Confirmation message. StatusNet account was unlinked from Facebook.
$this->showForm(_m('You have disconnected from Facebook.'), true); $this->showForm(_m('You have disconnected from Facebook.'), true);
} }
} }

View File

@ -48,7 +48,6 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php';
* *
* @see DB_DataObject * @see DB_DataObject
*/ */
class Notice_to_item extends Memcached_DataObject class Notice_to_item extends Memcached_DataObject
{ {
public $__table = 'notice_to_item'; // table name public $__table = 'notice_to_item'; // table name
@ -67,7 +66,6 @@ class Notice_to_item extends Memcached_DataObject
* @return Notice_to_item object found, or null for no hits * @return Notice_to_item object found, or null for no hits
* *
*/ */
function staticGet($k, $v=null) function staticGet($k, $v=null)
{ {
return Memcached_DataObject::staticGet('Notice_to_item', $k, $v); return Memcached_DataObject::staticGet('Notice_to_item', $k, $v);
@ -81,7 +79,6 @@ class Notice_to_item extends Memcached_DataObject
* *
* @return array array of column definitions * @return array array of column definitions
*/ */
function table() function table()
{ {
return array( return array(
@ -109,7 +106,6 @@ class Notice_to_item extends Memcached_DataObject
* *
* @return array list of key field names * @return array list of key field names
*/ */
function keys() function keys()
{ {
return array_keys($this->keyTypes()); return array_keys($this->keyTypes());
@ -127,7 +123,6 @@ class Notice_to_item extends Memcached_DataObject
* 'K' for primary key: for compound keys, add an entry for each component; * 'K' for primary key: for compound keys, add an entry for each component;
* 'U' for unique keys: compound keys are not well supported here. * 'U' for unique keys: compound keys are not well supported here.
*/ */
function keyTypes() function keyTypes()
{ {
return array('notice_id' => 'K', 'item_id' => 'U'); return array('notice_id' => 'K', 'item_id' => 'U');
@ -143,7 +138,6 @@ class Notice_to_item extends Memcached_DataObject
* *
* @return array magic three-false array that stops auto-incrementing. * @return array magic three-false array that stops auto-incrementing.
*/ */
function sequenceKey() function sequenceKey()
{ {
return array(false, false, false); return array(false, false, false);
@ -157,7 +151,6 @@ class Notice_to_item extends Memcached_DataObject
* *
* @return Notice_to_item new object for this value * @return Notice_to_item new object for this value
*/ */
static function saveNew($notice_id, $item_id) static function saveNew($notice_id, $item_id)
{ {
$n2i = Notice_to_item::staticGet('notice_id', $notice_id); $n2i = Notice_to_item::staticGet('notice_id', $notice_id);

View File

@ -340,7 +340,8 @@ class Facebookclient
function checkPermission($permission) function checkPermission($permission)
{ {
if (!in_array($permission, array('publish_stream', 'status_update'))) { if (!in_array($permission, array('publish_stream', 'status_update'))) {
throw new ServerException("No such permission!"); // TRANS: Server exception thrown when permission check fails.
throw new ServerException(_('No such permission!'));
} }
$fbuid = $this->flink->foreign_id; $fbuid = $this->flink->foreign_id;
@ -397,7 +398,6 @@ class Facebookclient
); );
return false; return false;
} }
} }
@ -461,7 +461,7 @@ class Facebookclient
), ),
__FILE__ __FILE__
); );
// @fixme: We want to rety at a later time when the throttling has expired // @todo FIXME: We want to rety at a later time when the throttling has expired
// instead of just giving up. // instead of just giving up.
return true; return true;
break; break;
@ -582,7 +582,6 @@ class Facebookclient
); );
if (!empty($result)) { // result will contain the item ID if (!empty($result)) { // result will contain the item ID
// Save a mapping // Save a mapping
Notice_to_item::saveNew($this->notice->id, $result); Notice_to_item::saveNew($this->notice->id, $result);
@ -598,7 +597,6 @@ class Facebookclient
), ),
__FILE__ __FILE__
); );
} else { } else {
$msg = sprintf( $msg = sprintf(
@ -740,7 +738,6 @@ class Facebookclient
$result = $this->mailFacebookDisconnect(); $result = $this->mailFacebookDisconnect();
if (!$result) { if (!$result) {
$msg = 'Unable to send email to notify %s (%d), fbuid %d ' $msg = 'Unable to send email to notify %s (%d), fbuid %d '
. 'about his/her Facebook link being removed.'; . 'about his/her Facebook link being removed.';
@ -755,9 +752,7 @@ class Facebookclient
__FILE__ __FILE__
); );
} }
} else { } else {
$msg = 'Unable to send email to notify %s (%d), fbuid %d ' $msg = 'Unable to send email to notify %s (%d), fbuid %d '
. 'about his/her Facebook link being removed because the ' . 'about his/her Facebook link being removed because the '
. 'user has not set an email address.'; . 'user has not set an email address.';
@ -789,26 +784,23 @@ class Facebookclient
common_switch_locale($this->user->language); common_switch_locale($this->user->language);
// TRANS: E-mail subject.
$subject = _m('Your Facebook connection has been removed'); $subject = _m('Your Facebook connection has been removed');
$msg = <<<BODY // TRANS: E-mail body. %1$s is a username, %2$s is the StatusNet sitename.
Hi %1$s, $msg = _m('Hi %1$s,\n\n'.
'We are sorry to inform you we are unable to publish your notice to\n'.
'Facebook, and have removed the connection between your %2$s account and\n'.
'Facebook.\n\n'.
'This may have happened because you have removed permission for %2$s\n'.
'to post on your behalf, or perhaps you have deactivated your Facebook\n'.
'account. You can reconnect your %2$s account to Facebook at any time by\n'.
'logging in with Facebook again.\n\n'.
'Sincerely,\n\n'.
'%2$s\n');
We're sorry to inform you we are unable to publish your notice to
Facebook, and have removed the connection between your %2$s account and
Facebook.
This may have happened because you have removed permission for %2$s
to post on your behalf, or perhaps you have deactivated your Facebook
account. You can reconnect your %s account to Facebook at any time by
logging in with Facebook again.
Sincerely,
%2$s
BODY;
$body = sprintf( $body = sprintf(
_m($msg), $msg,
$this->user->nickname, $this->user->nickname,
$siteName $siteName
); );
@ -848,22 +840,21 @@ BODY;
common_switch_locale($user->language); common_switch_locale($user->language);
// TRANS: E-mail subject. %s is the StatusNet sitename.
$subject = _m('Contact the %s administrator to retrieve your account'); $subject = _m('Contact the %s administrator to retrieve your account');
$msg = <<<BODY // TRANS: E-mail body. %1$s is a username,
Hi %1$s, // TRANS: %2$s is the StatusNet sitename, %3$s is the site contact e-mail address.
$msg = _m('Hi %1$s,\n\n'.
'We have noticed you have deauthorized the Facebook connection for your\n'.
'%2$s account. You have not set a password for your %2$s account yet, so\n'.
'you will not be able to login. If you wish to continue using your %2$s\n'.
'account, please contact the site administrator (%3$s) to set a password.\n\n'.
'Sincerely,\n\n'.
'%2$s\n');
We've noticed you have deauthorized the Facebook connection for your
%2$s account. You have not set a password for your %2$s account yet, so
you will not be able to login. If you wish to continue using your %2$s
account, please contact the site administrator (%3$s) to set a password.
Sincerely,
%2$s
BODY;
$body = sprintf( $body = sprintf(
_m($msg), $msg,
$user->nickname, $user->nickname,
$siteName, $siteName,
$siteEmail $siteEmail
@ -990,9 +981,7 @@ BODY;
$n2i = Notice_to_item::staticGet('notice_id', $this->notice->id); $n2i = Notice_to_item::staticGet('notice_id', $this->notice->id);
if (!empty($this->flink) && !empty($n2i)) { if (!empty($this->flink) && !empty($n2i)) {
try { try {
$result = $this->facebook->api( $result = $this->facebook->api(
array( array(
'method' => 'stream.remove', 'method' => 'stream.remove',
@ -1002,7 +991,6 @@ BODY;
); );
if (!empty($result) && result == true) { if (!empty($result) && result == true) {
common_log( common_log(
LOG_INFO, LOG_INFO,
sprintf( sprintf(
@ -1020,7 +1008,6 @@ BODY;
} else { } else {
throw new FaceboookApiException(var_export($result, true)); throw new FaceboookApiException(var_export($result, true));
} }
} catch (FacebookApiException $e) { } catch (FacebookApiException $e) {
common_log( common_log(
LOG_WARNING, LOG_WARNING,
@ -1049,9 +1036,7 @@ BODY;
$n2i = Notice_to_item::staticGet('notice_id', $this->notice->id); $n2i = Notice_to_item::staticGet('notice_id', $this->notice->id);
if (!empty($this->flink) && !empty($n2i)) { if (!empty($this->flink) && !empty($n2i)) {
try { try {
$result = $this->facebook->api( $result = $this->facebook->api(
array( array(
'method' => 'stream.addlike', 'method' => 'stream.addlike',
@ -1061,7 +1046,6 @@ BODY;
); );
if (!empty($result) && result == true) { if (!empty($result) && result == true) {
common_log( common_log(
LOG_INFO, LOG_INFO,
sprintf( sprintf(
@ -1073,11 +1057,9 @@ BODY;
), ),
__FILE__ __FILE__
); );
} else { } else {
throw new FacebookApiException(var_export($result, true)); throw new FacebookApiException(var_export($result, true));
} }
} catch (FacebookApiException $e) { } catch (FacebookApiException $e) {
common_log( common_log(
LOG_WARNING, LOG_WARNING,
@ -1105,9 +1087,7 @@ BODY;
$n2i = Notice_to_item::staticGet('notice_id', $this->notice->id); $n2i = Notice_to_item::staticGet('notice_id', $this->notice->id);
if (!empty($this->flink) && !empty($n2i)) { if (!empty($this->flink) && !empty($n2i)) {
try { try {
$result = $this->facebook->api( $result = $this->facebook->api(
array( array(
'method' => 'stream.removeLike', 'method' => 'stream.removeLike',
@ -1117,7 +1097,6 @@ BODY;
); );
if (!empty($result) && result == true) { if (!empty($result) && result == true) {
common_log( common_log(
LOG_INFO, LOG_INFO,
sprintf( sprintf(
@ -1133,7 +1112,6 @@ BODY;
} else { } else {
throw new FacebookApiException(var_export($result, true)); throw new FacebookApiException(var_export($result, true));
} }
} catch (FacebookApiException $e) { } catch (FacebookApiException $e) {
common_log( common_log(
LOG_WARNING, LOG_WARNING,
@ -1151,5 +1129,4 @@ BODY;
} }
} }
} }
} }