Update translator documentation.

i18n tweaks.
Add FIXME for missing class documentation.
Remove superfluous whitespace.
This commit is contained in:
Siebrand Mazeland 2011-04-01 17:05:42 +02:00
parent 1e73ba00bd
commit c17d8e0f5f
7 changed files with 112 additions and 70 deletions

View File

@ -54,7 +54,7 @@ class UseradminpanelAction extends AdminPanelAction
*/
function title()
{
// TRANS: User admin panel title
// TRANS: User admin panel title.
return _m('TITLE', 'User');
}
@ -172,6 +172,7 @@ class UseradminpanelAction extends AdminPanelAction
}
}
// @todo FIXME: Class documentation missing.
class UserAdminPanelForm extends AdminForm
{
/**
@ -212,7 +213,8 @@ class UserAdminPanelForm extends AdminForm
function formData()
{
$this->out->elementStart('fieldset', array('id' => 'settings_user-profile'));
$this->out->element('legend', null, _('Profile'));
// TRANS: Fieldset legend in user administration panel.
$this->out->element('legend', null, _m('LEGEND','Profile'));
$this->out->elementStart('ul', 'form_data');
$this->li();

View File

@ -165,7 +165,7 @@ class Action extends HTMLOutputter // lawsuit
{
$this->element('title', null,
// TRANS: Page title. %1$s is the title, %2$s is the site name.
sprintf(_("%1\$s - %2\$s"),
sprintf(_('%1$s - %2$s'),
$this->title(),
common_config('site', 'name')));
}
@ -181,7 +181,7 @@ class Action extends HTMLOutputter // lawsuit
function title()
{
// TRANS: Page title for a page without a title set.
return _("Untitled page");
return _('Untitled page');
}
/**
@ -609,17 +609,16 @@ class Action extends HTMLOutputter // lawsuit
*/
function showNoticeForm()
{
$tabs = array('status' => _('Status'));
// TRANS: Tab on the notice form.
$tabs = array('status' => _m('TAB','Status'));
$this->elementStart('div', 'input_forms');
if (Event::handle('StartShowEntryForms', array(&$tabs))) {
$this->elementStart('ul', array('class' => 'nav',
'id' => 'input_form_nav'));
foreach ($tabs as $tag => $title) {
$attrs = array('id' => 'input_form_nav_'.$tag,
'class' => 'input_form_nav_tab');
@ -647,7 +646,6 @@ class Action extends HTMLOutputter // lawsuit
$this->elementEnd('div');
foreach ($tabs as $tag => $title) {
$attrs = array('class' => 'input_form',
'id' => 'input_form_'.$tag);

View File

@ -81,7 +81,8 @@ class ActivityMover extends QueueHandler
function moveActivity($act, $sink, $user, $remote)
{
if (empty($user)) {
throw new Exception(sprintf(_("No such user %s."),$act->actor->id));
// TRANS: Exception thrown if no user is provided. %s is a user ID.
throw new Exception(sprintf(_('No such user "%s".'),$act->actor->id));
}
switch ($act->verb) {

View File

@ -4,7 +4,7 @@
* Copyright (C) 2011, StatusNet, Inc.
*
* Menu for admin panels
*
*
* PHP version 5
*
* This program is free software: you can redistribute it and/or modify
@ -45,7 +45,6 @@ if (!defined('STATUSNET')) {
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
* @link http://status.net/
*/
class AdminPanelNav extends Menu
{
/**
@ -62,11 +61,15 @@ class AdminPanelNav extends Menu
// Stub section w/ home link
$this->action->elementStart('ul');
$this->action->element('h3', null, _('Home'));
// TRANS: Header in administrator navigation panel.
$this->action->element('h3', null, _m('HEADER','Home'));
$this->action->elementStart('ul', 'nav');
$this->out->menuItem(common_local_url('all', array('nickname' =>
$nickname)),
_('Home'),
// TRANS: Menu item in administrator navigation panel.
_m('MENU','Home'),
// TRANS: Menu item title in administrator navigation panel.
// TRANS: %s is a username.
sprintf(_('%s and friends'), $name),
$this->action == 'all', 'nav_timeline_personal');
@ -74,88 +77,89 @@ class AdminPanelNav extends Menu
$this->action->elementEnd('ul');
$this->action->elementStart('ul');
$this->action->element('h3', null, _('Admin'));
// TRANS: Header in administrator navigation panel.
$this->action->element('h3', null, _m('HEADER','Admin'));
$this->action->elementStart('ul', array('class' => 'nav'));
if (Event::handle('StartAdminPanelNav', array($this))) {
if (AdminPanelAction::canAdmin('site')) {
// TRANS: Menu item title/tooltip
// TRANS: Menu item title in administrator navigation panel.
$menu_title = _('Basic site configuration');
// TRANS: Menu item for site administration
// TRANS: Menu item in administrator navigation panel.
$this->out->menuItem(common_local_url('siteadminpanel'), _m('MENU', 'Site'),
$menu_title, $action_name == 'siteadminpanel', 'nav_site_admin_panel');
}
if (AdminPanelAction::canAdmin('design')) {
// TRANS: Menu item title/tooltip
// TRANS: Menu item title in administrator navigation panel.
$menu_title = _('Design configuration');
// TRANS: Menu item for site administration
// TRANS: Menu item in administrator navigation panel.
$this->out->menuItem(common_local_url('designadminpanel'), _m('MENU', 'Design'),
$menu_title, $action_name == 'designadminpanel', 'nav_design_admin_panel');
}
if (AdminPanelAction::canAdmin('user')) {
// TRANS: Menu item title/tooltip
// TRANS: Menu item title in administrator navigation panel.
$menu_title = _('User configuration');
// TRANS: Menu item for site administration
$this->out->menuItem(common_local_url('useradminpanel'), _('User'),
// TRANS: Menu item in administrator navigation panel.
$this->out->menuItem(common_local_url('useradminpanel'), _m('MENU','User'),
$menu_title, $action_name == 'useradminpanel', 'nav_user_admin_panel');
}
if (AdminPanelAction::canAdmin('access')) {
// TRANS: Menu item title/tooltip
// TRANS: Menu item title in administrator navigation panel.
$menu_title = _('Access configuration');
// TRANS: Menu item for site administration
$this->out->menuItem(common_local_url('accessadminpanel'), _('Access'),
// TRANS: Menu item in administrator navigation panel.
$this->out->menuItem(common_local_url('accessadminpanel'), _m('MENU','Access'),
$menu_title, $action_name == 'accessadminpanel', 'nav_access_admin_panel');
}
if (AdminPanelAction::canAdmin('paths')) {
// TRANS: Menu item title/tooltip
// TRANS: Menu item title in administrator navigation panel.
$menu_title = _('Paths configuration');
// TRANS: Menu item for site administration
$this->out->menuItem(common_local_url('pathsadminpanel'), _('Paths'),
// TRANS: Menu item in administrator navigation panel.
$this->out->menuItem(common_local_url('pathsadminpanel'), _m('MENU','Paths'),
$menu_title, $action_name == 'pathsadminpanel', 'nav_paths_admin_panel');
}
if (AdminPanelAction::canAdmin('sessions')) {
// TRANS: Menu item title/tooltip
// TRANS: Menu item title in administrator navigation panel.
$menu_title = _('Sessions configuration');
// TRANS: Menu item for site administration
$this->out->menuItem(common_local_url('sessionsadminpanel'), _('Sessions'),
// TRANS: Menu item in administrator navigation panel.
$this->out->menuItem(common_local_url('sessionsadminpanel'), _m('MENU','Sessions'),
$menu_title, $action_name == 'sessionsadminpanel', 'nav_sessions_admin_panel');
}
if (AdminPanelAction::canAdmin('sitenotice')) {
// TRANS: Menu item title/tooltip
// TRANS: Menu item title in administrator navigation panel.
$menu_title = _('Edit site notice');
// TRANS: Menu item for site administration
$this->out->menuItem(common_local_url('sitenoticeadminpanel'), _('Site notice'),
// TRANS: Menu item in administrator navigation panel.
$this->out->menuItem(common_local_url('sitenoticeadminpanel'), _m('MENU','Site notice'),
$menu_title, $action_name == 'sitenoticeadminpanel', 'nav_sitenotice_admin_panel');
}
if (AdminPanelAction::canAdmin('snapshot')) {
// TRANS: Menu item title/tooltip
// TRANS: Menu item title in administrator navigation panel.
$menu_title = _('Snapshots configuration');
// TRANS: Menu item for site administration
$this->out->menuItem(common_local_url('snapshotadminpanel'), _('Snapshots'),
// TRANS: Menu item in administrator navigation panel.
$this->out->menuItem(common_local_url('snapshotadminpanel'), _m('MENU','Snapshots'),
$menu_title, $action_name == 'snapshotadminpanel', 'nav_snapshot_admin_panel');
}
if (AdminPanelAction::canAdmin('license')) {
// TRANS: Menu item title/tooltip
// TRANS: Menu item title in administrator navigation panel.
$menu_title = _('Set site license');
// TRANS: Menu item for site administration
$this->out->menuItem(common_local_url('licenseadminpanel'), _('License'),
// TRANS: Menu item in administrator navigation panel.
$this->out->menuItem(common_local_url('licenseadminpanel'), _m('MENU','License'),
$menu_title, $action_name == 'licenseadminpanel', 'nav_license_admin_panel');
}
if (AdminPanelAction::canAdmin('plugins')) {
// TRANS: Menu item title/tooltip
// TRANS: Menu item title in administrator navigation panel.
$menu_title = _('Plugins configuration');
// TRANS: Menu item for site administration
$this->out->menuItem(common_local_url('pluginsadminpanel'), _('Plugins'),
// TRANS: Menu item in administrator navigation panel.
$this->out->menuItem(common_local_url('pluginsadminpanel'), _m('MENU','Plugins'),
$menu_title, $action_name == 'pluginsadminpanel', 'nav_design_admin_panel');
}

View File

@ -4,7 +4,7 @@
* Copyright (C) 2011, StatusNet, Inc.
*
* Default local nav
*
*
* PHP version 5
*
* This program is free software: you can redistribute it and/or modify
@ -44,7 +44,6 @@ if (!defined('STATUSNET')) {
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
* @link http://status.net/
*/
class DefaultLocalNav extends Menu
{
function show()
@ -55,11 +54,13 @@ class DefaultLocalNav extends Menu
if (!empty($user)) {
$pn = new PersonalGroupNav($this->action);
$this->submenu(_m('Home'), $pn);
// TRANS: Menu item in default local navigation panel.
$this->submenu(_m('MENU','Home'), $pn);
}
$bn = new PublicGroupNav($this->action);
$this->submenu(_('Public'), $bn);
// TRANS: Menu item in default local navigation panel.
$this->submenu(_m('MENU','Public'), $bn);
$this->action->elementEnd('ul');
}

View File

@ -43,7 +43,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
class PersonalGroupNav extends Menu
{
/**
@ -56,7 +55,7 @@ class PersonalGroupNav extends Menu
$user = common_current_user();
if (empty($user)) {
throw new ServerException('Do not show personal group nav with no current user.');
throw new ServerException('Cannot show personal group navigation without a current user.');
}
$user_profile = $user->getProfile();
@ -71,24 +70,38 @@ class PersonalGroupNav extends Menu
if (Event::handle('StartPersonalGroupNav', array($this))) {
$this->out->menuItem(common_local_url('all', array('nickname' =>
$nickname)),
_('Home'),
// TRANS: Menu item in personal group navigation menu.
_m('MENU','Home'),
// TRANS: Menu item title in personal group navigation menu.
// TRANS: %s is a username.
sprintf(_('%s and friends'), $name),
$mine && $action =='all', 'nav_timeline_personal');
$this->out->menuItem(common_local_url('showstream', array('nickname' =>
$nickname)),
_('Profile'),
// TRANS: Menu item in personal group navigation menu.
_m('MENU','Profile'),
// TRANS: Menu item title in personal group navigation menu.
_('Your profile'),
$mine && $action =='showstream',
'nav_profile');
$this->out->menuItem(common_local_url('replies', array('nickname' =>
$nickname)),
_('Replies'),
// TRANS: Menu item in personal group navigation menu.
_m('MENU','Replies'),
// TRANS: Menu item title in personal group navigation menu.
// TRANS: %s is a username.
sprintf(_('Replies to %s'), $name),
$mine && $action =='replies', 'nav_timeline_replies');
$this->out->menuItem(common_local_url('showfavorites', array('nickname' =>
$nickname)),
_('Favorites'),
sprintf(_('%s\'s favorite notices'), ($user_profile) ? $name : _('User')),
// TRANS: Menu item in personal group navigation menu.
_m('MENU','Favorites'),
// @todo i18n FIXME: Need to make this two messages.
// TRANS: Menu item title in personal group navigation menu.
// TRANS: %s is a username.
sprintf(_('%s\'s favorite notices'),
// TRANS: Replaces %s in '%s\'s favorite notices'. (Yes, we know we need to fix this.)
($user_profile) ? $name : _m('FIXME','User')),
$mine && $action =='showfavorites', 'nav_timeline_favorites');
$cur = common_current_user();
@ -98,7 +111,9 @@ class PersonalGroupNav extends Menu
$this->out->menuItem(common_local_url('inbox', array('nickname' =>
$nickname)),
_('Messages'),
// TRANS: Menu item in personal group navigation menu.
_m('MENU','Messages'),
// TRANS: Menu item title in personal group navigation menu.
_('Your incoming messages'),
$mine && $action =='inbox');
}

View File

@ -4,7 +4,7 @@
* Copyright (C) 2010,2011, StatusNet, Inc.
*
* Settings menu
*
*
* PHP version 5
*
* This program is free software: you can redistribute it and/or modify
@ -45,7 +45,6 @@ if (!defined('STATUSNET')) {
*
* @see HTMLOutputter
*/
class SettingsNav extends Menu
{
/**
@ -53,7 +52,6 @@ class SettingsNav extends Menu
*
* @return void
*/
function show()
{
$actionName = $this->action->trimmed('action');
@ -63,11 +61,15 @@ class SettingsNav extends Menu
// Stub section w/ home link
$this->action->elementStart('ul');
$this->action->element('h3', null, _('Home'));
// TRANS: Header in settings navigation panel.
$this->action->element('h3', null, _m('HEADER','Home'));
$this->action->elementStart('ul', 'nav');
$this->out->menuItem(common_local_url('all', array('nickname' =>
$nickname)),
_('Home'),
// TRANS: Menu item in settings navigation panel.
_m('MENU','Home'),
// TRANS: Menu item title in settings navigation panel.
// TRANS: %s is a username.
sprintf(_('%s and friends'), $name),
$this->action == 'all', 'nav_timeline_personal');
@ -75,58 +77,77 @@ class SettingsNav extends Menu
$this->action->elementEnd('ul');
$this->action->elementStart('ul');
$this->action->element('h3', null, _('Settings'));
// TRANS: Header in settings navigation panel.
$this->action->element('h3', null, _m('HEADER','Settings'));
$this->action->elementStart('ul', array('class' => 'nav'));
if (Event::handle('StartAccountSettingsNav', array(&$this->action))) {
$this->action->menuItem(common_local_url('profilesettings'),
_('Profile'),
// TRANS: Menu item in settings navigation panel.
_m('MENU','Profile'),
// TRANS: Menu item title in settings navigation panel.
_('Change your profile settings'),
$actionName == 'profilesettings');
$this->action->menuItem(common_local_url('avatarsettings'),
_('Avatar'),
// TRANS: Menu item in settings navigation panel.
_m('MENU','Avatar'),
// TRANS: Menu item title in settings navigation panel.
_('Upload an avatar'),
$actionName == 'avatarsettings');
$this->action->menuItem(common_local_url('passwordsettings'),
_('Password'),
// TRANS: Menu item in settings navigation panel.
_m('MENU','Password'),
// TRANS: Menu item title in settings navigation panel.
_('Change your password'),
$actionName == 'passwordsettings');
$this->action->menuItem(common_local_url('emailsettings'),
_('Email'),
// TRANS: Menu item in settings navigation panel.
_m('MENU','Email'),
// TRANS: Menu item title in settings navigation panel.
_('Change email handling'),
$actionName == 'emailsettings');
$this->action->menuItem(common_local_url('userdesignsettings'),
_('Design'),
// TRANS: Menu item in settings navigation panel.
_m('MENU','Design'),
// TRANS: Menu item title in settings navigation panel.
_('Design your profile'),
$actionName == 'userdesignsettings');
$this->action->menuItem(common_local_url('urlsettings'),
_('URL'),
// TRANS: Menu item in settings navigation panel.
_m('MENU','URL'),
// TRANS: Menu item title in settings navigation panel.
_('URL shorteners'),
$actionName == 'urlsettings');
Event::handle('EndAccountSettingsNav', array(&$this->action));
if (common_config('xmpp', 'enabled')) {
$this->action->menuItem(common_local_url('imsettings'),
_m('IM'),
// TRANS: Menu item in settings navigation panel.
_m('MENU','IM'),
// TRANS: Menu item title in settings navigation panel.
_('Updates by instant messenger (IM)'),
$actionName == 'imsettings');
}
if (common_config('sms', 'enabled')) {
$this->action->menuItem(common_local_url('smssettings'),
_m('SMS'),
// TRANS: Menu item in settings navigation panel.
_m('MENU','SMS'),
// TRANS: Menu item title in settings navigation panel.
_('Updates by SMS'),
$actionName == 'smssettings');
}
$this->action->menuItem(common_local_url('oauthconnectionssettings'),
_('Connections'),
// TRANS: Menu item in settings navigation panel.
_m('MENU','Connections'),
// TRANS: Menu item title in settings navigation panel.
_('Authorized connected applications'),
$actionName == 'oauthconnectionsettings');