From 0df111025f364dcfd61f9420a3f4b5260e96c1d1 Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Wed, 27 Apr 2011 20:37:44 +0200 Subject: [PATCH] Update translator documentation. L10n/i18n fixes. Update whitespace. --- plugins/NoticeTitle/NoticeTitlePlugin.php | 25 +++------ plugins/NoticeTitle/Notice_title.php | 7 --- .../OpenExternalLinkTargetPlugin.php | 1 + plugins/OpenID/OpenIDPlugin.php | 29 ++++++----- plugins/OpenID/User_openid.php | 1 - plugins/OpenID/User_openid_trustroot.php | 1 - plugins/OpenID/finishaddopenid.php | 21 +++----- plugins/OpenID/finishopenidlogin.php | 24 +++++---- plugins/OpenID/openid.php | 9 ++-- plugins/OpenID/openidadminpanel.php | 42 +++++++++------ plugins/OpenID/openidlogin.php | 14 ++--- plugins/OpenID/openidserver.php | 3 +- plugins/OpenID/openidsettings.php | 52 ++++++++++++------- plugins/OpenID/openidtrust.php | 15 +++--- plugins/OpenX/OpenXPlugin.php | 4 +- plugins/OpenX/openxadminpanel.php | 2 +- 16 files changed, 129 insertions(+), 121 deletions(-) diff --git a/plugins/NoticeTitle/NoticeTitlePlugin.php b/plugins/NoticeTitle/NoticeTitlePlugin.php index 054c3d3e48..39df2621ac 100644 --- a/plugins/NoticeTitle/NoticeTitlePlugin.php +++ b/plugins/NoticeTitle/NoticeTitlePlugin.php @@ -48,7 +48,6 @@ define('NOTICE_TITLE_PLUGIN_VERSION', '0.1'); * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 * @link http://status.net/ */ - class NoticeTitlePlugin extends Plugin { @@ -67,7 +66,6 @@ class NoticeTitlePlugin extends Plugin * * @return boolean hook value; true means continue processing, false means stop. */ - function onCheckSchema() { $schema = Schema::get(); @@ -95,7 +93,6 @@ class NoticeTitlePlugin extends Plugin * * @return boolean hook value; true means continue processing, false means stop. */ - function onAutoload($cls) { $dir = dirname(__FILE__); @@ -119,7 +116,6 @@ class NoticeTitlePlugin extends Plugin * * @return boolean hook value */ - function onPluginVersion(&$versions) { $url = 'http://status.net/wiki/Plugin:NoticeTitle'; @@ -129,6 +125,7 @@ class NoticeTitlePlugin extends Plugin 'author' => 'Evan Prodromou', 'homepage' => $url, 'rawdescription' => + // TRANS: Plugin description. _m('Adds optional titles to notices.')); return true; } @@ -140,7 +137,6 @@ class NoticeTitlePlugin extends Plugin * * @return boolean hook value */ - function onStartShowNoticeFormData($form) { if ($this->isAllowedRichEdit()) { @@ -166,14 +162,17 @@ class NoticeTitlePlugin extends Plugin * * @return boolean hook value */ - function onStartNoticeSaveWeb($action, &$authorId, &$text, &$options) { $title = $action->trimmed('notice_title'); if (!empty($title) && $this->isAllowedRichEdit()) { if (mb_strlen($title) > Notice_title::MAXCHARS) { - throw new Exception(sprintf(_m("The notice title is too long (max %d characters).", - Notice_title::MAXCHARS))); + // TRANS: Exception thrown when a notice title is too long. + // TRANS: %d is the maximum number of characters allowed in a title (used for plural). + throw new Exception(sprintf(_m('The notice title is too long (maximum %d character).', + 'The notice title is too long (maximum %d characters).', + Notice_title::MAXCHARS), + Notice_title::MAXCHARS)); } } return true; @@ -187,7 +186,6 @@ class NoticeTitlePlugin extends Plugin * * @return boolean hook value */ - function onEndNoticeSaveWeb($action, $notice) { if (!empty($notice)) { @@ -215,7 +213,6 @@ class NoticeTitlePlugin extends Plugin * * @return boolean hook value */ - function onStartShowNoticeItem($nli) { $title = Notice_title::fromNotice($nli->notice); @@ -237,7 +234,6 @@ class NoticeTitlePlugin extends Plugin * * @return boolean hook value */ - function onEndRssEntryArray($notice, &$entry) { $title = Notice_title::fromNotice($notice); @@ -258,7 +254,6 @@ class NoticeTitlePlugin extends Plugin * * @return boolean hook value */ - function onEndNoticeAsActivity($notice, &$activity) { $title = Notice_title::fromNotice($notice); @@ -282,7 +277,6 @@ class NoticeTitlePlugin extends Plugin * * @return boolean hook value */ - function onNoticeDeleteRelated($notice) { $nt = Notice_title::staticGet('notice_id', $notice->id); @@ -301,7 +295,6 @@ class NoticeTitlePlugin extends Plugin * * @return boolean hook value */ - function onStartShowHeadTitle($action) { $actionName = $action->trimmed('action'); @@ -327,7 +320,6 @@ class NoticeTitlePlugin extends Plugin * * @return boolean hook value */ - function onStartShowPageTitle($action) { $actionName = $action->trimmed('action'); @@ -348,7 +340,7 @@ class NoticeTitlePlugin extends Plugin * Always true unless the plugin's "restricted" setting is on, in which * case it's limited to users with the "richedit" role. * - * @fixme make that more sanely configurable :) + * @todo FIXME: make that more sanely configurable :) * * @return boolean */ @@ -361,5 +353,4 @@ class NoticeTitlePlugin extends Plugin return true; } } - } diff --git a/plugins/NoticeTitle/Notice_title.php b/plugins/NoticeTitle/Notice_title.php index b66ea9901b..4030b5c965 100644 --- a/plugins/NoticeTitle/Notice_title.php +++ b/plugins/NoticeTitle/Notice_title.php @@ -44,7 +44,6 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php'; * * @see DB_DataObject */ - class Notice_title extends Memcached_DataObject { const MAXCHARS = 255; @@ -64,7 +63,6 @@ class Notice_title extends Memcached_DataObject * @return Notice_title object found, or null for no hits * */ - function staticGet($k, $v=null) { return Memcached_DataObject::staticGet('Notice_title', $k, $v); @@ -78,7 +76,6 @@ class Notice_title extends Memcached_DataObject * * @return array array of column definitions */ - function table() { return array('notice_id' => DB_DATAOBJECT_INT + DB_DATAOBJECT_NOTNULL, @@ -90,7 +87,6 @@ class Notice_title extends Memcached_DataObject * * @return array list of key field names */ - function keys() { return array_keys($this->keyTypes()); @@ -101,7 +97,6 @@ class Notice_title extends Memcached_DataObject * * @return array list mapping field names to key types */ - function keyTypes() { return array('notice_id' => 'K'); @@ -112,7 +107,6 @@ class Notice_title extends Memcached_DataObject * * @return array magic three-false array that stops auto-incrementing. */ - function sequenceKey() { return array(false, false, false); @@ -125,7 +119,6 @@ class Notice_title extends Memcached_DataObject * * @return string title of the notice, or null if none */ - static function fromNotice($notice) { $nt = Notice_title::staticGet('notice_id', $notice->id); diff --git a/plugins/OpenExternalLinkTarget/OpenExternalLinkTargetPlugin.php b/plugins/OpenExternalLinkTarget/OpenExternalLinkTargetPlugin.php index f0f6144e01..4453c2f122 100644 --- a/plugins/OpenExternalLinkTarget/OpenExternalLinkTargetPlugin.php +++ b/plugins/OpenExternalLinkTarget/OpenExternalLinkTargetPlugin.php @@ -56,6 +56,7 @@ class OpenExternalLinkTargetPlugin extends Plugin 'author' => 'Sarven Capadisli', 'homepage' => 'http://status.net/wiki/Plugin:OpenExternalLinkTarget', 'rawdescription' => + // TRANS: Plugin description. _m('Opens external links (i.e. with rel=external) on a new window or tab.')); return true; } diff --git a/plugins/OpenID/OpenIDPlugin.php b/plugins/OpenID/OpenIDPlugin.php index 6089777eb9..758c97b5f9 100644 --- a/plugins/OpenID/OpenIDPlugin.php +++ b/plugins/OpenID/OpenIDPlugin.php @@ -135,7 +135,7 @@ class OpenIDPlugin extends Plugin common_redirect(common_local_url('openidsettings')); exit(0); } else if ($action == 'recoverpassword') { - throw new ClientException('Unavailable action'); + throw new ClientException('Unavailable action.'); } } } @@ -215,7 +215,7 @@ class OpenIDPlugin extends Plugin { if (common_config('site', 'openidonly') && !common_logged_in()) { // TRANS: Tooltip for main menu option "Login" - $tooltip = _m('TOOLTIP', 'Login to the site'); + $tooltip = _m('TOOLTIP', 'Login to the site.'); $action->menuItem(common_local_url('openidlogin'), // TRANS: Main menu option when not logged in to log in _m('MENU', 'Login'), @@ -232,7 +232,7 @@ class OpenIDPlugin extends Plugin 'nav_help'); if (!common_config('site', 'private')) { // TRANS: Tooltip for main menu option "Search" - $tooltip = _m('TOOLTIP', 'Search for people or text'); + $tooltip = _m('TOOLTIP', 'Search for people or text.'); $action->menuItem(common_local_url('peoplesearch'), // TRANS: Main menu option when logged in or when the StatusNet instance is not private _m('MENU', 'Search'), $tooltip, false, 'nav_search'); @@ -294,7 +294,7 @@ class OpenIDPlugin extends Plugin // TRANS: OpenID plugin menu item on site logon page. _m('MENU', 'OpenID'), // TRANS: OpenID plugin tooltip for logon menu item. - _m('Login or register with OpenID'), + _m('Login or register with OpenID.'), $action_name === 'openidlogin'); } @@ -330,7 +330,7 @@ class OpenIDPlugin extends Plugin // TRANS: OpenID plugin menu item on user settings page. _m('MENU', 'OpenID'), // TRANS: OpenID plugin tooltip for user settings menu item. - _m('Add or remove OpenIDs'), + _m('Add or remove OpenIDs.'), $action_name === 'openidsettings'); return true; @@ -532,7 +532,8 @@ class OpenIDPlugin extends Plugin function onEndLoadDoc($title, &$output) { if ($title == 'help') { - $menuitem = '* [OpenID](%%doc.openid%%) - what OpenID is and how to use it with this service'; + // TRANS: Item on help page. This message contains Markdown links in the form [description](link). + $menuitem = _m('* [OpenID](%%doc.openid%%) - What OpenID is and how to use it with this service.'); $output .= common_markup_to_html($menuitem); } @@ -604,7 +605,7 @@ class OpenIDPlugin extends Plugin // TRANS: OpenID configuration menu item. _m('MENU','OpenID'), // TRANS: Tooltip for OpenID configuration menu item. - _m('OpenID configuration'), + _m('OpenID configuration.'), $action_name == 'openidadminpanel', 'nav_openid_admin_panel' ); @@ -649,7 +650,7 @@ class OpenIDPlugin extends Plugin 'author' => 'Evan Prodromou, Craig Andrews', 'homepage' => 'http://status.net/wiki/Plugin:OpenID', 'rawdescription' => - // TRANS: OpenID plugin description. + // TRANS: Plugin description. _m('Use OpenID to login to the site.')); return true; } @@ -677,7 +678,7 @@ class OpenIDPlugin extends Plugin { $action->elementStart('fieldset'); // TRANS: OpenID plugin logon form legend. - $action->element('legend', null, _m('OpenID login')); + $action->element('legend', null, _m('LEGEND','OpenID login')); $action->elementStart('ul', 'form_data'); $action->elementStart('li'); @@ -703,7 +704,7 @@ class OpenIDPlugin extends Plugin $action->input('openid_url', _m('OpenID URL'), '', // TRANS: OpenID plugin logon form field instructions. - _m('Your OpenID URL')); + _m('Your OpenID URL.')); } $action->elementEnd('li'); $action->elementEnd('ul'); @@ -760,26 +761,26 @@ class OpenIDPlugin extends Plugin /** * Add link in user's XRD file to allow OpenID login. - * + * * This link in the XRD should let users log in with their * Webfinger identity to services that support it. See * http://webfinger.org/login for an example. * * @param XRD &$xrd Currently-displaying XRD object * @param User $user The user that it's for - * + * * @return boolean hook value (always true) */ function onEndXrdActionLinks(&$xrd, $user) { $profile = $user->getProfile(); - + if (!empty($profile)) { $xrd->links[] = array('rel' => 'http://specs.openid.net/auth/2.0/provider', 'href' => $profile->profileurl); } - + return true; } } diff --git a/plugins/OpenID/User_openid.php b/plugins/OpenID/User_openid.php index e34cf21f2c..a9c96fa4bd 100644 --- a/plugins/OpenID/User_openid.php +++ b/plugins/OpenID/User_openid.php @@ -28,7 +28,6 @@ class User_openid extends Memcached_DataObject function table() { - $db = $this->getDatabaseConnection(); $dbtype = $db->phptype; // Database type is stored here. Crazy but true. diff --git a/plugins/OpenID/User_openid_trustroot.php b/plugins/OpenID/User_openid_trustroot.php index 69e0a3f3e0..eb82115e95 100644 --- a/plugins/OpenID/User_openid_trustroot.php +++ b/plugins/OpenID/User_openid_trustroot.php @@ -53,5 +53,4 @@ class User_openid_trustroot extends Memcached_DataObject { return array('trustroot' => 'K', 'user_id' => 'K'); } - } diff --git a/plugins/OpenID/finishaddopenid.php b/plugins/OpenID/finishaddopenid.php index c442aac989..5182e50778 100644 --- a/plugins/OpenID/finishaddopenid.php +++ b/plugins/OpenID/finishaddopenid.php @@ -44,7 +44,6 @@ require_once INSTALLDIR.'/plugins/OpenID/openid.php'; * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://status.net/ */ - class FinishaddopenidAction extends Action { var $msg = null; @@ -59,7 +58,6 @@ class FinishaddopenidAction extends Action * * @return void */ - function handle($args) { parent::handle($args); @@ -78,7 +76,6 @@ class FinishaddopenidAction extends Action * * @return void */ - function tryLogin() { $consumer = oid_consumer(); @@ -92,7 +89,7 @@ class FinishaddopenidAction extends Action } else if ($response->status == Auth_OpenID_FAILURE) { // TRANS: OpenID authentication failed; display the error message. // TRANS: %s is the error message. - $this->message(sprintf(_m('OpenID authentication failed: %s'), + $this->message(sprintf(_m('OpenID authentication failed: %s.'), $response->message)); } else if ($response->status == Auth_OpenID_SUCCESS) { @@ -108,7 +105,8 @@ class FinishaddopenidAction extends Action // Launchpad teams extension if (!oid_check_teams($response)) { - $this->message(_m('OpenID authentication aborted: you are not allowed to login to this site.')); + // TRANS: OpenID authentication error. + $this->message(_m('OpenID authentication aborted: You are not allowed to login to this site.')); return; } @@ -118,10 +116,10 @@ class FinishaddopenidAction extends Action if ($other) { if ($other->id == $cur->id) { - // TRANS: message in case a user tries to add an OpenID that is already connected to them. + // TRANS: Message in case a user tries to add an OpenID that is already connected to them. $this->message(_m('You already have this OpenID!')); } else { - // TRANS: message in case a user tries to add an OpenID that is already used by another user. + // TRANS: Message in case a user tries to add an OpenID that is already used by another user. $this->message(_m('Someone else already has this OpenID.')); } return; @@ -134,15 +132,15 @@ class FinishaddopenidAction extends Action $result = oid_link_user($cur->id, $canonical, $display); if (!$result) { - // TRANS: message in case the OpenID object cannot be connected to the user. + // TRANS: Message in case the OpenID object cannot be connected to the user. $this->message(_m('Error connecting user.')); return; } if (Event::handle('StartOpenIDUpdateUser', array($cur, $canonical, &$sreg))) { if ($sreg) { if (!oid_update_user($cur, $sreg)) { - // TRANS: message in case the user or the user profile cannot be saved in StatusNet. - $this->message(_m('Error updating profile')); + // TRANS: Message in case the user or the user profile cannot be saved in StatusNet. + $this->message(_m('Error updating profile.')); return; } } @@ -168,7 +166,6 @@ class FinishaddopenidAction extends Action * * @return void */ - function message($msg) { $this->message = $msg; @@ -180,7 +177,6 @@ class FinishaddopenidAction extends Action * * @return string title */ - function title() { // TRANS: Title after getting the status of the OpenID authorisation request. @@ -192,7 +188,6 @@ class FinishaddopenidAction extends Action * * @return void */ - function showPageNotice() { if ($this->message) { diff --git a/plugins/OpenID/finishopenidlogin.php b/plugins/OpenID/finishopenidlogin.php index bc93bc21a6..0d3f0fcb76 100644 --- a/plugins/OpenID/finishopenidlogin.php +++ b/plugins/OpenID/finishopenidlogin.php @@ -45,7 +45,7 @@ class FinishopenidloginAction extends Action if ($this->arg('create')) { if (!$this->boolean('license')) { // TRANS: Message given if user does not agree with the site's license. - $this->showForm(_m('You can\'t register if you don\'t agree to the license.'), + $this->showForm(_m('You cannot register if you do not agree to the license.'), $this->trimmed('newname')); return; } @@ -70,14 +70,14 @@ class FinishopenidloginAction extends Action $this->element('div', 'instructions', // TRANS: Instructions given after a first successful logon using OpenID. // TRANS: %s is the 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'))); + sprintf(_m('This is the first time you have 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() { // TRANS: Title - return _m('OpenID Account Setup'); + return _m('TITLE','OpenID Account Setup'); } function showForm($error=null, $username=null) @@ -114,8 +114,10 @@ class FinishopenidloginAction extends Action $this->hidden('token', common_session_token()); $this->elementStart('fieldset', array('id' => 'form_openid_createaccount')); $this->element('legend', null, + // TRANS: Fieldset legend. _m('Create new account')); $this->element('p', null, + // TRANS: Form guide. _m('Create a new user with this nickname.')); $this->elementStart('ul', 'form_data'); @@ -123,12 +125,16 @@ class FinishopenidloginAction extends Action Event::handle('StartRegistrationFormData', array($this)); $this->elementStart('li'); + // TRANS: Field label. $this->input('newname', _m('New nickname'), ($this->username) ? $this->username : '', + // TRANS: Field title. _m('1-64 lowercase letters or numbers, no punctuation or spaces.')); $this->elementEnd('li'); $this->elementStart('li'); + // TRANS: Field label. $this->input('email', _m('Email'), $this->getEmail(), + // TRANS: Field title. _m('Used only for updates, announcements, '. 'and password recovery.')); $this->elementEnd('li'); @@ -145,7 +151,7 @@ class FinishopenidloginAction extends Action $this->elementStart('label', array('for' => 'license', 'class' => 'checkbox')); // TRANS: OpenID plugin link text. - // TRANS: %s is a link to a licese with the license name as link text. + // TRANS: %s is a link to a license with the license name as link text. $message = _m('My text and files are available under %s ' . 'except this private data: password, ' . 'email address, IM address, and phone number.'); @@ -187,7 +193,7 @@ class FinishopenidloginAction extends Action $this->password('password', _m('Password')); $this->elementEnd('li'); $this->elementEnd('ul'); - // TRANS: Button label in form in which to connect an OpenID to an existing user on the site. + // TRANS: Button text in form in which to connect an OpenID to an existing user on the site. $this->submit('connect', _m('BUTTON', 'Connect')); $this->elementEnd('fieldset'); $this->elementEnd('form'); @@ -238,7 +244,7 @@ class FinishopenidloginAction extends Action return; } else if ($response->status == Auth_OpenID_FAILURE) { // TRANS: OpenID authentication failed; display the error message. %s is the error message. - $this->message(sprintf(_m('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 @@ -258,7 +264,8 @@ class FinishopenidloginAction extends Action // Launchpad teams extension if (!oid_check_teams($response)) { - $this->message(_m('OpenID authentication aborted: you are not allowed to login to this site.')); + // TRANS: Message displayed when OpenID authentication is aborted. + $this->message(_m('OpenID authentication aborted: You are not allowed to login to this site.')); return; } @@ -490,7 +497,6 @@ class FinishopenidloginAction extends Action function bestNewNickname($display, $sreg) { - // Try the passed-in nickname if (!empty($sreg['nickname'])) { @@ -549,7 +555,6 @@ class FinishopenidloginAction extends Action // 1. Plain hostname, like http://evanp.myopenid.com/ // 2. One element in path, like http://profile.typekey.com/EvanProdromou/ // or http://getopenid.com/evanprodromou - function urlToNickname($openid) { return common_url_to_nickname($openid); @@ -579,7 +584,6 @@ class FinishopenidloginAction extends Action } // Given a string, try to make it work as a nickname - function nicknamize($str) { return common_nicknamize($str); diff --git a/plugins/OpenID/openid.php b/plugins/OpenID/openid.php index d13db28a47..49dd53c878 100644 --- a/plugins/OpenID/openid.php +++ b/plugins/OpenID/openid.php @@ -85,7 +85,6 @@ function oid_get_last() function oid_link_user($id, $canonical, $display) { - $oid = new User_openid(); $oid->user_id = $id; $oid->canonical = $canonical; @@ -152,7 +151,7 @@ function oid_authenticate($openid_url, $returnto, $immediate=false) common_log(LOG_ERR, __METHOD__ . ": OpenID fail to $openid_url: $auth_request->message"); // TRANS: OpenID plugin server error. Given when the OpenID authentication request fails. // TRANS: %s is the failure message. - return sprintf(_m('OpenID failure: %s'), $auth_request->message); + return sprintf(_m('OpenID failure: %s.'), $auth_request->message); } $sreg_request = Auth_OpenID_SRegRequest::build(// Required @@ -202,7 +201,7 @@ function oid_authenticate($openid_url, $returnto, $immediate=false) } else if (Auth_OpenID::isFailure($redirect_url)) { // TRANS: OpenID plugin server error. Given when the OpenID authentication request cannot be redirected. // TRANS: %s is the failure message. - return sprintf(_m('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); } @@ -319,7 +318,7 @@ function oid_assert_allowed($url) } } // TRANS: OpenID plugin client exception (403). - throw new ClientException(_m("Unauthorized URL used for OpenID login."), 403); + throw new ClientException(_m('Unauthorized URL used for OpenID login.'), 403); } } @@ -373,7 +372,7 @@ class AutosubmitAction extends Action function showContent() { $this->raw('

