summaryrefslogtreecommitdiff
path: root/plugins/Facebook
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Facebook')
-rw-r--r--plugins/Facebook/FBConnectAuth.php62
-rw-r--r--plugins/Facebook/FBConnectLogin.php6
-rw-r--r--plugins/Facebook/FBConnectSettings.php30
-rw-r--r--plugins/Facebook/FacebookPlugin.php14
-rw-r--r--plugins/Facebook/facebookaction.php41
-rw-r--r--plugins/Facebook/facebookhome.php20
-rw-r--r--plugins/Facebook/facebookinvite.php12
-rw-r--r--plugins/Facebook/facebooklogin.php2
-rw-r--r--plugins/Facebook/facebookremove.php2
-rw-r--r--plugins/Facebook/facebooksettings.php20
-rw-r--r--plugins/Facebook/facebookutil.php6
-rw-r--r--plugins/Facebook/locale/Facebook.po394
12 files changed, 501 insertions, 108 deletions
diff --git a/plugins/Facebook/FBConnectAuth.php b/plugins/Facebook/FBConnectAuth.php
index b909a4977..51bfc3865 100644
--- a/plugins/Facebook/FBConnectAuth.php
+++ b/plugins/Facebook/FBConnectAuth.php
@@ -48,8 +48,8 @@ class FBConnectauthAction extends Action
common_log(LOG_WARNING, 'Facebook Connect Plugin - ' .
"Failed auth attempt, proxy = $proxy, ip = $ip.");
- $this->clientError(_('You must be logged into Facebook to ' .
- 'use Facebook Connect.'));
+ $this->clientError(_m('You must be logged into Facebook to ' .
+ 'use Facebook Connect.'));
}
return true;
@@ -74,7 +74,7 @@ class FBConnectauthAction extends Action
// We don't want these cookies
getFacebook()->clear_cookie_state();
- $this->clientError(_('There is already a local user linked with this Facebook.'));
+ $this->clientError(_m('There is already a local user linked with this Facebook.'));
} else {
@@ -87,12 +87,12 @@ class FBConnectauthAction extends Action
$token = $this->trimmed('token');
if (!$token || $token != common_session_token()) {
- $this->showForm(_('There was a problem with your session token. Try again, please.'));
+ $this->showForm(_m('There was a problem with your session token. Try again, please.'));
return;
}
if ($this->arg('create')) {
if (!$this->boolean('license')) {
- $this->showForm(_('You can\'t register if you don\'t agree to the license.'),
+ $this->showForm(_m('You can\'t register if you don\'t agree to the license.'),
$this->trimmed('newname'));
return;
}
@@ -102,7 +102,7 @@ class FBConnectauthAction extends Action
} else {
common_debug('Facebook Connect Plugin - ' .
print_r($this->args, true));
- $this->showForm(_('Something weird happened.'),
+ $this->showForm(_m('Something weird happened.'),
$this->trimmed('newname'));
}
} else {
@@ -116,13 +116,13 @@ class FBConnectauthAction extends Action
$this->element('div', array('class' => 'error'), $this->error);
} else {
$this->element('div', 'instructions',
- sprintf(_('This is the first time you\'ve logged into %s so we must connect your Facebook to a local account. You can either create a new account, or connect with your existing account, if you have one.'), common_config('site', 'name')));
+ sprintf(_m('This is the first time you\'ve logged into %s so we must connect your Facebook to a local account. You can either create a new account, or connect with your existing account, if you have one.'), common_config('site', 'name')));
}
}
function title()
{
- return _('Facebook Account Setup');
+ return _m('Facebook Account Setup');
}
function showForm($error=null, $username=null)
@@ -150,7 +150,7 @@ class FBConnectauthAction extends Action
'class' => 'form_settings',
'action' => common_local_url('FBConnectAuth')));
$this->elementStart('fieldset', array('id' => 'settings_facebook_connect_options'));
- $this->element('legend', null, _('Connection options'));
+ $this->element('legend', null, _m('Connection options'));
$this->elementStart('ul', 'form_data');
$this->elementStart('li');
$this->element('input', array('type' => 'checkbox',
@@ -159,10 +159,10 @@ class FBConnectauthAction extends Action
'name' => 'license',
'value' => 'true'));
$this->elementStart('label', array('class' => 'checkbox', 'for' => 'license'));
- $this->text(_('My text and files are available under '));
+ $this->text(_m('My text and files are available under '));
$this->element('a', array('href' => common_config('license', 'url')),
common_config('license', 'title'));
- $this->text(_(' except this private data: password, email address, IM address, phone number.'));
+ $this->text(_m(' except this private data: password, email address, IM address, phone number.'));
$this->elementEnd('label');
$this->elementEnd('li');
$this->elementEnd('ul');
@@ -170,33 +170,33 @@ class FBConnectauthAction extends Action
$this->elementStart('fieldset');
$this->hidden('token', common_session_token());
$this->element('legend', null,
- _('Create new account'));
+ _m('Create new account'));
$this->element('p', null,
- _('Create a new user with this nickname.'));
+ _m('Create a new user with this nickname.'));
$this->elementStart('ul', 'form_data');
$this->elementStart('li');
- $this->input('newname', _('New nickname'),
+ $this->input('newname', _m('New nickname'),
($this->username) ? $this->username : '',
- _('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('ul');
- $this->submit('create', _('Create'));
+ $this->submit('create', _m('Create'));
$this->elementEnd('fieldset');
$this->elementStart('fieldset');
$this->element('legend', null,
- _('Connect existing account'));
+ _m('Connect existing account'));
$this->element('p', null,
- _('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('li');
- $this->input('nickname', _('Existing nickname'));
+ $this->input('nickname', _m('Existing nickname'));
$this->elementEnd('li');
$this->elementStart('li');
- $this->password('password', _('Password'));
+ $this->password('password', _m('Password'));
$this->elementEnd('li');
$this->elementEnd('ul');
- $this->submit('connect', _('Connect'));
+ $this->submit('connect', _m('Connect'));
$this->elementEnd('fieldset');
$this->elementEnd('fieldset');
@@ -212,7 +212,7 @@ class FBConnectauthAction extends Action
function createNewUser()
{
if (common_config('site', 'closed')) {
- $this->clientError(_('Registration not allowed.'));
+ $this->clientError(_m('Registration not allowed.'));
return;
}
@@ -221,14 +221,14 @@ class FBConnectauthAction extends Action
if (common_config('site', 'inviteonly')) {
$code = $_SESSION['invitecode'];
if (empty($code)) {
- $this->clientError(_('Registration not allowed.'));
+ $this->clientError(_m('Registration not allowed.'));
return;
}
$invite = Invitation::staticGet($code);
if (empty($invite)) {
- $this->clientError(_('Not a valid invitation code.'));
+ $this->clientError(_m('Not a valid invitation code.'));
return;
}
}
@@ -238,17 +238,17 @@ class FBConnectauthAction extends Action
if (!Validate::string($nickname, array('min_length' => 1,
'max_length' => 64,
'format' => NICKNAME_FMT))) {
- $this->showForm(_('Nickname must have only lowercase letters and numbers and no spaces.'));
+ $this->showForm(_m('Nickname must have only lowercase letters and numbers and no spaces.'));
return;
}
if (!User::allowed_nickname($nickname)) {
- $this->showForm(_('Nickname not allowed.'));
+ $this->showForm(_m('Nickname not allowed.'));
return;
}
if (User::staticGet('nickname', $nickname)) {
- $this->showForm(_('Nickname already in use. Try another one.'));
+ $this->showForm(_m('Nickname already in use. Try another one.'));
return;
}
@@ -266,7 +266,7 @@ class FBConnectauthAction extends Action
$result = $this->flinkUser($user->id, $this->fbuid);
if (!$result) {
- $this->serverError(_('Error connecting user to Facebook.'));
+ $this->serverError(_m('Error connecting user to Facebook.'));
return;
}
@@ -286,7 +286,7 @@ class FBConnectauthAction extends Action
$password = $this->trimmed('password');
if (!common_check_user($nickname, $password)) {
- $this->showForm(_('Invalid username or password.'));
+ $this->showForm(_m('Invalid username or password.'));
return;
}
@@ -300,7 +300,7 @@ class FBConnectauthAction extends Action
$result = $this->flinkUser($user->id, $this->fbuid);
if (!$result) {
- $this->serverError(_('Error connecting user to Facebook.'));
+ $this->serverError(_m('Error connecting user to Facebook.'));
return;
}
@@ -320,7 +320,7 @@ class FBConnectauthAction extends Action
$result = $this->flinkUser($user->id, $this->fbuid);
if (empty($result)) {
- $this->serverError(_('Error connecting user to Facebook.'));
+ $this->serverError(_m('Error connecting user to Facebook.'));
return;
}
diff --git a/plugins/Facebook/FBConnectLogin.php b/plugins/Facebook/FBConnectLogin.php
index d2bb8054c..20c409f3e 100644
--- a/plugins/Facebook/FBConnectLogin.php
+++ b/plugins/Facebook/FBConnectLogin.php
@@ -30,7 +30,7 @@ class FBConnectLoginAction extends Action
parent::handle($args);
if (common_is_real_login()) {
- $this->clientError(_('Already logged in.'));
+ $this->clientError(_m('Already logged in.'));
}
$this->showPage();
@@ -38,7 +38,7 @@ class FBConnectLoginAction extends Action
function getInstructions()
{
- return _('Login with your Facebook Account');
+ return _m('Login with your Facebook Account');
}
function showPageNotice()
@@ -52,7 +52,7 @@ class FBConnectLoginAction extends Action
function title()
{
- return _('Facebook Login');
+ return _m('Facebook Login');
}
function showContent() {
diff --git a/plugins/Facebook/FBConnectSettings.php b/plugins/Facebook/FBConnectSettings.php
index 911c56787..590dffd8a 100644
--- a/plugins/Facebook/FBConnectSettings.php
+++ b/plugins/Facebook/FBConnectSettings.php
@@ -53,7 +53,7 @@ class FBConnectSettingsAction extends ConnectSettingsAction
function title()
{
- return _('Facebook Connect Settings');
+ return _m('Facebook Connect Settings');
}
/**
@@ -64,7 +64,7 @@ class FBConnectSettingsAction extends ConnectSettingsAction
function getInstructions()
{
- return _('Manage how your account connects to Facebook');
+ return _m('Manage how your account connects to Facebook');
}
/**
@@ -89,7 +89,7 @@ class FBConnectSettingsAction extends ConnectSettingsAction
if (!$flink) {
$this->element('p', 'instructions',
- _('There is no Facebook user connected to this account.'));
+ _m('There is no Facebook user connected to this account.'));
$this->element('fb:login-button', array('onlogin' => 'goto_login()',
'length' => 'long'));
@@ -97,7 +97,7 @@ class FBConnectSettingsAction extends ConnectSettingsAction
} else {
$this->element('p', 'form_note',
- _('Connected Facebook user'));
+ _m('Connected Facebook user'));
$this->elementStart('p', array('class' => 'facebook-user-display'));
$this->elementStart('fb:profile-pic',
@@ -116,18 +116,18 @@ class FBConnectSettingsAction extends ConnectSettingsAction
$this->elementStart('fieldset');
- $this->element('legend', null, _('Disconnect my account from Facebook'));
+ $this->element('legend', null, _m('Disconnect my account from Facebook'));
if (!$user->password) {
$this->elementStart('p', array('class' => 'form_guide'));
- $this->text(_('Disconnecting your Faceboook ' .
- 'would make it impossible to log in! Please '));
+ $this->text(_m('Disconnecting your Faceboook ' .
+ 'would make it impossible to log in! Please '));
$this->element('a',
array('href' => common_local_url('passwordsettings')),
- _('set a password'));
+ _m('set a password'));
- $this->text(_(' first.'));
+ $this->text(_m(' first.'));
$this->elementEnd('p');
} else {
@@ -139,7 +139,7 @@ class FBConnectSettingsAction extends ConnectSettingsAction
$this->element('p', 'instructions',
sprintf($note, $site, $site));
- $this->submit('disconnect', _('Disconnect'));
+ $this->submit('disconnect', _m('Disconnect'));
}
$this->elementEnd('fieldset');
@@ -161,8 +161,8 @@ class FBConnectSettingsAction extends ConnectSettingsAction
// CSRF protection
$token = $this->trimmed('token');
if (!$token || $token != common_session_token()) {
- $this->showForm(_('There was a problem with your session token. '.
- 'Try again, please.'));
+ $this->showForm(_m('There was a problem with your session token. '.
+ 'Try again, please.'));
return;
}
@@ -175,7 +175,7 @@ class FBConnectSettingsAction extends ConnectSettingsAction
if ($result === false) {
common_log_db_error($user, 'DELETE', __FILE__);
- $this->serverError(_('Couldn\'t delete link to Facebook.'));
+ $this->serverError(_m('Couldn\'t delete link to Facebook.'));
return;
}
@@ -191,10 +191,10 @@ class FBConnectSettingsAction extends ConnectSettingsAction
$e->getMessage());
}
- $this->showForm(_('You have disconnected from Facebook.'), true);
+ $this->showForm(_m('You have disconnected from Facebook.'), true);
} else {
- $this->showForm(_('Not sure what you\'re trying to do.'));
+ $this->showForm(_m('Not sure what you\'re trying to do.'));
return;
}
diff --git a/plugins/Facebook/FacebookPlugin.php b/plugins/Facebook/FacebookPlugin.php
index 047477d9c..39b2ef287 100644
--- a/plugins/Facebook/FacebookPlugin.php
+++ b/plugins/Facebook/FacebookPlugin.php
@@ -185,7 +185,6 @@ class FacebookPlugin extends Plugin
// XXX: Facebook says we don't need this FB_RequireFeatures(),
// but we actually do, for IE and Safari. Gar.
- $js = '<script type="text/javascript">';
$js .= ' $(document).ready(function () {';
$js .= ' FB_RequireFeatures(';
$js .= ' ["XFBML"], function() {';
@@ -219,7 +218,6 @@ class FacebookPlugin extends Plugin
$js .= ' }';
$js .= ' );';
$js .= ' });';
- $js .= '</script>';
$js = sprintf($js, $apikey, $login_url, $logout_url);
@@ -227,7 +225,7 @@ class FacebookPlugin extends Plugin
$js = str_replace(' ', '', $js);
- $action->raw(" $js"); // leading two spaces to make it line up
+ $action->inlineScript($js);
}
}
@@ -408,9 +406,9 @@ class FacebookPlugin extends Plugin
$action_name = $action->trimmed('action');
$action->menuItem(common_local_url('FBConnectLogin'),
- _('Facebook'),
- _('Login or register using Facebook'),
- 'FBConnectLogin' === $action_name);
+ _m('Facebook'),
+ _m('Login or register using Facebook'),
+ 'FBConnectLogin' === $action_name);
return true;
}
@@ -428,8 +426,8 @@ class FacebookPlugin extends Plugin
$action_name = $action->trimmed('action');
$action->menuItem(common_local_url('FBConnectSettings'),
- _('Facebook'),
- _('Facebook Connect Settings'),
+ _m('Facebook'),
+ _m('Facebook Connect Settings'),
$action_name === 'FBConnectSettings');
return true;
diff --git a/plugins/Facebook/facebookaction.php b/plugins/Facebook/facebookaction.php
index c852bbf5e..24bf215fd 100644
--- a/plugins/Facebook/facebookaction.php
+++ b/plugins/Facebook/facebookaction.php
@@ -44,7 +44,7 @@ class FacebookAction extends Action
var $app_uri = null;
var $app_name = null;
- function __construct($output='php://output', $indent=true, $facebook=null, $flink=null)
+ function __construct($output='php://output', $indent=null, $facebook=null, $flink=null)
{
parent::__construct($output, $indent);
@@ -168,7 +168,7 @@ class FacebookAction extends Action
$this->elementStart('li', array('class' =>
($this->action == 'facebookhome') ? 'current' : 'facebook_home'));
$this->element('a',
- array('href' => 'index.php', 'title' => _('Home')), _('Home'));
+ array('href' => 'index.php', 'title' => _m('Home')), _m('Home'));
$this->elementEnd('li');
if (common_config('invite', 'enabled')) {
@@ -176,7 +176,7 @@ class FacebookAction extends Action
array('class' =>
($this->action == 'facebookinvite') ? 'current' : 'facebook_invite'));
$this->element('a',
- array('href' => 'invite.php', 'title' => _('Invite')), _('Invite'));
+ array('href' => 'invite.php', 'title' => _m('Invite')), _m('Invite'));
$this->elementEnd('li');
}
@@ -185,7 +185,7 @@ class FacebookAction extends Action
($this->action == 'facebooksettings') ? 'current' : 'facebook_settings'));
$this->element('a',
array('href' => 'settings.php',
- 'title' => _('Settings')), _('Settings'));
+ 'title' => _m('Settings')), _m('Settings'));
$this->elementEnd('li');
$this->elementEnd('ul');
@@ -225,15 +225,15 @@ class FacebookAction extends Action
$this->elementStart('dl', array('class' => 'system_notice'));
$this->element('dt', null, 'Page Notice');
- $loginmsg_part1 = _('To use the %s Facebook Application you need to login ' .
+ $loginmsg_part1 = _m('To use the %s Facebook Application you need to login ' .
'with your username and password. Don\'t have a username yet? ');
- $loginmsg_part2 = _(' a new account.');
+ $loginmsg_part2 = _m(' a new account.');
$this->elementStart('dd');
$this->elementStart('p');
$this->text(sprintf($loginmsg_part1, common_config('site', 'name')));
$this->element('a',
- array('href' => common_local_url('register')), _('Register'));
+ array('href' => common_local_url('register')), _m('Register'));
$this->text($loginmsg_part2);
$this->elementEnd('p');
$this->elementEnd('dd');
@@ -246,7 +246,7 @@ class FacebookAction extends Action
{
$this->elementStart('div', array('id' => 'content'));
- $this->element('h1', null, _('Login'));
+ $this->element('h1', null, _m('Login'));
if ($msg) {
$this->element('fb:error', array('message' => $msg));
@@ -265,20 +265,20 @@ class FacebookAction extends Action
$this->elementStart('ul', array('class' => 'form_datas'));
$this->elementStart('li');
- $this->input('nickname', _('Nickname'));
+ $this->input('nickname', _m('Nickname'));
$this->elementEnd('li');
$this->elementStart('li');
- $this->password('password', _('Password'));
+ $this->password('password', _m('Password'));
$this->elementEnd('li');
$this->elementEnd('ul');
- $this->submit('submit', _('Login'));
+ $this->submit('submit', _m('Login'));
$this->elementEnd('fieldset');
$this->elementEnd('form');
$this->elementStart('p');
$this->element('a', array('href' => common_local_url('recoverpassword')),
- _('Lost or forgotten password?'));
+ _m('Lost or forgotten password?'));
$this->elementEnd('p');
$this->elementEnd('div');
@@ -383,7 +383,7 @@ class FacebookAction extends Action
// Does a little before-after block for next/prev page
if ($have_before || $have_after) {
$this->elementStart('dl', 'pagination');
- $this->element('dt', null, _('Pagination'));
+ $this->element('dt', null, _m('Pagination'));
$this->elementStart('dd', null);
$this->elementStart('ul', array('class' => 'nav'));
}
@@ -392,7 +392,7 @@ class FacebookAction extends Action
$newargs = $args ? array_merge($args, $pargs) : $pargs;
$this->elementStart('li', array('class' => 'nav_prev'));
$this->element('a', array('href' => "$this->app_uri/$action?page=$newargs[page]", 'rel' => 'prev'),
- _('After'));
+ _m('After'));
$this->elementEnd('li');
}
if ($have_after) {
@@ -400,7 +400,7 @@ class FacebookAction extends Action
$newargs = $args ? array_merge($args, $pargs) : $pargs;
$this->elementStart('li', array('class' => 'nav_next'));
$this->element('a', array('href' => "$this->app_uri/$action?page=$newargs[page]", 'rel' => 'next'),
- _('Before'));
+ _m('Before'));
$this->elementEnd('li');
}
if ($have_before || $have_after) {
@@ -418,13 +418,13 @@ class FacebookAction extends Action
$content = $this->trimmed('status_textarea');
if (!$content) {
- $this->showPage(_('No notice content!'));
+ $this->showPage(_m('No notice content!'));
return;
} else {
$content_shortened = common_shorten_links($content);
if (Notice::contentTooLong($content_shortened)) {
- $this->showPage(sprintf(_('That\'s too long. Max notice size is %d chars.'),
+ $this->showPage(sprintf(_m('That\'s too long. Max notice size is %d chars.'),
Notice::maxContent()));
return;
}
@@ -445,8 +445,9 @@ class FacebookAction extends Action
$replyto = $this->trimmed('inreplyto');
try {
- $notice = Notice::saveNew($user->id, $content,
- 'web', 1, ($replyto == 'false') ? null : $replyto);
+ $notice = Notice::saveNew($user->id, $content, 'web',
+ array('reply_to' => ($replyto == 'false') ? null : $replyto));
+
} catch (Exception $e) {
$this->showPage($e->getMessage());
return;
@@ -520,7 +521,7 @@ class FacebookNoticeList extends NoticeList
function show()
{
$this->out->elementStart('div', array('id' =>'notices_primary'));
- $this->out->element('h2', null, _('Notices'));
+ $this->out->element('h2', null, _m('Notices'));
$this->out->elementStart('ul', array('class' => 'notices'));
$cnt = 0;
diff --git a/plugins/Facebook/facebookhome.php b/plugins/Facebook/facebookhome.php
index ea141c2c2..60782f63c 100644
--- a/plugins/Facebook/facebookhome.php
+++ b/plugins/Facebook/facebookhome.php
@@ -108,7 +108,7 @@ class FacebookhomeAction extends FacebookAction
$user = User::staticGet('nickname', $nickname);
if (!$user) {
- $this->showLoginForm(_("Server error - couldn't get user!"));
+ $this->showLoginForm(_m("Server error - couldn't get user!"));
}
$flink = DB_DataObject::factory('foreign_link');
@@ -128,7 +128,7 @@ class FacebookhomeAction extends FacebookAction
return;
} else {
- $msg = _('Incorrect username or password.');
+ $msg = _m('Incorrect username or password.');
}
}
@@ -155,9 +155,9 @@ class FacebookhomeAction extends FacebookAction
function title()
{
if ($this->page > 1) {
- return sprintf(_("%s and friends, page %d"), $this->user->nickname, $this->page);
+ return sprintf(_m("%s and friends, page %d"), $this->user->nickname, $this->page);
} else {
- return sprintf(_("%s and friends"), $this->user->nickname);
+ return sprintf(_m("%s and friends"), $this->user->nickname);
}
}
@@ -186,7 +186,7 @@ class FacebookhomeAction extends FacebookAction
$this->elementStart('div', array('class' => 'facebook_guide'));
- $instructions = sprintf(_('If you would like the %s app to automatically update ' .
+ $instructions = sprintf(_m('If you would like the %s app to automatically update ' .
'your Facebook status with your latest notice, you need ' .
'to give it permission.'), $this->app_name);
@@ -210,13 +210,13 @@ class FacebookhomeAction extends FacebookAction
$this->elementStart('span', array('class' => 'facebook-button'));
$this->element('a', array('href' => $auth_url),
- sprintf(_('Okay, do it!'), $this->app_name));
+ sprintf(_m('Okay, do it!'), $this->app_name));
$this->elementEnd('span');
$this->elementEnd('li');
$this->elementStart('li', array('id' => 'fb-permissions-item'));
- $this->submit('skip', _('Skip'));
+ $this->submit('skip', _m('Skip'));
$this->elementEnd('li');
$this->elementEnd('ul');
@@ -245,7 +245,7 @@ class FacebookhomeAction extends FacebookAction
if ($have_before || $have_after) {
$this->elementStart('dl', 'pagination');
- $this->element('dt', null, _('Pagination'));
+ $this->element('dt', null, _m('Pagination'));
$this->elementStart('dd', null);
$this->elementStart('ul', array('class' => 'nav'));
}
@@ -254,7 +254,7 @@ class FacebookhomeAction extends FacebookAction
$newargs = $args ? array_merge($args, $pargs) : $pargs;
$this->elementStart('li', array('class' => 'nav_prev'));
$this->element('a', array('href' => "$action?page=$newargs[page]", 'rel' => 'prev'),
- _('After'));
+ _m('After'));
$this->elementEnd('li');
}
if ($have_after) {
@@ -262,7 +262,7 @@ class FacebookhomeAction extends FacebookAction
$newargs = $args ? array_merge($args, $pargs) : $pargs;
$this->elementStart('li', array('class' => 'nav_next'));
$this->element('a', array('href' => "$action?page=$newargs[page]", 'rel' => 'next'),
- _('Before'));
+ _m('Before'));
$this->elementEnd('li');
}
if ($have_before || $have_after) {
diff --git a/plugins/Facebook/facebookinvite.php b/plugins/Facebook/facebookinvite.php
index 3380b4c85..e02c7bf3e 100644
--- a/plugins/Facebook/facebookinvite.php
+++ b/plugins/Facebook/facebookinvite.php
@@ -69,9 +69,9 @@ class FacebookinviteAction extends FacebookAction
function showSuccessContent()
{
- $this->element('h2', null, sprintf(_('Thanks for inviting your friends to use %s'),
+ $this->element('h2', null, sprintf(_m('Thanks for inviting your friends to use %s'),
common_config('site', 'name')));
- $this->element('p', null, _('Invitations have been sent to the following users:'));
+ $this->element('p', null, _m('Invitations have been sent to the following users:'));
$friend_ids = $_POST['ids']; // XXX: Hmm... is this the best way to access the list?
@@ -91,7 +91,7 @@ class FacebookinviteAction extends FacebookAction
function showFormContent()
{
- $content = sprintf(_('You have been invited to %s'), common_config('site', 'name')) .
+ $content = sprintf(_m('You have been invited to %s'), common_config('site', 'name')) .
htmlentities('<fb:req-choice url="' . $this->app_uri . '" label="Add"/>');
$this->elementStart('fb:request-form', array('action' => 'invite.php',
@@ -100,7 +100,7 @@ class FacebookinviteAction extends FacebookAction
'type' => common_config('site', 'name'),
'content' => $content));
$this->hidden('invite', 'true');
- $actiontext = sprintf(_('Invite your friends to use %s'), common_config('site', 'name'));
+ $actiontext = sprintf(_m('Invite your friends to use %s'), common_config('site', 'name'));
$multi_params = array('showborder' => 'false');
$multi_params['actiontext'] = $actiontext;
@@ -122,7 +122,7 @@ class FacebookinviteAction extends FacebookAction
if ($exclude_ids) {
- $this->element('h2', null, sprintf(_('Friends already using %s:'),
+ $this->element('h2', null, sprintf(_m('Friends already using %s:'),
common_config('site', 'name')));
$this->elementStart('ul', array('id' => 'facebook-friends'));
@@ -140,7 +140,7 @@ class FacebookinviteAction extends FacebookAction
function title()
{
- return sprintf(_('Send invitations'));
+ return sprintf(_m('Send invitations'));
}
}
diff --git a/plugins/Facebook/facebooklogin.php b/plugins/Facebook/facebooklogin.php
index f77aecca3..7a173ddae 100644
--- a/plugins/Facebook/facebooklogin.php
+++ b/plugins/Facebook/facebooklogin.php
@@ -88,7 +88,7 @@ class FacebookinviteAction extends FacebookAction
function title()
{
- return sprintf(_('Login'));
+ return sprintf(_m('Login'));
}
function redirectHome()
diff --git a/plugins/Facebook/facebookremove.php b/plugins/Facebook/facebookremove.php
index 8531a8e6e..09cb33342 100644
--- a/plugins/Facebook/facebookremove.php
+++ b/plugins/Facebook/facebookremove.php
@@ -55,7 +55,7 @@ class FacebookremoveAction extends FacebookAction
if (!$result) {
common_log_db_error($flink, 'DELETE', __FILE__);
- $this->serverError(_('Couldn\'t remove Facebook user.'));
+ $this->serverError(_m('Couldn\'t remove Facebook user.'));
return;
}
diff --git a/plugins/Facebook/facebooksettings.php b/plugins/Facebook/facebooksettings.php
index d1269f101..766d0e199 100644
--- a/plugins/Facebook/facebooksettings.php
+++ b/plugins/Facebook/facebooksettings.php
@@ -71,9 +71,9 @@ class FacebooksettingsAction extends FacebookAction
$trimmed);
if ($result === false) {
- $this->showForm(_('There was a problem saving your sync preferences!'));
+ $this->showForm(_m('There was a problem saving your sync preferences!'));
} else {
- $this->showForm(_('Sync preferences saved.'), true);
+ $this->showForm(_m('Sync preferences saved.'), true);
}
}
@@ -96,14 +96,14 @@ class FacebooksettingsAction extends FacebookAction
$this->elementStart('li');
- $this->checkbox('noticesync', _('Automatically update my Facebook status with my notices.'),
+ $this->checkbox('noticesync', _m('Automatically update my Facebook status with my notices.'),
($this->flink) ? ($this->flink->noticesync & FOREIGN_NOTICE_SEND) : true);
$this->elementEnd('li');
$this->elementStart('li');
- $this->checkbox('replysync', _('Send "@" replies to Facebook.'),
+ $this->checkbox('replysync', _m('Send "@" replies to Facebook.'),
($this->flink) ? ($this->flink->noticesync & FOREIGN_NOTICE_SEND_REPLY) : true);
$this->elementEnd('li');
@@ -112,15 +112,15 @@ class FacebooksettingsAction extends FacebookAction
$prefix = trim($this->facebook->api_client->data_getUserPreference(FACEBOOK_NOTICE_PREFIX));
- $this->input('prefix', _('Prefix'),
+ $this->input('prefix', _m('Prefix'),
($prefix) ? $prefix : null,
- _('A string to prefix notices with.'));
+ _m('A string to prefix notices with.'));
$this->elementEnd('li');
$this->elementStart('li');
- $this->submit('save', _('Save'));
+ $this->submit('save', _m('Save'));
$this->elementEnd('li');
@@ -130,7 +130,7 @@ class FacebooksettingsAction extends FacebookAction
} else {
- $instructions = sprintf(_('If you would like %s to automatically update ' .
+ $instructions = sprintf(_m('If you would like %s to automatically update ' .
'your Facebook status with your latest notice, you need ' .
'to give it permission.'), $this->app_name);
@@ -143,7 +143,7 @@ class FacebooksettingsAction extends FacebookAction
$this->elementStart('fb:prompt-permission', array('perms' => 'publish_stream',
'next_fbjs' => 'document.setLocation(\'' . "$this->app_uri/settings.php" . '\')'));
$this->element('span', array('class' => 'facebook-button'),
- sprintf(_('Allow %s to update my Facebook status'), common_config('site', 'name')));
+ sprintf(_m('Allow %s to update my Facebook status'), common_config('site', 'name')));
$this->elementEnd('fb:prompt-permission');
$this->elementEnd('li');
$this->elementEnd('ul');
@@ -153,7 +153,7 @@ class FacebooksettingsAction extends FacebookAction
function title()
{
- return _('Sync preferences');
+ return _m('Sync preferences');
}
}
diff --git a/plugins/Facebook/facebookutil.php b/plugins/Facebook/facebookutil.php
index 6f50c173a..2ec6db6b8 100644
--- a/plugins/Facebook/facebookutil.php
+++ b/plugins/Facebook/facebookutil.php
@@ -168,7 +168,7 @@ function facebookBroadcastNotice($notice)
function updateProfileBox($facebook, $flink, $notice) {
$fbaction = new FacebookAction($output = 'php://output',
- $indent = true, $facebook, $flink);
+ $indent = null, $facebook, $flink);
$fbaction->updateProfileBox($notice);
}
@@ -277,10 +277,10 @@ function mail_facebook_app_removed($user)
$site_name = common_config('site', 'name');
$subject = sprintf(
- _('Your %1$s Facebook application access has been disabled.',
+ _m('Your %1$s Facebook application access has been disabled.',
$site_name));
- $body = sprintf(_("Hi, %1\$s. We're sorry to inform you that we are " .
+ $body = sprintf(_m("Hi, %1\$s. We're sorry to inform you that we are " .
'unable to update your Facebook status from %2$s, and have disabled ' .
'the Facebook application for your account. This may be because ' .
'you have removed the Facebook application\'s authorization, or ' .
diff --git a/plugins/Facebook/locale/Facebook.po b/plugins/Facebook/locale/Facebook.po
new file mode 100644
index 000000000..5b313c8c5
--- /dev/null
+++ b/plugins/Facebook/locale/Facebook.po
@@ -0,0 +1,394 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2009-12-07 20:38-0800\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: facebookaction.php:171
+msgid "Home"
+msgstr ""
+
+#: facebookaction.php:179
+msgid "Invite"
+msgstr ""
+
+#: facebookaction.php:188
+msgid "Settings"
+msgstr ""
+
+#: facebookaction.php:228
+#, php-format
+msgid ""
+"To use the %s Facebook Application you need to login with your username and "
+"password. Don't have a username yet? "
+msgstr ""
+
+#: facebookaction.php:230
+msgid " a new account."
+msgstr ""
+
+#: facebookaction.php:236
+msgid "Register"
+msgstr ""
+
+#: facebookaction.php:249 facebookaction.php:275 facebooklogin.php:91
+msgid "Login"
+msgstr ""
+
+#: facebookaction.php:268
+msgid "Nickname"
+msgstr ""
+
+#: facebookaction.php:271 FBConnectAuth.php:196
+msgid "Password"
+msgstr ""
+
+#: facebookaction.php:281
+msgid "Lost or forgotten password?"
+msgstr ""
+
+#: facebookaction.php:386 facebookhome.php:248
+msgid "Pagination"
+msgstr ""
+
+#: facebookaction.php:395 facebookhome.php:257
+msgid "After"
+msgstr ""
+
+#: facebookaction.php:403 facebookhome.php:265
+msgid "Before"
+msgstr ""
+
+#: facebookaction.php:421
+msgid "No notice content!"
+msgstr ""
+
+#: facebookaction.php:427
+#, php-format
+msgid "That's too long. Max notice size is %d chars."
+msgstr ""
+
+#: facebookaction.php:523
+msgid "Notices"
+msgstr ""
+
+#: facebookutil.php:280
+#, php-format
+msgid "Your %1$s Facebook application access has been disabled."
+msgstr ""
+
+#: facebookutil.php:283
+#, php-format
+msgid ""
+"Hi, %1$s. We're sorry to inform you that we are unable to update your "
+"Facebook status from %2$s, and have disabled the Facebook application for "
+"your account. This may be because you have removed the Facebook "
+"application's authorization, or have deleted your Facebook account. You can "
+"re-enable the Facebook application and automatic status updating by re-"
+"installing the %2$s Facebook application.\n"
+"\n"
+"Regards,\n"
+"\n"
+"%2$s"
+msgstr ""
+
+#: FBConnectLogin.php:33
+msgid "Already logged in."
+msgstr ""
+
+#: FBConnectLogin.php:41
+msgid "Login with your Facebook Account"
+msgstr ""
+
+#: FBConnectLogin.php:55
+msgid "Facebook Login"
+msgstr ""
+
+#: facebookhome.php:111
+msgid "Server error - couldn't get user!"
+msgstr ""
+
+#: facebookhome.php:131
+msgid "Incorrect username or password."
+msgstr ""
+
+#: facebookhome.php:158
+#, php-format
+msgid "%s and friends, page %d"
+msgstr ""
+
+#: facebookhome.php:160
+#, php-format
+msgid "%s and friends"
+msgstr ""
+
+#: facebookhome.php:189
+#, php-format
+msgid ""
+"If you would like the %s app to automatically update your Facebook status "
+"with your latest notice, you need to give it permission."
+msgstr ""
+
+#: facebookhome.php:213
+msgid "Okay, do it!"
+msgstr ""
+
+#: facebookhome.php:219
+msgid "Skip"
+msgstr ""
+
+#: facebooksettings.php:74
+msgid "There was a problem saving your sync preferences!"
+msgstr ""
+
+#: facebooksettings.php:76
+msgid "Sync preferences saved."
+msgstr ""
+
+#: facebooksettings.php:99
+msgid "Automatically update my Facebook status with my notices."
+msgstr ""
+
+#: facebooksettings.php:106
+msgid "Send \"@\" replies to Facebook."
+msgstr ""
+
+#: facebooksettings.php:115
+msgid "Prefix"
+msgstr ""
+
+#: facebooksettings.php:117
+msgid "A string to prefix notices with."
+msgstr ""
+
+#: facebooksettings.php:123
+msgid "Save"
+msgstr ""
+
+#: facebooksettings.php:133
+#, php-format
+msgid ""
+"If you would like %s to automatically update your Facebook status with your "
+"latest notice, you need to give it permission."
+msgstr ""
+
+#: facebooksettings.php:146
+#, php-format
+msgid "Allow %s to update my Facebook status"
+msgstr ""
+
+#: facebooksettings.php:156
+msgid "Sync preferences"
+msgstr ""
+
+#: facebookinvite.php:72
+#, php-format
+msgid "Thanks for inviting your friends to use %s"
+msgstr ""
+
+#: facebookinvite.php:74
+msgid "Invitations have been sent to the following users:"
+msgstr ""
+
+#: facebookinvite.php:94
+#, php-format
+msgid "You have been invited to %s"
+msgstr ""
+
+#: facebookinvite.php:103
+#, php-format
+msgid "Invite your friends to use %s"
+msgstr ""
+
+#: facebookinvite.php:125
+#, php-format
+msgid "Friends already using %s:"
+msgstr ""
+
+#: facebookinvite.php:143
+msgid "Send invitations"
+msgstr ""
+
+#: facebookremove.php:58
+msgid "Couldn't remove Facebook user."
+msgstr ""
+
+#: FBConnectSettings.php:56 FacebookPlugin.php:430
+msgid "Facebook Connect Settings"
+msgstr ""
+
+#: FBConnectSettings.php:67
+msgid "Manage how your account connects to Facebook"
+msgstr ""
+
+#: FBConnectSettings.php:92
+msgid "There is no Facebook user connected to this account."
+msgstr ""
+
+#: FBConnectSettings.php:100
+msgid "Connected Facebook user"
+msgstr ""
+
+#: FBConnectSettings.php:119
+msgid "Disconnect my account from Facebook"
+msgstr ""
+
+#: FBConnectSettings.php:124
+msgid ""
+"Disconnecting your Faceboook would make it impossible to log in! Please "
+msgstr ""
+
+#: FBConnectSettings.php:128
+msgid "set a password"
+msgstr ""
+
+#: FBConnectSettings.php:130
+msgid " first."
+msgstr ""
+
+#: FBConnectSettings.php:142
+msgid "Disconnect"
+msgstr ""
+
+#: FBConnectSettings.php:164 FBConnectAuth.php:90
+msgid "There was a problem with your session token. Try again, please."
+msgstr ""
+
+#: FBConnectSettings.php:178
+msgid "Couldn't delete link to Facebook."
+msgstr ""
+
+#: FBConnectSettings.php:194
+msgid "You have disconnected from Facebook."
+msgstr ""
+
+#: FBConnectSettings.php:197
+msgid "Not sure what you're trying to do."
+msgstr ""
+
+#: FBConnectAuth.php:51
+msgid "You must be logged into Facebook to use Facebook Connect."
+msgstr ""
+
+#: FBConnectAuth.php:77
+msgid "There is already a local user linked with this Facebook."
+msgstr ""
+
+#: FBConnectAuth.php:95
+msgid "You can't register if you don't agree to the license."
+msgstr ""
+
+#: FBConnectAuth.php:105
+msgid "Something weird happened."
+msgstr ""
+
+#: FBConnectAuth.php:119
+#, php-format
+msgid ""
+"This is the first time you've logged into %s so we must connect your "
+"Facebook to a local account. You can either create a new account, or connect "
+"with your existing account, if you have one."
+msgstr ""
+
+#: FBConnectAuth.php:125
+msgid "Facebook Account Setup"
+msgstr ""
+
+#: FBConnectAuth.php:153
+msgid "Connection options"
+msgstr ""
+
+#: FBConnectAuth.php:162
+msgid "My text and files are available under "
+msgstr ""
+
+#: FBConnectAuth.php:165
+msgid ""
+" except this private data: password, email address, IM address, phone number."
+msgstr ""
+
+#: FBConnectAuth.php:173
+msgid "Create new account"
+msgstr ""
+
+#: FBConnectAuth.php:175
+msgid "Create a new user with this nickname."
+msgstr ""
+
+#: FBConnectAuth.php:178
+msgid "New nickname"
+msgstr ""
+
+#: FBConnectAuth.php:180
+msgid "1-64 lowercase letters or numbers, no punctuation or spaces"
+msgstr ""
+
+#: FBConnectAuth.php:183
+msgid "Create"
+msgstr ""
+
+#: FBConnectAuth.php:188
+msgid "Connect existing account"
+msgstr ""
+
+#: FBConnectAuth.php:190
+msgid ""
+"If you already have an account, login with your username and password to "
+"connect it to your Facebook."
+msgstr ""
+
+#: FBConnectAuth.php:193
+msgid "Existing nickname"
+msgstr ""
+
+#: FBConnectAuth.php:199
+msgid "Connect"
+msgstr ""
+
+#: FBConnectAuth.php:215 FBConnectAuth.php:224
+msgid "Registration not allowed."
+msgstr ""
+
+#: FBConnectAuth.php:231
+msgid "Not a valid invitation code."
+msgstr ""
+
+#: FBConnectAuth.php:241
+msgid "Nickname must have only lowercase letters and numbers and no spaces."
+msgstr ""
+
+#: FBConnectAuth.php:246
+msgid "Nickname not allowed."
+msgstr ""
+
+#: FBConnectAuth.php:251
+msgid "Nickname already in use. Try another one."
+msgstr ""
+
+#: FBConnectAuth.php:269 FBConnectAuth.php:303 FBConnectAuth.php:323
+msgid "Error connecting user to Facebook."
+msgstr ""
+
+#: FBConnectAuth.php:289
+msgid "Invalid username or password."
+msgstr ""
+
+#: FacebookPlugin.php:409 FacebookPlugin.php:429
+msgid "Facebook"
+msgstr ""
+
+#: FacebookPlugin.php:410
+msgid "Login or register using Facebook"
+msgstr ""