* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
- return sprintf(_('You can upload your personal avatar. The maximum file size is %s.'), ImageFile::maxFileSize());
+ // TRANS: Instruction for avatar upload page.
+ // TRANS: %s is the maximum file size, for example "500b", "10kB" or "2MB".
+ return sprintf(_('You can upload your personal avatar. The maximum file size is %s.'),
+ ImageFile::maxFileSize());
$this->element('legend', null, _('Avatar settings'));
$this->hidden('token', common_session_token());
$this->element('legend', null, _('Avatar settings'));
$this->hidden('token', common_session_token());
if (Event::handle('StartAvatarFormData', array($this))) {
$this->elementStart('ul', 'form_data');
if ($original) {
$this->elementStart('li', array('id' => 'avatar_original',
'class' => 'avatar_view'));
if (Event::handle('StartAvatarFormData', array($this))) {
$this->elementStart('ul', 'form_data');
if ($original) {
$this->elementStart('li', array('id' => 'avatar_original',
'class' => 'avatar_view'));
$this->element('h2', null, _("Original"));
$this->elementStart('div', array('id'=>'avatar_original_view'));
$this->element('img', array('src' => $original->url,
$this->element('h2', null, _("Original"));
$this->elementStart('div', array('id'=>'avatar_original_view'));
$this->element('img', array('src' => $original->url,
if ($avatar) {
$this->elementStart('li', array('id' => 'avatar_preview',
'class' => 'avatar_view'));
if ($avatar) {
$this->elementStart('li', array('id' => 'avatar_preview',
'class' => 'avatar_view'));
$this->element('h2', null, _("Preview"));
$this->elementStart('div', array('id'=>'avatar_preview_view'));
$this->element('h2', null, _("Preview"));
$this->elementStart('div', array('id'=>'avatar_preview_view'));
'width' => AVATAR_PROFILE_SIZE,
'height' => AVATAR_PROFILE_SIZE,
'alt' => $user->nickname));
$this->elementEnd('div');
'width' => AVATAR_PROFILE_SIZE,
'height' => AVATAR_PROFILE_SIZE,
'alt' => $user->nickname));
$this->elementEnd('div');
- $this->submit('delete', _('Delete'));
+ if (!empty($avatar->filename)) {
+ // TRANS: Button on avatar upload page to delete current avatar.
+ $this->submit('delete', _m('BUTTON','Delete'));
+ }
$this->element('input', array('name' => 'MAX_FILE_SIZE',
'type' => 'hidden',
'id' => 'MAX_FILE_SIZE',
'value' => ImageFile::maxFileSizeInt()));
$this->element('input', array('name' => 'MAX_FILE_SIZE',
'type' => 'hidden',
'id' => 'MAX_FILE_SIZE',
'value' => ImageFile::maxFileSizeInt()));
$this->elementEnd('li');
$this->elementEnd('ul');
$this->elementStart('ul', 'form_actions');
$this->elementStart('li');
$this->elementEnd('li');
$this->elementEnd('ul');
$this->elementStart('ul', 'form_actions');
$this->elementStart('li');
- $this->submit('upload', _('Upload'));
+ // TRANS: Button on avatar upload page to upload an avatar.
+ $this->submit('upload', _m('BUTTON','Upload'));
$this->element('legend', null, _('Avatar settings'));
$this->hidden('token', common_session_token());
$this->element('legend', null, _('Avatar settings'));
$this->hidden('token', common_session_token());
$this->elementStart('li',
array('id' => 'avatar_original',
'class' => 'avatar_view'));
$this->elementStart('li',
array('id' => 'avatar_original',
'class' => 'avatar_view'));
- $this->element('h2', null, _("Original"));
+ // TRANS: Header on avatar upload crop form for thumbnail of originally uploaded avatar (h2).
+ $this->element('h2', null, _('Original'));
$this->elementStart('div', array('id'=>'avatar_original_view'));
$this->element('img', array('src' => Avatar::url($this->filedata['filename']),
'width' => $this->filedata['width'],
$this->elementStart('div', array('id'=>'avatar_original_view'));
$this->element('img', array('src' => Avatar::url($this->filedata['filename']),
'width' => $this->filedata['width'],
$this->elementStart('li',
array('id' => 'avatar_preview',
'class' => 'avatar_view'));
$this->elementStart('li',
array('id' => 'avatar_preview',
'class' => 'avatar_view'));
- $this->element('h2', null, _("Preview"));
+ // TRANS: Header on avatar upload crop form for thumbnail of to be used rendition of uploaded avatar (h2).
+ $this->element('h2', null, _('Preview'));
$this->elementStart('div', array('id'=>'avatar_preview_view'));
$this->element('img', array('src' => Avatar::url($this->filedata['filename']),
'width' => AVATAR_PROFILE_SIZE,
$this->elementStart('div', array('id'=>'avatar_preview_view'));
$this->element('img', array('src' => Avatar::url($this->filedata['filename']),
'width' => AVATAR_PROFILE_SIZE,
- $this->submit('crop', _('Crop'));
+
+ // TRANS: Button on avatar upload crop form to confirm a selected crop as avatar.
+ $this->submit('crop', _m('BUTTON','Crop'));
if (Event::handle('StartAvatarSaveForm', array($this))) {
if ($this->arg('upload')) {
$this->uploadAvatar();
if (Event::handle('StartAvatarSaveForm', array($this))) {
if ($this->arg('upload')) {
$this->uploadAvatar();
$this->showForm(_('Unexpected form submission.'));
}
Event::handle('EndAvatarSaveForm', array($this));
$this->showForm(_('Unexpected form submission.'));
}
Event::handle('EndAvatarSaveForm', array($this));
$filedata = array('filename' => $filename,
'filepath' => $filepath,
'width' => $imagefile->width,
'height' => $imagefile->height,
$filedata = array('filename' => $filename,
'filepath' => $filepath,
'width' => $imagefile->width,
'height' => $imagefile->height,
- $this->showForm(_('Pick a square area of the image to be your avatar'),
+ // TRANS: Avatar upload form instruction after uploading a file.
+ $this->showForm(_('Pick a square area of the image to be your avatar.'),
$this->showForm(_('Avatar updated.'), true);
common_broadcast_profile($profile);
} else {
$this->showForm(_('Avatar updated.'), true);
common_broadcast_profile($profile);
} else {
$avatar = $profile->getOriginalAvatar();
if($avatar) $avatar->delete();
$avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE);
$avatar = $profile->getOriginalAvatar();
if($avatar) $avatar->delete();
$avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE);