summaryrefslogtreecommitdiff
path: root/plugins/OpenID
diff options
context:
space:
mode:
authorBrion Vibber <brion@status.net>2009-12-08 12:17:11 -0800
committerBrion Vibber <brion@status.net>2009-12-08 12:17:11 -0800
commit4b5e977a7b1c390555d880d3dc7f8b8c6744646c (patch)
tree9aa0f21fdffcb8f737b28d8a676746735574944f /plugins/OpenID
parent3536f01258dc43bee764c98fbdda5a6f1df7bcb2 (diff)
New _m() gettext wrapper with smart detection of plugin domains. Plugin base class registers your gettext files if present at initialization.
update_pot.sh replaced with update_po_templates.php which can do core, plugins, or all (default). Top-level Makefile added to build .mo files for plugins as well as core. As described on list: http://lists.status.net/pipermail/statusnet-dev/2009-December/002869.html
Diffstat (limited to 'plugins/OpenID')
-rw-r--r--plugins/OpenID/OpenIDPlugin.php8
-rw-r--r--plugins/OpenID/finishaddopenid.php16
-rw-r--r--plugins/OpenID/finishopenidlogin.php62
-rw-r--r--plugins/OpenID/locale/OpenID.po344
-rw-r--r--plugins/OpenID/openid.php18
-rw-r--r--plugins/OpenID/openidlogin.php22
-rw-r--r--plugins/OpenID/openidserver.php4
-rw-r--r--plugins/OpenID/openidsettings.php30
-rw-r--r--plugins/OpenID/openidtrust.php10
9 files changed, 429 insertions, 85 deletions
diff --git a/plugins/OpenID/OpenIDPlugin.php b/plugins/OpenID/OpenIDPlugin.php
index e86725d70..a37d5465e 100644
--- a/plugins/OpenID/OpenIDPlugin.php
+++ b/plugins/OpenID/OpenIDPlugin.php
@@ -120,8 +120,8 @@ class OpenIDPlugin extends Plugin
$action_name = $action->trimmed('action');
$action->menuItem(common_local_url('openidlogin'),
- _('OpenID'),
- _('Login or register with OpenID'),
+ _m('OpenID'),
+ _m('Login or register with OpenID'),
$action_name === 'openidlogin');
return true;
@@ -132,8 +132,8 @@ class OpenIDPlugin extends Plugin
$action_name = $action->trimmed('action');
$action->menuItem(common_local_url('openidsettings'),
- _('OpenID'),
- _('Add or remove OpenIDs'),
+ _m('OpenID'),
+ _m('Add or remove OpenIDs'),
$action_name === 'openidsettings');
return true;
diff --git a/plugins/OpenID/finishaddopenid.php b/plugins/OpenID/finishaddopenid.php
index 7cd916523..991e6584e 100644
--- a/plugins/OpenID/finishaddopenid.php
+++ b/plugins/OpenID/finishaddopenid.php
@@ -64,7 +64,7 @@ class FinishaddopenidAction extends Action
{
parent::handle($args);
if (!common_logged_in()) {
- $this->clientError(_('Not logged in.'));
+ $this->clientError(_m('Not logged in.'));
} else {
$this->tryLogin();
}
@@ -85,11 +85,11 @@ class FinishaddopenidAction extends Action
$response = $consumer->complete(common_local_url('finishaddopenid'));
if ($response->status == Auth_OpenID_CANCEL) {
- $this->message(_('OpenID authentication cancelled.'));
+ $this->message(_m('OpenID authentication cancelled.'));
return;
} else if ($response->status == Auth_OpenID_FAILURE) {
// Authentication failed; display the error message.
- $this->message(sprintf(_('OpenID authentication failed: %s'),
+ $this->message(sprintf(_m('OpenID authentication failed: %s'),
$response->message));
} else if ($response->status == Auth_OpenID_SUCCESS) {
@@ -109,9 +109,9 @@ class FinishaddopenidAction extends Action
if ($other) {
if ($other->id == $cur->id) {
- $this->message(_('You already have this OpenID!'));
+ $this->message(_m('You already have this OpenID!'));
} else {
- $this->message(_('Someone else already has this OpenID.'));
+ $this->message(_m('Someone else already has this OpenID.'));
}
return;
}
@@ -123,12 +123,12 @@ class FinishaddopenidAction extends Action
$result = oid_link_user($cur->id, $canonical, $display);
if (!$result) {
- $this->message(_('Error connecting user.'));
+ $this->message(_m('Error connecting user.'));
return;
}
if ($sreg) {
if (!oid_update_user($cur, $sreg)) {
- $this->message(_('Error updating profile'));
+ $this->message(_m('Error updating profile'));
return;
}
}
@@ -167,7 +167,7 @@ class FinishaddopenidAction extends Action
function title()
{
- return _('OpenID Login');
+ return _m('OpenID Login');
}
/**
diff --git a/plugins/OpenID/finishopenidlogin.php b/plugins/OpenID/finishopenidlogin.php
index e5551b412..987fa9213 100644
--- a/plugins/OpenID/finishopenidlogin.php
+++ b/plugins/OpenID/finishopenidlogin.php
@@ -31,16 +31,16 @@ class FinishopenidloginAction extends Action
{
parent::handle($args);
if (common_is_real_login()) {
- $this->clientError(_('Already logged in.'));
+ $this->clientError(_m('Already logged in.'));
} else if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$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;
}
@@ -49,7 +49,7 @@ class FinishopenidloginAction extends Action
$this->connectUser();
} else {
common_debug(print_r($this->args, true), __FILE__);
- $this->showForm(_('Something weird happened.'),
+ $this->showForm(_m('Something weird happened.'),
$this->trimmed('newname'));
}
} else {
@@ -63,13 +63,13 @@ class FinishopenidloginAction 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 OpenID 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 OpenID 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 _('OpenID Account Setup');
+ return _m('OpenID Account Setup');
}
function showForm($error=null, $username=null)
@@ -94,14 +94,14 @@ class FinishopenidloginAction extends Action
$this->hidden('token', common_session_token());
$this->elementStart('fieldset', array('id' => 'form_openid_createaccount'));
$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->elementStart('li');
$this->element('input', array('type' => 'checkbox',
@@ -111,30 +111,30 @@ class FinishopenidloginAction extends Action
'value' => 'true'));
$this->elementStart('label', array('for' => 'license',
'class' => 'checkbox'));
- $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');
- $this->submit('create', _('Create'));
+ $this->submit('create', _m('Create'));
$this->elementEnd('fieldset');
$this->elementStart('fieldset', array('id' => 'form_openid_createaccount'));
$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 OpenID.'));
+ _m('If you already have an account, login with your username and password to connect it to your OpenID.'));
$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('form');
}
@@ -146,11 +146,11 @@ class FinishopenidloginAction extends Action
$response = $consumer->complete(common_local_url('finishopenidlogin'));
if ($response->status == Auth_OpenID_CANCEL) {
- $this->message(_('OpenID authentication cancelled.'));
+ $this->message(_m('OpenID authentication cancelled.'));
return;
} else if ($response->status == Auth_OpenID_FAILURE) {
// Authentication failed; display the error message.
- $this->message(sprintf(_('OpenID authentication failed: %s'), $response->message));
+ $this->message(sprintf(_m('OpenID authentication failed: %s'), $response->message));
} else if ($response->status == Auth_OpenID_SUCCESS) {
// This means the authentication succeeded; extract the
// identity URL and Simple Registration data (if it was
@@ -212,7 +212,7 @@ class FinishopenidloginAction extends Action
# FIXME: save invite code before redirect, and check here
if (common_config('site', 'closed')) {
- $this->clientError(_('Registration not allowed.'));
+ $this->clientError(_m('Registration not allowed.'));
return;
}
@@ -221,14 +221,14 @@ class FinishopenidloginAction 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,24 +238,24 @@ class FinishopenidloginAction 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;
}
list($display, $canonical, $sreg) = $this->getSavedValues();
if (!$display || !$canonical) {
- $this->serverError(_('Stored OpenID not found.'));
+ $this->serverError(_m('Stored OpenID not found.'));
return;
}
@@ -264,7 +264,7 @@ class FinishopenidloginAction extends Action
$other = oid_get_user($canonical);
if ($other) {
- $this->serverError(_('Creating new account for OpenID that already has a user.'));
+ $this->serverError(_m('Creating new account for OpenID that already has a user.'));
return;
}
@@ -324,7 +324,7 @@ class FinishopenidloginAction 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;
}
@@ -335,14 +335,14 @@ class FinishopenidloginAction extends Action
list($display, $canonical, $sreg) = $this->getSavedValues();
if (!$display || !$canonical) {
- $this->serverError(_('Stored OpenID not found.'));
+ $this->serverError(_m('Stored OpenID not found.'));
return;
}
$result = oid_link_user($user->id, $canonical, $display);
if (!$result) {
- $this->serverError(_('Error connecting user to OpenID.'));
+ $this->serverError(_m('Error connecting user to OpenID.'));
return;
}
diff --git a/plugins/OpenID/locale/OpenID.po b/plugins/OpenID/locale/OpenID.po
new file mode 100644
index 000000000..34738bc75
--- /dev/null
+++ b/plugins/OpenID/locale/OpenID.po
@@ -0,0 +1,344 @@
+# 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"
+
+#: openidlogin.php:30 finishopenidlogin.php:34
+msgid "Already logged in."
+msgstr ""
+
+#: openidlogin.php:37 openidsettings.php:194 finishopenidlogin.php:38
+msgid "There was a problem with your session token. Try again, please."
+msgstr ""
+
+#: openidlogin.php:66
+#, php-format
+msgid ""
+"For security reasons, please re-login with your [OpenID](%%doc.openid%%) "
+"before changing your settings."
+msgstr ""
+
+#: openidlogin.php:70
+#, php-format
+msgid "Login with an [OpenID](%%doc.openid%%) account."
+msgstr ""
+
+#: openidlogin.php:95 finishaddopenid.php:170
+msgid "OpenID Login"
+msgstr ""
+
+#: openidlogin.php:112
+msgid "OpenID login"
+msgstr ""
+
+#: openidlogin.php:117 openidsettings.php:107
+msgid "OpenID URL"
+msgstr ""
+
+#: openidlogin.php:119
+msgid "Your OpenID URL"
+msgstr ""
+
+#: openidlogin.php:122
+msgid "Remember me"
+msgstr ""
+
+#: openidlogin.php:123
+msgid "Automatically login in the future; not for shared computers!"
+msgstr ""
+
+#: openidlogin.php:127
+msgid "Login"
+msgstr ""
+
+#: openidserver.php:106
+#, php-format
+msgid "You are not authorized to use the identity %s"
+msgstr ""
+
+#: openidserver.php:126
+msgid "Just an OpenID provider. Nothing to see here, move along..."
+msgstr ""
+
+#: OpenIDPlugin.php:123 OpenIDPlugin.php:135
+msgid "OpenID"
+msgstr ""
+
+#: OpenIDPlugin.php:124
+msgid "Login or register with OpenID"
+msgstr ""
+
+#: OpenIDPlugin.php:136
+msgid "Add or remove OpenIDs"
+msgstr ""
+
+#: openid.php:141
+msgid "Cannot instantiate OpenID consumer object."
+msgstr ""
+
+#: openid.php:151
+msgid "Not a valid OpenID."
+msgstr ""
+
+#: openid.php:153
+#, php-format
+msgid "OpenID failure: %s"
+msgstr ""
+
+#: openid.php:180
+#, php-format
+msgid "Could not redirect to server: %s"
+msgstr ""
+
+#: openid.php:198
+#, php-format
+msgid "Could not create OpenID form: %s"
+msgstr ""
+
+#: openid.php:214
+msgid ""
+"This form should automatically submit itself. If not, click the submit "
+"button to go to your OpenID provider."
+msgstr ""
+
+#: openid.php:246
+msgid "Error saving the profile."
+msgstr ""
+
+#: openid.php:257
+msgid "Error saving the user."
+msgstr ""
+
+#: openid.php:277
+msgid "OpenID Auto-Submit"
+msgstr ""
+
+#: openidtrust.php:51
+msgid "OpenID Identity Verification"
+msgstr ""
+
+#: openidtrust.php:69
+msgid ""
+"This page should only be reached during OpenID processing, not directly."
+msgstr ""
+
+#: openidtrust.php:118
+#, php-format
+msgid ""
+"%s has asked to verify your identity. Click Continue to verify your "
+"identity and login without creating a new password."
+msgstr ""
+
+#: openidtrust.php:136
+msgid "Continue"
+msgstr ""
+
+#: openidtrust.php:137
+msgid "Cancel"
+msgstr ""
+
+#: finishaddopenid.php:67
+msgid "Not logged in."
+msgstr ""
+
+#: finishaddopenid.php:88 finishopenidlogin.php:149
+msgid "OpenID authentication cancelled."
+msgstr ""
+
+#: finishaddopenid.php:92 finishopenidlogin.php:153
+#, php-format
+msgid "OpenID authentication failed: %s"
+msgstr ""
+
+#: finishaddopenid.php:112
+msgid "You already have this OpenID!"
+msgstr ""
+
+#: finishaddopenid.php:114
+msgid "Someone else already has this OpenID."
+msgstr ""
+
+#: finishaddopenid.php:126
+msgid "Error connecting user."
+msgstr ""
+
+#: finishaddopenid.php:131
+msgid "Error updating profile"
+msgstr ""
+
+#: openidsettings.php:59
+msgid "OpenID settings"
+msgstr ""
+
+#: openidsettings.php:70
+#, php-format
+msgid ""
+"[OpenID](%%doc.openid%%) lets you log into many sites with the same user "
+"account. Manage your associated OpenIDs from here."
+msgstr ""
+
+#: openidsettings.php:99
+msgid "Add OpenID"
+msgstr ""
+
+#: openidsettings.php:102
+msgid ""
+"If you want to add an OpenID to your account, enter it in the box below and "
+"click \"Add\"."
+msgstr ""
+
+#: openidsettings.php:117
+msgid "Add"
+msgstr ""
+
+#: openidsettings.php:129
+msgid "Remove OpenID"
+msgstr ""
+
+#: openidsettings.php:134
+msgid ""
+"Removing your only OpenID would make it impossible to log in! If you need to "
+"remove it, add another OpenID first."
+msgstr ""
+
+#: openidsettings.php:149
+msgid ""
+"You can remove an OpenID from your account by clicking the button marked "
+"\"Remove\"."
+msgstr ""
+
+#: openidsettings.php:172
+msgid "Remove"
+msgstr ""
+
+#: openidsettings.php:208 finishopenidlogin.php:52
+msgid "Something weird happened."
+msgstr ""
+
+#: openidsettings.php:228
+msgid "No such OpenID."
+msgstr ""
+
+#: openidsettings.php:233
+msgid "That OpenID does not belong to you."
+msgstr ""
+
+#: openidsettings.php:237
+msgid "OpenID removed."
+msgstr ""
+
+#: finishopenidlogin.php:43
+msgid "You can't register if you don't agree to the license."
+msgstr ""
+
+#: finishopenidlogin.php:66
+#, php-format
+msgid ""
+"This is the first time you've logged into %s so we must connect your OpenID "
+"to a local account. You can either create a new account, or connect with "
+"your existing account, if you have one."
+msgstr ""
+
+#: finishopenidlogin.php:72
+msgid "OpenID Account Setup"
+msgstr ""
+
+#: finishopenidlogin.php:97
+msgid "Create new account"
+msgstr ""
+
+#: finishopenidlogin.php:99
+msgid "Create a new user with this nickname."
+msgstr ""
+
+#: finishopenidlogin.php:102
+msgid "New nickname"
+msgstr ""
+
+#: finishopenidlogin.php:104
+msgid "1-64 lowercase letters or numbers, no punctuation or spaces"
+msgstr ""
+
+#: finishopenidlogin.php:114
+msgid "My text and files are available under "
+msgstr ""
+
+#: finishopenidlogin.php:117
+msgid ""
+" except this private data: password, email address, IM address, phone number."
+msgstr ""
+
+#: finishopenidlogin.php:121
+msgid "Create"
+msgstr ""
+
+#: finishopenidlogin.php:126
+msgid "Connect existing account"
+msgstr ""
+
+#: finishopenidlogin.php:128
+msgid ""
+"If you already have an account, login with your username and password to "
+"connect it to your OpenID."
+msgstr ""
+
+#: finishopenidlogin.php:131
+msgid "Existing nickname"
+msgstr ""
+
+#: finishopenidlogin.php:134
+msgid "Password"
+msgstr ""
+
+#: finishopenidlogin.php:137
+msgid "Connect"
+msgstr ""
+
+#: finishopenidlogin.php:215 finishopenidlogin.php:224
+msgid "Registration not allowed."
+msgstr ""
+
+#: finishopenidlogin.php:231
+msgid "Not a valid invitation code."
+msgstr ""
+
+#: finishopenidlogin.php:241
+msgid "Nickname must have only lowercase letters and numbers and no spaces."
+msgstr ""
+
+#: finishopenidlogin.php:246
+msgid "Nickname not allowed."
+msgstr ""
+
+#: finishopenidlogin.php:251
+msgid "Nickname already in use. Try another one."
+msgstr ""
+
+#: finishopenidlogin.php:258 finishopenidlogin.php:338
+msgid "Stored OpenID not found."
+msgstr ""
+
+#: finishopenidlogin.php:267
+msgid "Creating new account for OpenID that already has a user."
+msgstr ""
+
+#: finishopenidlogin.php:327
+msgid "Invalid username or password."
+msgstr ""
+
+#: finishopenidlogin.php:345
+msgid "Error connecting user to OpenID."
+msgstr ""
diff --git a/plugins/OpenID/openid.php b/plugins/OpenID/openid.php
index dd628e773..8f949c9c5 100644
--- a/plugins/OpenID/openid.php
+++ b/plugins/OpenID/openid.php
@@ -138,7 +138,7 @@ function oid_authenticate($openid_url, $returnto, $immediate=false)
$consumer = oid_consumer();
if (!$consumer) {
- common_server_error(_('Cannot instantiate OpenID consumer object.'));
+ common_server_error(_m('Cannot instantiate OpenID consumer object.'));
return false;
}
@@ -148,9 +148,9 @@ function oid_authenticate($openid_url, $returnto, $immediate=false)
// Handle failure status return values.
if (!$auth_request) {
- return _('Not a valid OpenID.');
+ return _m('Not a valid OpenID.');
} else if (Auth_OpenID::isFailure($auth_request)) {
- return sprintf(_('OpenID failure: %s'), $auth_request->message);
+ return sprintf(_m('OpenID failure: %s'), $auth_request->message);
}
$sreg_request = Auth_OpenID_SRegRequest::build(// Required
@@ -177,7 +177,7 @@ function oid_authenticate($openid_url, $returnto, $immediate=false)
$immediate);
if (!$redirect_url) {
} else if (Auth_OpenID::isFailure($redirect_url)) {
- return sprintf(_('Could not redirect to server: %s'), $redirect_url->message);
+ return sprintf(_m('Could not redirect to server: %s'), $redirect_url->message);
} else {
common_redirect($redirect_url, 303);
}
@@ -195,7 +195,7 @@ function oid_authenticate($openid_url, $returnto, $immediate=false)
// Display an error if the form markup couldn't be generated;
// otherwise, render the HTML.
if (Auth_OpenID::isFailure($form_html)) {
- common_server_error(sprintf(_('Could not create OpenID form: %s'), $form_html->message));
+ common_server_error(sprintf(_m('Could not create OpenID form: %s'), $form_html->message));
} else {
$action = new AutosubmitAction(); // see below
$action->form_html = $form_html;
@@ -211,7 +211,7 @@ function oid_authenticate($openid_url, $returnto, $immediate=false)
function _oid_print_instructions()
{
common_element('div', 'instructions',
- _('This form should automatically submit itself. '.
+ _m('This form should automatically submit itself. '.
'If not, click the submit button to go to your '.
'OpenID provider.'));
}
@@ -243,7 +243,7 @@ function oid_update_user(&$user, &$sreg)
# XXX save timezone if it's passed
if (!$profile->update($orig_profile)) {
- common_server_error(_('Error saving the profile.'));
+ common_server_error(_m('Error saving the profile.'));
return false;
}
@@ -254,7 +254,7 @@ function oid_update_user(&$user, &$sreg)
}
if (!$user->update($orig_user)) {
- common_server_error(_('Error saving the user.'));
+ common_server_error(_m('Error saving the user.'));
return false;
}
@@ -274,7 +274,7 @@ class AutosubmitAction extends Action
function title()
{
- return _('OpenID Auto-Submit');
+ return _m('OpenID Auto-Submit');
}
function showContent()
diff --git a/plugins/OpenID/openidlogin.php b/plugins/OpenID/openidlogin.php
index 29e89234e..9ba55911c 100644
--- a/plugins/OpenID/openidlogin.php
+++ b/plugins/OpenID/openidlogin.php
@@ -27,14 +27,14 @@ class OpenidloginAction extends Action
{
parent::handle($args);
if (common_is_real_login()) {
- $this->clientError(_('Already logged in.'));
+ $this->clientError(_m('Already logged in.'));
} else if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$openid_url = $this->trimmed('openid_url');
# 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.'), $openid_url);
+ $this->showForm(_m('There was a problem with your session token. Try again, please.'), $openid_url);
return;
}
@@ -63,11 +63,11 @@ class OpenidloginAction extends Action
common_get_returnto()) {
// rememberme logins have to reauthenticate before
// changing any profile settings (cookie-stealing protection)
- return _('For security reasons, please re-login with your ' .
+ return _m('For security reasons, please re-login with your ' .
'[OpenID](%%doc.openid%%) ' .
'before changing your settings.');
} else {
- return _('Login with an [OpenID](%%doc.openid%%) account.');
+ return _m('Login with an [OpenID](%%doc.openid%%) account.');
}
}
@@ -92,7 +92,7 @@ class OpenidloginAction extends Action
function title()
{
- return _('OpenID Login');
+ return _m('OpenID Login');
}
function showForm($error=null, $openid_url)
@@ -109,22 +109,22 @@ class OpenidloginAction extends Action
'class' => 'form_settings',
'action' => $formaction));
$this->elementStart('fieldset');
- $this->element('legend', null, _('OpenID login'));
+ $this->element('legend', null, _m('OpenID login'));
$this->hidden('token', common_session_token());
$this->elementStart('ul', 'form_data');
$this->elementStart('li');
- $this->input('openid_url', _('OpenID URL'),
+ $this->input('openid_url', _m('OpenID URL'),
$this->openid_url,
- _('Your OpenID URL'));
+ _m('Your OpenID URL'));
$this->elementEnd('li');
$this->elementStart('li', array('id' => 'settings_rememberme'));
- $this->checkbox('rememberme', _('Remember me'), false,
- _('Automatically login in the future; ' .
+ $this->checkbox('rememberme', _m('Remember me'), false,
+ _m('Automatically login in the future; ' .
'not for shared computers!'));
$this->elementEnd('li');
$this->elementEnd('ul');
- $this->submit('submit', _('Login'));
+ $this->submit('submit', _m('Login'));
$this->elementEnd('fieldset');
$this->elementEnd('form');
}
diff --git a/plugins/OpenID/openidserver.php b/plugins/OpenID/openidserver.php
index dab97c93e..181cbdf45 100644
--- a/plugins/OpenID/openidserver.php
+++ b/plugins/OpenID/openidserver.php
@@ -103,7 +103,7 @@ class OpenidserverAction extends Action
$response = $this->generateDenyResponse($request);
} else {
//invalid
- $this->clientError(sprintf(_('You are not authorized to use the identity %s'),$request->identity),$code=403);
+ $this->clientError(sprintf(_m('You are not authorized to use the identity %s'),$request->identity),$code=403);
}
} else {
$response = $this->oserver->handleRequest($request);
@@ -123,7 +123,7 @@ class OpenidserverAction extends Action
}
$this->raw($response->body);
}else{
- $this->clientError(_('Just an OpenID provider. Nothing to see here, move along...'),$code=500);
+ $this->clientError(_m('Just an OpenID provider. Nothing to see here, move along...'),$code=500);
}
}
diff --git a/plugins/OpenID/openidsettings.php b/plugins/OpenID/openidsettings.php
index 3ad46f5f5..3fc3d6128 100644
--- a/plugins/OpenID/openidsettings.php
+++ b/plugins/OpenID/openidsettings.php
@@ -56,7 +56,7 @@ class OpenidsettingsAction extends AccountSettingsAction
function title()
{
- return _('OpenID settings');
+ return _m('OpenID settings');
}
/**
@@ -67,7 +67,7 @@ class OpenidsettingsAction extends AccountSettingsAction
function getInstructions()
{
- return _('[OpenID](%%doc.openid%%) lets you log into many sites' .
+ return _m('[OpenID](%%doc.openid%%) lets you log into many sites' .
' with the same user account.'.
' Manage your associated OpenIDs from here.');
}
@@ -96,15 +96,15 @@ class OpenidsettingsAction extends AccountSettingsAction
'action' =>
common_local_url('openidsettings')));
$this->elementStart('fieldset', array('id' => 'settings_openid_add'));
- $this->element('legend', null, _('Add OpenID'));
+ $this->element('legend', null, _m('Add OpenID'));
$this->hidden('token', common_session_token());
$this->element('p', 'form_guide',
- _('If you want to add an OpenID to your account, ' .
+ _m('If you want to add an OpenID to your account, ' .
'enter it in the box below and click "Add".'));
$this->elementStart('ul', 'form_data');
$this->elementStart('li');
$this->element('label', array('for' => 'openid_url'),
- _('OpenID URL'));
+ _m('OpenID URL'));
$this->element('input', array('name' => 'openid_url',
'type' => 'text',
'id' => 'openid_url'));
@@ -114,7 +114,7 @@ class OpenidsettingsAction extends AccountSettingsAction
'id' => 'settings_openid_add_action-submit',
'name' => 'add',
'class' => 'submit',
- 'value' => _('Add')));
+ 'value' => _m('Add')));
$this->elementEnd('fieldset');
$this->elementEnd('form');
@@ -126,12 +126,12 @@ class OpenidsettingsAction extends AccountSettingsAction
if ($cnt > 0) {
- $this->element('h2', null, _('Remove OpenID'));
+ $this->element('h2', null, _m('Remove OpenID'));
if ($cnt == 1 && !$user->password) {
$this->element('p', 'form_guide',
- _('Removing your only OpenID '.
+ _m('Removing your only OpenID '.
'would make it impossible to log in! ' .
'If you need to remove it, '.
'add another OpenID first.'));
@@ -146,7 +146,7 @@ class OpenidsettingsAction extends AccountSettingsAction
} else {
$this->element('p', 'form_guide',
- _('You can remove an OpenID from your account '.
+ _m('You can remove an OpenID from your account '.
'by clicking the button marked "Remove".'));
$idx = 0;
@@ -169,7 +169,7 @@ class OpenidsettingsAction extends AccountSettingsAction
'id' => 'remove'.$idx,
'name' => 'remove',
'class' => 'submit remove',
- 'value' => _('Remove')));
+ 'value' => _m('Remove')));
$this->elementEnd('fieldset');
$this->elementEnd('form');
$idx++;
@@ -191,7 +191,7 @@ class OpenidsettingsAction extends AccountSettingsAction
// CSRF protection
$token = $this->trimmed('token');
if (!$token || $token != common_session_token()) {
- $this->showForm(_('There was a problem with your session token. '.
+ $this->showForm(_m('There was a problem with your session token. '.
'Try again, please.'));
return;
}
@@ -205,7 +205,7 @@ class OpenidsettingsAction extends AccountSettingsAction
} else if ($this->arg('remove')) {
$this->removeOpenid();
} else {
- $this->showForm(_('Something weird happened.'));
+ $this->showForm(_m('Something weird happened.'));
}
}
@@ -225,16 +225,16 @@ class OpenidsettingsAction extends AccountSettingsAction
$oid = User_openid::staticGet('canonical', $openid_url);
if (!$oid) {
- $this->showForm(_('No such OpenID.'));
+ $this->showForm(_m('No such OpenID.'));
return;
}
$cur = common_current_user();
if (!$cur || $oid->user_id != $cur->id) {
- $this->showForm(_('That OpenID does not belong to you.'));
+ $this->showForm(_m('That OpenID does not belong to you.'));
return;
}
$oid->delete();
- $this->showForm(_('OpenID removed.'), true);
+ $this->showForm(_m('OpenID removed.'), true);
return;
}
}
diff --git a/plugins/OpenID/openidtrust.php b/plugins/OpenID/openidtrust.php
index 29c7bdc23..fa7ea36e2 100644
--- a/plugins/OpenID/openidtrust.php
+++ b/plugins/OpenID/openidtrust.php
@@ -48,7 +48,7 @@ class OpenidtrustAction extends Action
function title()
{
- return _('OpenID Identity Verification');
+ return _m('OpenID Identity Verification');
}
function prepare($args)
@@ -66,7 +66,7 @@ class OpenidtrustAction extends Action
$this->allowUrl = $_SESSION['openid_allow_url'];
$this->denyUrl = $_SESSION['openid_deny_url'];
if(empty($this->trust_root) || empty($this->allowUrl) || empty($this->denyUrl)){
- $this->clientError(_('This page should only be reached during OpenID processing, not directly.'));
+ $this->clientError(_m('This page should only be reached during OpenID processing, not directly.'));
return;
}
return true;
@@ -115,7 +115,7 @@ class OpenidtrustAction extends Action
function showPageNotice()
{
- $this->element('p',null,sprintf(_('%s has asked to verify your identity. Click Continue to verify your identity and login without creating a new password.'),$this->trust_root));
+ $this->element('p',null,sprintf(_m('%s has asked to verify your identity. Click Continue to verify your identity and login without creating a new password.'),$this->trust_root));
}
/**
@@ -133,8 +133,8 @@ class OpenidtrustAction extends Action
'class' => 'form_settings',
'action' => common_local_url('openidtrust')));
$this->elementStart('fieldset');
- $this->submit('allow', _('Continue'));
- $this->submit('deny', _('Cancel'));
+ $this->submit('allow', _m('Continue'));
+ $this->submit('deny', _m('Cancel'));
$this->elementEnd('fieldset');
$this->elementEnd('form');