* update/add translator documentation.

* remove superfluous whitespace.
* minor updates to L10n/i18n.
This commit is contained in:
Siebrand Mazeland 2011-03-11 17:07:27 +01:00
parent dccd0ae6e1
commit e2defc1f7c
9 changed files with 69 additions and 42 deletions

View File

@ -55,7 +55,8 @@ class PasswordsettingsAction extends SettingsAction
function title() function title()
{ {
return _('Change password'); // TRANS: Title for page where to change password.
return _m('TITLE','Change password');
} }
/** /**
@ -66,6 +67,7 @@ class PasswordsettingsAction extends SettingsAction
function getInstructions() function getInstructions()
{ {
// TRANS: Instructions for page where to change password.
return _('Change your password.'); return _('Change your password.');
} }
@ -93,6 +95,7 @@ class PasswordsettingsAction extends SettingsAction
'action' => 'action' =>
common_local_url('passwordsettings'))); common_local_url('passwordsettings')));
$this->elementStart('fieldset'); $this->elementStart('fieldset');
// TRANS: Fieldset legend on page where to change password.
$this->element('legend', null, _('Password change')); $this->element('legend', null, _('Password change'));
$this->hidden('token', common_session_token()); $this->hidden('token', common_session_token());
@ -101,20 +104,26 @@ class PasswordsettingsAction extends SettingsAction
// Users who logged in with OpenID won't have a pwd // Users who logged in with OpenID won't have a pwd
if ($user->password) { if ($user->password) {
$this->elementStart('li'); $this->elementStart('li');
// TRANS: Field label on page where to change password.
$this->password('oldpassword', _('Old password')); $this->password('oldpassword', _('Old password'));
$this->elementEnd('li'); $this->elementEnd('li');
} }
$this->elementStart('li'); $this->elementStart('li');
// TRANS: Field label on page where to change password.
$this->password('newpassword', _('New password'), $this->password('newpassword', _('New password'),
// TRANS: Field title on page where to change password.
_('6 or more characters.')); _('6 or more characters.'));
$this->elementEnd('li'); $this->elementEnd('li');
$this->elementStart('li'); $this->elementStart('li');
$this->password('confirm', _('Confirm'), // TRANS: Field label on page where to change password. In this field the new password should be typed a second time.
$this->password('confirm', _m('LABEL','Confirm'),
// TRANS: Field title on page where to change password.
_('Same as password above.')); _('Same as password above.'));
$this->elementEnd('li'); $this->elementEnd('li');
$this->elementEnd('ul'); $this->elementEnd('ul');
$this->submit('changepass', _('Change')); // TRANS: Button text on page where to change password.
$this->submit('changepass', _m('BUTTON','Change'));
$this->elementEnd('fieldset'); $this->elementEnd('fieldset');
$this->elementEnd('form'); $this->elementEnd('form');
@ -150,6 +159,7 @@ class PasswordsettingsAction extends SettingsAction
# Some validation # Some validation
if (strlen($newpassword) < 6) { if (strlen($newpassword) < 6) {
// TRANS: Form validation error on page where to change password.
$this->showForm(_('Password must be 6 or more characters.')); $this->showForm(_('Password must be 6 or more characters.'));
return; return;
} else if (0 != strcmp($newpassword, $confirm)) { } else if (0 != strcmp($newpassword, $confirm)) {
@ -161,7 +171,8 @@ class PasswordsettingsAction extends SettingsAction
$oldpassword = $this->arg('oldpassword'); $oldpassword = $this->arg('oldpassword');
if (!common_check_user($user->nickname, $oldpassword)) { if (!common_check_user($user->nickname, $oldpassword)) {
$this->showForm(_('Incorrect old password')); // TRANS: Form validation error on page where to change password.
$this->showForm(_('Incorrect old password.'));
return; return;
} }
}else{ }else{
@ -177,17 +188,21 @@ class PasswordsettingsAction extends SettingsAction
$val = $user->validate(); $val = $user->validate();
if ($val !== true) { if ($val !== true) {
// TRANS: Form validation error on page where to change password.
$this->showForm(_('Error saving user; invalid.')); $this->showForm(_('Error saving user; invalid.'));
return; return;
} }
if (!$user->update($original)) { if (!$user->update($original)) {
// TRANS: Server error displayed on page where to change password when password change
// TRANS: could not be made because of a server error.
$this->serverError(_('Cannot save new password.')); $this->serverError(_('Cannot save new password.'));
return; return;
} }
Event::handle('EndChangePassword', array($user)); Event::handle('EndChangePassword', array($user));
} }
// TRANS: Form validation notice on page where to change password.
$this->showForm(_('Password saved.'), true); $this->showForm(_('Password saved.'), true);
} }
} }

View File

@ -152,7 +152,7 @@ class PathsadminpanelAction extends AdminPanelAction
if (!empty($values['theme']['dir']) && !is_readable($values['theme']['dir'])) { if (!empty($values['theme']['dir']) && !is_readable($values['theme']['dir'])) {
// TRANS: Client error in Paths admin panel. // TRANS: Client error in Paths admin panel.
// TRANS: %s is the directory that could not be read from. // TRANS: %s is the directory that could not be read from.
$this->clientError(sprintf(_("Theme directory not readable: %s."), $values['theme']['dir'])); $this->clientError(sprintf(_('Theme directory not readable: %s.'), $values['theme']['dir']));
} }
// Validate avatar dir // Validate avatar dir
@ -160,7 +160,7 @@ class PathsadminpanelAction extends AdminPanelAction
if (empty($values['avatar']['dir']) || !is_writable($values['avatar']['dir'])) { if (empty($values['avatar']['dir']) || !is_writable($values['avatar']['dir'])) {
// TRANS: Client error in Paths admin panel. // TRANS: Client error in Paths admin panel.
// TRANS: %s is the avatar directory that could not be written to. // TRANS: %s is the avatar directory that could not be written to.
$this->clientError(sprintf(_("Avatar directory not writable: %s."), $values['avatar']['dir'])); $this->clientError(sprintf(_('Avatar directory not writable: %s.'), $values['avatar']['dir']));
} }
// Validate background dir // Validate background dir
@ -168,7 +168,7 @@ class PathsadminpanelAction extends AdminPanelAction
if (empty($values['background']['dir']) || !is_writable($values['background']['dir'])) { if (empty($values['background']['dir']) || !is_writable($values['background']['dir'])) {
// TRANS: Client error in Paths admin panel. // TRANS: Client error in Paths admin panel.
// TRANS: %s is the background directory that could not be written to. // TRANS: %s is the background directory that could not be written to.
$this->clientError(sprintf(_("Background directory not writable: %s."), $values['background']['dir'])); $this->clientError(sprintf(_('Background directory not writable: %s.'), $values['background']['dir']));
} }
// Validate locales dir // Validate locales dir
@ -178,7 +178,7 @@ class PathsadminpanelAction extends AdminPanelAction
if (!empty($values['site']['locale_path']) && !is_readable($values['site']['locale_path'])) { if (!empty($values['site']['locale_path']) && !is_readable($values['site']['locale_path'])) {
// TRANS: Client error in Paths admin panel. // TRANS: Client error in Paths admin panel.
// TRANS: %s is the locales directory that could not be read from. // TRANS: %s is the locales directory that could not be read from.
$this->clientError(sprintf(_("Locales directory not readable: %s."), $values['site']['locale_path'])); $this->clientError(sprintf(_('Locales directory not readable: %s.'), $values['site']['locale_path']));
} }
// Validate SSL setup // Validate SSL setup
@ -239,6 +239,7 @@ class PathsAdminPanelForm extends AdminForm
$this->input('server', $this->input('server',
// TRANS: Field label in Paths admin panel. // TRANS: Field label in Paths admin panel.
_('Server'), _('Server'),
// TRANS: Field title in Paths admin panel.
_('Site\'s server hostname.')); _('Site\'s server hostname.'));
$this->unli(); $this->unli();
@ -246,6 +247,7 @@ class PathsAdminPanelForm extends AdminForm
$this->input('path', $this->input('path',
// TRANS: Field label in Paths admin panel. // TRANS: Field label in Paths admin panel.
_('Path'), _('Path'),
// TRANS: Field title in Paths admin panel.
_('Site path.')); _('Site path.'));
$this->unli(); $this->unli();
@ -253,6 +255,7 @@ class PathsAdminPanelForm extends AdminForm
$this->input('locale_path', $this->input('locale_path',
// TRANS: Field label in Paths admin panel. // TRANS: Field label in Paths admin panel.
_('Locale directory'), _('Locale directory'),
// TRANS: Field title in Paths admin panel.
_('Directory path to locales.'), _('Directory path to locales.'),
'site'); 'site');
$this->unli(); $this->unli();
@ -262,14 +265,16 @@ class PathsAdminPanelForm extends AdminForm
// TRANS: Checkbox label in Paths admin panel. // TRANS: Checkbox label in Paths admin panel.
_('Fancy URLs'), _('Fancy URLs'),
(bool) $this->value('fancy'), (bool) $this->value('fancy'),
_('Use fancy (more readable and memorable) URLs?')); // TRANS: Field title in Paths admin panel.
_('Use fancy URLs (more readable and memorable)?'));
$this->unli(); $this->unli();
$this->out->elementEnd('ul'); $this->out->elementEnd('ul');
$this->out->elementEnd('fieldset'); $this->out->elementEnd('fieldset');
$this->out->elementStart('fieldset', array('id' => 'settings_paths_theme')); $this->out->elementStart('fieldset', array('id' => 'settings_paths_theme'));
$this->out->element('legend', null, _('Theme')); // TRANS: Fieldset legend in Paths admin panel.
$this->out->element('legend', null, _m('LEGEND','Theme'));
$this->out->elementStart('ul', 'form_data'); $this->out->elementStart('ul', 'form_data');
@ -469,7 +474,7 @@ class PathsAdminPanelForm extends AdminForm
$this->out->elementStart('fieldset', array('id' => 'settings_admin_ssl')); $this->out->elementStart('fieldset', array('id' => 'settings_admin_ssl'));
// TRANS: Fieldset legend in Paths admin panel. // TRANS: Fieldset legend in Paths admin panel.
$this->out->element('legend', null, _('SSL')); $this->out->element('legend', null, _m('LEGEND','SSL'));
$this->out->elementStart('ul', 'form_data'); $this->out->elementStart('ul', 'form_data');
$this->li(); $this->li();

View File

@ -44,7 +44,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
* *
* @see Action * @see Action
*/ */
class PeopletagAction extends Action class PeopletagAction extends Action
{ {
@ -65,6 +64,8 @@ class PeopletagAction extends Action
$this->tag = $this->trimmed('tag'); $this->tag = $this->trimmed('tag');
if (!common_valid_profile_tag($this->tag)) { if (!common_valid_profile_tag($this->tag)) {
// TRANS: Client error displayed when trying to tag a profile with an invalid tag.
// TRANS: %s is the invalid tag.
$this->clientError(sprintf(_('Not a valid people tag: %s.'), $this->clientError(sprintf(_('Not a valid people tag: %s.'),
$this->tag)); $this->tag));
return; return;
@ -139,10 +140,11 @@ class PeopletagAction extends Action
*/ */
function title() function title()
{ {
// TRANS: Page title for users with a certain self-tag.
// TRANS: %1$s is the tag, %2$s is the page number.
return sprintf(_('Users self-tagged with %1$s - page %2$d'), return sprintf(_('Users self-tagged with %1$s - page %2$d'),
$this->tag, $this->page); $this->tag, $this->page);
} }
} }
class PeopleTagList extends ProfileList class PeopleTagList extends ProfileList
@ -177,4 +179,3 @@ class PeopleTagListItem extends ProfileListItem
return $aAttrs; return $aAttrs;
} }
} }

