From 2dbdb0f185cb9b98097ce2f20bbd9430ab715203 Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Mon, 4 Apr 2011 00:41:21 +0200 Subject: [PATCH] Translator documentation updated/added. i18n tweaks. Superfluous whitespace removed. YAY! All StatusNet core messages in the 1.0.x branch have been documented at this point in time!!! --- actions/cancelsubscription.php | 2 +- actions/deletenotice.php | 2 +- actions/disfavor.php | 2 +- actions/favor.php | 2 +- actions/groupblock.php | 2 +- actions/groupunblock.php | 2 +- actions/logout.php | 2 +- actions/makeadmin.php | 2 +- actions/newmessage.php | 2 +- actions/newnotice.php | 7 ++++--- actions/nudge.php | 2 +- actions/pluginenable.php | 2 +- actions/subedit.php | 2 +- actions/subscribe.php | 2 +- actions/tagother.php | 2 +- actions/unsubscribe.php | 2 +- index.php | 14 ++++++++++---- lib/adminpanelaction.php | 2 +- lib/deletegroupform.php | 10 ++-------- lib/joinform.php | 10 ++-------- lib/jsonsearchresultslist.php | 3 +-- lib/noticeform.php | 1 + lib/noticelist.php | 8 ++------ lib/noticelistitem.php | 1 + lib/primarynav.php | 11 ++++++----- lib/profileformaction.php | 2 +- lib/settingsaction.php | 1 + plugins/OpenID/finishaddopenid.php | 2 +- plugins/SearchSub/searchsubaction.php | 2 +- plugins/SubMirror/actions/basemirror.php | 1 + plugins/TagSub/tagsubaction.php | 2 +- plugins/UserFlag/adminprofileflag.php | 1 + 32 files changed, 52 insertions(+), 56 deletions(-) diff --git a/actions/cancelsubscription.php b/actions/cancelsubscription.php index 30726e0d04..226fd0822e 100644 --- a/actions/cancelsubscription.php +++ b/actions/cancelsubscription.php @@ -53,7 +53,7 @@ class CancelsubscriptionAction extends Action StatusNet::setApi(true); } if (!common_logged_in()) { - // TRANS: Client error displayed when trying to leave a group while not logged in. + // TRANS: Error message displayed when trying to perform an action that requires a logged in user. $this->clientError(_('Not logged in.')); return; } diff --git a/actions/deletenotice.php b/actions/deletenotice.php index 9032de8974..e3690c51d4 100644 --- a/actions/deletenotice.php +++ b/actions/deletenotice.php @@ -48,7 +48,7 @@ class DeletenoticeAction extends Action $this->user = common_current_user(); if (!$this->user) { - // TRANS: Error message displayed trying to delete a notice while not logged in. + // TRANS: Error message displayed when trying to perform an action that requires a logged in user. common_user_error(_('Not logged in.')); exit; } diff --git a/actions/disfavor.php b/actions/disfavor.php index 39598d60bf..e9fc17c5b7 100644 --- a/actions/disfavor.php +++ b/actions/disfavor.php @@ -57,7 +57,7 @@ class DisfavorAction extends Action { parent::handle($args); if (!common_logged_in()) { - // TRANS: Client error displayed when trying to remove a favorite while not logged in. + // TRANS: Error message displayed when trying to perform an action that requires a logged in user. $this->clientError(_('Not logged in.')); return; } diff --git a/actions/favor.php b/actions/favor.php index 494648f671..39d7735d00 100644 --- a/actions/favor.php +++ b/actions/favor.php @@ -58,7 +58,7 @@ class FavorAction extends Action { parent::handle($args); if (!common_logged_in()) { - // TRANS: Client error displayed when trying to mark a notice as favorite without being logged in. + // TRANS: Error message displayed when trying to perform an action that requires a logged in user. $this->clientError(_('Not logged in.')); return; } diff --git a/actions/groupblock.php b/actions/groupblock.php index 3f8cb90e9e..a597d47c29 100644 --- a/actions/groupblock.php +++ b/actions/groupblock.php @@ -56,7 +56,7 @@ class GroupblockAction extends RedirectingAction { parent::prepare($args); if (!common_logged_in()) { - // TRANS: Client error displayed trying to block a user from a group while not logged in. + // TRANS: Error message displayed when trying to perform an action that requires a logged in user. $this->clientError(_('Not logged in.')); return false; } diff --git a/actions/groupunblock.php b/actions/groupunblock.php index 7b92e83f71..c14ec04adc 100644 --- a/actions/groupunblock.php +++ b/actions/groupunblock.php @@ -56,7 +56,7 @@ class GroupunblockAction extends Action { parent::prepare($args); if (!common_logged_in()) { - // TRANS: Client error displayed when trying to unblock a user from a group while not logged in. + // TRANS: Error message displayed when trying to perform an action that requires a logged in user. $this->clientError(_('Not logged in.')); return false; } diff --git a/actions/logout.php b/actions/logout.php index 8e903db221..567d808cd1 100644 --- a/actions/logout.php +++ b/actions/logout.php @@ -65,7 +65,7 @@ class LogoutAction extends Action { parent::handle($args); if (!common_logged_in()) { - // TRANS: Client error displayed trying to log out when not logged in. + // TRANS: Error message displayed when trying to perform an action that requires a logged in user. $this->clientError(_('Not logged in.')); } else { if (Event::handle('StartLogout', array($this))) { diff --git a/actions/makeadmin.php b/actions/makeadmin.php index 0ca537f755..8ec8a7ce0c 100644 --- a/actions/makeadmin.php +++ b/actions/makeadmin.php @@ -58,7 +58,7 @@ class MakeadminAction extends RedirectingAction { parent::prepare($args); if (!common_logged_in()) { - // TRANS: Client error displayed when trying to access the "make admin" page while not logged in. + // TRANS: Error message displayed when trying to perform an action that requires a logged in user. $this->clientError(_('Not logged in.')); return false; } diff --git a/actions/newmessage.php b/actions/newmessage.php index 8f185b55b5..dd7c5357ba 100644 --- a/actions/newmessage.php +++ b/actions/newmessage.php @@ -85,7 +85,7 @@ class NewmessageAction extends Action parent::handle($args); if (!common_logged_in()) { - // TRANS: Client error displayed trying to create a new direct message while not logged in. + // TRANS: Error message displayed when trying to perform an action that requires a logged in user. $this->clientError(_('Not logged in.'), 403); } else if ($_SERVER['REQUEST_METHOD'] == 'POST') { $this->saveNewMessage(); diff --git a/actions/newnotice.php b/actions/newnotice.php index 97282e215d..a8a5fa932f 100644 --- a/actions/newnotice.php +++ b/actions/newnotice.php @@ -64,7 +64,7 @@ class NewnoticeAction extends Action function title() { // TRANS: Page title for sending a new notice. - return _('New notice'); + return _m('TITLE','New notice'); } /** @@ -83,7 +83,7 @@ class NewnoticeAction extends Action function handle($args) { if (!common_logged_in()) { - // TRANS: Client error displayed trying to send a notice while not logged in. + // TRANS: Error message displayed when trying to perform an action that requires a logged in user. $this->clientError(_('Not logged in.')); } else if ($_SERVER['REQUEST_METHOD'] == 'POST') { // check for this before token since all POST and FILES data @@ -289,7 +289,8 @@ class NewnoticeAction extends Action { $this->startHTML('text/xml;charset=utf-8', true); $this->elementStart('head'); - $this->element('title', null, _('New notice')); + // TRANS: Title for form to send a new notice. + $this->element('title', null, _m('TITLE','New notice')); $this->elementEnd('head'); $this->elementStart('body'); diff --git a/actions/nudge.php b/actions/nudge.php index 401285b9f3..a44915a2d6 100644 --- a/actions/nudge.php +++ b/actions/nudge.php @@ -60,7 +60,7 @@ class NudgeAction extends Action parent::handle($args); if (!common_logged_in()) { - // TRANS: Client error displayed trying to nudge a user without being logged in. + // TRANS: Error message displayed when trying to perform an action that requires a logged in user. $this->clientError(_('Not logged in.')); return; } diff --git a/actions/pluginenable.php b/actions/pluginenable.php index 4caa6baf37..156a604cf0 100644 --- a/actions/pluginenable.php +++ b/actions/pluginenable.php @@ -95,7 +95,7 @@ class PluginEnableAction extends Action $this->user = common_current_user(); if (empty($this->user)) { - // TRANS: Client error displayed when trying to enable or disable a plugin while not logged in. + // TRANS: Error message displayed when trying to perform an action that requires a logged in user. $this->clientError(_('Not logged in.')); return false; } diff --git a/actions/subedit.php b/actions/subedit.php index f8b22d72b9..7439904af0 100644 --- a/actions/subedit.php +++ b/actions/subedit.php @@ -29,7 +29,7 @@ class SubeditAction extends Action parent::prepare($args); if (!common_logged_in()) { - // TRANS: Client error displayed trying a change a subscription while not logged in. + // TRANS: Error message displayed when trying to perform an action that requires a logged in user. $this->clientError(_('Not logged in.')); return false; } diff --git a/actions/subscribe.php b/actions/subscribe.php index fad153fc6e..b8c1cdd8f7 100644 --- a/actions/subscribe.php +++ b/actions/subscribe.php @@ -94,7 +94,7 @@ class SubscribeAction extends Action $this->user = common_current_user(); if (empty($this->user)) { - // TRANS: Client error displayed trying to subscribe when not logged in. + // TRANS: Error message displayed when trying to perform an action that requires a logged in user. $this->clientError(_('Not logged in.')); return false; } diff --git a/actions/tagother.php b/actions/tagother.php index 6d63ea5b5e..be1aae20eb 100644 --- a/actions/tagother.php +++ b/actions/tagother.php @@ -31,7 +31,7 @@ class TagotherAction extends Action { parent::prepare($args); if (!common_logged_in()) { - // TRANS: Client error displayed on user tag page when trying to add tags while not logged in. + // TRANS: Error message displayed when trying to perform an action that requires a logged in user. $this->clientError(_('Not logged in.'), 403); return false; } diff --git a/actions/unsubscribe.php b/actions/unsubscribe.php index 73661a4f16..ba9ecd8f00 100644 --- a/actions/unsubscribe.php +++ b/actions/unsubscribe.php @@ -48,7 +48,7 @@ class UnsubscribeAction extends Action { parent::handle($args); if (!common_logged_in()) { - // TRANS: Client error displayed when trying to unsubscribe while not logged in. + // TRANS: Error message displayed when trying to perform an action that requires a logged in user. $this->clientError(_('Not logged in.')); return; } diff --git a/index.php b/index.php index c8d4fbee9b..8617780be7 100644 --- a/index.php +++ b/index.php @@ -106,20 +106,22 @@ function handleError($error) $_cur = null; $msg = sprintf( + // TRANS: Database error message. _( - 'The database for %s isn\'t responding correctly, '. - 'so the site won\'t work properly. '. + 'The database for %1$s is not responding correctly, '. + 'so the site will not work properly. '. 'The site admins probably know about the problem, '. - 'but you can contact them at %s to make sure. '. + 'but you can contact them at %2$s to make sure. '. 'Otherwise, wait a few minutes and try again.' ), common_config('site', 'name'), common_config('site', 'email') ); } else { + // TRANS: Error message. $msg = _( 'An important error occured, probably related to email setup. '. - 'Check logfiles for more info..' + 'Check logfiles for more info.' ); } @@ -127,6 +129,7 @@ function handleError($error) $dac->showPage(); } catch (Exception $e) { + // TRANS: Error message. echo _('An error occurred.'); } exit(-1); @@ -250,6 +253,7 @@ function main() if (!_have_config()) { $msg = sprintf( + // TRANS: Error message displayed when there is no StatusNet configuration file. _( "No configuration file found. Try running ". "the installation program first." @@ -281,6 +285,7 @@ function main() $args = $r->map($path); if (!$args) { + // TRANS: Error message displayed when trying to access a non-existing page. $cac = new ClientErrorAction(_('Unknown page'), 404); $cac->showPage(); return; @@ -335,6 +340,7 @@ function main() $action_class = ucfirst($action).'Action'; if (!class_exists($action_class)) { + // TRANS: Error message displayed when trying to perform an undefined action. $cac = new ClientErrorAction(_('Unknown action'), 404); $cac->showPage(); } else { diff --git a/lib/adminpanelaction.php b/lib/adminpanelaction.php index 5e7e284b5c..5642c68d62 100644 --- a/lib/adminpanelaction.php +++ b/lib/adminpanelaction.php @@ -67,7 +67,7 @@ class AdminPanelAction extends Action // User must be logged in. if (!common_logged_in()) { - // TRANS: Client error message thrown when trying to access the admin panel while not logged in. + // TRANS: Error message displayed when trying to perform an action that requires a logged in user. $this->clientError(_('Not logged in.')); return false; } diff --git a/lib/deletegroupform.php b/lib/deletegroupform.php index 9d8012d33b..65bc34812e 100644 --- a/lib/deletegroupform.php +++ b/lib/deletegroupform.php @@ -47,13 +47,11 @@ if (!defined('STATUSNET')) { * @see UnsubscribeForm * @fixme merge a bunch of this stuff with similar form types to reduce boilerplate */ - class DeleteGroupForm extends Form { /** * group for user to delete */ - var $group = null; /** @@ -62,7 +60,6 @@ class DeleteGroupForm extends Form * @param HTMLOutputter $out output channel * @param group $group group to join */ - function __construct($out=null, $group=null) { parent::__construct($out); @@ -75,7 +72,6 @@ class DeleteGroupForm extends Form * * @return string ID of the form */ - function id() { return 'group-delete-' . $this->group->id; @@ -86,7 +82,6 @@ class DeleteGroupForm extends Form * * @return string of the form class */ - function formClass() { return 'form_group_delete'; @@ -97,7 +92,6 @@ class DeleteGroupForm extends Form * * @return string URL of the action */ - function action() { return common_local_url('deletegroup', @@ -115,9 +109,9 @@ class DeleteGroupForm extends Form * * @return void */ - function formActions() { - $this->out->submit('submit', _('Delete')); + // TRANS: Button text for deleting a group. + $this->out->submit('submit', _m('BUTTON','Delete')); } } diff --git a/lib/joinform.php b/lib/joinform.php index 0918133a55..a1a6189b08 100644 --- a/lib/joinform.php +++ b/lib/joinform.php @@ -46,13 +46,11 @@ require_once INSTALLDIR.'/lib/form.php'; * * @see UnsubscribeForm */ - class JoinForm extends Form { /** * group for user to join */ - var $group = null; /** @@ -61,7 +59,6 @@ class JoinForm extends Form * @param HTMLOutputter $out output channel * @param group $group group to join */ - function __construct($out=null, $group=null) { parent::__construct($out); @@ -74,7 +71,6 @@ class JoinForm extends Form * * @return string ID of the form */ - function id() { return 'group-join-' . $this->group->id; @@ -85,7 +81,6 @@ class JoinForm extends Form * * @return string of the form class */ - function formClass() { return 'form_group_join ajax'; @@ -96,7 +91,6 @@ class JoinForm extends Form * * @return string URL of the action */ - function action() { return common_local_url('joingroup', @@ -108,9 +102,9 @@ class JoinForm extends Form * * @return void */ - function formActions() { - $this->out->submit('submit', _('Join')); + // TRANS: Button text for joining a group. + $this->out->submit('submit', _m('BUTTON','Join')); } } diff --git a/lib/jsonsearchresultslist.php b/lib/jsonsearchresultslist.php index 80d4036aad..8bf3678d4f 100644 --- a/lib/jsonsearchresultslist.php +++ b/lib/jsonsearchresultslist.php @@ -256,9 +256,9 @@ class ResultItem * * @return string a fully rendered source of the Notice */ - function getSourceLink($source) { + // Gettext translations for the below source types are available. $source_name = _($source); switch ($source) { case 'web': @@ -277,5 +277,4 @@ class ResultItem return $source_name; } - } diff --git a/lib/noticeform.php b/lib/noticeform.php index ee4e2ca967..bc47dd1bd3 100644 --- a/lib/noticeform.php +++ b/lib/noticeform.php @@ -256,6 +256,7 @@ class NoticeForm extends Form 'data-api' => common_local_url('geocode'))); // @fixme checkbox method allows no way to change the id without changing the name + //// TRANS: Checkbox label to allow sharing geo location in notices. //$this->out->checkbox('notice_data-geo', _('Share my location'), true); $this->out->elementStart('label', 'notice_data-geo'); $this->out->element('input', array( diff --git a/lib/noticelist.php b/lib/noticelist.php index dbe2a0996f..273bf3a231 100644 --- a/lib/noticelist.php +++ b/lib/noticelist.php @@ -53,7 +53,6 @@ require_once INSTALLDIR.'/lib/attachmentlist.php'; * @see NoticeListItem * @see ProfileNoticeList */ - class NoticeList extends Widget { /** the current stream of notices being displayed. */ @@ -65,7 +64,6 @@ class NoticeList extends Widget * * @param Notice $notice stream of notices from DB_DataObject */ - function __construct($notice, $out=null) { parent::__construct($out); @@ -80,11 +78,11 @@ class NoticeList extends Widget * * @return int count of notices listed. */ - function show() { $this->out->elementStart('div', array('id' =>'notices_primary')); - $this->out->element('h2', null, _('Notices')); + // TRANS: Header in notice list. + $this->out->element('h2', null, _m('HEADER','Notices')); $this->out->elementStart('ol', array('class' => 'notices xoxo')); $cnt = 0; @@ -122,10 +120,8 @@ class NoticeList extends Widget * * @return NoticeListItem a list item for displaying the notice */ - function newListItem($notice) { return new NoticeListItem($notice, $this->out); } } - diff --git a/lib/noticelistitem.php b/lib/noticelistitem.php index aafa935140..9c50966406 100644 --- a/lib/noticelistitem.php +++ b/lib/noticelistitem.php @@ -420,6 +420,7 @@ class NoticeListItem extends Widget $ns = $this->notice->getSource(); if ($ns) { + // TRANS: A possible notice source (web interface). $source_name = (empty($ns->name)) ? ($ns->code ? _($ns->code) : _m('SOURCE','web')) : _($ns->name); $this->out->text(' '); $this->out->elementStart('span', 'source'); diff --git a/lib/primarynav.php b/lib/primarynav.php index fc9f3c7203..7a9815af7b 100644 --- a/lib/primarynav.php +++ b/lib/primarynav.php @@ -57,7 +57,7 @@ class PrimaryNav extends Menu // TRANS: Menu item in primary navigation panel. _m('MENU','Settings'), // TRANS: Menu item title in primary navigation panel. - _('Change your personal settings'), + _('Change your personal settings.'), false, 'nav_account'); if ($user->hasRight(Right::CONFIGURESITE)) { @@ -65,14 +65,15 @@ class PrimaryNav extends Menu // TRANS: Menu item in primary navigation panel. _m('MENU','Admin'), // TRANS: Menu item title in primary navigation panel. - _('Site configuration'), + _('Site configuration.'), false, 'nav_admin'); } $this->action->menuItem(common_local_url('logout'), // TRANS: Menu item in primary navigation panel. _m('MENU','Logout'), - _('Logout from the site'), + // TRANS: Menu item title in primary navigation panel. + _('Logout from the site.'), false, 'nav_logout'); } else { @@ -80,7 +81,7 @@ class PrimaryNav extends Menu // TRANS: Menu item in primary navigation panel. _m('MENU','Login'), // TRANS: Menu item title in primary navigation panel. - _('Login to the site'), + _('Login to the site.'), false, 'nav_login'); } @@ -90,7 +91,7 @@ class PrimaryNav extends Menu // TRANS: Menu item in primary navigation panel. _m('MENU','Search'), // TRANS: Menu item title in primary navigation panel. - _('Search the site'), + _('Search the site.'), false, 'nav_search'); } diff --git a/lib/profileformaction.php b/lib/profileformaction.php index 5706528223..b5f2e5d2a3 100644 --- a/lib/profileformaction.php +++ b/lib/profileformaction.php @@ -59,7 +59,7 @@ class ProfileFormAction extends RedirectingAction if (!common_logged_in()) { if ($_SERVER['REQUEST_METHOD'] == 'POST') { - // TRANS: Client error displayed when trying to change user options while not logged in. + // TRANS: Error message displayed when trying to perform an action that requires a logged in user. $this->clientError(_('Not logged in.')); } else { // Redirect to login. diff --git a/lib/settingsaction.php b/lib/settingsaction.php index c7113d15c2..c70a5ffa8d 100644 --- a/lib/settingsaction.php +++ b/lib/settingsaction.php @@ -69,6 +69,7 @@ class SettingsAction extends CurrentUserDesignAction { parent::handle($args); if (!common_logged_in()) { + // TRANS: Error message displayed when trying to perform an action that requires a logged in user. $this->clientError(_('Not logged in.')); return; } else if (!common_is_real_login()) { diff --git a/plugins/OpenID/finishaddopenid.php b/plugins/OpenID/finishaddopenid.php index 6eb2f2d206..c442aac989 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()) { - // TRANS: Client error message + // TRANS: Error message displayed when trying to perform an action that requires a logged in user. $this->clientError(_m('Not logged in.')); } else { $this->tryLogin(); diff --git a/plugins/SearchSub/searchsubaction.php b/plugins/SearchSub/searchsubaction.php index db1a0e9abc..0234feef40 100644 --- a/plugins/SearchSub/searchsubaction.php +++ b/plugins/SearchSub/searchsubaction.php @@ -95,7 +95,7 @@ class SearchsubAction extends Action $this->user = common_current_user(); if (empty($this->user)) { - // TRANS: Client error displayed trying to subscribe when not logged in. + // TRANS: Error message displayed when trying to perform an action that requires a logged in user. $this->clientError(_m('Not logged in.')); return false; } diff --git a/plugins/SubMirror/actions/basemirror.php b/plugins/SubMirror/actions/basemirror.php index 6a9109d13a..9a01e2ddb7 100644 --- a/plugins/SubMirror/actions/basemirror.php +++ b/plugins/SubMirror/actions/basemirror.php @@ -133,6 +133,7 @@ abstract class BaseMirrorAction extends Action $this->user = common_current_user(); if (empty($this->user)) { + // TRANS: Error message displayed when trying to perform an action that requires a logged in user. $this->clientError(_m('Not logged in.')); return false; } diff --git a/plugins/TagSub/tagsubaction.php b/plugins/TagSub/tagsubaction.php index 83bf106bed..18335f4cc8 100644 --- a/plugins/TagSub/tagsubaction.php +++ b/plugins/TagSub/tagsubaction.php @@ -95,7 +95,7 @@ class TagsubAction extends Action $this->user = common_current_user(); if (empty($this->user)) { - // TRANS: Client error displayed trying to subscribe when not logged in. + // TRANS: Error message displayed when trying to perform an action that requires a logged in user. $this->clientError(_m('Not logged in.')); return false; } diff --git a/plugins/UserFlag/adminprofileflag.php b/plugins/UserFlag/adminprofileflag.php index 2f62fa7c41..1aafa3c1bf 100644 --- a/plugins/UserFlag/adminprofileflag.php +++ b/plugins/UserFlag/adminprofileflag.php @@ -61,6 +61,7 @@ class AdminprofileflagAction extends Action // User must be logged in. if (!common_logged_in()) { + // TRANS: Error message displayed when trying to perform an action that requires a logged in user. $this->clientError(_m('Not logged in.')); return; }