Many i18n/L10n updates and lots of descriptions for translators added.

This commit is contained in:
Siebrand Mazeland 2010-10-20 00:35:39 +02:00
parent d358c88f94
commit 4b4894b121
9 changed files with 253 additions and 82 deletions

View File

@ -42,7 +42,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 EditApplicationAction extends OwnerDesignAction
{
var $msg = null;
@ -51,18 +50,19 @@ class EditApplicationAction extends OwnerDesignAction
function title()
{
return _('Edit Application');
// TRANS: Title for "Edit application" form.
return _('Edit application');
}
/**
* Prepare to run
*/
function prepare($args)
{
parent::prepare($args);
if (!common_logged_in()) {
// TRANS: Client error displayed trying to edit an application while not logged in.
$this->clientError(_('You must be logged in to edit an application.'));
return false;
}
@ -74,10 +74,12 @@ class EditApplicationAction extends OwnerDesignAction
$cur = common_current_user();
if ($cur->id != $this->owner->id) {
// TRANS: Client error displayed trying to edit an application while not being its owner.
$this->clientError(_('You are not the owner of this application.'), 401);
}
if (!$this->app) {
// TRANS: Client error displayed trying to edit an application that does not exist.
$this->clientError(_('No such application.'));
return false;
}
@ -94,7 +96,6 @@ class EditApplicationAction extends OwnerDesignAction
*
* @return void
*/
function handle($args)
{
parent::handle($args);
@ -115,6 +116,7 @@ class EditApplicationAction extends OwnerDesignAction
&& empty($_POST)
&& ($_SERVER['CONTENT_LENGTH'] > 0)
) {
// TRANS: Client exception. %s is CONTENT_LENGTH (in bytes).
$msg = _('The server was unable to handle that much POST ' .
'data (%s bytes) due to its current configuration.');
$this->clientException(sprintf($msg, $_SERVER['CONTENT_LENGTH']));
@ -136,6 +138,7 @@ class EditApplicationAction extends OwnerDesignAction
} elseif ($this->arg('save')) {
$this->trySave();
} else {
// TRANS: Client error displayed submitting invalid form data for edit application.
$this->clientError(_('Unexpected form submission.'));
}
}
@ -158,6 +161,7 @@ class EditApplicationAction extends OwnerDesignAction
$this->element('p', 'error', $this->msg);
} else {
$this->element('p', 'instructions',
// TRANS: Instructions for "Edit application" form.
_('Use this form to edit your application.'));
}
}
@ -174,36 +178,47 @@ class EditApplicationAction extends OwnerDesignAction
$access_type = $this->arg('default_access_type');
if (empty($name)) {
// TRANS: Validation error shown when not providing a name in the "Edit application" form.
$this->showForm(_('Name is required.'));
return;
} elseif (mb_strlen($name) > 255) {
$this->showForm(_('Name is too long (max 255 chars).'));
// TRANS: Validation error shown when providing too long a name in the "Edit application" form.
$this->showForm(_('Name is too long (max 255 characters).'));
return;
} else if ($this->nameExists($name)) {
// TRANS: Validation error shown when providing a name for an application that already exists in the "Edit application" form.
$this->showForm(_('Name already in use. Try another one.'));
return;
} elseif (empty($description)) {
// TRANS: Validation error shown when not providing a description in the "Edit application" form.
$this->showForm(_('Description is required.'));
return;
} elseif (Oauth_application::descriptionTooLong($description)) {
$this->showForm(sprintf(
_('Description is too long (max %d chars).'),
// TRANS: Validation error shown when providing too long a description in the "Edit application" form.
_m('Description is too long (maximum %d character).',
'Description is too long (maximum %d characters).',
Oauth_application::maxDesc()),
Oauth_application::maxDesc()));
return;
} elseif (mb_strlen($source_url) > 255) {
// TRANS: Validation error shown when providing too long a source URL in the "Edit application" form.
$this->showForm(_('Source URL is too long.'));
return;
} elseif ((mb_strlen($source_url) > 0)
&& !Validate::uri($source_url,
array('allowed_schemes' => array('http', 'https'))))
{
// TRANS: Validation error shown when providing an invalid source URL in the "Edit application" form.
$this->showForm(_('Source URL is not valid.'));
return;
} elseif (empty($organization)) {
// TRANS: Validation error shown when not providing an organisation in the "Edit application" form.
$this->showForm(_('Organization is required.'));
return;
} elseif (mb_strlen($organization) > 255) {
$this->showForm(_('Organization is too long (max 255 chars).'));
// TRANS: Validation error shown when providing too long an arganisation name in the "Edit application" form.
$this->showForm(_('Organization is too long (maximum 255 characters).'));
return;
} elseif (empty($homepage)) {
$this->showForm(_('Organization homepage is required.'));
@ -212,9 +227,11 @@ class EditApplicationAction extends OwnerDesignAction
&& !Validate::uri($homepage,
array('allowed_schemes' => array('http', 'https'))))
{
// TRANS: Validation error shown when providing an invalid homepage URL in the "Edit application" form.
$this->showForm(_('Homepage is not a valid URL.'));
return;
} elseif (mb_strlen($callback_url) > 255) {
// TRANS: Validation error shown when providing too long a callback URL in the "Edit application" form.
$this->showForm(_('Callback is too long.'));
return;
} elseif (mb_strlen($callback_url) > 0
@ -222,6 +239,7 @@ class EditApplicationAction extends OwnerDesignAction
array('allowed_schemes' => array('http', 'https'))
))
{
// TRANS: Validation error shown when providing an invalid callback URL in the "Edit application" form.
$this->showForm(_('Callback URL is not valid.'));
return;
}
@ -258,6 +276,7 @@ class EditApplicationAction extends OwnerDesignAction
// the next step.
if ($result === false) {
common_log_db_error($this->app, 'UPDATE', __FILE__);
// TRANS: Server error occuring when an application could not be updated from the "Edit application" form.
$this->serverError(_('Could not update application.'));
}
@ -276,7 +295,6 @@ class EditApplicationAction extends OwnerDesignAction
*
* @return boolean true if the name already exists
*/
function nameExists($name)
{
$newapp = Oauth_application::staticGet('name', $name);
@ -286,6 +304,4 @@ class EditApplicationAction extends OwnerDesignAction
return $newapp->id != $this->app->id;
}
}
}

