diff options
author | Siebrand Mazeland <s.mazeland@xs4all.nl> | 2010-10-20 19:34:27 +0200 |
---|---|---|
committer | Siebrand Mazeland <s.mazeland@xs4all.nl> | 2010-10-20 19:34:27 +0200 |
commit | dc62cf1c0b6f77ebd4e4bf885aa3de7846b3232a (patch) | |
tree | 3948a0a0daa392e5aadf1aafad6a34874ae2c568 /actions/apistatusesupdate.php | |
parent | 17f5cc4f29c2f9408636dd3e628cf1521b4a08e2 (diff) |
* i18n/L10n fixes.
* translator documentation updated/added.
* superfluous whitespace removed.
Diffstat (limited to 'actions/apistatusesupdate.php')
-rw-r--r-- | actions/apistatusesupdate.php | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/actions/apistatusesupdate.php b/actions/apistatusesupdate.php index 91dcdd10f..822ebacbd 100644 --- a/actions/apistatusesupdate.php +++ b/actions/apistatusesupdate.php @@ -147,7 +147,6 @@ require_once INSTALLDIR . '/lib/mediafile.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 ApiStatusesUpdateAction extends ApiAuthAction { var $status = null; @@ -163,7 +162,6 @@ class ApiStatusesUpdateAction extends ApiAuthAction * @return boolean success flag * */ - function prepare($args) { parent::prepare($args); @@ -187,7 +185,6 @@ class ApiStatusesUpdateAction extends ApiAuthAction * * @return void */ - function handle($args) { parent::handle($args); @@ -209,8 +206,11 @@ class ApiStatusesUpdateAction extends ApiAuthAction && empty($_POST) && ($_SERVER['CONTENT_LENGTH'] > 0) ) { - $msg = _('The server was unable to handle that much POST ' . - 'data (%s bytes) due to its current configuration.'); + // TRANS: Client error displayed when the number of bytes in a POST request exceeds a limit. + // TRANS: %s is the number of bytes of the CONTENT_LENGTH. + $msg = _m('The server was unable to handle that much POST data (%s byte) due to its current configuration.', + 'The server was unable to handle that much POST data (%s bytes) due to its current configuration.', + intval($_SERVER['CONTENT_LENGTH'])); $this->clientError(sprintf($msg, $_SERVER['CONTENT_LENGTH'])); return; @@ -218,6 +218,7 @@ class ApiStatusesUpdateAction extends ApiAuthAction if (empty($this->status)) { $this->clientError( + // TRANS: Client error displayed when the parameter "status" is missing. _('Client must provide a \'status\' parameter with a value.'), 400, $this->format @@ -239,7 +240,11 @@ class ApiStatusesUpdateAction extends ApiAuthAction $this->clientError( sprintf( - _('That\'s too long. Max notice size is %d chars.'), + // TRANS: Client error displayed when the parameter "status" is missing. + // TRANS: %d is the maximum number of character for a notice. + _m('That\'s too long. Maximum notice size is %d character.', + 'That\'s too long. Maximum notice size is %d characters.', + Notice::maxContent()), Notice::maxContent() ), 406, @@ -255,7 +260,6 @@ class ApiStatusesUpdateAction extends ApiAuthAction $cmd = $inter->handle_command($this->auth_user, $status_shortened); if ($cmd) { - if ($this->supported($cmd)) { $cmd->execute(new Channel()); } @@ -265,13 +269,10 @@ class ApiStatusesUpdateAction extends ApiAuthAction // or not! $this->notice = $this->auth_user->getCurrentNotice(); - } else { - $reply_to = null; if (!empty($this->in_reply_to_status_id)) { - // Check whether notice actually exists $reply = Notice::staticGet($this->in_reply_to_status_id); @@ -280,7 +281,8 @@ class ApiStatusesUpdateAction extends ApiAuthAction $reply_to = $this->in_reply_to_status_id; } else { $this->clientError( - _('Not found.'), + // TRANS: Client error displayed when replying to a non-existing notice. + _('Parent notice not found.'), $code = 404, $this->format ); @@ -302,10 +304,9 @@ class ApiStatusesUpdateAction extends ApiAuthAction if (Notice::contentTooLong($status_shortened)) { $upload->delete(); - $msg = _( - 'Max notice size is %d chars, ' . - 'including attachment URL.' - ); + $msg = _m('Maximum notice size is %d character, including attachment URL.', + 'Maximum notice size is %d characters, including attachment URL.', + Notice::maxContent()); $this->clientError( sprintf($msg, Notice::maxContent()), 400, @@ -344,7 +345,6 @@ class ApiStatusesUpdateAction extends ApiAuthAction if (isset($upload)) { $upload->attachToNotice($this->notice); } - } $this->showNotice(); @@ -355,7 +355,6 @@ class ApiStatusesUpdateAction extends ApiAuthAction * * @return void */ - function showNotice() { if (!empty($this->notice)) { @@ -374,7 +373,6 @@ class ApiStatusesUpdateAction extends ApiAuthAction * * @return boolean true or false */ - function supported($cmd) { static $cmdlist = array('MessageCommand', 'SubCommand', 'UnsubCommand', @@ -386,5 +384,4 @@ class ApiStatusesUpdateAction extends ApiAuthAction return false; } - } |