Fix several L10n and i18n issues.
Add dummy method MessageListItem::messageListItemDummyMessages() to allow xgettext to add possible sources to POT files. Mark a few i18n issues as FIXME as well as some messages for which the use case was not clear to me. Merged some code on multiple lines into one. Translator documentation added. Remove superfluous whiteapace.
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
* Copyright (C) 2011, StatusNet, Inc.
|
||||
*
|
||||
* Superclass for microapp plugin
|
||||
*
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
@@ -39,8 +39,8 @@ if (!defined('STATUSNET')) {
|
||||
*
|
||||
* This class lets you define micro-applications with different kinds of activities.
|
||||
*
|
||||
* The applications work more-or-less like other
|
||||
*
|
||||
* The applications work more-or-less like other
|
||||
*
|
||||
* @category Microapp
|
||||
* @package StatusNet
|
||||
* @author Evan Prodromou <evan@status.net>
|
||||
@@ -48,7 +48,6 @@ if (!defined('STATUSNET')) {
|
||||
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
|
||||
* @link http://status.net/
|
||||
*/
|
||||
|
||||
abstract class MicroAppPlugin extends Plugin
|
||||
{
|
||||
/**
|
||||
@@ -255,10 +254,9 @@ abstract class MicroAppPlugin extends Plugin
|
||||
* by calling the overridable $this->deleteRelated().
|
||||
*
|
||||
* @param Notice $notice Notice being deleted
|
||||
*
|
||||
*
|
||||
* @return boolean hook value
|
||||
*/
|
||||
|
||||
function onNoticeDeleteRelated($notice)
|
||||
{
|
||||
if ($this->isMyNotice($notice)) {
|
||||
@@ -277,7 +275,6 @@ abstract class MicroAppPlugin extends Plugin
|
||||
*
|
||||
* @fixme WARNING WARNING WARNING this closes a 'div' that is implicitly opened in BookmarkPlugin's showNotice implementation
|
||||
*/
|
||||
|
||||
function onStartShowNoticeItem($nli)
|
||||
{
|
||||
if (!$this->isMyNotice($nli->notice)) {
|
||||
@@ -294,9 +291,9 @@ abstract class MicroAppPlugin extends Plugin
|
||||
$nli->showNoticeLocation();
|
||||
$nli->showContext();
|
||||
$nli->showRepeat();
|
||||
|
||||
|
||||
$out->elementEnd('div');
|
||||
|
||||
|
||||
$nli->showNoticeOptions();
|
||||
|
||||
return false;
|
||||
@@ -310,7 +307,6 @@ abstract class MicroAppPlugin extends Plugin
|
||||
*
|
||||
* @return boolean hook value
|
||||
*/
|
||||
|
||||
function onStartActivityObjectFromNotice($notice, &$object)
|
||||
{
|
||||
if ($this->isMyNotice($notice)) {
|
||||
@@ -329,7 +325,6 @@ abstract class MicroAppPlugin extends Plugin
|
||||
*
|
||||
* @return boolean hook value
|
||||
*/
|
||||
|
||||
function onStartHandleFeedEntryWithProfile($activity, $oprofile)
|
||||
{
|
||||
if ($this->isMyActivity($activity)) {
|
||||
@@ -337,7 +332,8 @@ abstract class MicroAppPlugin extends Plugin
|
||||
$actor = $oprofile->checkAuthorship($activity);
|
||||
|
||||
if (empty($actor)) {
|
||||
throw new ClientException(_('Can\'t get author for activity.'));
|
||||
// TRANS: Client exception thrown when no author for an activity was found.
|
||||
throw new ClientException(_('Cannot get author for activity.'));
|
||||
}
|
||||
|
||||
$object = $activity->objects[0];
|
||||
@@ -368,31 +364,32 @@ abstract class MicroAppPlugin extends Plugin
|
||||
function onStartHandleSalmonTarget($activity, $target)
|
||||
{
|
||||
if ($this->isMyActivity($activity)) {
|
||||
|
||||
$this->log(LOG_INFO, "Checking {$activity->id} as a valid Salmon slap.");
|
||||
|
||||
if ($target instanceof User_group) {
|
||||
$uri = $target->getUri();
|
||||
if (!in_array($uri, $activity->context->attention)) {
|
||||
throw new ClientException(_("Bookmark not posted ".
|
||||
"to this group."));
|
||||
// @todo FIXME: please document (i18n).
|
||||
// TRANS: Client exception.
|
||||
throw new ClientException(_('Bookmark not posted to this group.'));
|
||||
}
|
||||
} else if ($target instanceof User) {
|
||||
$uri = $target->uri;
|
||||
$original = null;
|
||||
if (!empty($activity->context->replyToID)) {
|
||||
$original = Notice::staticGet('uri',
|
||||
$activity->context->replyToID);
|
||||
$original = Notice::staticGet('uri',
|
||||
$activity->context->replyToID);
|
||||
}
|
||||
if (!in_array($uri, $activity->context->attention) &&
|
||||
(empty($original) ||
|
||||
$original->profile_id != $target->id)) {
|
||||
throw new ClientException(_("Object not posted ".
|
||||
"to this user."));
|
||||
// @todo FIXME: Please document (i18n).
|
||||
// TRANS: Client exception.
|
||||
throw new ClientException(_('Object not posted to this user.'));
|
||||
}
|
||||
} else {
|
||||
throw new ServerException(_("Don't know how to handle ".
|
||||
"this kind of target."));
|
||||
// TRANS: Server exception thrown when a micro app plugin uses a target that cannot be handled.
|
||||
throw new ServerException(_('Do not know how to handle this kind of target.'));
|
||||
}
|
||||
|
||||
$actor = Ostatus_profile::ensureActivityObjectProfile($activity->actor);
|
||||
@@ -422,7 +419,6 @@ abstract class MicroAppPlugin extends Plugin
|
||||
*
|
||||
* @return boolean hook value
|
||||
*/
|
||||
|
||||
function onStartAtomPubNewActivity(&$activity, $user, &$notice)
|
||||
{
|
||||
if ($this->isMyActivity($activity)) {
|
||||
@@ -451,7 +447,6 @@ abstract class MicroAppPlugin extends Plugin
|
||||
*
|
||||
* @return boolean hook value
|
||||
*/
|
||||
|
||||
function onStartImportActivity($user, $author, $activity, $trusted, &$done)
|
||||
{
|
||||
if ($this->isMyActivity($activity)) {
|
||||
|
Reference in New Issue
Block a user