View File

@ -52,7 +52,6 @@ if (!defined('STATUSNET')) {
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPLv3 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPLv3
* @link http://status.net/ * @link http://status.net/
*/ */
class PluginDisableAction extends PluginEnableAction class PluginDisableAction extends PluginEnableAction
{ {
/** /**
@ -74,5 +73,3 @@ class PluginDisableAction extends PluginEnableAction
return new EnablePluginForm($this, $this->plugin); return new EnablePluginForm($this, $this->plugin);
} }
} }

View File

@ -52,7 +52,6 @@ if (!defined('STATUSNET')) {
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPLv3 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPLv3
* @link http://status.net/ * @link http://status.net/
*/ */
class PluginEnableAction extends Action class PluginEnableAction extends Action
{ {
var $user; var $user;
@ -65,7 +64,6 @@ class PluginEnableAction extends Action
* *
* @return boolean success flag * @return boolean success flag
*/ */
function prepare($args) function prepare($args)
{ {
parent::prepare($args); parent::prepare($args);
@ -75,6 +73,8 @@ class PluginEnableAction extends Action
// Only allow POST requests // Only allow POST requests
if ($_SERVER['REQUEST_METHOD'] != 'POST') { if ($_SERVER['REQUEST_METHOD'] != 'POST') {
// TRANS: Client error displayed when trying to use another method than POST.
// TRANS: Do not translate POST.
$this->clientError(_('This action only accepts POST requests.')); $this->clientError(_('This action only accepts POST requests.'));
return false; return false;
} }
@ -94,11 +94,13 @@ class PluginEnableAction extends Action
$this->user = common_current_user(); $this->user = common_current_user();
if (empty($this->user)) { if (empty($this->user)) {
// TRANS: Client error displayed when trying to enable or disable a plugin while not logged in.
$this->clientError(_('Not logged in.')); $this->clientError(_('Not logged in.'));
return false; return false;
} }
if (!AdminPanelAction::canAdmin('plugins')) { if (!AdminPanelAction::canAdmin('plugins')) {
// TRANS: Client error displayed when trying to enable or disable a plugin without access rights.
$this->clientError(_('You cannot administer plugins.')); $this->clientError(_('You cannot administer plugins.'));
return false; return false;
} }
@ -106,6 +108,7 @@ class PluginEnableAction extends Action
$this->plugin = $this->arg('plugin'); $this->plugin = $this->arg('plugin');
$defaultPlugins = common_config('plugins', 'default'); $defaultPlugins = common_config('plugins', 'default');
if (!array_key_exists($this->plugin, $defaultPlugins)) { if (!array_key_exists($this->plugin, $defaultPlugins)) {
// TRANS: Client error displayed when trying to enable or disable a non-existing plugin.
$this->clientError(_('No such plugin.')); $this->clientError(_('No such plugin.'));
return false; return false;
} }
@ -122,7 +125,6 @@ class PluginEnableAction extends Action
* *
* @return void * @return void
*/ */
function handle($args) function handle($args)
{ {
$key = 'disable-' . $this->plugin; $key = 'disable-' . $this->plugin;

View File

@ -40,20 +40,17 @@ if (!defined('STATUSNET')) {
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/ * @link http://status.net/
*/ */
class PluginsadminpanelAction extends AdminPanelAction class PluginsadminpanelAction extends AdminPanelAction
{ {
/** /**
* Returns the page title * Returns the page title
* *
* @return string page title * @return string page title
*/ */
function title() function title()
{ {
// TRANS: Tab and title for plugins admin panel. // TRANS: Tab and title for plugins admin panel.
return _('Plugins'); return _m('TITLE','Plugins');
} }
/** /**
@ -61,7 +58,6 @@ class PluginsadminpanelAction extends AdminPanelAction
* *
* @return string instructions * @return string instructions
*/ */
function getInstructions() function getInstructions()
{ {
// TRANS: Instructions at top of plugin admin page. // TRANS: Instructions at top of plugin admin page.
@ -75,7 +71,6 @@ class PluginsadminpanelAction extends AdminPanelAction
* *
* @return void * @return void
*/ */
function showForm() function showForm()
{ {
$this->elementStart('fieldset', array('id' => 'settings_plugins_default')); $this->elementStart('fieldset', array('id' => 'settings_plugins_default'));
@ -103,6 +98,7 @@ class PluginsadminpanelAction extends AdminPanelAction
$list->show(); $list->show();
} else { } else {
$this->element('p', null, $this->element('p', null,
// TRANS: Text displayed on plugin admin page when no plugin are enabled.
_('All default plugins have been disabled from the ' . _('All default plugins have been disabled from the ' .
'site\'s configuration file.')); 'site\'s configuration file.'));
} }

View File

@ -92,16 +92,18 @@ class PostnoticeAction extends Action
{ {
$content = common_shorten_links($_POST['omb_notice_content']); $content = common_shorten_links($_POST['omb_notice_content']);
if (Notice::contentTooLong($content)) { if (Notice::contentTooLong($content)) {
// TRANS: Client error displayed if the notice posted has too many characters.
$this->clientError(_('Invalid notice content.'), 400); $this->clientError(_('Invalid notice content.'), 400);
return false; return false;
} }
$license = $_POST['omb_notice_license']; $license = $_POST['omb_notice_license'];
$site_license = common_config('license', 'url'); $site_license = common_config('license', 'url');
if ($license && !common_compatible_license($license, $site_license)) { if ($license && !common_compatible_license($license, $site_license)) {
throw new Exception(sprintf(_('Notice license %1$s is not ' . // TRANS: Exception thrown if a notice's license is not compatible with the StatusNet site license.
'compatible with site license %2$s.'), // TRANS: %1$s is the notice license, %2$s is the StatusNet site's license.
throw new Exception(sprintf(_('Notice license "%1$s" is not ' .
'compatible with site license "%2$s".'),
$license, $site_license)); $license, $site_license));
} }
} }
} }
?>

View File

@ -51,7 +51,6 @@ define('MAX_PUBLIC_PAGE', 100);
* @see PublicrssAction * @see PublicrssAction
* @see PublicxrdsAction * @see PublicxrdsAction
*/ */
class PublicAction extends Action class PublicAction extends Action
{ {
/** /**
@ -73,14 +72,15 @@ class PublicAction extends Action
* *
* @return boolean success value * @return boolean success value
*/ */
function prepare($args) function prepare($args)
{ {
parent::prepare($args); parent::prepare($args);
$this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1; $this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
if ($this->page > MAX_PUBLIC_PAGE) { if ($this->page > MAX_PUBLIC_PAGE) {
$this->clientError(sprintf(_("Beyond the page limit (%s)."), MAX_PUBLIC_PAGE)); // TRANS: Client error displayed when requesting a public timeline page beyond the page limit.
// TRANS: %s is the page limit.
$this->clientError(sprintf(_('Beyond the page limit (%s).'), MAX_PUBLIC_PAGE));
} }
common_set_returnto($this->selfUrl()); common_set_returnto($this->selfUrl());
@ -89,12 +89,13 @@ class PublicAction extends Action
NOTICES_PER_PAGE + 1); NOTICES_PER_PAGE + 1);
if (!$this->notice) { if (!$this->notice) {
// TRANS: Server error displayed when a public timeline cannot be retrieved.
$this->serverError(_('Could not retrieve public stream.')); $this->serverError(_('Could not retrieve public stream.'));
return; return;
} }
if($this->page > 1 && $this->notice->N == 0){ if($this->page > 1 && $this->notice->N == 0){
// TRANS: Server error when page not found (404) // TRANS: Server error when page not found (404).
$this->serverError(_('No such page.'),$code=404); $this->serverError(_('No such page.'),$code=404);
} }
@ -110,7 +111,6 @@ class PublicAction extends Action
* *
* @return void * @return void
*/ */
function handle($args) function handle($args)
{ {
parent::handle($args); parent::handle($args);
@ -123,12 +123,14 @@ class PublicAction extends Action
* *
* @return page title, including page number if over 1 * @return page title, including page number if over 1
*/ */
function title() function title()
{ {
if ($this->page > 1) { if ($this->page > 1) {
// TRANS: Title for all public timeline pages but the first.
// TRANS: %d is the page number.
return sprintf(_('Public timeline, page %d'), $this->page); return sprintf(_('Public timeline, page %d'), $this->page);
} else { } else {
// TRANS: Title for the first public timeline page.
return _('Public timeline'); return _('Public timeline');
} }
} }
@ -153,30 +155,35 @@ class PublicAction extends Action
* *
* @return void * @return void
*/ */
function getFeeds() function getFeeds()
{ {
return array(new Feed(Feed::RSS1, common_local_url('publicrss'), return array(new Feed(Feed::RSS1, common_local_url('publicrss'),
// TRANS: Link description for public timeline feed.
_('Public Stream Feed (RSS 1.0)')), _('Public Stream Feed (RSS 1.0)')),
new Feed(Feed::RSS2, new Feed(Feed::RSS2,
common_local_url('ApiTimelinePublic', common_local_url('ApiTimelinePublic',
array('format' => 'rss')), array('format' => 'rss')),
// TRANS: Link description for public timeline feed.
_('Public Stream Feed (RSS 2.0)')), _('Public Stream Feed (RSS 2.0)')),
new Feed(Feed::ATOM, new Feed(Feed::ATOM,
common_local_url('ApiTimelinePublic', common_local_url('ApiTimelinePublic',
array('format' => 'atom')), array('format' => 'atom')),
// TRANS: Link description for public timeline feed.
_('Public Stream Feed (Atom)'))); _('Public Stream Feed (Atom)')));
} }
function showEmptyList() function showEmptyList()
{ {
// TRANS: Text displayed for public feed when there are no public notices.
$message = _('This is the public timeline for %%site.name%% but no one has posted anything yet.') . ' '; $message = _('This is the public timeline for %%site.name%% but no one has posted anything yet.') . ' ';
if (common_logged_in()) { if (common_logged_in()) {
// TRANS: Additional text displayed for public feed when there are no public notices for a logged in user.
$message .= _('Be the first to post!'); $message .= _('Be the first to post!');
} }
else { else {
if (! (common_config('site','closed') || common_config('site','inviteonly'))) { if (! (common_config('site','closed') || common_config('site','inviteonly'))) {
// TRANS: Additional text displayed for public feed when there are no public notices for a not logged in user.
$message .= _('Why not [register an account](%%action.register%%) and be the first to post!'); $message .= _('Why not [register an account](%%action.register%%) and be the first to post!');
} }
} }
@ -194,7 +201,6 @@ class PublicAction extends Action
* *
* @return void * @return void
*/ */
function showContent() function showContent()
{ {
$nl = new ThreadedNoticeList($this->notice, $this); $nl = new ThreadedNoticeList($this->notice, $this);
@ -224,11 +230,15 @@ class PublicAction extends Action
function showAnonymousMessage() function showAnonymousMessage()
{ {
if (! (common_config('site','closed') || common_config('site','inviteonly'))) { if (! (common_config('site','closed') || common_config('site','inviteonly'))) {
// TRANS: Message for not logged in users at an invite-only site trying to view the public feed of notices.
// TRANS: This message contains Markdown links. Please mind the formatting.
$m = _('This is %%site.name%%, a [micro-blogging](http://en.wikipedia.org/wiki/Micro-blogging) service ' . $m = _('This is %%site.name%%, a [micro-blogging](http://en.wikipedia.org/wiki/Micro-blogging) service ' .
'based on the Free Software [StatusNet](http://status.net/) tool. ' . 'based on the Free Software [StatusNet](http://status.net/) tool. ' .
'[Join now](%%action.register%%) to share notices about yourself with friends, family, and colleagues! ' . '[Join now](%%action.register%%) to share notices about yourself with friends, family, and colleagues! ' .
'([Read more](%%doc.help%%))'); '([Read more](%%doc.help%%))');
} else { } else {
// TRANS: Message for not logged in users at a closed site trying to view the public feed of notices.
// TRANS: This message contains Markdown links. Please mind the formatting.
$m = _('This is %%site.name%%, a [micro-blogging](http://en.wikipedia.org/wiki/Micro-blogging) service ' . $m = _('This is %%site.name%%, a [micro-blogging](http://en.wikipedia.org/wiki/Micro-blogging) service ' .
'based on the Free Software [StatusNet](http://status.net/) tool.'); 'based on the Free Software [StatusNet](http://status.net/) tool.');
} }

View File

@ -1,5 +1,4 @@
<?php <?php
/** /**
* Public XRDS for OpenID * Public XRDS for OpenID
* *