'); - // @fixme this would be better using standard CSS class, but the present theme's a bit scary. + // @todo FIXME: This would be better using standard CSS class, but the present theme's a bit scary. $this->element('img', array('src' => Theme::path('images/icons/icon_processing.gif', 'base'), // for some reason the base CSS sets s as block display?! 'style' => 'display: inline')); diff --git a/plugins/OpenID/openidadminpanel.php b/plugins/OpenID/openidadminpanel.php index 9299261e90..c447a166b5 100644 --- a/plugins/OpenID/openidadminpanel.php +++ b/plugins/OpenID/openidadminpanel.php @@ -40,7 +40,6 @@ if (!defined('STATUSNET')) { * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://status.net/ */ - class OpenidadminpanelAction extends AdminPanelAction { /** @@ -48,10 +47,10 @@ class OpenidadminpanelAction extends AdminPanelAction * * @return string page title */ - function title() { - return _m('OpenID'); + // TRANS: Title for OpenID bridge administration page. + return _m('TITLE','OpenID Settings'); } /** @@ -59,9 +58,9 @@ class OpenidadminpanelAction extends AdminPanelAction * * @return string instructions */ - function getInstructions() { + // TRANS: Page instructions. return _m('OpenID settings'); } @@ -70,7 +69,6 @@ class OpenidadminpanelAction extends AdminPanelAction * * @return void */ - function showForm() { $form = new OpenIDAdminPanelForm($this); @@ -83,7 +81,6 @@ class OpenidadminpanelAction extends AdminPanelAction * * @return void */ - function saveSettings() { static $settings = array( @@ -144,13 +141,15 @@ class OpenidadminpanelAction extends AdminPanelAction if (mb_strlen($values['openid']['trusted_provider']) > 255) { $this->clientError( - _m("Invalid provider URL. Max length is 255 characters.") + // TRANS: Client error displayed when OpenID provider URL is too long. + _m('Invalid provider URL. Maximum length is 255 characters.') ); } if (mb_strlen($values['openid']['required_team']) > 255) { $this->clientError( - _m("Invalid team name. Max length is 255 characters.") + // TRANS: Client error displayed when Launchpad team name is too long. + _m('Invalid team name. Maximum length is 255 characters.') ); } } @@ -163,7 +162,6 @@ class OpenIDAdminPanelForm extends AdminForm * * @return int ID of the form */ - function id() { return 'openidadminpanel'; @@ -174,7 +172,6 @@ class OpenIDAdminPanelForm extends AdminForm * * @return string class of the form */ - function formClass() { return 'form_settings'; @@ -185,7 +182,6 @@ class OpenIDAdminPanelForm extends AdminForm * * @return string URL of the action */ - function action() { return common_local_url('openidadminpanel'); @@ -200,15 +196,16 @@ class OpenIDAdminPanelForm extends AdminForm * Make sure that the acting administrator has a valid OpenID matching, * or more carefully warn folks. */ - function formData() { $this->out->elementStart( 'fieldset', array('id' => 'settings_openid') ); - $this->out->element('legend', null, _m('Trusted provider')); + // TRANS: Fieldset legend. + $this->out->element('legend', null, _m('LEGEND','Trusted provider')); $this->out->element('p', 'form_guide', + // TRANS: Form guide. _m('By default, users are allowed to authenticate with any OpenID provider. ' . 'If you are using your own OpenID service for shared sign-in, ' . 'you can restrict access to only your own users here.')); @@ -217,7 +214,9 @@ class OpenIDAdminPanelForm extends AdminForm $this->li(); $this->input( 'trusted_provider', + // TRANS: Field label. _m('Provider URL'), + // TRANS: Field title. _m('All OpenID logins will be sent to this URL; other providers may not be used.'), 'openid' ); @@ -225,8 +224,10 @@ class OpenIDAdminPanelForm extends AdminForm $this->li(); $this->out->checkbox( + // TRANS: Checkbox label. 'append_username', _m('Append a username to base URL'), (bool) $this->value('append_username', 'openid'), + // TRANS: Checkbox title. _m('Login form will show the base URL and prompt for a username to add at the end. Use when OpenID provider URL should be the profile page for individual users.'), 'true' ); @@ -235,7 +236,9 @@ class OpenIDAdminPanelForm extends AdminForm $this->li(); $this->input( 'required_team', - _m('Required team'), + // TRANS: Field label. + _m('Required team'), + // TRANS: Field title. _m('Only allow logins from users in the given team (Launchpad extension).'), 'openid' ); @@ -248,15 +251,18 @@ class OpenIDAdminPanelForm extends AdminForm 'fieldset', array('id' => 'settings_openid-options') ); - $this->out->element('legend', null, _m('Options')); + // TRANS: Fieldset legend. + $this->out->element('legend', null, _m('LEGEND','Options')); $this->out->elementStart('ul', 'form_data'); $this->li(); $this->out->checkbox( + // TRANS: Checkbox label. 'openidonly', _m('Enable OpenID-only mode'), (bool) $this->value('openidonly', 'site'), + // TRANS: Checkbox title. _m('Require all users to login via OpenID. Warning: disables password authentication for all users!'), 'true' ); @@ -272,9 +278,11 @@ class OpenIDAdminPanelForm extends AdminForm * * @return void */ - function formActions() { - $this->out->submit('submit', _m('Save'), 'submit', null, _m('Save OpenID settings.')); + // TRANS: Button text to save OpenID settings. + $this->out->submit('submit', _m('BUTTON','Save'), 'submit', null, + // TRANS: Button title to save OpenID settings. + _m('Save OpenID settings.')); } } diff --git a/plugins/OpenID/openidlogin.php b/plugins/OpenID/openidlogin.php index 918a79ccd1..667e627cd3 100644 --- a/plugins/OpenID/openidlogin.php +++ b/plugins/OpenID/openidlogin.php @@ -111,7 +111,7 @@ class OpenidloginAction extends Action function title() { // TRANS: OpenID plugin message. Title. - return _m('OpenID Login'); + return _m('TITLE','OpenID Login'); } function showForm($error=null, $openid_url) @@ -129,14 +129,14 @@ class OpenidloginAction extends Action 'action' => $formaction)); $this->elementStart('fieldset'); // TRANS: OpenID plugin logon form legend. - $this->element('legend', null, _m('OpenID login')); + $this->element('legend', null, _m('LEGEND','OpenID login')); $this->elementStart('ul', 'form_data'); $this->elementStart('li'); $provider = common_config('openid', 'trusted_provider'); $appendUsername = common_config('openid', 'append_username'); if ($provider) { - $this->element('label', array(), _m('OpenID provider')); + $this->element('label', array(), _m('LABEL','OpenID provider')); $this->element('span', array(), $provider); if ($appendUsername) { $this->element('input', array('id' => 'openid_username', @@ -144,21 +144,23 @@ class OpenidloginAction extends Action 'style' => 'float: none')); } $this->element('p', 'form_guide', + // TRANS: Form guide. ($appendUsername ? _m('Enter your username.') . ' ' : '') . + // TRANS: Form guide. _m('You will be sent to the provider\'s site for authentication.')); $this->hidden('openid_url', $provider); } else { // TRANS: OpenID plugin logon form field label. $this->input('openid_url', _m('OpenID URL'), $this->openid_url, - // TRANS: OpenID plugin logon form field instructions. - _m('Your OpenID URL')); + // TRANS: OpenID plugin logon form field title. + _m('Your OpenID URL.')); } $this->elementEnd('li'); $this->elementStart('li', array('id' => 'settings_rememberme')); // TRANS: OpenID plugin logon form checkbox label for setting to put the OpenID information in a cookie. $this->checkbox('rememberme', _m('Remember me'), false, - // TRANS: OpenID plugin logon form field instructions. + // TRANS: OpenID plugin logon form field title. _m('Automatically login in the future; ' . 'not for shared computers!')); $this->elementEnd('li'); diff --git a/plugins/OpenID/openidserver.php b/plugins/OpenID/openidserver.php index ed9db4fd28..847eb48c65 100644 --- a/plugins/OpenID/openidserver.php +++ b/plugins/OpenID/openidserver.php @@ -113,6 +113,7 @@ class OpenidserverAction extends Action } else { //invalid // TRANS: OpenID plugin client error given trying to add an unauthorised OpenID to a user (403). + // TRANS: %s is a request identity. $this->clientError(sprintf(_m('You are not authorized to use the identity %s.'),$request->identity),$code=403); } } else { @@ -140,7 +141,7 @@ class OpenidserverAction extends Action function generateAllowResponse($request, $user){ $response = $request->answer(true, null, common_profile_url($user->nickname)); - + $profile = $user->getProfile(); $sreg_data = array( 'fullname' => $profile->fullname, diff --git a/plugins/OpenID/openidsettings.php b/plugins/OpenID/openidsettings.php index 1eb6aadb8c..f1a62384b4 100644 --- a/plugins/OpenID/openidsettings.php +++ b/plugins/OpenID/openidsettings.php @@ -44,7 +44,6 @@ require_once INSTALLDIR.'/plugins/OpenID/openid.php'; * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://status.net/ */ - class OpenidsettingsAction extends SettingsAction { /** @@ -52,10 +51,10 @@ class OpenidsettingsAction extends SettingsAction * * @return string Page title */ - function title() { - return _m('OpenID settings'); + // TRANS: Title of OpenID settings page for a user. + return _m('TITLE','OpenID settings'); } /** @@ -63,12 +62,13 @@ class OpenidsettingsAction extends SettingsAction * * @return string Instructions for use */ - function getInstructions() { - return _m('[OpenID](%%doc.openid%%) lets you log into many sites' . - ' with the same user account.'. - ' Manage your associated OpenIDs from here.'); + // TRANS: Form instructions for OpenID settings. + // TRANS: This message contains Markdown links in the form [description](link). + return _m('[OpenID](%%doc.openid%%) lets you log into many sites ' . + 'with the same user account. '. + 'Manage your associated OpenIDs from here.'); } function showScripts() @@ -84,7 +84,6 @@ class OpenidsettingsAction extends SettingsAction * * @return void */ - function showContent() { $user = common_current_user(); @@ -97,14 +96,17 @@ class OpenidsettingsAction extends SettingsAction common_local_url('openidsettings'))); $this->elementStart('fieldset', array('id' => 'settings_openid_add')); - $this->element('legend', null, _m('Add OpenID')); + // TRANS: Fieldset legend. + $this->element('legend', null, _m('LEGEND','Add OpenID')); $this->hidden('token', common_session_token()); $this->element('p', 'form_guide', + // TRANS: Form guide. _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'), + // TRANS: Field label. _m('OpenID URL')); $this->element('input', array('name' => 'openid_url', 'type' => 'text', @@ -115,7 +117,8 @@ class OpenidsettingsAction extends SettingsAction 'id' => 'settings_openid_add_action-submit', 'name' => 'add', 'class' => 'submit', - 'value' => _m('Add'))); + // TRANS: Button text for adding an OpenID URL. + 'value' => _m('BUTTON','Add'))); $this->elementEnd('fieldset'); $this->elementEnd('form'); } @@ -126,12 +129,13 @@ class OpenidsettingsAction extends SettingsAction $cnt = $oid->find(); if ($cnt > 0) { - - $this->element('h2', null, _m('Remove OpenID')); + // TRANS: Header on OpenID settings page. + $this->element('h2', null, _m('HEADER','Remove OpenID')); if ($cnt == 1 && !$user->password) { $this->element('p', 'form_guide', + // TRANS: Form guide. _m('Removing your only OpenID '. 'would make it impossible to log in! ' . 'If you need to remove it, '. @@ -147,6 +151,7 @@ class OpenidsettingsAction extends SettingsAction } else { $this->element('p', 'form_guide', + // TRANS: Form guide. _m('You can remove an OpenID from your account '. 'by clicking the button marked "Remove".')); $idx = 0; @@ -170,7 +175,8 @@ class OpenidsettingsAction extends SettingsAction 'id' => 'remove'.$idx, 'name' => 'remove', 'class' => 'submit remove', - 'value' => _m('Remove'))); + // TRANS: Button text to remove an OpenID. + 'value' => _m('BUTTON','Remove'))); $this->elementEnd('fieldset'); $this->elementEnd('form'); $idx++; @@ -184,9 +190,11 @@ class OpenidsettingsAction extends SettingsAction 'action' => common_local_url('openidsettings'))); $this->elementStart('fieldset', array('id' => 'settings_openid_trustroots')); + // TRANS: Fieldset legend. $this->element('legend', null, _m('OpenID Trusted Sites')); $this->hidden('token', common_session_token()); $this->element('p', 'form_guide', + // TRANS: Form guide. _m('The following sites are allowed to access your ' . 'identity and log you in. You can remove a site from ' . 'this list to deny it access to your OpenID.')); @@ -211,7 +219,8 @@ class OpenidsettingsAction extends SettingsAction 'id' => 'settings_openid_trustroots_action-submit', 'name' => 'remove_trustroots', 'class' => 'submit', - 'value' => _m('Remove'))); + // TRANS: Button text to remove an OpenID trustroot. + 'value' => _m('BUTTON','Remove'))); $this->elementEnd('fieldset'); $this->elementEnd('form'); } @@ -223,12 +232,12 @@ class OpenidsettingsAction extends SettingsAction * * @return void */ - function handlePost() { // CSRF protection $token = $this->trimmed('token'); if (!$token || $token != common_session_token()) { + // TRANS: Client error displayed when the session token does not match or is not given. $this->showForm(_m('There was a problem with your session token. '. 'Try again, please.')); return; @@ -236,7 +245,8 @@ class OpenidsettingsAction extends SettingsAction if ($this->arg('add')) { if (common_config('openid', 'trusted_provider')) { - $this->showForm(_m("Can't add new providers.")); + // TRANS: Form validation error if no OpenID providers can be added. + $this->showForm(_m('Cannot add new providers.')); } else { $result = oid_authenticate($this->trimmed('openid_url'), 'finishaddopenid'); @@ -249,6 +259,7 @@ class OpenidsettingsAction extends SettingsAction } else if($this->arg('remove_trustroots')) { $this->removeTrustroots(); } else { + // TRANS: Unexpected form validation error. $this->showForm(_m('Something weird happened.')); } } @@ -261,7 +272,6 @@ class OpenidsettingsAction extends SettingsAction * * @return void */ - function removeTrustroots() { $user = common_current_user(); @@ -273,11 +283,13 @@ class OpenidsettingsAction extends SettingsAction if($user_openid_trustroot) { $user_openid_trustroot->delete(); } else { + // TRANS: Form validation error when trying to remove a non-existing trustroot. $this->showForm(_m('No such OpenID trustroot.')); return; } } - $this->showForm(_m('Trustroots removed'), true); + // TRANS: Success message after removing trustroots. + $this->showForm(_m('Trustroots removed.'), true); } else { $this->showForm(); } @@ -292,7 +304,6 @@ class OpenidsettingsAction extends SettingsAction * * @return void */ - function removeOpenid() { $openid_url = $this->trimmed('openid_url'); @@ -300,15 +311,18 @@ class OpenidsettingsAction extends SettingsAction $oid = User_openid::staticGet('canonical', $openid_url); if (!$oid) { + // TRANS: Form validation error for a non-existing OpenID. $this->showForm(_m('No such OpenID.')); return; } $cur = common_current_user(); if (!$cur || $oid->user_id != $cur->id) { + // TRANS: Form validation error if OpenID is connected to another user. $this->showForm(_m('That OpenID does not belong to you.')); return; } $oid->delete(); + // TRANS: Success message after removing an OpenID. $this->showForm(_m('OpenID removed.'), true); return; } diff --git a/plugins/OpenID/openidtrust.php b/plugins/OpenID/openidtrust.php index 89f3150f63..d39d8541c6 100644 --- a/plugins/OpenID/openidtrust.php +++ b/plugins/OpenID/openidtrust.php @@ -35,7 +35,6 @@ class OpenidtrustAction extends Action * * @return boolean false */ - function isReadOnly($args) { return false; @@ -46,9 +45,9 @@ class OpenidtrustAction extends Action * * @return string title of the page */ - function title() { + // TRANS: Title for identity verification page. return _m('OpenID Identity Verification'); } @@ -67,6 +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)){ + // TRANS: Client error when visiting page directly. $this->clientError(_m('This page should only be reached during OpenID processing, not directly.')); return; } @@ -112,10 +112,10 @@ class OpenidtrustAction extends Action * * @return void */ - function showPageNotice() { - $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)); + // TRANS: Page notice. %s is a trustroot name. + $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)); } /** @@ -125,7 +125,6 @@ class OpenidtrustAction extends Action * * @return void */ - function showContent() { $this->elementStart('form', array('method' => 'post', @@ -133,8 +132,10 @@ class OpenidtrustAction extends Action 'class' => 'form_settings', 'action' => common_local_url('openidtrust'))); $this->elementStart('fieldset'); - $this->submit('allow', _m('Continue')); - $this->submit('deny', _m('Cancel')); + // TRANS: Button text to continue OpenID identity verification. + $this->submit('allow', _m('BUTTON','Continue')); + // TRANS: Button text to cancel OpenID identity verification. + $this->submit('deny', _m('BUTTON','Cancel')); $this->elementEnd('fieldset'); $this->elementEnd('form'); diff --git a/plugins/OpenX/OpenXPlugin.php b/plugins/OpenX/OpenXPlugin.php index acc904381a..d288363b21 100644 --- a/plugins/OpenX/OpenXPlugin.php +++ b/plugins/OpenX/OpenXPlugin.php @@ -197,8 +197,8 @@ ENDOFSCRIPT; function onEndAdminPanelNav($menu) { if (AdminPanelAction::canAdmin('openx')) { - // TRANS: Menu item title/tooltip - $menu_title = _m('OpenX configuration'); + // TRANS: Menu item title. + $menu_title = _m('OpenX configuration.'); // TRANS: Menu item for site administration $menu->out->menuItem(common_local_url('openxadminpanel'), _m('OpenX'), $menu_title, $action_name == 'openxadminpanel', 'nav_openx_admin_panel'); diff --git a/plugins/OpenX/openxadminpanel.php b/plugins/OpenX/openxadminpanel.php index 0bd09c70a4..bf2001a41d 100644 --- a/plugins/OpenX/openxadminpanel.php +++ b/plugins/OpenX/openxadminpanel.php @@ -217,6 +217,6 @@ class OpenXAdminPanelForm extends AdminForm 'submit', null, // TRANS: Submit button title in OpenX admin panel. - _m('Save OpenX settings')); + _m('Save OpenX settings.')); } } -- 2.39.5