* 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()
{
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()
{
// TRANS: Instructions for page where to change password.
return _('Change your password.');
}
@ -93,6 +95,7 @@ class PasswordsettingsAction extends SettingsAction
'action' =>
common_local_url('passwordsettings')));
$this->elementStart('fieldset');
// TRANS: Fieldset legend on page where to change password.
$this->element('legend', null, _('Password change'));
$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
if ($user->password) {
$this->elementStart('li');
// TRANS: Field label on page where to change password.
$this->password('oldpassword', _('Old password'));
$this->elementEnd('li');
}
$this->elementStart('li');
// TRANS: Field label on page where to change password.
$this->password('newpassword', _('New password'),
// TRANS: Field title on page where to change password.
_('6 or more characters.'));
$this->elementEnd('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.'));
$this->elementEnd('li');
$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('form');
@ -150,6 +159,7 @@ class PasswordsettingsAction extends SettingsAction
# Some validation
if (strlen($newpassword) < 6) {
// TRANS: Form validation error on page where to change password.
$this->showForm(_('Password must be 6 or more characters.'));
return;
} else if (0 != strcmp($newpassword, $confirm)) {
@ -161,7 +171,8 @@ class PasswordsettingsAction extends SettingsAction
$oldpassword = $this->arg('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;
}
}else{
@ -177,17 +188,21 @@ class PasswordsettingsAction extends SettingsAction
$val = $user->validate();
if ($val !== true) {
// TRANS: Form validation error on page where to change password.
$this->showForm(_('Error saving user; invalid.'));
return;
}
if (!$user->update($original)) {
$this->serverError(_('Cannot save new password.'));
// 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.'));
return;
}
Event::handle('EndChangePassword', array($user));
}
// TRANS: Form validation notice on page where to change password.
$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'])) {
// TRANS: Client error in Paths admin panel.
// 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
@ -160,7 +160,7 @@ class PathsadminpanelAction extends AdminPanelAction
if (empty($values['avatar']['dir']) || !is_writable($values['avatar']['dir'])) {
// TRANS: Client error in Paths admin panel.
// 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
@ -168,7 +168,7 @@ class PathsadminpanelAction extends AdminPanelAction
if (empty($values['background']['dir']) || !is_writable($values['background']['dir'])) {
// TRANS: Client error in Paths admin panel.
// 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
@ -178,7 +178,7 @@ class PathsadminpanelAction extends AdminPanelAction
if (!empty($values['site']['locale_path']) && !is_readable($values['site']['locale_path'])) {
// TRANS: Client error in Paths admin panel.
// 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
@ -239,6 +239,7 @@ class PathsAdminPanelForm extends AdminForm
$this->input('server',
// TRANS: Field label in Paths admin panel.
_('Server'),
// TRANS: Field title in Paths admin panel.
_('Site\'s server hostname.'));
$this->unli();
@ -246,6 +247,7 @@ class PathsAdminPanelForm extends AdminForm
$this->input('path',
// TRANS: Field label in Paths admin panel.
_('Path'),
// TRANS: Field title in Paths admin panel.
_('Site path.'));
$this->unli();
@ -253,6 +255,7 @@ class PathsAdminPanelForm extends AdminForm
$this->input('locale_path',
// TRANS: Field label in Paths admin panel.
_('Locale directory'),
// TRANS: Field title in Paths admin panel.
_('Directory path to locales.'),
'site');
$this->unli();
@ -262,14 +265,16 @@ class PathsAdminPanelForm extends AdminForm
// TRANS: Checkbox label in Paths admin panel.
_('Fancy URLs'),
(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->out->elementEnd('ul');
$this->out->elementEnd('fieldset');
$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');
@ -469,7 +474,7 @@ class PathsAdminPanelForm extends AdminForm
$this->out->elementStart('fieldset', array('id' => 'settings_admin_ssl'));
// 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->li();

View File

@ -44,7 +44,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
*
* @see Action
*/
class PeopletagAction extends Action
{
@ -65,6 +64,8 @@ class PeopletagAction extends Action
$this->tag = $this->trimmed('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->tag));
return;
@ -139,10 +140,11 @@ class PeopletagAction extends Action
*/
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'),
$this->tag, $this->page);
}
}
class PeopleTagList extends ProfileList
@ -177,4 +179,3 @@ class PeopleTagListItem extends ProfileListItem
return $aAttrs;
}
}

View File

@ -52,7 +52,6 @@ if (!defined('STATUSNET')) {
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPLv3
* @link http://status.net/
*/
class PluginDisableAction extends PluginEnableAction
{
/**
@ -74,5 +73,3 @@ class PluginDisableAction extends PluginEnableAction
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
* @link http://status.net/
*/
class PluginEnableAction extends Action
{
var $user;
@ -65,7 +64,6 @@ class PluginEnableAction extends Action
*
* @return boolean success flag
*/
function prepare($args)
{
parent::prepare($args);
@ -75,6 +73,8 @@ class PluginEnableAction extends Action
// Only allow POST requests
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.'));
return false;
}
@ -94,11 +94,13 @@ 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.
$this->clientError(_('Not logged in.'));
return false;
}
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.'));
return false;
}
@ -106,6 +108,7 @@ class PluginEnableAction extends Action
$this->plugin = $this->arg('plugin');
$defaultPlugins = common_config('plugins', 'default');
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.'));
return false;
}
@ -122,7 +125,6 @@ class PluginEnableAction extends Action
*
* @return void
*/
function handle($args)
{
$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
* @link http://status.net/
*/
class PluginsadminpanelAction extends AdminPanelAction
{
/**
* Returns the page title
*
* @return string page title
*/
function title()
{
// TRANS: Tab and title for plugins admin panel.
return _('Plugins');
return _m('TITLE','Plugins');
}
/**
@ -61,11 +58,10 @@ class PluginsadminpanelAction extends AdminPanelAction
*
* @return string instructions
*/
function getInstructions()
{
// TRANS: Instructions at top of plugin admin page.
return _('Additional plugins can be enabled and configured manually. ' .
return _('Additional plugins can be enabled and configured manually. ' .
'See the <a href="http://status.net/wiki/Plugins">online plugin ' .
'documentation</a> for more details.');
}
@ -75,11 +71,10 @@ class PluginsadminpanelAction extends AdminPanelAction
*
* @return void
*/
function showForm()
{
$this->elementStart('fieldset', array('id' => 'settings_plugins_default'));
// TRANS: Admin form section header
$this->element('legend', null, _('Default plugins'), 'default');
@ -103,6 +98,7 @@ class PluginsadminpanelAction extends AdminPanelAction
$list->show();
} else {
$this->element('p', null,
// TRANS: Text displayed on plugin admin page when no plugin are enabled.
_('All default plugins have been disabled from the ' .
'site\'s configuration file.'));
}

View File

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

View File

@ -51,7 +51,6 @@ define('MAX_PUBLIC_PAGE', 100);
* @see PublicrssAction
* @see PublicxrdsAction
*/
class PublicAction extends Action
{
/**
@ -73,14 +72,15 @@ class PublicAction extends Action
*
* @return boolean success value
*/
function prepare($args)
{
parent::prepare($args);
$this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
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());
@ -89,12 +89,13 @@ class PublicAction extends Action
NOTICES_PER_PAGE + 1);
if (!$this->notice) {
// TRANS: Server error displayed when a public timeline cannot be retrieved.
$this->serverError(_('Could not retrieve public stream.'));
return;
}
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);
}
@ -110,7 +111,6 @@ class PublicAction extends Action
*
* @return void
*/
function handle($args)
{
parent::handle($args);
@ -123,12 +123,14 @@ class PublicAction extends Action
*
* @return page title, including page number if over 1
*/
function title()
{
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);
} else {
// TRANS: Title for the first public timeline page.
return _('Public timeline');
}
}
@ -153,33 +155,38 @@ class PublicAction extends Action
*
* @return void
*/
function getFeeds()
{
return array(new Feed(Feed::RSS1, common_local_url('publicrss'),
// TRANS: Link description for public timeline feed.
_('Public Stream Feed (RSS 1.0)')),
new Feed(Feed::RSS2,
common_local_url('ApiTimelinePublic',
array('format' => 'rss')),
// TRANS: Link description for public timeline feed.
_('Public Stream Feed (RSS 2.0)')),
new Feed(Feed::ATOM,
common_local_url('ApiTimelinePublic',
array('format' => 'atom')),
// TRANS: Link description for public timeline feed.
_('Public Stream Feed (Atom)')));
}
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.') . ' ';
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!');
}
else {
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!');
}
}
}
$this->elementStart('div', 'guide');
$this->raw(common_markup_to_html($message));
@ -194,7 +201,6 @@ class PublicAction extends Action
*
* @return void
*/
function showContent()
{
$nl = new ThreadedNoticeList($this->notice, $this);
@ -224,11 +230,15 @@ class PublicAction extends Action
function showAnonymousMessage()
{
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 ' .
'based on the Free Software [StatusNet](http://status.net/) tool. ' .
'[Join now](%%action.register%%) to share notices about yourself with friends, family, and colleagues! ' .
'([Read more](%%doc.help%%))');
} 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 ' .
'based on the Free Software [StatusNet](http://status.net/) tool.');
}

View File

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