forked from GNUsocial/gnu-social
* i18n/L10n update
* translator comments added * remove superfluous whitespace
This commit is contained in:
@@ -106,8 +106,8 @@ class Discovery
|
||||
}
|
||||
}
|
||||
|
||||
// @todo Needs i18n.
|
||||
throw new Exception('Unable to find services for '. $id . '.');
|
||||
// TRANS: Exception.
|
||||
throw new Exception(sprintf(_m('Unable to find services for %s.'),$id));
|
||||
}
|
||||
|
||||
public static function getService($links, $service) {
|
||||
|
@@ -20,7 +20,6 @@
|
||||
*/
|
||||
|
||||
class DiscoveryHints {
|
||||
|
||||
static function fromXRD($xrd)
|
||||
{
|
||||
$hints = array();
|
||||
|
@@ -1,4 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* @todo Add file header and documentation.
|
||||
*/
|
||||
|
||||
class LinkHeader
|
||||
{
|
||||
|
@@ -76,7 +76,8 @@ class MagicEnvelope
|
||||
}
|
||||
}
|
||||
}
|
||||
throw new Exception('Unable to locate signer public key.');
|
||||
// TRANS: Exception.
|
||||
throw new Exception(_m('Unable to locate signer public key.'));
|
||||
}
|
||||
|
||||
|
||||
@@ -92,7 +93,6 @@ class MagicEnvelope
|
||||
'sig' => $signature_alg->sign($armored_text),
|
||||
'alg' => $signature_alg->getName()
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
public function toXML($env) {
|
||||
@@ -110,7 +110,6 @@ class MagicEnvelope
|
||||
return $string;
|
||||
}
|
||||
|
||||
|
||||
public function unfold($env)
|
||||
{
|
||||
$dom = new DOMDocument();
|
||||
@@ -218,5 +217,4 @@ class MagicEnvelope
|
||||
'sig' => preg_replace('/\s/', '', $sig_element->nodeValue),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -221,5 +221,4 @@ class OStatusQueueHandler extends QueueHandler
|
||||
|
||||
return $feed;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -22,7 +22,6 @@
|
||||
* @package FeedSub
|
||||
* @author Brion Vibber <brion@status.net>
|
||||
*/
|
||||
|
||||
class PushInQueueHandler extends QueueHandler
|
||||
{
|
||||
function transport()
|
||||
|
@@ -89,8 +89,8 @@ class Salmon
|
||||
$magickey->generate($user->id);
|
||||
}
|
||||
} else {
|
||||
// @todo i18n FIXME: added i18n and use sprintf when using parameters.
|
||||
throw new Exception("Salmon invalid actor for signing.");
|
||||
// TRANS: Exception.
|
||||
throw new Exception(_m('Salmon invalid actor for signing.'));
|
||||
}
|
||||
|
||||
try {
|
||||
@@ -101,7 +101,6 @@ class Salmon
|
||||
return $magic_env->toXML($env);
|
||||
}
|
||||
|
||||
|
||||
public function verifyMagicEnv($text)
|
||||
{
|
||||
$magic_env = new MagicEnvelope();
|
||||
|
@@ -38,11 +38,12 @@ class SalmonAction extends Action
|
||||
parent::prepare($args);
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
|
||||
// TRANS: POST is a HTTP command. It should not be translated.
|
||||
// TRANS: Client error. POST is a HTTP command. It should not be translated.
|
||||
$this->clientError(_m('This method requires a POST.'));
|
||||
}
|
||||
|
||||
if (empty($_SERVER['CONTENT_TYPE']) || $_SERVER['CONTENT_TYPE'] != 'application/magic-envelope+xml') {
|
||||
// TRANS: Client error. Do not translate "application/magic-envelope+xml"
|
||||
$this->clientError(_m('Salmon requires "application/magic-envelope+xml".'));
|
||||
}
|
||||
|
||||
@@ -52,6 +53,7 @@ class SalmonAction extends Action
|
||||
$salmon = new Salmon;
|
||||
if (!$salmon->verifyMagicEnv($xml)) {
|
||||
common_log(LOG_DEBUG, "Salmon signature verification failed.");
|
||||
// TRANS: Client error.
|
||||
$this->clientError(_m('Salmon signature verification failed.'));
|
||||
} else {
|
||||
$magic_env = new MagicEnvelope();
|
||||
@@ -63,6 +65,7 @@ class SalmonAction extends Action
|
||||
if ($dom->documentElement->namespaceURI != Activity::ATOM ||
|
||||
$dom->documentElement->localName != 'entry') {
|
||||
common_log(LOG_DEBUG, "Got invalid Salmon post: $xml");
|
||||
// TRANS: Client error.
|
||||
$this->clientError(_m('Salmon post must be an Atom entry.'));
|
||||
}
|
||||
|
||||
@@ -111,6 +114,7 @@ class SalmonAction extends Action
|
||||
$this->handleUpdateProfile();
|
||||
break;
|
||||
default:
|
||||
// TRANS: Client exception.
|
||||
throw new ClientException(_m("Unrecognized activity type."));
|
||||
}
|
||||
Event::handle('EndHandleSalmon', array($this->activity));
|
||||
@@ -119,41 +123,49 @@ class SalmonAction extends Action
|
||||
|
||||
function handlePost()
|
||||
{
|
||||
// TRANS: Client exception.
|
||||
throw new ClientException(_m("This target doesn't understand posts."));
|
||||
}
|
||||
|
||||
function handleFollow()
|
||||
{
|
||||
// TRANS: Client exception.
|
||||
throw new ClientException(_m("This target doesn't understand follows."));
|
||||
}
|
||||
|
||||
function handleUnfollow()
|
||||
{
|
||||
// TRANS: Client exception.
|
||||
throw new ClientException(_m("This target doesn't understand unfollows."));
|
||||
}
|
||||
|
||||
function handleFavorite()
|
||||
{
|
||||
// TRANS: Client exception.
|
||||
throw new ClientException(_m("This target doesn't understand favorites."));
|
||||
}
|
||||
|
||||
function handleUnfavorite()
|
||||
{
|
||||
// TRANS: Client exception.
|
||||
throw new ClientException(_m("This target doesn't understand unfavorites."));
|
||||
}
|
||||
|
||||
function handleShare()
|
||||
{
|
||||
// TRANS: Client exception.
|
||||
throw new ClientException(_m("This target doesn't understand share events."));
|
||||
}
|
||||
|
||||
function handleJoin()
|
||||
{
|
||||
// TRANS: Client exception.
|
||||
throw new ClientException(_m("This target doesn't understand joins."));
|
||||
}
|
||||
|
||||
function handleLeave()
|
||||
{
|
||||
// TRANS: Client exception.
|
||||
throw new ClientException(_m("This target doesn't understand leave events."));
|
||||
}
|
||||
|
||||
@@ -181,7 +193,8 @@ class SalmonAction extends Action
|
||||
if (empty($actor->id)) {
|
||||
common_log(LOG_ERR, "broken actor: " . var_export($actor, true));
|
||||
common_log(LOG_ERR, "activity with no actor: " . var_export($this->activity, true));
|
||||
throw new Exception("Received a salmon slap from unidentified actor.");
|
||||
// TRANS: Exception.
|
||||
throw new Exception(_m('Received a salmon slap from unidentified actor.'));
|
||||
}
|
||||
|
||||
return Ostatus_profile::ensureActivityObjectProfile($actor);
|
||||
|
@@ -27,7 +27,6 @@
|
||||
* @link http://status.net/
|
||||
*/
|
||||
|
||||
|
||||
class XRD
|
||||
{
|
||||
const XML_NS = 'http://www.w3.org/2000/xmlns/';
|
||||
@@ -61,11 +60,13 @@ class XRD
|
||||
error_reporting($old);
|
||||
|
||||
if (!$ok) {
|
||||
throw new Exception("Invalid XML.");
|
||||
// TRANS: Exception.
|
||||
throw new Exception(_m('Invalid XML.'));
|
||||
}
|
||||
$xrd_element = $dom->getElementsByTagName('XRD')->item(0);
|
||||
if (!$xrd_element) {
|
||||
throw new Exception("Invalid XML, missing XRD root.");
|
||||
// TRANS: Exception.
|
||||
throw new Exception(_m('Invalid XML, missing XRD root.'));
|
||||
}
|
||||
|
||||
// Check for host-meta host
|
||||
|
@@ -103,5 +103,4 @@ class XrdAction extends Action
|
||||
header('Content-type: application/xrd+xml');
|
||||
print $xrd->toXML();
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user