View File

@ -36,8 +36,11 @@ class InviteAction extends CurrentUserDesignAction
{
parent::handle($args);
if (!common_config('invite', 'enabled')) {
// TRANS: Client error displayed when trying to sent invites while they have been disabled.
$this->clientError(_('Invites have been disabled.'));
} else if (!common_logged_in()) {
// TRANS: Client error displayed when trying to sent invites while not logged in.
// TRANS: %s is the StatusNet site name.
$this->clientError(sprintf(_('You must be logged in to invite other users to use %s.'),
common_config('site', 'name')));
return;
@ -69,7 +72,9 @@ class InviteAction extends CurrentUserDesignAction
foreach ($addresses as $email) {
$email = trim($email);
if (!Validate::email($email, common_config('email', 'check_domain'))) {
$this->showForm(sprintf(_('Invalid email address: %s'), $email));
// TRANS: Form validation message when providing an e-mail address that does not validate.
// TRANS: %s is an invalid e-mail address.
$this->showForm(sprintf(_('Invalid email address: %s.'), $email));
return;
}
}
@ -107,8 +112,10 @@ class InviteAction extends CurrentUserDesignAction
function title()
{
if ($this->mode == 'sent') {
return _('Invitation(s) sent');
// TRANS: Page title when invitations have been sent.
return _('Invitations sent');
} else {
// TRANS: Page title when inviting potential users.
return _('Invite new users');
}
}
@ -125,28 +132,48 @@ class InviteAction extends CurrentUserDesignAction
function showInvitationSuccess()
{
if ($this->already) {
$this->element('p', null, _('You are already subscribed to these users:'));
// TRANS: Message displayed inviting users to use a StatusNet site while the inviting user
// TRANS: is already subscribed to one or more users with the given e-mail address(es).
// TRANS: Plural form is based on the number of reported already subscribed e-mail addresses.
// TRANS: Followed by a bullet list.
$this->element('p', null, _m('You are already subscribed to this user:',
'You are already subscribed to these users:',
count($this->already)));
$this->elementStart('ul');
foreach ($this->already as $other) {
// TRANS: Used as list item for already subscribed users (%1$s is nickname, %2$s is e-mail address).
$this->element('li', null, sprintf(_('%1$s (%2$s)'), $other->nickname, $other->email));
}
$this->elementEnd('ul');
}
if ($this->subbed) {
$this->element('p', null, _('These people are already users and you were automatically subscribed to them:'));
// TRANS: Message displayed inviting users to use a StatusNet site while the invited user
// TRANS: already uses a this StatusNet site. Plural form is based on the number of
// TRANS: reported already present people. Followed by a bullet list.
$this->element('p', null, _m('This person is already a user and you were automatically subscribed:',
'These people are already users and you were automatically subscribed to them:',
count($this->subbed)));
$this->elementStart('ul');
foreach ($this->subbed as $other) {
// TRANS: Used as list item for already registered people (%1$s is nickname, %2$s is e-mail address).
$this->element('li', null, sprintf(_('%1$s (%2$s)'), $other->nickname, $other->email));
}
$this->elementEnd('ul');
}
if ($this->sent) {
$this->element('p', null, _('Invitation(s) sent to the following people:'));
// TRANS: Message displayed inviting users to use a StatusNet site. Plural form is
// TRANS: based on the number of invitations sent. Followed by a bullet list of
// TRANS: e-mail addresses to which invitations were sent.
$this->element('p', null, _m('Invitation sent to the following person:',
'Invitations sent to the following people:',
count($this->sent)));
$this->elementStart('ul');
foreach ($this->sent as $other) {
$this->element('li', null, $other);
}
$this->elementEnd('ul');
// TRANS: Generic message displayed after sending out one or more invitations to
// TRANS: people to join a StatusNet site.
$this->element('p', null, _('You will be notified when your invitees accept the invitation and register on the site. Thanks for growing the community!'));
}
}
@ -159,6 +186,7 @@ class InviteAction extends CurrentUserDesignAction
} else {
$this->elementStart('div', 'instructions');
$this->element('p', null,
// TRANS: Form instructions.
_('Use this form to invite your friends and colleagues to use this service.'));
$this->elementEnd('div');
}
@ -179,18 +207,23 @@ class InviteAction extends CurrentUserDesignAction
'class' => 'form_settings',
'action' => common_local_url('invite')));
$this->elementStart('fieldset');
// TRANS: Form legend.
$this->element('legend', null, 'Send an invitation');
$this->hidden('token', common_session_token());
$this->elementStart('ul', 'form_data');
$this->elementStart('li');
// TRANS: Field label for a list of e-mail addresses.
$this->textarea('addresses', _('Email addresses'),
$this->trimmed('addresses'),
// TRANS: Tooltip for field label for a list of e-mail addresses.
_('Addresses of friends to invite (one per line)'));
$this->elementEnd('li');
$this->elementStart('li');
// TRANS: Field label for a personal message to send to invitees.
$this->textarea('personal', _('Personal message'),
$this->trimmed('personal'),
// TRANS: Tooltip for field label for a personal message to send to invitees.
_('Optionally add a personal message to the invitation.'));
$this->elementEnd('li');
$this->elementEnd('ul');
@ -224,10 +257,16 @@ class InviteAction extends CurrentUserDesignAction
$headers['From'] = mail_notify_from();
$headers['To'] = trim($email);
// TRANS: Subject for invitation email. Note that 'them' is correct as a gender-neutral singular 3rd-person pronoun in English.
// TRANS: Subject for invitation email. Note that 'them' is correct as a gender-neutral
// TRANS: singular 3rd-person pronoun in English. %1$s is the inviting user, $2$s is
// TRANS: the StatusNet sitename.
$headers['Subject'] = sprintf(_('%1$s has invited you to join them on %2$s'), $bestname, $sitename);
// TRANS: Body text for invitation email. Note that 'them' is correct as a gender-neutral singular 3rd-person pronoun in English.
// TRANS: Body text for invitation email. Note that 'them' is correct as a gender-neutral
// TRANS: singular 3rd-person pronoun in English. %1$s is the inviting user, %2$s is the
// TRANS: StatusNet sitename, %3$s is the site URL, %4$s is the personal message from the
// TRANS: inviting user, %s%5 a link to the timeline for the inviting user, %s$6 is a link
// TRANS: to register with the StatusNet site.
$body = sprintf(_("%1\$s has invited you to join them on %2\$s (%3\$s).\n\n".
"%2\$s is a micro-blogging service that lets you keep up-to-date with people you know and people who interest you.\n\n".
"You can also share news about yourself, your thoughts, or your life online with people who know about you. ".

View File

@ -57,6 +57,7 @@ class ProfilesettingsAction extends AccountSettingsAction
function title()
{
// TRANS: Page title for profile settings.
return _('Profile settings');
}
@ -68,6 +69,7 @@ class ProfilesettingsAction extends AccountSettingsAction
function getInstructions()
{
// TRANS: Usage instructions for profile settings.
return _('You can update your personal profile info here '.
'so people know more about you.');
}
@ -96,6 +98,7 @@ class ProfilesettingsAction extends AccountSettingsAction
'class' => 'form_settings',
'action' => common_local_url('profilesettings')));
$this->elementStart('fieldset');
// TRANS: Profile settings form legend.
$this->element('legend', null, _('Profile information'));
$this->hidden('token', common_session_token());
@ -103,38 +106,54 @@ class ProfilesettingsAction extends AccountSettingsAction
$this->elementStart('ul', 'form_data');
if (Event::handle('StartProfileFormData', array($this))) {
$this->elementStart('li');
// TRANS: Field label in form for profile settings.
$this->input('nickname', _('Nickname'),
($this->arg('nickname')) ? $this->arg('nickname') : $profile->nickname,
_('1-64 lowercase letters or numbers, no punctuation or spaces'));
// TRANS: Tooltip for field label in form for profile settings.
_('1-64 lowercase letters or numbers, no punctuation or spaces.'));
$this->elementEnd('li');
$this->elementStart('li');
// TRANS: Field label in form for profile settings.
$this->input('fullname', _('Full name'),
($this->arg('fullname')) ? $this->arg('fullname') : $profile->fullname);
$this->elementEnd('li');
$this->elementStart('li');
// TRANS: Field label in form for profile settings.
$this->input('homepage', _('Homepage'),
($this->arg('homepage')) ? $this->arg('homepage') : $profile->homepage,
_('URL of your homepage, blog, or profile on another site'));
// TRANS: Tooltip for field label in form for profile settings.
_('URL of your homepage, blog, or profile on another site.'));
$this->elementEnd('li');
$this->elementStart('li');
$maxBio = Profile::maxBio();
if ($maxBio > 0) {
$bioInstr = sprintf(_('Describe yourself and your interests in %d chars'),
// TRANS: Tooltip for field label in form for profile settings. Plural
// TRANS: is decided by the number of characters available for the
// TRANS: biography (%d).
$bioInstr = sprintf(_m('Describe yourself and your interests in %d character',
'Describe yourself and your interests in %d characters',
$maxBio),
$maxBio);
} else {
// TRANS: Tooltip for field label in form for profile settings.
$bioInstr = _('Describe yourself and your interests');
}
// TRANS: Text area label in form for profile settings where users can provide.
// TRANS: their biography.
$this->textarea('bio', _('Bio'),
($this->arg('bio')) ? $this->arg('bio') : $profile->bio,
$bioInstr);
$this->elementEnd('li');
$this->elementStart('li');
// TRANS: Field label in form for profile settings.
$this->input('location', _('Location'),
($this->arg('location')) ? $this->arg('location') : $profile->location,
// TRANS: Tooltip for field label in form for profile settings.
_('Where you are, like "City, State (or Region), Country"'));
$this->elementEnd('li');
if (common_config('location', 'share') == 'user') {
$this->elementStart('li');
// TRANS: Checkbox label in form for profile settings.
$this->checkbox('sharelocation', _('Share my current location when posting notices'),
($this->arg('sharelocation')) ?
$this->arg('sharelocation') : $user->shareLocation());
@ -142,13 +161,17 @@ class ProfilesettingsAction extends AccountSettingsAction
}
Event::handle('EndProfileFormData', array($this));
$this->elementStart('li');
// TRANS: Field label in form for profile settings.
$this->input('tags', _('Tags'),
($this->arg('tags')) ? $this->arg('tags') : implode(' ', $user->getSelfTags()),
// TRANS: Tooltip for field label in form for profile settings.
_('Tags for yourself (letters, numbers, -, ., and _), comma- or space- separated'));
$this->elementEnd('li');
$this->elementStart('li');
$language = common_language();
// TRANS: Dropdownlist label in form for profile settings.
$this->dropdown('language', _('Language'),
// TRANS: Tooltip for dropdown list label in form for profile settings.
get_nice_language_list(), _('Preferred language'),
false, $language);
$this->elementEnd('li');
@ -158,12 +181,15 @@ class ProfilesettingsAction extends AccountSettingsAction
$timezones[$v] = $v;
}
$this->elementStart('li');
// TRANS: Dropdownlist label in form for profile settings.
$this->dropdown('timezone', _('Timezone'),
// TRANS: Tooltip for dropdown list label in form for profile settings.
$timezones, _('What timezone are you normally in?'),
true, $timezone);
$this->elementEnd('li');
$this->elementStart('li');
$this->checkbox('autosubscribe',
// TRANS: Checkbox label in form for profile settings.
_('Automatically subscribe to whoever '.
'subscribes to me (best for non-humans)'),
($this->arg('autosubscribe')) ?
@ -171,7 +197,8 @@ class ProfilesettingsAction extends AccountSettingsAction
$this->elementEnd('li');
}
$this->elementEnd('ul');
$this->submit('save', _('Save'));
// TRANS: Button to save input in profile settings.
$this->submit('save', _m('BUTTON','Save'));
$this->elementEnd('fieldset');
$this->elementEnd('form');
@ -212,33 +239,46 @@ class ProfilesettingsAction extends AccountSettingsAction
if (!Validate::string($nickname, array('min_length' => 1,
'max_length' => 64,
'format' => NICKNAME_FMT))) {
// TRANS: Validation error in form for profile settings.
$this->showForm(_('Nickname must have only lowercase letters and numbers and no spaces.'));
return;
} else if (!User::allowed_nickname($nickname)) {
// TRANS: Validation error in form for profile settings.
$this->showForm(_('Not a valid nickname.'));
return;
} else if (!is_null($homepage) && (strlen($homepage) > 0) &&
!Validate::uri($homepage, array('allowed_schemes' => array('http', 'https')))) {
// TRANS: Validation error in form for profile settings.
$this->showForm(_('Homepage is not a valid URL.'));
return;
} else if (!is_null($fullname) && mb_strlen($fullname) > 255) {
$this->showForm(_('Full name is too long (max 255 chars).'));
// TRANS: Validation error in form for profile settings.
$this->showForm(_('Full name is too long (max 255 characters).'));
return;
} else if (Profile::bioTooLong($bio)) {
$this->showForm(sprintf(_('Bio is too long (max %d chars).'),
// TRANS: Validation error in form for profile settings.
// TRANS: Plural form is used based on the maximum number of allowed
// TRANS: characters for the biography (%d).
$this->showForm(sprintf(_m('Bio is too long (max %d character).',
'Bio is too long (max %d characters).',
Profile::maxBio()),
Profile::maxBio()));
return;
} else if (!is_null($location) && mb_strlen($location) > 255) {
$this->showForm(_('Location is too long (max 255 chars).'));
// TRANS: Validation error in form for profile settings.
$this->showForm(_('Location is too long (max 255 characters).'));
return;
} else if (is_null($timezone) || !in_array($timezone, DateTimeZone::listIdentifiers())) {
// TRANS: Validation error in form for profile settings.
$this->showForm(_('Timezone not selected.'));
return;
} else if ($this->nicknameExists($nickname)) {
// TRANS: Validation error in form for profile settings.
$this->showForm(_('Nickname already in use. Try another one.'));
return;
} else if (!is_null($language) && strlen($language) > 50) {
$this->showForm(_('Language is too long (max 50 chars).'));
// TRANS: Validation error in form for profile settings.
$this->showForm(_('Language is too long (max 50 characters).'));
return;
}
@ -250,6 +290,8 @@ class ProfilesettingsAction extends AccountSettingsAction
foreach ($tags as $tag) {
if (!common_valid_profile_tag($tag)) {
// TRANS: Validation error in form for profile settings.
// TRANS: %s is an invalid tag.
$this->showForm(sprintf(_('Invalid tag: "%s"'), $tag));
return;
}
@ -280,6 +322,7 @@ class ProfilesettingsAction extends AccountSettingsAction
if ($result === false) {
common_log_db_error($user, 'UPDATE', __FILE__);
// TRANS: Server error thrown when user profile settings could not be updated.
$this->serverError(_('Couldn\'t update user.'));
return;
} else {
@ -303,6 +346,8 @@ class ProfilesettingsAction extends AccountSettingsAction
if ($result === false) {
common_log_db_error($user, 'UPDATE', __FILE__);
// TRANS: Server error thrown when user profile settings could not be updated to
// TRANS: automatically subscribe to any subscriber.
$this->serverError(_('Couldn\'t update user for autosubscribe.'));
return;
}
@ -360,6 +405,7 @@ class ProfilesettingsAction extends AccountSettingsAction
if ($result === false) {
common_log_db_error($prefs, ($exists) ? 'UPDATE' : 'INSERT', __FILE__);
// TRANS: Server error thrown when user profile location preference settings could not be updated.
$this->serverError(_('Couldn\'t save location prefs.'));
return;
}
@ -372,6 +418,7 @@ class ProfilesettingsAction extends AccountSettingsAction
if ($result === false) {
common_log_db_error($profile, 'UPDATE', __FILE__);
// TRANS: Server error thrown when user profile settings could not be saved.
$this->serverError(_('Couldn\'t save profile.'));
return;
}
@ -380,6 +427,7 @@ class ProfilesettingsAction extends AccountSettingsAction
$result = $user->setSelfTags($tags);
if (!$result) {
// TRANS: Server error thrown when user profile settings tags could not be saved.
$this->serverError(_('Couldn\'t save tags.'));
return;
}
@ -388,6 +436,7 @@ class ProfilesettingsAction extends AccountSettingsAction
Event::handle('EndProfileSaveForm', array($this));
common_broadcast_profile($profile);
// TRANS: Confirmation shown when user profile settings are saved.
$this->showForm(_('Settings saved.'), true);
}

View File

@ -44,7 +44,6 @@ define('TAGS_PER_PAGE', 100);
* @copyright 2008-2009 StatusNet, Inc.
* @link http://status.net/
*/
class PublictagcloudAction extends Action
{
function isReadOnly($args)
@ -54,24 +53,37 @@ class PublictagcloudAction extends Action
function title()
{
// TRANS: Title for public tag cloud.
return _('Public tag cloud');
}
function showPageNotice()
{
$this->element('p', 'instructions',
sprintf(_('These are most popular recent tags on %s '),
// TRANS: Instructions (more used like an explanation/header).
// TRANS: %s is the StatusNet sitename.
sprintf(_('These are most popular recent tags on %s'),
common_config('site', 'name')));
}
function showEmptyList()
{
// TRANS: This message contains a Markdown URL. The link description is between
// TRANS: square brackets, and the link between parentheses. Do not separate "]("
// TRANS: and do not change the URL part.
$message = _('No one has posted a notice with a [hashtag](%%doc.tags%%) yet.') . ' ';
if (common_logged_in()) {
// TRANS: Message shown to a logged in user for the public tag cloud
// TRANS: while no tags exist yet. "One" refers to the non-existing hashtag.
$message .= _('Be the first to post one!');
}
else {
// TRANS: Message shown to a anonymous user for the public tag cloud
// TRANS: while no tags exist yet. "One" refers to the non-existing hashtag.
// TRANS: This message contains a Markdown URL. The link description is between
// TRANS: square brackets, and the link between parentheses. Do not separate "]("
// TRANS: and do not change the URL part.
$message .= _('Why not [register an account](%%action.register%%) and be the first to post one!');
}

View File

@ -54,7 +54,6 @@ require_once INSTALLDIR.'/lib/feedlist.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 ShowstreamAction extends ProfileAction
{
function isReadOnly($args)
@ -84,7 +83,6 @@ class ShowstreamAction extends ProfileAction
function handle($args)
{
// Looks like we're good; start output
// For YADIS discovery, we also have a <meta> tag
@ -186,7 +184,6 @@ class ShowstreamAction extends ProfileAction
$this->element('link', array('rel' => 'EditURI',
'type' => 'application/rsd+xml',
'href' => $rsd));
}
function showProfile()

View File

@ -41,14 +41,17 @@ 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 SubscribersAction extends GalleryAction
{
function title()
{
if ($this->page == 1) {
// TRANS: Header for list of subscribers for a user (first page).
// TRANS: %s is the user's nickname.
return sprintf(_('%s subscribers'), $this->user->nickname);
} else {
// TRANS: Header for list of subscribers for a user (not first page).
// TRANS: %1$s is the user's nickname, $2$d is the page number.
return sprintf(_('%1$s subscribers, page %2$d'),
$this->user->nickname,
$this->page);
@ -60,10 +63,14 @@ class SubscribersAction extends GalleryAction
$user = common_current_user();
if ($user && ($user->id == $this->profile->id)) {
$this->element('p', null,
// TRANS: Page notice for page with an overview of all subscribers
// TRANS: of the logged in user's own profile.
_('These are the people who listen to '.
'your notices.'));
} else {
$this->element('p', null,
// TRANS: Page notice for page with an overview of all subscribers of a user other
// TRANS: than the logged in user. %s is the user nickname.
sprintf(_('These are the people who '.
'listen to %s\'s notices.'),
$this->profile->nickname));
@ -105,12 +112,20 @@ class SubscribersAction extends GalleryAction
if (common_logged_in()) {
$current_user = common_current_user();
if ($this->user->id === $current_user->id) {
$message = _('You have no subscribers. Try subscribing to people you know and they might return the favor');
// TRANS: Subscriber list text when the logged in user has no subscribers.
$message = _('You have no subscribers. Try subscribing to people you know and they might return the favor.');
} else {
// TRANS: Subscriber list text when looking at the subscribers for a of a user other
// TRANS: than the logged in user that has no subscribers. %s is the user nickname.
$message = sprintf(_('%s has no subscribers. Want to be the first?'), $this->user->nickname);
}
}
else {
// TRANS: Subscriber list text when looking at the subscribers for a of a user that has none
// TRANS: as an anonymous user. %s is the user nickname.
// TRANS: This message contains a Markdown URL. The link description is between
// TRANS: square brackets, and the link between parentheses. Do not separate "]("
// TRANS: and do not change the URL part.
$message = sprintf(_('%s has no subscribers. Why not [register an account](%%%%action.register%%%%) and be the first?'), $this->user->nickname);
}

View File

@ -41,16 +41,17 @@ 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/
*/
if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
class SubscriptionsAction extends GalleryAction
{
function title()
{
if ($this->page == 1) {
// TRANS: Header for subscriptions overview for a user (first page).
// TRANS: %s is a user nickname.
return sprintf(_('%s subscriptions'), $this->user->nickname);
} else {
// TRANS: Header for subscriptions overview for a user (not first page).
// TRANS: %1$s is a user nickname, %2$d is the page number.
return sprintf(_('%1$s subscriptions, page %2$d'),
$this->user->nickname,
$this->page);
@ -62,10 +63,14 @@ class SubscriptionsAction extends GalleryAction
$user = common_current_user();
if ($user && ($user->id == $this->profile->id)) {
$this->element('p', null,
// TRANS: Page notice for page with an overview of all subscriptions
// TRANS: of the logged in user's own profile.
_('These are the people whose notices '.
'you listen to.'));
} else {
$this->element('p', null,
// TRANS: Page notice for page with an overview of all subscriptions of a user other
// TRANS: than the logged in user. %s is the user nickname.
sprintf(_('These are the people whose '.
'notices %s listens to.'),
$this->profile->nickname));
@ -123,12 +128,24 @@ class SubscriptionsAction extends GalleryAction
if (common_logged_in()) {
$current_user = common_current_user();
if ($this->user->id === $current_user->id) {
$message = _('You\'re not listening to anyone\'s notices right now, try subscribing to people you know. Try [people search](%%action.peoplesearch%%), look for members in groups you\'re interested in and in our [featured users](%%action.featured%%). If you\'re a [Twitter user](%%action.twittersettings%%), you can automatically subscribe to people you already follow there.');
// TRANS: Subscription list text when the logged in user has no subscriptions.
// TRANS: This message contains Markdown URLs. The link description is between
// TRANS: square brackets, and the link between parentheses. Do not separate "]("
// TRANS: and do not change the URL part.
$message = _('You\'re not listening to anyone\'s notices right now, try subscribing to people you know. '.
'Try [people search](%%action.peoplesearch%%), look for members in groups you\'re interested '.
'in and in our [featured users](%%action.featured%%). '.
'If you\'re a [Twitter user](%%action.twittersettings%%), you can automatically subscribe to '.
'people you already follow there.');
} else {
// TRANS: Subscription list text when looking at the subscriptions for a of a user other
// TRANS: than the logged in user that has no subscriptions. %s is the user nickname.
$message = sprintf(_('%s is not listening to anyone.'), $this->user->nickname);
}
}
else {
// TRANS: Subscription list text when looking at the subscriptions for a of a user that has none
// TRANS: as an anonymous user. %s is the user nickname.
$message = sprintf(_('%s is not listening to anyone.'), $this->user->nickname);
}
@ -205,6 +222,7 @@ class SubscriptionsListItem extends SubscriptionListItem
}
$this->out->element('input', $attrs);
// TRANS: Checkbox label for enabling Jabber messages for a profile in a subscriptions list.
$this->out->element('label', array('for' => 'jabber-'.$this->profile->id), _('Jabber'));
} else {
$this->out->hidden('jabber', $sub->jabber);
@ -219,11 +237,13 @@ class SubscriptionsListItem extends SubscriptionListItem
}
$this->out->element('input', $attrs);
// TRANS: Checkbox label for enabling SMS messages for a profile in a subscriptions list.
$this->out->element('label', array('for' => 'sms-'.$this->profile->id), _('SMS'));
} else {
$this->out->hidden('sms', $sub->sms);
}
$this->out->submit('save', _('Save'));
// TRANS: Save button for settings for a profile in a subscriptions list.
$this->out->submit('save', _m('BUTTON','Save'));
$this->out->elementEnd('form');
return;
}

View File

@ -133,10 +133,10 @@ try {
// XXX: Throw a conniption if database not installed
// XXX: Find a way to use htmlwriter for this instead of handcoded markup
// TRANS: Error message displayed when no configuration file was found for a StatusNet installation.
echo '<p>'. _('No configuration file found. ') .'</p>';
echo '<p>'. _('No configuration file found.') .'</p>';
// TRANS: Error message displayed when no configuration file was found for a StatusNet installation.
// TRANS: Is followed by a list of directories (separated by HTML breaks).
echo '<p>'. _('I looked for configuration files in the following places: ') .'<br /> ';
echo '<p>'. _('I looked for configuration files in the following places:') .'<br /> ';
echo implode($e->configFiles, '<br />');
// TRANS: Error message displayed when no configuration file was found for a StatusNet installation.
echo '<p>'. _('You may wish to run the installer to fix this.') .'</p>';

View File

@ -170,19 +170,21 @@ function mail_to_user(&$user, $subject, $body, $headers=array(), $address=null)
function mail_confirm_address($user, $code, $nickname, $address)
{
// TRANS: Subject for address confirmation email
// TRANS: Subject for address confirmation email.
$subject = _('Email address confirmation');
// TRANS: Body for address confirmation email.
$body = sprintf(_("Hey, %s.\n\n".
"Someone just entered this email address on %s.\n\n" .
// TRANS: %1$s is the addressed user's nickname, %2$s is the StatusNet sitename,
// TRANS: %3$s is the URL to confirm at.
$body = sprintf(_("Hey, %1\$s.\n\n".
"Someone just entered this email address on %2\$s.\n\n" .
"If it was you, and you want to confirm your entry, ".
"use the URL below:\n\n\t%s\n\n" .
"use the URL below:\n\n\t%3\$s\n\n" .
"If not, just ignore this message.\n\n".
"Thanks for your time, \n%s\n"),
$nickname, common_config('site', 'name'),
common_local_url('confirmaddress', array('code' => $code)),
common_config('site', 'name'));
"Thanks for your time, \n%2\$s\n"),
$nickname,
common_config('site', 'name'),
common_local_url('confirmaddress', array('code' => $code)));
$headers = array();
return mail_to_user($user, $subject, $body, $headers, $address);
@ -239,41 +241,50 @@ function mail_subscribe_notify_profile($listenee, $other)
$headers = _mail_prepare_headers('subscribe', $listenee->nickname, $other->nickname);
$headers['From'] = mail_notify_from();
$headers['To'] = $name . ' <' . $listenee->email . '>';
// TRANS: Subject of new-subscriber notification e-mail
// TRANS: Subject of new-subscriber notification e-mail.
// TRANS: %1$s is the subscribing user's nickname, %2$s is the StatusNet sitename.
$headers['Subject'] = sprintf(_('%1$s is now listening to '.
'your notices on %2$s.'),
$other->getBestName(),
common_config('site', 'name'));
// TRANS: This is a paragraph in a new-subscriber e-mail.
// TRANS: %s is a URL where the subscriber can be reported as abusive.
$blocklink = sprintf(_("If you believe this account is being used abusively, " .
"you can block them from your subscribers list and " .
"report as spam to site administrators at %s"),
common_local_url('block', array('profileid' => $other->id)));
// TRANS: Main body of new-subscriber notification e-mail
// TRANS: Main body of new-subscriber notification e-mail.
// TRANS: %1$s is the subscriber's long name, %2$s is the StatusNet sitename,
// TRANS: %3$s is the subscriber's profile URL, %4$s is the subscriber's location (or empty)
// TRANS: %5$s is the subscriber's homepage URL (or empty), %6%s is the subscriber's bio (or empty)
// TRANS: %7$s is a link to the addressed user's e-mail settings.
$body = sprintf(_('%1$s is now listening to your notices on %2$s.'."\n\n".
"\t".'%3$s'."\n\n".
'%4$s'.
'%5$s'.
'%6$s'.
"\n".'Faithfully yours,'."\n".'%7$s.'."\n\n".
"\n".'Faithfully yours,'."\n".'%2$s.'."\n\n".
"----\n".
"Change your email address or ".
"notification options at ".'%8$s' ."\n"),
"notification options at ".'%7$s' ."\n"),
$long_name,
common_config('site', 'name'),
$other->profileurl,
($other->location) ?
// TRANS: Profile info line in new-subscriber notification e-mail
// TRANS: Profile info line in new-subscriber notification e-mail.
// TRANS: %s is a location.
sprintf(_("Location: %s"), $other->location) . "\n" : '',
($other->homepage) ?
// TRANS: Profile info line in new-subscriber notification e-mail
// TRANS: Profile info line in new-subscriber notification e-mail.
// TRANS: %s is a homepage.
sprintf(_("Homepage: %s"), $other->homepage) . "\n" : '',
(($other->bio) ?
// TRANS: Profile info line in new-subscriber notification e-mail
// TRANS: Profile info line in new-subscriber notification e-mail.
// TRANS: %s is biographical information.
sprintf(_("Bio: %s"), $other->bio) . "\n" : '') .
"\n\n" . $blocklink . "\n",
common_config('site', 'name'),
common_local_url('emailsettings'));
// reset localization
@ -291,7 +302,6 @@ function mail_subscribe_notify_profile($listenee, $other)
*
* @return void
*/
function mail_new_incoming_notify($user)
{
$profile = $user->getProfile();
@ -300,19 +310,21 @@ function mail_new_incoming_notify($user)
$headers['From'] = $user->incomingemail;
$headers['To'] = $name . ' <' . $user->email . '>';
// TRANS: Subject of notification mail for new posting email address
// TRANS: Subject of notification mail for new posting email address.
// TRANS: %s is the StatusNet sitename.
$headers['Subject'] = sprintf(_('New email address for posting to %s'),
common_config('site', 'name'));
// TRANS: Body of notification mail for new posting email address
// TRANS: Body of notification mail for new posting email address.
// TRANS: %1$s is the StatusNet sitename, %2$s is the e-mail address to send
// TRANS: to to post by e-mail, %3$s is a URL to more instructions.
$body = sprintf(_("You have a new posting address on %1\$s.\n\n".
"Send email to %2\$s to post new messages.\n\n".
"More email instructions at %3\$s.\n\n".
"Faithfully yours,\n%4\$s"),
"Faithfully yours,\n%1\$s"),
common_config('site', 'name'),
$user->incomingemail,
common_local_url('doc', array('title' => 'email')),
common_config('site', 'name'));
common_local_url('doc', array('title' => 'email')));
mail_send($user->email, $headers, $body);
}
@ -324,7 +336,6 @@ function mail_new_incoming_notify($user)
*
* @return string new email address for incoming messages
*/
function mail_new_incoming_address()
{
$prefix = common_confirmation_code(64);
@ -343,7 +354,6 @@ function mail_new_incoming_address()
*
* @return success flag
*/
function mail_broadcast_notice_sms($notice)
{
// Now, get users subscribed to this profile
@ -395,7 +405,6 @@ function mail_broadcast_notice_sms($notice)
*
* @return boolean success flag
*/
function mail_send_sms_notice($notice, $user)
{
return mail_send_sms_notice_address($notice,
@ -415,7 +424,6 @@ function mail_send_sms_notice($notice, $user)
*
* @return boolean success flag
*/
function mail_send_sms_notice_address($notice, $smsemail, $incomingemail)
{
$to = $nickname . ' <' . $smsemail . '>';
@ -429,7 +437,8 @@ function mail_send_sms_notice_address($notice, $smsemail, $incomingemail)
$headers['From'] = ($incomingemail) ? $incomingemail : mail_notify_from();
$headers['To'] = $to;
// TRANS: Subject line for SMS-by-email notification messages
// TRANS: Subject line for SMS-by-email notification messages.
// TRANS: %s is the posting user's nickname.
$headers['Subject'] = sprintf(_('%s status'),
$other->getBestName());
@ -449,17 +458,17 @@ function mail_send_sms_notice_address($notice, $smsemail, $incomingemail)
*
* @return void
*/
function mail_confirm_sms($code, $nickname, $address)
{
$recipients = $address;
$headers['From'] = mail_notify_from();
$headers['To'] = $nickname . ' <' . $address . '>';
// TRANS: Subject line for SMS-by-email address confirmation message
// TRANS: Subject line for SMS-by-email address confirmation message.
$headers['Subject'] = _('SMS confirmation');
// TRANS: Main body heading for SMS-by-email address confirmation message
// TRANS: Main body heading for SMS-by-email address confirmation message.
// TRANS: %s is the addressed user's nickname.
$body = sprintf(_("%s: confirm you own this phone number with this code:"), $nickname);
$body .= "\n\n";
$body .= $code;
@ -476,16 +485,18 @@ function mail_confirm_sms($code, $nickname, $address)
*
* @return boolean success flag
*/
function mail_notify_nudge($from, $to)
{
common_switch_locale($to->language);
// TRANS: Subject for 'nudge' notification email
// TRANS: Subject for 'nudge' notification email.
// TRANS: %s is the nudging user.
$subject = sprintf(_('You\'ve been nudged by %s'), $from->nickname);
$from_profile = $from->getProfile();
// TRANS: Body for 'nudge' notification email
// TRANS: Body for 'nudge' notification email.
// TRANS: %1$s is the nuding user's long name, $2$s is the nudging user's nickname,
// TRANS: %3$s is a URL to post notices at, %4$s is the StatusNet sitename.
$body = sprintf(_("%1\$s (%2\$s) is wondering what you are up to ".
"these days and is inviting you to post some news.\n\n".
"So let's hear from you :)\n\n".
@ -516,7 +527,6 @@ function mail_notify_nudge($from, $to)
*
* @return boolean success code
*/
function mail_notify_message($message, $from=null, $to=null)
{
if (is_null($from)) {
@ -532,12 +542,16 @@ function mail_notify_message($message, $from=null, $to=null)
}
common_switch_locale($to->language);
// TRANS: Subject for direct-message notification email
// TRANS: Subject for direct-message notification email.
// TRANS: %s is the sending user's nickname.
$subject = sprintf(_('New private message from %s'), $from->nickname);
$from_profile = $from->getProfile();
// TRANS: Body for direct-message notification email
// TRANS: Body for direct-message notification email.
// TRANS: %1$s is the sending user's long name, %2$s is the sending user's nickname,
// TRANS: %3$s is the message content, %4$s a URL to the message,
// TRANS: %5$s is the StatusNet sitename.
$body = sprintf(_("%1\$s (%2\$s) sent you a private message:\n\n".
"------------------------------------------------------\n".
"%3\$s\n".
@ -572,7 +586,6 @@ function mail_notify_message($message, $from=null, $to=null)
*
* @return void
*/
function mail_notify_fave($other, $user, $notice)
{
if (!$user->hasRight(Right::EMAILONFAVE)) {
@ -585,10 +598,15 @@ function mail_notify_fave($other, $user, $notice)
common_switch_locale($other->language);
// TRANS: Subject for favorite notification email
$subject = sprintf(_('%s (@%s) added your notice as a favorite'), $bestname, $user->nickname);
// TRANS: Subject for favorite notification e-mail.
// TRANS: %1$s is the adding user's long name, %2$s is the adding user's nickname.
$subject = sprintf(_('%1s$ (@%2$s) added your notice as a favorite'), $bestname, $user->nickname);
// TRANS: Body for favorite notification email
// TRANS: Body for favorite notification e-mail.
// TRANS: %1$s is the adding user's long name, $2$s is the date the notice was created,
// TRANS: %3$s is a URL to the faved notice, %4$s is the faved notice text,
// TRANS: %5$s is a URL to all faves of the adding user, %6$s is the StatusNet sitename,
// TRANS: %7$s is the adding user's nickname.
$body = sprintf(_("%1\$s (@%7\$s) just added your notice from %2\$s".
" as one of their favorites.\n\n" .
"The URL of your notice is:\n\n" .
@ -623,7 +641,6 @@ function mail_notify_fave($other, $user, $notice)
*
* @return void
*/
function mail_notify_attn($user, $notice)
{
if (!$user->email || !$user->emailnotifyattn) {
@ -654,9 +671,16 @@ function mail_notify_attn($user, $notice)
$conversationEmailText = '';
}
$subject = sprintf(_('%s (@%s) sent a notice to your attention'), $bestname, $sender->nickname);
// TRANS: E-mail subject for notice notification.
// TRANS: %1$s is the sending user's long name, %2$s is the adding user's nickname.
$subject = sprintf(_('%1$s (@%2$s) sent a notice to your attention'), $bestname, $sender->nickname);
// TRANS: Body of @-reply notification e-mail.
// TRANS: %1$s is the sending user's long name, $2$s is the StatusNet sitename,
// TRANS: %3$s is a URL to the notice, %4$s is the notice text,
// TRANS: %5$s is a URL to the full conversion if it exists (otherwise empty),
// TRANS: %6$s is a URL to reply to the notice, %7$s is a URL to all @-replied for the addressed user,
// TRANS: %8$s is a URL to the addressed user's e-mail settings, %9$s is the sender's nickname.
$body = sprintf(_("%1\$s (@%9\$s) just sent a notice to your attention (an '@-reply') on %2\$s.\n\n".
"The notice is here:\n\n".
"\t%3\$s\n\n" .
@ -709,4 +733,3 @@ function _mail_prepare_headers($msg_type, $to, $from)
return $headers;
}