Merge branch 'channel-relay' of https://github.com/annando/friendica into channel-relay

This commit is contained in:
Michael 2024-01-15 19:53:07 +00:00
commit 976ec30417
6 changed files with 93 additions and 89 deletions

View File

@ -35,7 +35,7 @@ namespace Friendica\Content\Conversation\Entity;
* @property-read array $languages Channel languages
* @property-read int $circle Circle or timeline this channel is based on
* @property-read bool $publish Publish the channel
* @property-read bool $valid Signalizes that the search condiions are valid
* @property-read bool $valid Indicates that the search conditions are valid
*/
class Timeline extends \Friendica\BaseEntity
{

View File

@ -65,6 +65,9 @@ class L10n
'zh-cn' => '简体中文',
];
/** @var string Undetermined language */
const UNDETERMINED_LANGUAGE = 'un';
/**
* A string indicating the current language used for translation:
* - Two-letter ISO 639-1 code.
@ -438,7 +441,7 @@ class L10n
// In ISO 639-2 undetermined languages have got the code "und".
// There is no official code for ISO 639-1, but "un" is not assigned to any language.
$languages = ['un' => $this->t('Undetermined')];
$languages = [self::UNDETERMINED_LANGUAGE => $this->t('Undetermined')];
foreach ($this->getDetectableLanguages() as $code) {
$code = $this->toISO6391($code);

View File

@ -28,6 +28,7 @@ use Friendica\Content\Post\Entity\PostMedia;
use Friendica\Content\Text\BBCode;
use Friendica\Content\Text\HTML;
use Friendica\Core\Hook;
use Friendica\Core\L10n;
use Friendica\Core\Logger;
use Friendica\Core\Protocol;
use Friendica\Core\Renderer;
@ -2124,7 +2125,7 @@ class Item
*/
public static function getLanguageArray(string $body, int $count, int $uri_id = 0, int $author_id = 0, array $default = []): array
{
$default = $default ?: ['un' => 1];
$default = $default ?: [L10n::UNDETERMINED_LANGUAGE => 1];
$searchtext = BBCode::toSearchText($body, $uri_id);
@ -2274,7 +2275,7 @@ class Item
foreach (json_decode($item['language'], true) as $language => $reliability) {
$code = DI::l10n()->toISO6391($language);
if ($code == 'un') {
if ($code == L10n::UNDETERMINED_LANGUAGE) {
$native = $language = DI::l10n()->t('Undetermined');
} else {
$native = $iso639->nativeByCode1($code);

View File

@ -645,7 +645,7 @@ class User
}
if (!DI::config()->get('system', 'relay_deny_undetected_language')) {
$languages['un'] = 'un';
$languages[L10n::UNDETERMINED_LANGUAGE] = L10n::UNDETERMINED_LANGUAGE;
}
ksort($languages);

View File

@ -23,7 +23,7 @@ namespace Friendica\Protocol;
use Friendica\Content\Smilies;
use Friendica\Content\Text\BBCode;
use Friendica\Core\Cache\Enum\Duration;
use Friendica\Core\L10n;
use Friendica\Core\Logger;
use Friendica\Core\Protocol;
use Friendica\Database\DBA;
@ -189,7 +189,7 @@ class Relay
}
if (empty($detected) && empty($languages)) {
$detected = ['un'];
$detected = [L10n::UNDETERMINED_LANGUAGE];
}
if (empty($body) || Smilies::isEmojiPost($body)) {

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: 2024.03-dev\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-01-07 19:57+0000\n"
"POT-Creation-Date: 2024-01-15 19:41+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -1770,7 +1770,7 @@ msgstr ""
msgid "Create new group"
msgstr ""
#: src/Content/Item.php:332 src/Model/Item.php:3205
#: src/Content/Item.php:332 src/Model/Item.php:3235
msgid "event"
msgstr ""
@ -1778,7 +1778,7 @@ msgstr ""
msgid "status"
msgstr ""
#: src/Content/Item.php:341 src/Model/Item.php:3207
#: src/Content/Item.php:341 src/Model/Item.php:3237
#: src/Module/Post/Tag/Add.php:123
msgid "photo"
msgstr ""
@ -2180,39 +2180,39 @@ msgstr ""
msgid "last"
msgstr ""
#: src/Content/Text/BBCode.php:751 src/Content/Text/BBCode.php:1696
#: src/Content/Text/BBCode.php:1697
#: src/Content/Text/BBCode.php:755 src/Content/Text/BBCode.php:1700
#: src/Content/Text/BBCode.php:1701
msgid "Image/photo"
msgstr ""
#: src/Content/Text/BBCode.php:969
#: src/Content/Text/BBCode.php:973
#, php-format
msgid ""
"<a href=\"%1$s\" target=\"_blank\" rel=\"noopener noreferrer\">%2$s</a> %3$s"
msgstr ""
#: src/Content/Text/BBCode.php:994 src/Model/Item.php:3938
#: src/Model/Item.php:3944 src/Model/Item.php:3945
#: src/Content/Text/BBCode.php:998 src/Model/Item.php:3968
#: src/Model/Item.php:3974 src/Model/Item.php:3975
msgid "Link to source"
msgstr ""
#: src/Content/Text/BBCode.php:1603 src/Content/Text/HTML.php:904
#: src/Content/Text/BBCode.php:1607 src/Content/Text/HTML.php:904
msgid "Click to open/close"
msgstr ""
#: src/Content/Text/BBCode.php:1636
#: src/Content/Text/BBCode.php:1640
msgid "$1 wrote:"
msgstr ""
#: src/Content/Text/BBCode.php:1701 src/Content/Text/BBCode.php:1702
#: src/Content/Text/BBCode.php:1705 src/Content/Text/BBCode.php:1706
msgid "Encrypted content"
msgstr ""
#: src/Content/Text/BBCode.php:1957
#: src/Content/Text/BBCode.php:1961
msgid "Invalid source protocol"
msgstr ""
#: src/Content/Text/BBCode.php:1976
#: src/Content/Text/BBCode.php:1980
msgid "Invalid link protocol"
msgstr ""
@ -2424,12 +2424,12 @@ msgstr[1] ""
msgid "More Trending Tags"
msgstr ""
#: src/Content/Widget/VCard.php:106 src/Model/Contact.php:1209
#: src/Content/Widget/VCard.php:102 src/Model/Contact.php:1209
#: src/Model/Profile.php:461
msgid "Post to group"
msgstr ""
#: src/Content/Widget/VCard.php:110 src/Model/Contact.php:1214
#: src/Content/Widget/VCard.php:106 src/Model/Contact.php:1214
#: src/Model/Profile.php:466 src/Module/Moderation/Item/Source.php:85
msgid "Mention"
msgstr ""
@ -2457,13 +2457,13 @@ msgstr ""
msgid "Network:"
msgstr ""
#: src/Content/Widget/VCard.php:129 src/Model/Contact.php:1242
#: src/Content/Widget/VCard.php:125 src/Model/Contact.php:1242
#: src/Model/Contact.php:1254 src/Model/Profile.php:479
#: src/Module/Contact/Profile.php:463
msgid "Unfollow"
msgstr ""
#: src/Content/Widget/VCard.php:135 src/Model/Contact.php:1211
#: src/Content/Widget/VCard.php:131 src/Model/Contact.php:1211
#: src/Model/Profile.php:463
msgid "View group"
msgstr ""
@ -2855,167 +2855,167 @@ msgstr ""
msgid "Could not connect to database."
msgstr ""
#: src/Core/L10n.php:441 src/Model/Item.php:2249
#: src/Core/L10n.php:444 src/Model/Item.php:2279
msgid "Undetermined"
msgstr ""
#: src/Core/L10n.php:448
#: src/Core/L10n.php:451
#, php-format
msgid "%s (%s)"
msgstr ""
#: src/Core/L10n.php:496 src/Model/Event.php:430
#: src/Core/L10n.php:499 src/Model/Event.php:430
#: src/Module/Settings/Display.php:284
msgid "Monday"
msgstr ""
#: src/Core/L10n.php:496 src/Model/Event.php:431
#: src/Core/L10n.php:499 src/Model/Event.php:431
#: src/Module/Settings/Display.php:285
msgid "Tuesday"
msgstr ""
#: src/Core/L10n.php:496 src/Model/Event.php:432
#: src/Core/L10n.php:499 src/Model/Event.php:432
#: src/Module/Settings/Display.php:286
msgid "Wednesday"
msgstr ""
#: src/Core/L10n.php:496 src/Model/Event.php:433
#: src/Core/L10n.php:499 src/Model/Event.php:433
#: src/Module/Settings/Display.php:287
msgid "Thursday"
msgstr ""
#: src/Core/L10n.php:496 src/Model/Event.php:434
#: src/Core/L10n.php:499 src/Model/Event.php:434
#: src/Module/Settings/Display.php:288
msgid "Friday"
msgstr ""
#: src/Core/L10n.php:496 src/Model/Event.php:435
#: src/Core/L10n.php:499 src/Model/Event.php:435
#: src/Module/Settings/Display.php:289
msgid "Saturday"
msgstr ""
#: src/Core/L10n.php:496 src/Model/Event.php:429
#: src/Core/L10n.php:499 src/Model/Event.php:429
#: src/Module/Settings/Display.php:283
msgid "Sunday"
msgstr ""
#: src/Core/L10n.php:500 src/Model/Event.php:450
#: src/Core/L10n.php:503 src/Model/Event.php:450
msgid "January"
msgstr ""
#: src/Core/L10n.php:500 src/Model/Event.php:451
#: src/Core/L10n.php:503 src/Model/Event.php:451
msgid "February"
msgstr ""
#: src/Core/L10n.php:500 src/Model/Event.php:452
#: src/Core/L10n.php:503 src/Model/Event.php:452
msgid "March"
msgstr ""
#: src/Core/L10n.php:500 src/Model/Event.php:453
#: src/Core/L10n.php:503 src/Model/Event.php:453
msgid "April"
msgstr ""
#: src/Core/L10n.php:500 src/Core/L10n.php:519 src/Model/Event.php:441
#: src/Core/L10n.php:503 src/Core/L10n.php:522 src/Model/Event.php:441
msgid "May"
msgstr ""
#: src/Core/L10n.php:500 src/Model/Event.php:454
#: src/Core/L10n.php:503 src/Model/Event.php:454
msgid "June"
msgstr ""
#: src/Core/L10n.php:500 src/Model/Event.php:455
#: src/Core/L10n.php:503 src/Model/Event.php:455
msgid "July"
msgstr ""
#: src/Core/L10n.php:500 src/Model/Event.php:456
#: src/Core/L10n.php:503 src/Model/Event.php:456
msgid "August"
msgstr ""
#: src/Core/L10n.php:500 src/Model/Event.php:457
#: src/Core/L10n.php:503 src/Model/Event.php:457
msgid "September"
msgstr ""
#: src/Core/L10n.php:500 src/Model/Event.php:458
#: src/Core/L10n.php:503 src/Model/Event.php:458
msgid "October"
msgstr ""
#: src/Core/L10n.php:500 src/Model/Event.php:459
#: src/Core/L10n.php:503 src/Model/Event.php:459
msgid "November"
msgstr ""
#: src/Core/L10n.php:500 src/Model/Event.php:460
#: src/Core/L10n.php:503 src/Model/Event.php:460
msgid "December"
msgstr ""
#: src/Core/L10n.php:515 src/Model/Event.php:422
#: src/Core/L10n.php:518 src/Model/Event.php:422
msgid "Mon"
msgstr ""
#: src/Core/L10n.php:515 src/Model/Event.php:423
#: src/Core/L10n.php:518 src/Model/Event.php:423
msgid "Tue"
msgstr ""
#: src/Core/L10n.php:515 src/Model/Event.php:424
#: src/Core/L10n.php:518 src/Model/Event.php:424
msgid "Wed"
msgstr ""
#: src/Core/L10n.php:515 src/Model/Event.php:425
#: src/Core/L10n.php:518 src/Model/Event.php:425
msgid "Thu"
msgstr ""
#: src/Core/L10n.php:515 src/Model/Event.php:426
#: src/Core/L10n.php:518 src/Model/Event.php:426
msgid "Fri"
msgstr ""
#: src/Core/L10n.php:515 src/Model/Event.php:427
#: src/Core/L10n.php:518 src/Model/Event.php:427
msgid "Sat"
msgstr ""
#: src/Core/L10n.php:515 src/Model/Event.php:421
#: src/Core/L10n.php:518 src/Model/Event.php:421
msgid "Sun"
msgstr ""
#: src/Core/L10n.php:519 src/Model/Event.php:437
#: src/Core/L10n.php:522 src/Model/Event.php:437
msgid "Jan"
msgstr ""
#: src/Core/L10n.php:519 src/Model/Event.php:438
#: src/Core/L10n.php:522 src/Model/Event.php:438
msgid "Feb"
msgstr ""
#: src/Core/L10n.php:519 src/Model/Event.php:439
#: src/Core/L10n.php:522 src/Model/Event.php:439
msgid "Mar"
msgstr ""
#: src/Core/L10n.php:519 src/Model/Event.php:440
#: src/Core/L10n.php:522 src/Model/Event.php:440
msgid "Apr"
msgstr ""
#: src/Core/L10n.php:519 src/Model/Event.php:442
#: src/Core/L10n.php:522 src/Model/Event.php:442
msgid "Jun"
msgstr ""
#: src/Core/L10n.php:519 src/Model/Event.php:443
#: src/Core/L10n.php:522 src/Model/Event.php:443
msgid "Jul"
msgstr ""
#: src/Core/L10n.php:519 src/Model/Event.php:444
#: src/Core/L10n.php:522 src/Model/Event.php:444
msgid "Aug"
msgstr ""
#: src/Core/L10n.php:519
#: src/Core/L10n.php:522
msgid "Sep"
msgstr ""
#: src/Core/L10n.php:519 src/Model/Event.php:446
#: src/Core/L10n.php:522 src/Model/Event.php:446
msgid "Oct"
msgstr ""
#: src/Core/L10n.php:519 src/Model/Event.php:447
#: src/Core/L10n.php:522 src/Model/Event.php:447
msgid "Nov"
msgstr ""
#: src/Core/L10n.php:519 src/Model/Event.php:448
#: src/Core/L10n.php:522 src/Model/Event.php:448
msgid "Dec"
msgstr ""
@ -3413,91 +3413,91 @@ msgstr ""
msgid "Happy Birthday %s"
msgstr ""
#: src/Model/Item.php:2256
#: src/Model/Item.php:2286
#, php-format
msgid "%s (%s - %s): %s"
msgstr ""
#: src/Model/Item.php:2258
#: src/Model/Item.php:2288
#, php-format
msgid "%s (%s): %s"
msgstr ""
#: src/Model/Item.php:2261
#: src/Model/Item.php:2291
#, php-format
msgid "Detected languages in this post:\\n%s"
msgstr ""
#: src/Model/Item.php:3209
#: src/Model/Item.php:3239
msgid "activity"
msgstr ""
#: src/Model/Item.php:3211
#: src/Model/Item.php:3241
msgid "comment"
msgstr ""
#: src/Model/Item.php:3214 src/Module/Post/Tag/Add.php:123
#: src/Model/Item.php:3244 src/Module/Post/Tag/Add.php:123
msgid "post"
msgstr ""
#: src/Model/Item.php:3384
#: src/Model/Item.php:3414
#, php-format
msgid "%s is blocked"
msgstr ""
#: src/Model/Item.php:3386
#: src/Model/Item.php:3416
#, php-format
msgid "%s is ignored"
msgstr ""
#: src/Model/Item.php:3388
#: src/Model/Item.php:3418
#, php-format
msgid "Content from %s is collapsed"
msgstr ""
#: src/Model/Item.php:3392
#: src/Model/Item.php:3422
#, php-format
msgid "Content warning: %s"
msgstr ""
#: src/Model/Item.php:3845
#: src/Model/Item.php:3875
msgid "bytes"
msgstr ""
#: src/Model/Item.php:3876
#: src/Model/Item.php:3906
#, php-format
msgid "%2$s (%3$d%%, %1$d vote)"
msgid_plural "%2$s (%3$d%%, %1$d votes)"
msgstr[0] ""
msgstr[1] ""
#: src/Model/Item.php:3878
#: src/Model/Item.php:3908
#, php-format
msgid "%2$s (%1$d vote)"
msgid_plural "%2$s (%1$d votes)"
msgstr[0] ""
msgstr[1] ""
#: src/Model/Item.php:3883
#: src/Model/Item.php:3913
#, php-format
msgid "%d voter. Poll end: %s"
msgid_plural "%d voters. Poll end: %s"
msgstr[0] ""
msgstr[1] ""
#: src/Model/Item.php:3885
#: src/Model/Item.php:3915
#, php-format
msgid "%d voter."
msgid_plural "%d voters."
msgstr[0] ""
msgstr[1] ""
#: src/Model/Item.php:3887
#: src/Model/Item.php:3917
#, php-format
msgid "Poll end: %s"
msgstr ""
#: src/Model/Item.php:3921 src/Model/Item.php:3922
#: src/Model/Item.php:3951 src/Model/Item.php:3952
msgid "View on separate page"
msgstr ""
@ -3505,7 +3505,7 @@ msgstr ""
msgid "[no subject]"
msgstr ""
#: src/Model/Photo.php:1190 src/Module/Media/Photo/Upload.php:170
#: src/Model/Photo.php:1191 src/Module/Media/Photo/Upload.php:170
msgid "Wall Photos"
msgstr ""
@ -3793,7 +3793,7 @@ msgstr ""
msgid "Profile Photos"
msgstr ""
#: src/Model/User.php:1592
#: src/Model/User.php:1594
#, php-format
msgid ""
"\n"
@ -3801,7 +3801,7 @@ msgid ""
"\t\t\tthe administrator of %2$s has set up an account for you."
msgstr ""
#: src/Model/User.php:1595
#: src/Model/User.php:1597
#, php-format
msgid ""
"\n"
@ -3837,12 +3837,12 @@ msgid ""
"\t\tThank you and welcome to %4$s."
msgstr ""
#: src/Model/User.php:1627 src/Model/User.php:1733
#: src/Model/User.php:1629 src/Model/User.php:1735
#, php-format
msgid "Registration details for %s"
msgstr ""
#: src/Model/User.php:1647
#: src/Model/User.php:1649
#, php-format
msgid ""
"\n"
@ -3858,12 +3858,12 @@ msgid ""
"\t\t"
msgstr ""
#: src/Model/User.php:1666
#: src/Model/User.php:1668
#, php-format
msgid "Registration at %s"
msgstr ""
#: src/Model/User.php:1690
#: src/Model/User.php:1692
#, php-format
msgid ""
"\n"
@ -3872,7 +3872,7 @@ msgid ""
"\t\t\t"
msgstr ""
#: src/Model/User.php:1698
#: src/Model/User.php:1700
#, php-format
msgid ""
"\n"
@ -3910,7 +3910,7 @@ msgid ""
"\t\t\tThank you and welcome to %2$s."
msgstr ""
#: src/Model/User.php:1760
#: src/Model/User.php:1762
msgid ""
"User with delegates can't be removed, please remove delegate users first"
msgstr ""