forked from friendica/friendica-addons
Compare commits
No commits in common. "mat/2023.12-rebase" and "develop" have entirely different histories.
mat/2023.1
...
develop
675 changed files with 34723 additions and 12852 deletions
|
|
@ -1,113 +0,0 @@
|
|||
matrix:
|
||||
include:
|
||||
- PHP_MAJOR_VERSION: 7.4
|
||||
PHP_VERSION: 7.4.33
|
||||
- PHP_MAJOR_VERSION: 8.0
|
||||
PHP_VERSION: 8.0.30
|
||||
- PHP_MAJOR_VERSION: 8.1
|
||||
PHP_VERSION: 8.1.23
|
||||
- PHP_MAJOR_VERSION: 8.2
|
||||
PHP_VERSION: 8.2.11
|
||||
|
||||
# This forces PHP Unit executions at the "opensocial" labeled location (because of much more power...)
|
||||
labels:
|
||||
location: opensocial
|
||||
|
||||
skip_clone: true
|
||||
|
||||
pipeline:
|
||||
clone_friendica_base:
|
||||
image: alpine/git
|
||||
commands:
|
||||
- git clone https://github.com/friendica/friendica.git .
|
||||
- git checkout $CI_COMMIT_BRANCH
|
||||
clone_friendica_addon:
|
||||
image: alpine/git
|
||||
commands:
|
||||
- git config --global user.email "no-reply@friendi.ca"
|
||||
- git config --global user.name "Friendica"
|
||||
- git clone $CI_REPO_LINK addon
|
||||
- cd addon/
|
||||
- git checkout $CI_COMMIT_BRANCH
|
||||
- git fetch origin $CI_COMMIT_REF
|
||||
- git merge $CI_COMMIT_SHA
|
||||
restore_cache:
|
||||
image: meltwater/drone-cache:dev
|
||||
settings:
|
||||
backend: "filesystem"
|
||||
restore: true
|
||||
cache_key: "{{ .Repo.Name }}_php${PHP_MAJOR_VERSION}_{{ arch }}_{{ os }}"
|
||||
archive_format: "gzip"
|
||||
mount:
|
||||
- '.composer'
|
||||
volumes:
|
||||
- /tmp/drone-cache:/tmp/cache
|
||||
composer_install:
|
||||
image: friendicaci/php${PHP_MAJOR_VERSION}:php${PHP_VERSION}
|
||||
commands:
|
||||
- export COMPOSER_HOME=.composer
|
||||
- ./bin/composer.phar validate
|
||||
- ./bin/composer.phar install --prefer-dist
|
||||
volumes:
|
||||
- /etc/hosts:/etc/hosts
|
||||
rebuild_cache:
|
||||
image: meltwater/drone-cache:dev
|
||||
settings:
|
||||
backend: "filesystem"
|
||||
rebuild: true
|
||||
cache_key: "{{ .Repo.Name }}_php${PHP_MAJOR_VERSION}_{{ arch }}_{{ os }}"
|
||||
archive_format: "gzip"
|
||||
mount:
|
||||
- '.composer'
|
||||
volumes:
|
||||
- /tmp/drone-cache:/tmp/cache
|
||||
test:
|
||||
image: friendicaci/php${PHP_MAJOR_VERSION}:php${PHP_VERSION}
|
||||
environment:
|
||||
MYSQL_HOST: "mariadb"
|
||||
MYSQL_PORT: "3306"
|
||||
MYSQL_DATABASE: "test"
|
||||
MYSQL_PASSWORD: "test"
|
||||
MYSQL_USER: "test"
|
||||
REDIS_HOST: "redis"
|
||||
MEMCACHED_HOST: "memcached"
|
||||
MEMCACHE_HOST: "memcached"
|
||||
commands:
|
||||
- cp config/local-sample.config.php config/local.config.php
|
||||
- if ! bin/wait-for-connection $MYSQL_HOST $MYSQL_PORT 300; then echo "[ERROR] Waited 300 seconds, no response" >&2; exit 1; fi
|
||||
- mysql -h$MYSQL_HOST -P$MYSQL_PORT -p$MYSQL_PASSWORD -u$MYSQL_USER $MYSQL_DATABASE < database.sql
|
||||
- if [ "${PHP_MAJOR_VERSION}" = "7.4" -a "${CI_REPO}" = "friendica/friendica-addons" ]; then
|
||||
phpenmod xdebug;
|
||||
export XDEBUG_MODE=coverage;
|
||||
phpunit --configuration tests/phpunit-addons.xml --coverage-clover clover.xml;
|
||||
else
|
||||
phpunit --configuration tests/phpunit-addons.xml;
|
||||
fi
|
||||
codecov:
|
||||
image: friendicaci/codecov
|
||||
when:
|
||||
matrix:
|
||||
PHP_MAJOR_VERSION: 7.4
|
||||
PHP_VERSION: 7.4.33
|
||||
repo:
|
||||
- friendica/friendica-addons
|
||||
commands:
|
||||
- codecov -R '.' -Z -f 'clover.xml'
|
||||
secrets:
|
||||
- source: codecov-token
|
||||
target: codecov_token
|
||||
|
||||
services:
|
||||
mariadb:
|
||||
image: mariadb:latest
|
||||
environment:
|
||||
MYSQL_ALLOW_EMPTY_PASSWORD: "true"
|
||||
MYSQL_DATABASE: "test"
|
||||
MYSQL_PASSWORD: "test"
|
||||
MYSQL_USER: "test"
|
||||
|
||||
memcached:
|
||||
image: memcached
|
||||
|
||||
redis:
|
||||
image: redis
|
||||
|
|
@ -455,7 +455,7 @@ function advancedcontentfilter_prepare_item_row(array $item_row): array
|
|||
$item_row['tags'] = $tags['tags'];
|
||||
$item_row['hashtags'] = $tags['hashtags'];
|
||||
$item_row['mentions'] = $tags['mentions'];
|
||||
$item_row['attachments'] = DI::postMediaRepository()->splitAttachments($item_row['uri-id']);
|
||||
$item_row['attachments'] = Post\Media::splitAttachments($item_row['uri-id']);
|
||||
|
||||
return $item_row;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +0,0 @@
|
|||
Audon Addon
|
||||
=============
|
||||
|
||||
This is a quick and dirty addon to add a [Audon][1] website as an app. This Addon based on webrtc. Audon is a service of realtime audio chat
|
||||
|
||||
[1]: https://codeberg.org/nmkj/audon
|
||||
|
|
@ -1,69 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
* Name: Audon Application
|
||||
* Description: add a Audon instance. Based on webRTC Addon
|
||||
* Version: 0.1
|
||||
* Author: Stephen Mahood <https://friends.mayfirst.org/profile/marxistvegan>
|
||||
* Author: Tobias Diekershoff <https://f.diekershoff.de/profile/tobias>
|
||||
* Author: Matthias Ebers <https://loma.ml/profile/feb>
|
||||
*/
|
||||
|
||||
use Friendica\Core\Hook;
|
||||
use Friendica\Core\Renderer;
|
||||
use Friendica\DI;
|
||||
|
||||
function audon_install()
|
||||
{
|
||||
Hook::register('app_menu', __FILE__, 'audon_app_menu');
|
||||
}
|
||||
|
||||
function audon_app_menu(array &$b)
|
||||
{
|
||||
$b['app_menu'][] = '<div class="app-title"><a href="audon">' . DI::l10n()->t('Audon Audiochat') . '</a></div>';
|
||||
}
|
||||
|
||||
function audon_addon_admin(string &$o)
|
||||
{
|
||||
$t = Renderer::getMarkupTemplate('admin.tpl', 'addon/audon/');
|
||||
$o = Renderer::replaceMacros($t, [
|
||||
'$submit' => DI::l10n()->t('Save Settings'),
|
||||
'$audonurl' => [
|
||||
'audonurl',
|
||||
DI::l10n()->t('Audon Base URL'),
|
||||
DI::config()->get('audon','audonurl'),
|
||||
DI::l10n()->t('Page your users will create an Audon audio chat room on. For example you could use https://audon.space.'),
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
function audon_addon_admin_post()
|
||||
{
|
||||
DI::config()->set('audon', 'audonurl', trim($_POST['audonurl'] ?? ''));
|
||||
}
|
||||
|
||||
/**
|
||||
* This is a statement rather than an actual function definition. The simple
|
||||
* existence of this method is checked to figure out if the addon offers a
|
||||
* module.
|
||||
*/
|
||||
function audon_module() {}
|
||||
|
||||
function audon_content(): string
|
||||
{
|
||||
$o = '';
|
||||
|
||||
/* landingpage to create chatrooms */
|
||||
$audonurl = DI::config()->get('audon', 'audonurl');
|
||||
|
||||
|
||||
/* embedd the landing page in an iframe */
|
||||
$o .= '<h2>' . DI::l10n()->t('Audio Chat') . '</h2>';
|
||||
$o .= '<p>' . DI::l10n()->t('Audon is an audio conferencing tool. Connect your account to Audon and create a room. Share the generated link to talk to other participants.') . '</p>';
|
||||
if ($audonurl == '') {
|
||||
$o .= '<p>' . DI::l10n()->t('Please contact your Friendica administrator to remind them to configure the Audon addon.') . '</p>';
|
||||
} else {
|
||||
$o .= '<iframe src="' . $audonurl . '" width="740px" height="600px"></iframe>';
|
||||
}
|
||||
|
||||
return $o;
|
||||
}
|
||||
|
|
@ -1,52 +0,0 @@
|
|||
# ADDON audon
|
||||
# Copyright (C)
|
||||
# This file is distributed under the same license as the Friendica audon addon package.
|
||||
#
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2023-08-18 18:23+0200\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"
|
||||
"Language: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: audon.php:22
|
||||
msgid "Audon Audiochat"
|
||||
msgstr ""
|
||||
|
||||
#: audon.php:29
|
||||
msgid "Save Settings"
|
||||
msgstr ""
|
||||
|
||||
#: audon.php:32
|
||||
msgid "Audon Base URL"
|
||||
msgstr ""
|
||||
|
||||
#: audon.php:34
|
||||
msgid ""
|
||||
"Page your users will create an Audon audio chat room on. For example you "
|
||||
"could use https://audon.space."
|
||||
msgstr ""
|
||||
|
||||
#: audon.php:60
|
||||
msgid "Audio Chat"
|
||||
msgstr ""
|
||||
|
||||
#: audon.php:61
|
||||
msgid ""
|
||||
"Audon is an audio conferencing tool. Connect your account to Audon and "
|
||||
"create a room. Share the generated link to talk to other participants."
|
||||
msgstr ""
|
||||
|
||||
#: audon.php:63
|
||||
msgid ""
|
||||
"Please contact your Friendica administrator to remind them to configure the "
|
||||
"Audon addon."
|
||||
msgstr ""
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
{{include file="field_input.tpl" field=$audonurl}}
|
||||
<button type="submit">{{$submit}}</button>
|
||||
230
blockem/blockem.php
Normal file
230
blockem/blockem.php
Normal file
|
|
@ -0,0 +1,230 @@
|
|||
<?php
|
||||
/**
|
||||
* Name: blockem
|
||||
* Description: Allows users to hide content by collapsing posts and replies.
|
||||
* Version: 1.0
|
||||
* Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
|
||||
* Author: Roland Haeder <https://f.haeder.net/roland>
|
||||
* Status: unsupported
|
||||
*/
|
||||
|
||||
use Friendica\App;
|
||||
use Friendica\Core\Hook;
|
||||
use Friendica\Core\Renderer;
|
||||
use Friendica\DI;
|
||||
use Friendica\Util\Strings;
|
||||
|
||||
global $blockem_words;
|
||||
|
||||
function blockem_install()
|
||||
{
|
||||
Hook::register('prepare_body_content_filter', 'addon/blockem/blockem.php', 'blockem_prepare_body_content_filter');
|
||||
Hook::register('display_item' , 'addon/blockem/blockem.php', 'blockem_display_item');
|
||||
Hook::register('addon_settings' , 'addon/blockem/blockem.php', 'blockem_addon_settings');
|
||||
Hook::register('addon_settings_post' , 'addon/blockem/blockem.php', 'blockem_addon_settings_post');
|
||||
Hook::register('conversation_start' , 'addon/blockem/blockem.php', 'blockem_conversation_start');
|
||||
Hook::register('item_photo_menu' , 'addon/blockem/blockem.php', 'blockem_item_photo_menu');
|
||||
Hook::register('enotify_store' , 'addon/blockem/blockem.php', 'blockem_enotify_store');
|
||||
}
|
||||
|
||||
function blockem_addon_settings(array &$data)
|
||||
{
|
||||
if (!DI::userSession()->getLocalUserId()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$words = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'blockem', 'words', '');
|
||||
|
||||
$t = Renderer::getMarkupTemplate('settings.tpl', 'addon/blockem/');
|
||||
$html = Renderer::replaceMacros($t, [
|
||||
'$info' => DI::l10n()->t("Hides user's content by collapsing posts. Also replaces their avatar with generic image."),
|
||||
'$words' => ['blockem-words', DI::l10n()->t('Comma separated profile URLS:'), $words],
|
||||
]);
|
||||
|
||||
$data = [
|
||||
'addon' => 'blockem',
|
||||
'title' => DI::l10n()->t('Blockem'),
|
||||
'html' => $html,
|
||||
];
|
||||
}
|
||||
|
||||
function blockem_addon_settings_post(array &$b)
|
||||
{
|
||||
if (!DI::userSession()->getLocalUserId()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!empty($_POST['blockem-submit'])) {
|
||||
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'blockem', 'words', trim($_POST['blockem-words']));
|
||||
}
|
||||
}
|
||||
|
||||
function blockem_enotify_store(array &$b)
|
||||
{
|
||||
$words = DI::pConfig()->get($b['uid'], 'blockem', 'words');
|
||||
|
||||
if ($words) {
|
||||
$arr = explode(',', $words);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
$found = false;
|
||||
|
||||
if (count($arr)) {
|
||||
foreach ($arr as $word) {
|
||||
if (!strlen(trim($word))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (Strings::compareLink($b['url'], $word)) {
|
||||
$found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($found) {
|
||||
// empty out the fields
|
||||
$b = [];
|
||||
}
|
||||
}
|
||||
|
||||
function blockem_prepare_body_content_filter(array &$hook_data)
|
||||
{
|
||||
if (!DI::userSession()->getLocalUserId()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$profiles_string = null;
|
||||
|
||||
if (DI::userSession()->getLocalUserId()) {
|
||||
$profiles_string = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'blockem', 'words');
|
||||
}
|
||||
|
||||
if ($profiles_string) {
|
||||
$profiles_array = explode(',', $profiles_string);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
$found = false;
|
||||
|
||||
foreach ($profiles_array as $word) {
|
||||
if (Strings::compareLink($hook_data['item']['author-link'], trim($word))) {
|
||||
$found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($found) {
|
||||
$hook_data['filter_reasons'][] = DI::l10n()->t('Filtered user: %s', $hook_data['item']['author-name']);
|
||||
}
|
||||
}
|
||||
|
||||
function blockem_display_item(array &$b = null)
|
||||
{
|
||||
if (!empty($b['output']['body']) && strstr($b['output']['body'], 'id="blockem-wrap-')) {
|
||||
$b['output']['thumb'] = DI::baseUrl() . "/images/person-80.jpg";
|
||||
}
|
||||
}
|
||||
|
||||
function blockem_conversation_start(array &$b)
|
||||
{
|
||||
global $blockem_words;
|
||||
|
||||
if (!DI::userSession()->getLocalUserId()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$words = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'blockem', 'words');
|
||||
|
||||
if ($words) {
|
||||
$blockem_words = explode(',', $words);
|
||||
}
|
||||
|
||||
DI::page()['htmlhead'] .= <<< EOT
|
||||
|
||||
<script>
|
||||
function blockemBlock(author) {
|
||||
$.get('blockem?block=' +author, function(data) {
|
||||
location.reload(true);
|
||||
});
|
||||
}
|
||||
function blockemUnblock(author) {
|
||||
$.get('blockem?unblock=' +author, function(data) {
|
||||
location.reload(true);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
EOT;
|
||||
}
|
||||
|
||||
function blockem_item_photo_menu(array &$b)
|
||||
{
|
||||
global $blockem_words;
|
||||
|
||||
if (!DI::userSession()->getLocalUserId() || $b['item']['self']) {
|
||||
return;
|
||||
}
|
||||
|
||||
$blocked = false;
|
||||
$author = $b['item']['author-link'];
|
||||
|
||||
if (!empty($blockem_words)) {
|
||||
foreach($blockem_words as $bloke) {
|
||||
if (Strings::compareLink($bloke,$author)) {
|
||||
$blocked = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($blocked) {
|
||||
$b['menu'][DI::l10n()->t('Unblock Author')] = 'javascript:blockemUnblock(\'' . $author . '\');';
|
||||
} else {
|
||||
$b['menu'][DI::l10n()->t('Block Author')] = 'javascript:blockemBlock(\'' . $author . '\');';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This is a statement rather than an actual function definition. The simple
|
||||
* existence of this method is checked to figure out if the addon offers a
|
||||
* module.
|
||||
*/
|
||||
function blockem_module() {}
|
||||
|
||||
function blockem_init()
|
||||
{
|
||||
if (!DI::userSession()->getLocalUserId()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$words = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'blockem', 'words');
|
||||
|
||||
if (array_key_exists('block', $_GET) && $_GET['block']) {
|
||||
if (strlen($words)) {
|
||||
$words .= ',';
|
||||
}
|
||||
|
||||
$words .= trim($_GET['block']);
|
||||
}
|
||||
|
||||
if (array_key_exists('unblock', $_GET) && $_GET['unblock']) {
|
||||
$arr = explode(',',$words);
|
||||
$newarr = [];
|
||||
|
||||
if (count($arr)) {
|
||||
foreach ($arr as $x) {
|
||||
if (!Strings::compareLink(trim($x), trim($_GET['unblock']))) {
|
||||
$newarr[] = $x;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$words = implode(',', $newarr);
|
||||
}
|
||||
|
||||
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'blockem', 'words', $words);
|
||||
exit();
|
||||
}
|
||||
45
blockem/lang/C/messages.po
Normal file
45
blockem/lang/C/messages.po
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
# ADDON blockem
|
||||
# Copyright (C)
|
||||
# This file is distributed under the same license as the Friendica blockem addon package.
|
||||
#
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-11-21 19:13-0500\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"
|
||||
"Language: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: blockem.php:39
|
||||
msgid ""
|
||||
"Hides user's content by collapsing posts. Also replaces their avatar with "
|
||||
"generic image."
|
||||
msgstr ""
|
||||
|
||||
#: blockem.php:40
|
||||
msgid "Comma separated profile URLS:"
|
||||
msgstr ""
|
||||
|
||||
#: blockem.php:45
|
||||
msgid "Blockem"
|
||||
msgstr ""
|
||||
|
||||
#: blockem.php:120
|
||||
#, php-format
|
||||
msgid "Filtered user: %s"
|
||||
msgstr ""
|
||||
|
||||
#: blockem.php:183
|
||||
msgid "Unblock Author"
|
||||
msgstr ""
|
||||
|
||||
#: blockem.php:185
|
||||
msgid "Block Author"
|
||||
msgstr ""
|
||||
52
blockem/lang/ar/messages.po
Normal file
52
blockem/lang/ar/messages.po
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
# ADDON blockem
|
||||
# Copyright (C)
|
||||
# This file is distributed under the same license as the Friendica blockem addon package.
|
||||
#
|
||||
#
|
||||
# Translators:
|
||||
# abidin toumi <abidin24@tutanota.com>, 2021
|
||||
# Farida Khalaf <faridakhalaf@hotmail.com>, 2021
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: friendica\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-02-01 18:15+0100\n"
|
||||
"PO-Revision-Date: 2021-10-29 08:15+0000\n"
|
||||
"Last-Translator: abidin toumi <abidin24@tutanota.com>\n"
|
||||
"Language-Team: Arabic (http://www.transifex.com/Friendica/friendica/language/ar/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: ar\n"
|
||||
"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n"
|
||||
|
||||
#: blockem.php:42 blockem.php:46
|
||||
msgid "Blockem"
|
||||
msgstr "احجبه<br>"
|
||||
|
||||
#: blockem.php:50
|
||||
msgid ""
|
||||
"Hides user's content by collapsing posts. Also replaces their avatar with "
|
||||
"generic image."
|
||||
msgstr "إخفاء محتوى المستخدم عن طريق تصغير المشاركات. و استبدال الصورة الرمزية الخاصة بهم بصورة عامة."
|
||||
|
||||
#: blockem.php:51
|
||||
msgid "Comma separated profile URLS:"
|
||||
msgstr "عناوين الملفات الشخصية مفصولة بفواصل:"
|
||||
|
||||
#: blockem.php:55
|
||||
msgid "Save Settings"
|
||||
msgstr "احفظ الإعدادات"
|
||||
|
||||
#: blockem.php:131
|
||||
#, php-format
|
||||
msgid "Filtered user: %s"
|
||||
msgstr "ترشيح المستخدم :1%s"
|
||||
|
||||
#: blockem.php:190
|
||||
msgid "Unblock Author"
|
||||
msgstr "ألغ الحجب عن المدون"
|
||||
|
||||
#: blockem.php:192
|
||||
msgid "Block Author"
|
||||
msgstr "احجب المدون"
|
||||
14
blockem/lang/ar/strings.php
Normal file
14
blockem/lang/ar/strings.php
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<?php
|
||||
|
||||
if(! function_exists("string_plural_select_ar")) {
|
||||
function string_plural_select_ar($n){
|
||||
$n = intval($n);
|
||||
if ($n==0) { return 0; } else if ($n==1) { return 1; } else if ($n==2) { return 2; } else if ($n%100>=3 && $n%100<=10) { return 3; } else if ($n%100>=11 && $n%100<=99) { return 4; } else { return 5; }
|
||||
}}
|
||||
$a->strings['Blockem'] = 'احجبه<br>';
|
||||
$a->strings['Hides user\'s content by collapsing posts. Also replaces their avatar with generic image.'] = 'إخفاء محتوى المستخدم عن طريق تصغير المشاركات. و استبدال الصورة الرمزية الخاصة بهم بصورة عامة.';
|
||||
$a->strings['Comma separated profile URLS:'] = 'عناوين الملفات الشخصية مفصولة بفواصل:';
|
||||
$a->strings['Save Settings'] = 'احفظ الإعدادات';
|
||||
$a->strings['Filtered user: %s'] = 'ترشيح المستخدم :1%s';
|
||||
$a->strings['Unblock Author'] = 'ألغ الحجب عن المدون';
|
||||
$a->strings['Block Author'] = 'احجب المدون';
|
||||
59
blockem/lang/ca/messages.po
Normal file
59
blockem/lang/ca/messages.po
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
# ADDON blockem
|
||||
# Copyright (C)
|
||||
# This file is distributed under the same license as the Friendica blockem addon package.
|
||||
#
|
||||
#
|
||||
# Translators:
|
||||
# Joan Bar <friendica@tutanota.com>, 2019
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: friendica\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2018-08-17 10:23+0200\n"
|
||||
"PO-Revision-Date: 2019-10-14 11:50+0000\n"
|
||||
"Last-Translator: Joan Bar <friendica@tutanota.com>\n"
|
||||
"Language-Team: Catalan (http://www.transifex.com/Friendica/friendica/language/ca/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: ca\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#: blockem.php:54 blockem.php:58
|
||||
msgid "Blockem"
|
||||
msgstr "Blockem"
|
||||
|
||||
#: blockem.php:62
|
||||
msgid ""
|
||||
"Hides user's content by collapsing posts. Also replaces their avatar with "
|
||||
"generic image."
|
||||
msgstr "Amaga el contingut de l'usuari mitjançant la publicació col·lapsada. També substitueix el seu avatar per una imatge genèrica"
|
||||
|
||||
#: blockem.php:63
|
||||
msgid "Comma separated profile URLS:"
|
||||
msgstr "URL de perfil separats per comes:"
|
||||
|
||||
#: blockem.php:67
|
||||
msgid "Save Settings"
|
||||
msgstr "Desa la configuració"
|
||||
|
||||
#: blockem.php:81
|
||||
msgid "BLOCKEM Settings saved."
|
||||
msgstr "S'ha desat la configuració de BLOCKEM."
|
||||
|
||||
#: blockem.php:143
|
||||
#, php-format
|
||||
msgid "Filtered user: %s"
|
||||
msgstr "Usuari filtrat:%s"
|
||||
|
||||
#: blockem.php:202
|
||||
msgid "Unblock Author"
|
||||
msgstr "Desbloca l'autor"
|
||||
|
||||
#: blockem.php:204
|
||||
msgid "Block Author"
|
||||
msgstr "Autor de bloc"
|
||||
|
||||
#: blockem.php:244
|
||||
msgid "blockem settings updated"
|
||||
msgstr "S'ha actualitzat la configuració de blockem"
|
||||
16
blockem/lang/ca/strings.php
Normal file
16
blockem/lang/ca/strings.php
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
if(! function_exists("string_plural_select_ca")) {
|
||||
function string_plural_select_ca($n){
|
||||
$n = intval($n);
|
||||
return intval($n != 1);
|
||||
}}
|
||||
$a->strings['Blockem'] = 'Blockem';
|
||||
$a->strings['Hides user\'s content by collapsing posts. Also replaces their avatar with generic image.'] = 'Amaga el contingut de l\'usuari mitjançant la publicació col·lapsada. També substitueix el seu avatar per una imatge genèrica';
|
||||
$a->strings['Comma separated profile URLS:'] = 'URL de perfil separats per comes:';
|
||||
$a->strings['Save Settings'] = 'Desa la configuració';
|
||||
$a->strings['BLOCKEM Settings saved.'] = 'S\'ha desat la configuració de BLOCKEM.';
|
||||
$a->strings['Filtered user: %s'] = 'Usuari filtrat:%s';
|
||||
$a->strings['Unblock Author'] = 'Desbloca l\'autor';
|
||||
$a->strings['Block Author'] = 'Autor de bloc';
|
||||
$a->strings['blockem settings updated'] = 'S\'ha actualitzat la configuració de blockem';
|
||||
60
blockem/lang/cs/messages.po
Normal file
60
blockem/lang/cs/messages.po
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
# ADDON blockem
|
||||
# Copyright (C)
|
||||
# This file is distributed under the same license as the Friendica blockem addon package.
|
||||
#
|
||||
#
|
||||
# Translators:
|
||||
# Aditoo, 2018
|
||||
# michal_s <msupler@gmail.com>, 2014
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: friendica\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2018-08-17 10:23+0200\n"
|
||||
"PO-Revision-Date: 2018-08-18 12:25+0000\n"
|
||||
"Last-Translator: Aditoo\n"
|
||||
"Language-Team: Czech (http://www.transifex.com/Friendica/friendica/language/cs/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: cs\n"
|
||||
"Plural-Forms: nplurals=4; plural=(n == 1 && n % 1 == 0) ? 0 : (n >= 2 && n <= 4 && n % 1 == 0) ? 1: (n % 1 != 0 ) ? 2 : 3;\n"
|
||||
|
||||
#: blockem.php:54 blockem.php:58
|
||||
msgid "Blockem"
|
||||
msgstr "Blockem"
|
||||
|
||||
#: blockem.php:62
|
||||
msgid ""
|
||||
"Hides user's content by collapsing posts. Also replaces their avatar with "
|
||||
"generic image."
|
||||
msgstr "Skrývá uživatelský obsah zabalením příspěvků. Navíc nahrazuje avatar generickým obrázkem."
|
||||
|
||||
#: blockem.php:63
|
||||
msgid "Comma separated profile URLS:"
|
||||
msgstr "URL adresy profilů, oddělené čárkami:"
|
||||
|
||||
#: blockem.php:67
|
||||
msgid "Save Settings"
|
||||
msgstr "Uložit nastavení"
|
||||
|
||||
#: blockem.php:81
|
||||
msgid "BLOCKEM Settings saved."
|
||||
msgstr "Nastavení BLOCKEM uložena."
|
||||
|
||||
#: blockem.php:143
|
||||
#, php-format
|
||||
msgid "Filtered user: %s"
|
||||
msgstr "Filtrovaný uživatel: %s"
|
||||
|
||||
#: blockem.php:202
|
||||
msgid "Unblock Author"
|
||||
msgstr "Odblokovat autora"
|
||||
|
||||
#: blockem.php:204
|
||||
msgid "Block Author"
|
||||
msgstr "Zablokovat autora"
|
||||
|
||||
#: blockem.php:244
|
||||
msgid "blockem settings updated"
|
||||
msgstr "nastavení blockem aktualizována"
|
||||
16
blockem/lang/cs/strings.php
Normal file
16
blockem/lang/cs/strings.php
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
if(! function_exists("string_plural_select_cs")) {
|
||||
function string_plural_select_cs($n){
|
||||
$n = intval($n);
|
||||
if (($n == 1 && $n % 1 == 0)) { return 0; } else if (($n >= 2 && $n <= 4 && $n % 1 == 0)) { return 1; } else if (($n % 1 != 0 )) { return 2; } else { return 3; }
|
||||
}}
|
||||
$a->strings['Blockem'] = 'Blockem';
|
||||
$a->strings['Hides user\'s content by collapsing posts. Also replaces their avatar with generic image.'] = 'Skrývá uživatelský obsah zabalením příspěvků. Navíc nahrazuje avatar generickým obrázkem.';
|
||||
$a->strings['Comma separated profile URLS:'] = 'URL adresy profilů, oddělené čárkami:';
|
||||
$a->strings['Save Settings'] = 'Uložit nastavení';
|
||||
$a->strings['BLOCKEM Settings saved.'] = 'Nastavení BLOCKEM uložena.';
|
||||
$a->strings['Filtered user: %s'] = 'Filtrovaný uživatel: %s';
|
||||
$a->strings['Unblock Author'] = 'Odblokovat autora';
|
||||
$a->strings['Block Author'] = 'Zablokovat autora';
|
||||
$a->strings['blockem settings updated'] = 'nastavení blockem aktualizována';
|
||||
47
blockem/lang/da-dk/messages.po
Normal file
47
blockem/lang/da-dk/messages.po
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
# ADDON blockem
|
||||
# Copyright (C)
|
||||
# This file is distributed under the same license as the Friendica blockem addon package.
|
||||
#
|
||||
#
|
||||
# Translators:
|
||||
# Anton <dev@atjn.dk>, 2022
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: friendica\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-11-21 19:13-0500\n"
|
||||
"PO-Revision-Date: 2014-06-22 11:20+0000\n"
|
||||
"Last-Translator: Anton <dev@atjn.dk>, 2022\n"
|
||||
"Language-Team: Danish (Denmark) (http://www.transifex.com/Friendica/friendica/language/da_DK/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: da_DK\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#: blockem.php:39
|
||||
msgid ""
|
||||
"Hides user's content by collapsing posts. Also replaces their avatar with "
|
||||
"generic image."
|
||||
msgstr "Skjul brugers indhold ved at kollapse deres opslag. Erstatter også deres avatar med et generisk billede."
|
||||
|
||||
#: blockem.php:40
|
||||
msgid "Comma separated profile URLS:"
|
||||
msgstr "Kommasepareret liste over profil-URL's:"
|
||||
|
||||
#: blockem.php:45
|
||||
msgid "Blockem"
|
||||
msgstr "Blokdem"
|
||||
|
||||
#: blockem.php:120
|
||||
#, php-format
|
||||
msgid "Filtered user: %s"
|
||||
msgstr "Filtreret bruger: %s"
|
||||
|
||||
#: blockem.php:183
|
||||
msgid "Unblock Author"
|
||||
msgstr "Fjern blokering af forfatter"
|
||||
|
||||
#: blockem.php:185
|
||||
msgid "Block Author"
|
||||
msgstr "Blokér forfatter"
|
||||
13
blockem/lang/da-dk/strings.php
Normal file
13
blockem/lang/da-dk/strings.php
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
|
||||
if(! function_exists("string_plural_select_da_dk")) {
|
||||
function string_plural_select_da_dk($n){
|
||||
$n = intval($n);
|
||||
return intval($n != 1);
|
||||
}}
|
||||
$a->strings['Hides user\'s content by collapsing posts. Also replaces their avatar with generic image.'] = 'Skjul brugers indhold ved at kollapse deres opslag. Erstatter også deres avatar med et generisk billede.';
|
||||
$a->strings['Comma separated profile URLS:'] = 'Kommasepareret liste over profil-URL\'s:';
|
||||
$a->strings['Blockem'] = 'Blokdem';
|
||||
$a->strings['Filtered user: %s'] = 'Filtreret bruger: %s';
|
||||
$a->strings['Unblock Author'] = 'Fjern blokering af forfatter';
|
||||
$a->strings['Block Author'] = 'Blokér forfatter';
|
||||
50
blockem/lang/de/messages.po
Normal file
50
blockem/lang/de/messages.po
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
# ADDON blockem
|
||||
# Copyright (C)
|
||||
# This file is distributed under the same license as the Friendica blockem addon package.
|
||||
#
|
||||
#
|
||||
# Translators:
|
||||
# Andreas H., 2018
|
||||
# Tobias Diekershoff <tobias.diekershoff@gmx.net>, 2014
|
||||
# Tobias Diekershoff <tobias.diekershoff@gmx.net>, 2018
|
||||
# Ulf Rompe <transifex.com@rompe.org>, 2019
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: friendica\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-11-21 19:13-0500\n"
|
||||
"PO-Revision-Date: 2021-12-22 15:27+0000\n"
|
||||
"Last-Translator: Transifex Bot <>\n"
|
||||
"Language-Team: German (http://www.transifex.com/Friendica/friendica/language/de/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: de\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#: blockem.php:39
|
||||
msgid ""
|
||||
"Hides user's content by collapsing posts. Also replaces their avatar with "
|
||||
"generic image."
|
||||
msgstr "Verbirgt Inhalte von Benutzern durch Zusammenklappen der Beiträge. Des Weiteren wird das Profilbild durch einen generischen Avatar ersetzt."
|
||||
|
||||
#: blockem.php:40
|
||||
msgid "Comma separated profile URLS:"
|
||||
msgstr "Komma-separierte Liste von Profil-URLs"
|
||||
|
||||
#: blockem.php:45
|
||||
msgid "Blockem"
|
||||
msgstr "Blockem"
|
||||
|
||||
#: blockem.php:120
|
||||
#, php-format
|
||||
msgid "Filtered user: %s"
|
||||
msgstr "Gefilterte Person: %s"
|
||||
|
||||
#: blockem.php:183
|
||||
msgid "Unblock Author"
|
||||
msgstr "Autor freischalten"
|
||||
|
||||
#: blockem.php:185
|
||||
msgid "Block Author"
|
||||
msgstr "Autor blockieren"
|
||||
13
blockem/lang/de/strings.php
Normal file
13
blockem/lang/de/strings.php
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
|
||||
if(! function_exists("string_plural_select_de")) {
|
||||
function string_plural_select_de($n){
|
||||
$n = intval($n);
|
||||
return intval($n != 1);
|
||||
}}
|
||||
$a->strings['Hides user\'s content by collapsing posts. Also replaces their avatar with generic image.'] = 'Verbirgt Inhalte von Benutzern durch Zusammenklappen der Beiträge. Des Weiteren wird das Profilbild durch einen generischen Avatar ersetzt.';
|
||||
$a->strings['Comma separated profile URLS:'] = 'Komma-separierte Liste von Profil-URLs';
|
||||
$a->strings['Blockem'] = 'Blockem';
|
||||
$a->strings['Filtered user: %s'] = 'Gefilterte Person: %s';
|
||||
$a->strings['Unblock Author'] = 'Autor freischalten';
|
||||
$a->strings['Block Author'] = 'Autor blockieren';
|
||||
59
blockem/lang/en-gb/messages.po
Normal file
59
blockem/lang/en-gb/messages.po
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
# ADDON blockem
|
||||
# Copyright (C)
|
||||
# This file is distributed under the same license as the Friendica blockem addon package.
|
||||
#
|
||||
#
|
||||
# Translators:
|
||||
# Andy H3 <andy@hubup.pro>, 2018
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: friendica\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2018-02-09 13:00+0100\n"
|
||||
"PO-Revision-Date: 2018-03-15 14:10+0000\n"
|
||||
"Last-Translator: Andy H3 <andy@hubup.pro>\n"
|
||||
"Language-Team: English (United Kingdom) (http://www.transifex.com/Friendica/friendica/language/en_GB/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: en_GB\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#: blockem.php:51 blockem.php:55
|
||||
msgid "\"Blockem\""
|
||||
msgstr "\"Blockem\""
|
||||
|
||||
#: blockem.php:59
|
||||
msgid ""
|
||||
"Hides user's content by collapsing posts. Also replaces their avatar with "
|
||||
"generic image."
|
||||
msgstr "Hides user's content by collapsing posts. Also replaces their avatar with generic image."
|
||||
|
||||
#: blockem.php:60
|
||||
msgid "Comma separated profile URLS:"
|
||||
msgstr "Comma separated profile URLs:"
|
||||
|
||||
#: blockem.php:64
|
||||
msgid "Save Settings"
|
||||
msgstr "Save settings"
|
||||
|
||||
#: blockem.php:77
|
||||
msgid "BLOCKEM Settings saved."
|
||||
msgstr "Blockem settings saved."
|
||||
|
||||
#: blockem.php:140
|
||||
#, php-format
|
||||
msgid "Hidden content by %s - Click to open/close"
|
||||
msgstr "Hidden content by %s - Reveal/hide"
|
||||
|
||||
#: blockem.php:193
|
||||
msgid "Unblock Author"
|
||||
msgstr "Unblock author"
|
||||
|
||||
#: blockem.php:195
|
||||
msgid "Block Author"
|
||||
msgstr "Block author"
|
||||
|
||||
#: blockem.php:227
|
||||
msgid "blockem settings updated"
|
||||
msgstr "Blockem settings updated"
|
||||
16
blockem/lang/en-gb/strings.php
Normal file
16
blockem/lang/en-gb/strings.php
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
if(! function_exists("string_plural_select_en_gb")) {
|
||||
function string_plural_select_en_gb($n){
|
||||
$n = intval($n);
|
||||
return intval($n != 1);
|
||||
}}
|
||||
$a->strings['"Blockem"'] = '"Blockem"';
|
||||
$a->strings['Hides user\'s content by collapsing posts. Also replaces their avatar with generic image.'] = 'Hides user\'s content by collapsing posts. Also replaces their avatar with generic image.';
|
||||
$a->strings['Comma separated profile URLS:'] = 'Comma separated profile URLs:';
|
||||
$a->strings['Save Settings'] = 'Save settings';
|
||||
$a->strings['BLOCKEM Settings saved.'] = 'Blockem settings saved.';
|
||||
$a->strings['Hidden content by %s - Click to open/close'] = 'Hidden content by %s - Reveal/hide';
|
||||
$a->strings['Unblock Author'] = 'Unblock author';
|
||||
$a->strings['Block Author'] = 'Block author';
|
||||
$a->strings['blockem settings updated'] = 'Blockem settings updated';
|
||||
61
blockem/lang/en-us/messages.po
Normal file
61
blockem/lang/en-us/messages.po
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
# ADDON blockem
|
||||
# Copyright (C)
|
||||
# This file is distributed under the same license as the Friendica blockem addon package.
|
||||
#
|
||||
#
|
||||
# Translators:
|
||||
# Adam Clark <adam@isurf.ca>, 2018
|
||||
# Andy H3 <andy@hubup.pro>, 2018
|
||||
# R C <miqrogroove@gmail.com>, 2018
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: friendica\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2018-04-01 11:11-0400\n"
|
||||
"PO-Revision-Date: 2018-06-13 02:40+0000\n"
|
||||
"Last-Translator: R C <miqrogroove@gmail.com>\n"
|
||||
"Language-Team: English (United States) (http://www.transifex.com/Friendica/friendica/language/en_US/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: en_US\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#: blockem.php:52 blockem.php:56
|
||||
msgid "\"Blockem\""
|
||||
msgstr "Blockem"
|
||||
|
||||
#: blockem.php:60
|
||||
msgid ""
|
||||
"Hides user's content by collapsing posts. Also replaces their avatar with "
|
||||
"generic image."
|
||||
msgstr "Hides user's content by collapsing posts. Also replaces their avatar with generic image."
|
||||
|
||||
#: blockem.php:61
|
||||
msgid "Comma separated profile URLS:"
|
||||
msgstr "Comma-separated profile URLs:"
|
||||
|
||||
#: blockem.php:65
|
||||
msgid "Save Settings"
|
||||
msgstr "Save settings"
|
||||
|
||||
#: blockem.php:78
|
||||
msgid "BLOCKEM Settings saved."
|
||||
msgstr "Blockem settings saved."
|
||||
|
||||
#: blockem.php:136
|
||||
#, php-format
|
||||
msgid "Filtered user: %s"
|
||||
msgstr "Filtered user: %s"
|
||||
|
||||
#: blockem.php:189
|
||||
msgid "Unblock Author"
|
||||
msgstr "Unblock author"
|
||||
|
||||
#: blockem.php:191
|
||||
msgid "Block Author"
|
||||
msgstr "Block author"
|
||||
|
||||
#: blockem.php:223
|
||||
msgid "blockem settings updated"
|
||||
msgstr "Blockem settings updated"
|
||||
16
blockem/lang/en-us/strings.php
Normal file
16
blockem/lang/en-us/strings.php
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
if(! function_exists("string_plural_select_en_us")) {
|
||||
function string_plural_select_en_us($n){
|
||||
$n = intval($n);
|
||||
return intval($n != 1);
|
||||
}}
|
||||
$a->strings['"Blockem"'] = 'Blockem';
|
||||
$a->strings['Hides user\'s content by collapsing posts. Also replaces their avatar with generic image.'] = 'Hides user\'s content by collapsing posts. Also replaces their avatar with generic image.';
|
||||
$a->strings['Comma separated profile URLS:'] = 'Comma-separated profile URLs:';
|
||||
$a->strings['Save Settings'] = 'Save settings';
|
||||
$a->strings['BLOCKEM Settings saved.'] = 'Blockem settings saved.';
|
||||
$a->strings['Filtered user: %s'] = 'Filtered user: %s';
|
||||
$a->strings['Unblock Author'] = 'Unblock author';
|
||||
$a->strings['Block Author'] = 'Block author';
|
||||
$a->strings['blockem settings updated'] = 'Blockem settings updated';
|
||||
10
blockem/lang/eo/strings.php
Normal file
10
blockem/lang/eo/strings.php
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
$a->strings["\"Blockem\" Settings"] = "\"Blockem\" Agordoj";
|
||||
$a->strings["Comma separated profile URLS to block"] = "Blokotaj URL adresoj, disigita per komo";
|
||||
$a->strings["Submit"] = "Sendi";
|
||||
$a->strings["BLOCKEM Settings saved."] = "Konservis Agordojn de BLOCKEM.";
|
||||
$a->strings["Blocked %s - Click to open/close"] = "%s blokita - Klaku por malfermi/fermi";
|
||||
$a->strings["Unblock Author"] = "Malbloki Aŭtoron";
|
||||
$a->strings["Block Author"] = "Bloki Aŭtoron";
|
||||
$a->strings["blockem settings updated"] = "Ĝisdatigis la blockem agordojn";
|
||||
53
blockem/lang/es/messages.po
Normal file
53
blockem/lang/es/messages.po
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
# ADDON blockem
|
||||
# Copyright (C)
|
||||
# This file is distributed under the same license as the Friendica blockem addon package.
|
||||
#
|
||||
#
|
||||
# Translators:
|
||||
# Albert, 2018
|
||||
# Senex Petrovic <javierruizo@hotmail.com>, 2021
|
||||
# Tupambae.org, 2016
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: friendica\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-02-01 18:15+0100\n"
|
||||
"PO-Revision-Date: 2021-04-01 09:45+0000\n"
|
||||
"Last-Translator: Senex Petrovic <javierruizo@hotmail.com>\n"
|
||||
"Language-Team: Spanish (http://www.transifex.com/Friendica/friendica/language/es/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: es\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#: blockem.php:42 blockem.php:46
|
||||
msgid "Blockem"
|
||||
msgstr "Blockem (Bloquealos)"
|
||||
|
||||
#: blockem.php:50
|
||||
msgid ""
|
||||
"Hides user's content by collapsing posts. Also replaces their avatar with "
|
||||
"generic image."
|
||||
msgstr "Oculta el contenido del usuario al colapsar las publicaciones. También reemplaza su avatar con una imagen genérica."
|
||||
|
||||
#: blockem.php:51
|
||||
msgid "Comma separated profile URLS:"
|
||||
msgstr "URLs de perfil separadas por comas:"
|
||||
|
||||
#: blockem.php:55
|
||||
msgid "Save Settings"
|
||||
msgstr "Guardar configuración"
|
||||
|
||||
#: blockem.php:131
|
||||
#, php-format
|
||||
msgid "Filtered user: %s"
|
||||
msgstr "Usuario filtrado: %s"
|
||||
|
||||
#: blockem.php:190
|
||||
msgid "Unblock Author"
|
||||
msgstr "Desbloquear autor"
|
||||
|
||||
#: blockem.php:192
|
||||
msgid "Block Author"
|
||||
msgstr "Bloquear autor"
|
||||
14
blockem/lang/es/strings.php
Normal file
14
blockem/lang/es/strings.php
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<?php
|
||||
|
||||
if(! function_exists("string_plural_select_es")) {
|
||||
function string_plural_select_es($n){
|
||||
$n = intval($n);
|
||||
return intval($n != 1);
|
||||
}}
|
||||
$a->strings['Blockem'] = 'Blockem (Bloquealos)';
|
||||
$a->strings['Hides user\'s content by collapsing posts. Also replaces their avatar with generic image.'] = 'Oculta el contenido del usuario al colapsar las publicaciones. También reemplaza su avatar con una imagen genérica.';
|
||||
$a->strings['Comma separated profile URLS:'] = 'URLs de perfil separadas por comas:';
|
||||
$a->strings['Save Settings'] = 'Guardar configuración';
|
||||
$a->strings['Filtered user: %s'] = 'Usuario filtrado: %s';
|
||||
$a->strings['Unblock Author'] = 'Desbloquear autor';
|
||||
$a->strings['Block Author'] = 'Bloquear autor';
|
||||
60
blockem/lang/fi-fi/messages.po
Normal file
60
blockem/lang/fi-fi/messages.po
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
# ADDON blockem
|
||||
# Copyright (C)
|
||||
# This file is distributed under the same license as the Friendica blockem addon package.
|
||||
#
|
||||
#
|
||||
# Translators:
|
||||
# Kris, 2018
|
||||
# Kris, 2018
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: friendica\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2018-04-01 11:11-0400\n"
|
||||
"PO-Revision-Date: 2018-04-18 14:44+0000\n"
|
||||
"Last-Translator: Kris\n"
|
||||
"Language-Team: Finnish (Finland) (http://www.transifex.com/Friendica/friendica/language/fi_FI/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: fi_FI\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#: blockem.php:52 blockem.php:56
|
||||
msgid "\"Blockem\""
|
||||
msgstr "\"Blockem\""
|
||||
|
||||
#: blockem.php:60
|
||||
msgid ""
|
||||
"Hides user's content by collapsing posts. Also replaces their avatar with "
|
||||
"generic image."
|
||||
msgstr ""
|
||||
|
||||
#: blockem.php:61
|
||||
msgid "Comma separated profile URLS:"
|
||||
msgstr "Profiilien URL-osoitteet pilkulla erotettuina:"
|
||||
|
||||
#: blockem.php:65
|
||||
msgid "Save Settings"
|
||||
msgstr "Tallenna asetukset"
|
||||
|
||||
#: blockem.php:78
|
||||
msgid "BLOCKEM Settings saved."
|
||||
msgstr "Blockem -asetukset tallennettu"
|
||||
|
||||
#: blockem.php:136
|
||||
#, php-format
|
||||
msgid "Filtered user: %s"
|
||||
msgstr "Suodatettu käyttäjä: %s"
|
||||
|
||||
#: blockem.php:189
|
||||
msgid "Unblock Author"
|
||||
msgstr "Poista kirjoittaja estolistalta"
|
||||
|
||||
#: blockem.php:191
|
||||
msgid "Block Author"
|
||||
msgstr "Lisää kirjoittaja estolistalle"
|
||||
|
||||
#: blockem.php:223
|
||||
msgid "blockem settings updated"
|
||||
msgstr "blockem -asetukset päivitetty"
|
||||
15
blockem/lang/fi-fi/strings.php
Normal file
15
blockem/lang/fi-fi/strings.php
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
|
||||
if(! function_exists("string_plural_select_fi_fi")) {
|
||||
function string_plural_select_fi_fi($n){
|
||||
$n = intval($n);
|
||||
return intval($n != 1);
|
||||
}}
|
||||
$a->strings['"Blockem"'] = '"Blockem"';
|
||||
$a->strings['Comma separated profile URLS:'] = 'Profiilien URL-osoitteet pilkulla erotettuina:';
|
||||
$a->strings['Save Settings'] = 'Tallenna asetukset';
|
||||
$a->strings['BLOCKEM Settings saved.'] = 'Blockem -asetukset tallennettu';
|
||||
$a->strings['Filtered user: %s'] = 'Suodatettu käyttäjä: %s';
|
||||
$a->strings['Unblock Author'] = 'Poista kirjoittaja estolistalta';
|
||||
$a->strings['Block Author'] = 'Lisää kirjoittaja estolistalle';
|
||||
$a->strings['blockem settings updated'] = 'blockem -asetukset päivitetty';
|
||||
50
blockem/lang/fr/messages.po
Normal file
50
blockem/lang/fr/messages.po
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
# ADDON blockem
|
||||
# Copyright (C)
|
||||
# This file is distributed under the same license as the Friendica blockem addon package.
|
||||
#
|
||||
#
|
||||
# Translators:
|
||||
# Hypolite Petovan <hypolite@mrpetovan.com>, 2016
|
||||
# Marie Olive <lacellule101@gmail.com>, 2018
|
||||
# StefOfficiel <pichard.stephane@free.fr>, 2015
|
||||
# Vladimir Núñez <lapoubelle111@gmail.com>, 2018
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: friendica\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-11-21 19:13-0500\n"
|
||||
"PO-Revision-Date: 2014-06-22 11:20+0000\n"
|
||||
"Last-Translator: Vladimir Núñez <lapoubelle111@gmail.com>, 2018\n"
|
||||
"Language-Team: French (http://www.transifex.com/Friendica/friendica/language/fr/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: fr\n"
|
||||
"Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n"
|
||||
|
||||
#: blockem.php:39
|
||||
msgid ""
|
||||
"Hides user's content by collapsing posts. Also replaces their avatar with "
|
||||
"generic image."
|
||||
msgstr "Cache le contenu de l'utilisateur en contractant les publications. Remplace aussi leur avatar par une image générique."
|
||||
|
||||
#: blockem.php:40
|
||||
msgid "Comma separated profile URLS:"
|
||||
msgstr "URLs de profil séparées par des virgules:"
|
||||
|
||||
#: blockem.php:45
|
||||
msgid "Blockem"
|
||||
msgstr "Bloquez-les"
|
||||
|
||||
#: blockem.php:120
|
||||
#, php-format
|
||||
msgid "Filtered user: %s"
|
||||
msgstr "Utilisateur filtré:%s"
|
||||
|
||||
#: blockem.php:183
|
||||
msgid "Unblock Author"
|
||||
msgstr "Débloquer l'Auteur"
|
||||
|
||||
#: blockem.php:185
|
||||
msgid "Block Author"
|
||||
msgstr "Bloquer l'Auteur"
|
||||
13
blockem/lang/fr/strings.php
Normal file
13
blockem/lang/fr/strings.php
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
|
||||
if(! function_exists("string_plural_select_fr")) {
|
||||
function string_plural_select_fr($n){
|
||||
$n = intval($n);
|
||||
if (($n == 0 || $n == 1)) { return 0; } else if ($n != 0 && $n % 1000000 == 0) { return 1; } else { return 2; }
|
||||
}}
|
||||
$a->strings['Hides user\'s content by collapsing posts. Also replaces their avatar with generic image.'] = 'Cache le contenu de l\'utilisateur en contractant les publications. Remplace aussi leur avatar par une image générique.';
|
||||
$a->strings['Comma separated profile URLS:'] = 'URLs de profil séparées par des virgules:';
|
||||
$a->strings['Blockem'] = 'Bloquez-les';
|
||||
$a->strings['Filtered user: %s'] = 'Utilisateur filtré:%s';
|
||||
$a->strings['Unblock Author'] = 'Débloquer l\'Auteur';
|
||||
$a->strings['Block Author'] = 'Bloquer l\'Auteur';
|
||||
47
blockem/lang/hu/messages.po
Normal file
47
blockem/lang/hu/messages.po
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
# ADDON blockem
|
||||
# Copyright (C)
|
||||
# This file is distributed under the same license as the Friendica blockem addon package.
|
||||
#
|
||||
#
|
||||
# Translators:
|
||||
# Balázs Úr, 2020
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: friendica\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-11-21 19:13-0500\n"
|
||||
"PO-Revision-Date: 2014-06-22 11:20+0000\n"
|
||||
"Last-Translator: Balázs Úr, 2020\n"
|
||||
"Language-Team: Hungarian (http://www.transifex.com/Friendica/friendica/language/hu/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: hu\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#: blockem.php:39
|
||||
msgid ""
|
||||
"Hides user's content by collapsing posts. Also replaces their avatar with "
|
||||
"generic image."
|
||||
msgstr "Elrejti a felhasználók tartalmát a bejegyzések összecsukásával. Ezenkívül lecseréli a profilképeiket egy általános képre."
|
||||
|
||||
#: blockem.php:40
|
||||
msgid "Comma separated profile URLS:"
|
||||
msgstr "Profil URL-ek vesszővel elválasztva:"
|
||||
|
||||
#: blockem.php:45
|
||||
msgid "Blockem"
|
||||
msgstr "Blockem"
|
||||
|
||||
#: blockem.php:120
|
||||
#, php-format
|
||||
msgid "Filtered user: %s"
|
||||
msgstr "Kiszűrt felhasználó: %s"
|
||||
|
||||
#: blockem.php:183
|
||||
msgid "Unblock Author"
|
||||
msgstr "Szerző tiltásának feloldása"
|
||||
|
||||
#: blockem.php:185
|
||||
msgid "Block Author"
|
||||
msgstr "Szerző tiltása"
|
||||
13
blockem/lang/hu/strings.php
Normal file
13
blockem/lang/hu/strings.php
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
|
||||
if(! function_exists("string_plural_select_hu")) {
|
||||
function string_plural_select_hu($n){
|
||||
$n = intval($n);
|
||||
return intval($n != 1);
|
||||
}}
|
||||
$a->strings['Hides user\'s content by collapsing posts. Also replaces their avatar with generic image.'] = 'Elrejti a felhasználók tartalmát a bejegyzések összecsukásával. Ezenkívül lecseréli a profilképeiket egy általános képre.';
|
||||
$a->strings['Comma separated profile URLS:'] = 'Profil URL-ek vesszővel elválasztva:';
|
||||
$a->strings['Blockem'] = 'Blockem';
|
||||
$a->strings['Filtered user: %s'] = 'Kiszűrt felhasználó: %s';
|
||||
$a->strings['Unblock Author'] = 'Szerző tiltásának feloldása';
|
||||
$a->strings['Block Author'] = 'Szerző tiltása';
|
||||
10
blockem/lang/is/strings.php
Normal file
10
blockem/lang/is/strings.php
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
$a->strings["\"Blockem\" Settings"] = "\"Blockem\" stillingar";
|
||||
$a->strings["Comma separated profile URLS to block"] = "Banna lista af forsíðum (komma á milli)";
|
||||
$a->strings["Submit"] = "Senda inn";
|
||||
$a->strings["BLOCKEM Settings saved."] = "BLOCKEM stillingar vistaðar.";
|
||||
$a->strings["Blocked %s - Click to open/close"] = "%s sett í straff - Smella til að taka úr/setja á";
|
||||
$a->strings["Unblock Author"] = "Leyfa notanda";
|
||||
$a->strings["Block Author"] = "Banna notanda";
|
||||
$a->strings["blockem settings updated"] = "";
|
||||
59
blockem/lang/it/messages.po
Normal file
59
blockem/lang/it/messages.po
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
# ADDON blockem
|
||||
# Copyright (C)
|
||||
# This file is distributed under the same license as the Friendica blockem addon package.
|
||||
#
|
||||
#
|
||||
# Translators:
|
||||
# fabrixxm <fabrix.xm@gmail.com>, 2014,2018-2019
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: friendica\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2018-08-17 10:23+0200\n"
|
||||
"PO-Revision-Date: 2019-03-11 14:21+0000\n"
|
||||
"Last-Translator: fabrixxm <fabrix.xm@gmail.com>\n"
|
||||
"Language-Team: Italian (http://www.transifex.com/Friendica/friendica/language/it/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: it\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#: blockem.php:54 blockem.php:58
|
||||
msgid "Blockem"
|
||||
msgstr "Blockem"
|
||||
|
||||
#: blockem.php:62
|
||||
msgid ""
|
||||
"Hides user's content by collapsing posts. Also replaces their avatar with "
|
||||
"generic image."
|
||||
msgstr "Nascondi il contenuto degli utenti collassando i messaggi. Sostituisce anche gli avatar con un'immagine generica."
|
||||
|
||||
#: blockem.php:63
|
||||
msgid "Comma separated profile URLS:"
|
||||
msgstr "URL profili separati da virgola:"
|
||||
|
||||
#: blockem.php:67
|
||||
msgid "Save Settings"
|
||||
msgstr "Salva Impostazioni"
|
||||
|
||||
#: blockem.php:81
|
||||
msgid "BLOCKEM Settings saved."
|
||||
msgstr "Impostazioni BLOCKEM salvate."
|
||||
|
||||
#: blockem.php:143
|
||||
#, php-format
|
||||
msgid "Filtered user: %s"
|
||||
msgstr "Utente filtrato: %s"
|
||||
|
||||
#: blockem.php:202
|
||||
msgid "Unblock Author"
|
||||
msgstr "Sblocca autore"
|
||||
|
||||
#: blockem.php:204
|
||||
msgid "Block Author"
|
||||
msgstr "Blocca autore"
|
||||
|
||||
#: blockem.php:244
|
||||
msgid "blockem settings updated"
|
||||
msgstr "Impostazioni 'blockem' aggiornate."
|
||||
16
blockem/lang/it/strings.php
Normal file
16
blockem/lang/it/strings.php
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
if(! function_exists("string_plural_select_it")) {
|
||||
function string_plural_select_it($n){
|
||||
$n = intval($n);
|
||||
return intval($n != 1);
|
||||
}}
|
||||
$a->strings['Blockem'] = 'Blockem';
|
||||
$a->strings['Hides user\'s content by collapsing posts. Also replaces their avatar with generic image.'] = 'Nascondi il contenuto degli utenti collassando i messaggi. Sostituisce anche gli avatar con un\'immagine generica.';
|
||||
$a->strings['Comma separated profile URLS:'] = 'URL profili separati da virgola:';
|
||||
$a->strings['Save Settings'] = 'Salva Impostazioni';
|
||||
$a->strings['BLOCKEM Settings saved.'] = 'Impostazioni BLOCKEM salvate.';
|
||||
$a->strings['Filtered user: %s'] = 'Utente filtrato: %s';
|
||||
$a->strings['Unblock Author'] = 'Sblocca autore';
|
||||
$a->strings['Block Author'] = 'Blocca autore';
|
||||
$a->strings['blockem settings updated'] = 'Impostazioni \'blockem\' aggiornate.';
|
||||
10
blockem/lang/nb-no/strings.php
Normal file
10
blockem/lang/nb-no/strings.php
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
$a->strings["\"Blockem\" Settings"] = "";
|
||||
$a->strings["Comma separated profile URLS to block"] = "";
|
||||
$a->strings["Submit"] = "Lagre";
|
||||
$a->strings["BLOCKEM Settings saved."] = "";
|
||||
$a->strings["Blocked %s - Click to open/close"] = "";
|
||||
$a->strings["Unblock Author"] = "";
|
||||
$a->strings["Block Author"] = "";
|
||||
$a->strings["blockem settings updated"] = "";
|
||||
60
blockem/lang/nl/messages.po
Normal file
60
blockem/lang/nl/messages.po
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
# ADDON blockem
|
||||
# Copyright (C)
|
||||
# This file is distributed under the same license as the Friendica blockem addon package.
|
||||
#
|
||||
#
|
||||
# Translators:
|
||||
# AgnesElisa <agneselisa@disroot.org>, 2018
|
||||
# Jeroen De Meerleer <me@jeroened.be>, 2018
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: friendica\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2018-08-17 10:23+0200\n"
|
||||
"PO-Revision-Date: 2018-08-24 13:49+0000\n"
|
||||
"Last-Translator: Jeroen De Meerleer <me@jeroened.be>\n"
|
||||
"Language-Team: Dutch (http://www.transifex.com/Friendica/friendica/language/nl/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: nl\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#: blockem.php:54 blockem.php:58
|
||||
msgid "Blockem"
|
||||
msgstr "Blockem"
|
||||
|
||||
#: blockem.php:62
|
||||
msgid ""
|
||||
"Hides user's content by collapsing posts. Also replaces their avatar with "
|
||||
"generic image."
|
||||
msgstr "Verbergt de inhoud van het bericht van de gebruiker. Daarnaast vervangt het de avatar door een standaardafbeelding."
|
||||
|
||||
#: blockem.php:63
|
||||
msgid "Comma separated profile URLS:"
|
||||
msgstr "Profiel URLs (kommagescheiden):"
|
||||
|
||||
#: blockem.php:67
|
||||
msgid "Save Settings"
|
||||
msgstr "Instellingen opslaan"
|
||||
|
||||
#: blockem.php:81
|
||||
msgid "BLOCKEM Settings saved."
|
||||
msgstr "BLOCKEM instellingen opgeslagen."
|
||||
|
||||
#: blockem.php:143
|
||||
#, php-format
|
||||
msgid "Filtered user: %s"
|
||||
msgstr "Gefilterde gebruiker: %s"
|
||||
|
||||
#: blockem.php:202
|
||||
msgid "Unblock Author"
|
||||
msgstr "Deblokkeer Auteur"
|
||||
|
||||
#: blockem.php:204
|
||||
msgid "Block Author"
|
||||
msgstr "Auteur blokkeren"
|
||||
|
||||
#: blockem.php:244
|
||||
msgid "blockem settings updated"
|
||||
msgstr "blockem instellingen opgeslagen"
|
||||
16
blockem/lang/nl/strings.php
Normal file
16
blockem/lang/nl/strings.php
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
if(! function_exists("string_plural_select_nl")) {
|
||||
function string_plural_select_nl($n){
|
||||
$n = intval($n);
|
||||
return intval($n != 1);
|
||||
}}
|
||||
$a->strings['Blockem'] = 'Blockem';
|
||||
$a->strings['Hides user\'s content by collapsing posts. Also replaces their avatar with generic image.'] = 'Verbergt de inhoud van het bericht van de gebruiker. Daarnaast vervangt het de avatar door een standaardafbeelding.';
|
||||
$a->strings['Comma separated profile URLS:'] = 'Profiel URLs (kommagescheiden):';
|
||||
$a->strings['Save Settings'] = 'Instellingen opslaan';
|
||||
$a->strings['BLOCKEM Settings saved.'] = 'BLOCKEM instellingen opgeslagen.';
|
||||
$a->strings['Filtered user: %s'] = 'Gefilterde gebruiker: %s';
|
||||
$a->strings['Unblock Author'] = 'Deblokkeer Auteur';
|
||||
$a->strings['Block Author'] = 'Auteur blokkeren';
|
||||
$a->strings['blockem settings updated'] = 'blockem instellingen opgeslagen';
|
||||
47
blockem/lang/pl/messages.po
Normal file
47
blockem/lang/pl/messages.po
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
# ADDON blockem
|
||||
# Copyright (C)
|
||||
# This file is distributed under the same license as the Friendica blockem addon package.
|
||||
#
|
||||
#
|
||||
# Translators:
|
||||
# Waldemar Stoczkowski, 2018
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: friendica\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-11-21 19:13-0500\n"
|
||||
"PO-Revision-Date: 2014-06-22 11:20+0000\n"
|
||||
"Last-Translator: Waldemar Stoczkowski, 2018\n"
|
||||
"Language-Team: Polish (http://www.transifex.com/Friendica/friendica/language/pl/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: pl\n"
|
||||
"Plural-Forms: nplurals=4; plural=(n==1 ? 0 : (n%10>=2 && n%10<=4) && (n%100<12 || n%100>14) ? 1 : n!=1 && (n%10>=0 && n%10<=1) || (n%10>=5 && n%10<=9) || (n%100>=12 && n%100<=14) ? 2 : 3);\n"
|
||||
|
||||
#: blockem.php:39
|
||||
msgid ""
|
||||
"Hides user's content by collapsing posts. Also replaces their avatar with "
|
||||
"generic image."
|
||||
msgstr "Ukrywa zawartość użytkownika, zwijając posty. Zastępuje również awatar wygenerowanym obrazem."
|
||||
|
||||
#: blockem.php:40
|
||||
msgid "Comma separated profile URLS:"
|
||||
msgstr "Rozdzielone przecinkami adresy URL profilu:"
|
||||
|
||||
#: blockem.php:45
|
||||
msgid "Blockem"
|
||||
msgstr "Zablokowanie"
|
||||
|
||||
#: blockem.php:120
|
||||
#, php-format
|
||||
msgid "Filtered user: %s"
|
||||
msgstr "Użytkownik filtrowany: %s"
|
||||
|
||||
#: blockem.php:183
|
||||
msgid "Unblock Author"
|
||||
msgstr "Odblokuj autora"
|
||||
|
||||
#: blockem.php:185
|
||||
msgid "Block Author"
|
||||
msgstr "Zablokuj autora"
|
||||
13
blockem/lang/pl/strings.php
Normal file
13
blockem/lang/pl/strings.php
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
|
||||
if(! function_exists("string_plural_select_pl")) {
|
||||
function string_plural_select_pl($n){
|
||||
$n = intval($n);
|
||||
if ($n==1) { return 0; } else if (($n%10>=2 && $n%10<=4) && ($n%100<12 || $n%100>14)) { return 1; } else if ($n!=1 && ($n%10>=0 && $n%10<=1) || ($n%10>=5 && $n%10<=9) || ($n%100>=12 && $n%100<=14)) { return 2; } else { return 3; }
|
||||
}}
|
||||
$a->strings['Hides user\'s content by collapsing posts. Also replaces their avatar with generic image.'] = 'Ukrywa zawartość użytkownika, zwijając posty. Zastępuje również awatar wygenerowanym obrazem.';
|
||||
$a->strings['Comma separated profile URLS:'] = 'Rozdzielone przecinkami adresy URL profilu:';
|
||||
$a->strings['Blockem'] = 'Zablokowanie';
|
||||
$a->strings['Filtered user: %s'] = 'Użytkownik filtrowany: %s';
|
||||
$a->strings['Unblock Author'] = 'Odblokuj autora';
|
||||
$a->strings['Block Author'] = 'Zablokuj autora';
|
||||
10
blockem/lang/pt-br/strings.php
Normal file
10
blockem/lang/pt-br/strings.php
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
$a->strings["\"Blockem\" Settings"] = "Configurações \"Blockem\"";
|
||||
$a->strings["Comma separated profile URLS to block"] = "URLS de perfis separados por vírgulas a serem bloqueados";
|
||||
$a->strings["Submit"] = "Enviar";
|
||||
$a->strings["BLOCKEM Settings saved."] = "Configurações BLOCKEM armazenadas.";
|
||||
$a->strings["Blocked %s - Click to open/close"] = "Bloqueado %s - Clique para abrir/fechar";
|
||||
$a->strings["Unblock Author"] = "Desbloqueie Autor";
|
||||
$a->strings["Block Author"] = "Bloqueie Autor";
|
||||
$a->strings["blockem settings updated"] = "configurações blockem atualizadas";
|
||||
52
blockem/lang/ro/messages.po
Normal file
52
blockem/lang/ro/messages.po
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
# ADDON blockem
|
||||
# Copyright (C)
|
||||
# This file is distributed under the same license as the Friendica blockem addon package.
|
||||
#
|
||||
#
|
||||
# Translators:
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: friendica\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2014-06-22 13:18+0200\n"
|
||||
"PO-Revision-Date: 2014-07-08 11:43+0000\n"
|
||||
"Last-Translator: Arian - Cazare Muncitori <arianserv@gmail.com>\n"
|
||||
"Language-Team: Romanian (Romania) (http://www.transifex.com/projects/p/friendica/language/ro_RO/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: ro_RO\n"
|
||||
"Plural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1));\n"
|
||||
|
||||
#: blockem.php:53 blockem.php:57
|
||||
msgid "\"Blockem\""
|
||||
msgstr "\"Blockem\""
|
||||
|
||||
#: blockem.php:61
|
||||
msgid "Comma separated profile URLS to block"
|
||||
msgstr "Adresele URL de profil, de blocat, separate prin virgulă"
|
||||
|
||||
#: blockem.php:65
|
||||
msgid "Save Settings"
|
||||
msgstr "Salvare Configurări"
|
||||
|
||||
#: blockem.php:78
|
||||
msgid "BLOCKEM Settings saved."
|
||||
msgstr "Configurările BLOCKEM au fost salvate."
|
||||
|
||||
#: blockem.php:142
|
||||
#, php-format
|
||||
msgid "Blocked %s - Click to open/close"
|
||||
msgstr "%s Blocate - Apăsați pentru a deschide/închide"
|
||||
|
||||
#: blockem.php:197
|
||||
msgid "Unblock Author"
|
||||
msgstr "Deblocare Autor"
|
||||
|
||||
#: blockem.php:199
|
||||
msgid "Block Author"
|
||||
msgstr "Blocare Autor"
|
||||
|
||||
#: blockem.php:231
|
||||
msgid "blockem settings updated"
|
||||
msgstr "Configurările blockem au fost actualizate"
|
||||
15
blockem/lang/ro/strings.php
Normal file
15
blockem/lang/ro/strings.php
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
|
||||
if(! function_exists("string_plural_select_ro")) {
|
||||
function string_plural_select_ro($n){
|
||||
$n = intval($n);
|
||||
if ($n==1) { return 0; } else if ((($n%100>19)||(($n%100==0)&&($n!=0)))) { return 2; } else { return 1; }
|
||||
}}
|
||||
$a->strings['"Blockem"'] = '"Blockem"';
|
||||
$a->strings['Comma separated profile URLS to block'] = 'Adresele URL de profil, de blocat, separate prin virgulă';
|
||||
$a->strings['Save Settings'] = 'Salvare Configurări';
|
||||
$a->strings['BLOCKEM Settings saved.'] = 'Configurările BLOCKEM au fost salvate.';
|
||||
$a->strings['Blocked %s - Click to open/close'] = '%s Blocate - Apăsați pentru a deschide/închide';
|
||||
$a->strings['Unblock Author'] = 'Deblocare Autor';
|
||||
$a->strings['Block Author'] = 'Blocare Autor';
|
||||
$a->strings['blockem settings updated'] = 'Configurările blockem au fost actualizate';
|
||||
60
blockem/lang/ru/messages.po
Normal file
60
blockem/lang/ru/messages.po
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
# ADDON blockem
|
||||
# Copyright (C)
|
||||
# This file is distributed under the same license as the Friendica blockem addon package.
|
||||
#
|
||||
#
|
||||
# Translators:
|
||||
# Alexander An <ravnina@gmail.com>, 2020
|
||||
# Stanislav N. <pztrn@pztrn.name>, 2017-2018
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: friendica\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2018-08-17 10:23+0200\n"
|
||||
"PO-Revision-Date: 2020-04-23 14:13+0000\n"
|
||||
"Last-Translator: Alexander An <ravnina@gmail.com>\n"
|
||||
"Language-Team: Russian (http://www.transifex.com/Friendica/friendica/language/ru/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: ru\n"
|
||||
"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n"
|
||||
|
||||
#: blockem.php:54 blockem.php:58
|
||||
msgid "Blockem"
|
||||
msgstr "Blockem"
|
||||
|
||||
#: blockem.php:62
|
||||
msgid ""
|
||||
"Hides user's content by collapsing posts. Also replaces their avatar with "
|
||||
"generic image."
|
||||
msgstr "Скрыть контент пользователя. Также заменяет его аватар изображением по-умолчанию."
|
||||
|
||||
#: blockem.php:63
|
||||
msgid "Comma separated profile URLS:"
|
||||
msgstr "URL профилей, разделенные запятыми:"
|
||||
|
||||
#: blockem.php:67
|
||||
msgid "Save Settings"
|
||||
msgstr "Сохранить настройки"
|
||||
|
||||
#: blockem.php:81
|
||||
msgid "BLOCKEM Settings saved."
|
||||
msgstr "BLOCKEM Настройки сохранены."
|
||||
|
||||
#: blockem.php:143
|
||||
#, php-format
|
||||
msgid "Filtered user: %s"
|
||||
msgstr "Отфильтрованный пользователь: %s"
|
||||
|
||||
#: blockem.php:202
|
||||
msgid "Unblock Author"
|
||||
msgstr "Разблокировать автора"
|
||||
|
||||
#: blockem.php:204
|
||||
msgid "Block Author"
|
||||
msgstr "Блокировать автора"
|
||||
|
||||
#: blockem.php:244
|
||||
msgid "blockem settings updated"
|
||||
msgstr "Настройки Blockem обновлены"
|
||||
16
blockem/lang/ru/strings.php
Normal file
16
blockem/lang/ru/strings.php
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
if(! function_exists("string_plural_select_ru")) {
|
||||
function string_plural_select_ru($n){
|
||||
$n = intval($n);
|
||||
if ($n%10==1 && $n%100!=11) { return 0; } else if ($n%10>=2 && $n%10<=4 && ($n%100<12 || $n%100>14)) { return 1; } else if ($n%10==0 || ($n%10>=5 && $n%10<=9) || ($n%100>=11 && $n%100<=14)) { return 2; } else { return 3; }
|
||||
}}
|
||||
$a->strings['Blockem'] = 'Blockem';
|
||||
$a->strings['Hides user\'s content by collapsing posts. Also replaces their avatar with generic image.'] = 'Скрыть контент пользователя. Также заменяет его аватар изображением по-умолчанию.';
|
||||
$a->strings['Comma separated profile URLS:'] = 'URL профилей, разделенные запятыми:';
|
||||
$a->strings['Save Settings'] = 'Сохранить настройки';
|
||||
$a->strings['BLOCKEM Settings saved.'] = 'BLOCKEM Настройки сохранены.';
|
||||
$a->strings['Filtered user: %s'] = 'Отфильтрованный пользователь: %s';
|
||||
$a->strings['Unblock Author'] = 'Разблокировать автора';
|
||||
$a->strings['Block Author'] = 'Блокировать автора';
|
||||
$a->strings['blockem settings updated'] = 'Настройки Blockem обновлены';
|
||||
47
blockem/lang/sv/messages.po
Normal file
47
blockem/lang/sv/messages.po
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
# ADDON blockem
|
||||
# Copyright (C)
|
||||
# This file is distributed under the same license as the Friendica blockem addon package.
|
||||
#
|
||||
#
|
||||
# Translators:
|
||||
# Bjoessi <torbjorn.andersson@syte.se>, 2019
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: friendica\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-11-21 19:13-0500\n"
|
||||
"PO-Revision-Date: 2021-12-22 15:27+0000\n"
|
||||
"Last-Translator: Transifex Bot <>\n"
|
||||
"Language-Team: Swedish (http://www.transifex.com/Friendica/friendica/language/sv/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: sv\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#: blockem.php:39
|
||||
msgid ""
|
||||
"Hides user's content by collapsing posts. Also replaces their avatar with "
|
||||
"generic image."
|
||||
msgstr "Döljer användares inlägg genom sammanslagning nedåt. Användarens profilbild ersätts med en standardbild."
|
||||
|
||||
#: blockem.php:40
|
||||
msgid "Comma separated profile URLS:"
|
||||
msgstr "Kommaseparerade profiladresser:"
|
||||
|
||||
#: blockem.php:45
|
||||
msgid "Blockem"
|
||||
msgstr "BLOCKEM"
|
||||
|
||||
#: blockem.php:120
|
||||
#, php-format
|
||||
msgid "Filtered user: %s"
|
||||
msgstr "Filtrerat på användare:%s"
|
||||
|
||||
#: blockem.php:183
|
||||
msgid "Unblock Author"
|
||||
msgstr "Avblockera författare"
|
||||
|
||||
#: blockem.php:185
|
||||
msgid "Block Author"
|
||||
msgstr "Blockera författare"
|
||||
13
blockem/lang/sv/strings.php
Normal file
13
blockem/lang/sv/strings.php
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
|
||||
if(! function_exists("string_plural_select_sv")) {
|
||||
function string_plural_select_sv($n){
|
||||
$n = intval($n);
|
||||
return intval($n != 1);
|
||||
}}
|
||||
$a->strings['Hides user\'s content by collapsing posts. Also replaces their avatar with generic image.'] = 'Döljer användares inlägg genom sammanslagning nedåt. Användarens profilbild ersätts med en standardbild.';
|
||||
$a->strings['Comma separated profile URLS:'] = 'Kommaseparerade profiladresser:';
|
||||
$a->strings['Blockem'] = 'BLOCKEM';
|
||||
$a->strings['Filtered user: %s'] = 'Filtrerat på användare:%s';
|
||||
$a->strings['Unblock Author'] = 'Avblockera författare';
|
||||
$a->strings['Block Author'] = 'Blockera författare';
|
||||
10
blockem/lang/zh-cn/strings.php
Normal file
10
blockem/lang/zh-cn/strings.php
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
$a->strings["\"Blockem\" Settings"] = "「Blockem」配置";
|
||||
$a->strings["Comma separated profile URLS to block"] = "逗号分简介URL为栏";
|
||||
$a->strings["Submit"] = "提交";
|
||||
$a->strings["BLOCKEM Settings saved."] = "「Blockem」配置保存了。";
|
||||
$a->strings["Blocked %s - Click to open/close"] = "%s拦了-点击为开关";
|
||||
$a->strings["Unblock Author"] = "不拦作家";
|
||||
$a->strings["Block Author"] = "拦作家";
|
||||
$a->strings["blockem settings updated"] = "blockem设置更新了";
|
||||
1
blockem/templates/settings.tpl
Normal file
1
blockem/templates/settings.tpl
Normal file
|
|
@ -0,0 +1 @@
|
|||
{{include file="field_textarea.tpl" field=$words}}
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
Bluesky Addon
|
||||
==============
|
||||
|
||||
This addon supports posting to and receiving posts from Bluesky.
|
||||
|
||||
No setup is needed for the admins to make it work for their users.
|
||||
|
||||
Bluesky itself is under development as well. It is planned to make it decentral.
|
||||
The addon is prepared to support different servers. But it isn't enabled yet.
|
||||
1775
bluesky/bluesky.php
1775
bluesky/bluesky.php
|
|
@ -1,1775 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Name: Bluesky Connector
|
||||
* Description: Post to Bluesky
|
||||
* Version: 1.1
|
||||
* Author: Michael Vogel <https://pirati.ca/profile/heluecht>
|
||||
*
|
||||
* @todo
|
||||
* Currently technical issues in the core:
|
||||
* - Outgoing mentions
|
||||
*
|
||||
* At some point in time:
|
||||
* - Sending Quote shares https://atproto.com/lexicons/app-bsky-embed#appbskyembedrecord and https://atproto.com/lexicons/app-bsky-embed#appbskyembedrecordwithmedia
|
||||
*
|
||||
* Possibly not possible:
|
||||
* - only fetch new posts
|
||||
*
|
||||
* Currently not possible, due to limitations in Friendica
|
||||
* - mute contacts https://atproto.com/lexicons/app-bsky-graph#appbskygraphmuteactor
|
||||
* - unmute contacts https://atproto.com/lexicons/app-bsky-graph#appbskygraphunmuteactor
|
||||
*
|
||||
* Possibly interesting:
|
||||
* - https://atproto.com/lexicons/com-atproto-label#comatprotolabelsubscribelabels
|
||||
*/
|
||||
|
||||
use Friendica\Content\Text\BBCode;
|
||||
use Friendica\Content\Text\HTML;
|
||||
use Friendica\Content\Text\Plaintext;
|
||||
use Friendica\Core\Cache\Enum\Duration;
|
||||
use Friendica\Core\Config\Util\ConfigFileManager;
|
||||
use Friendica\Core\Hook;
|
||||
use Friendica\Core\Logger;
|
||||
use Friendica\Core\Protocol;
|
||||
use Friendica\Core\Renderer;
|
||||
use Friendica\Core\Worker;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\DI;
|
||||
use Friendica\Model\Contact;
|
||||
use Friendica\Model\GServer;
|
||||
use Friendica\Model\Item;
|
||||
use Friendica\Model\ItemURI;
|
||||
use Friendica\Model\Photo;
|
||||
use Friendica\Model\Post;
|
||||
use Friendica\Model\Tag;
|
||||
use Friendica\Network\HTTPClient\Client\HttpClientAccept;
|
||||
use Friendica\Network\HTTPClient\Client\HttpClientOptions;
|
||||
use Friendica\Object\Image;
|
||||
use Friendica\Protocol\Activity;
|
||||
use Friendica\Protocol\Relay;
|
||||
use Friendica\Util\DateTimeFormat;
|
||||
use Friendica\Util\Strings;
|
||||
|
||||
const BLUESKY_DEFAULT_POLL_INTERVAL = 10; // given in minutes
|
||||
const BLUESKY_IMAGE_SIZE = [1000000, 500000, 100000, 50000];
|
||||
|
||||
const BLUEKSY_STATUS_UNKNOWN = 0;
|
||||
const BLUEKSY_STATUS_TOKEN_OK = 1;
|
||||
const BLUEKSY_STATUS_SUCCESS = 2;
|
||||
const BLUEKSY_STATUS_API_FAIL = 10;
|
||||
const BLUEKSY_STATUS_DID_FAIL = 11;
|
||||
const BLUEKSY_STATUS_PDS_FAIL = 12;
|
||||
const BLUEKSY_STATUS_TOKEN_FAIL = 13;
|
||||
|
||||
/*
|
||||
* (Currently) hard wired paths for Bluesky services
|
||||
*/
|
||||
const BLUESKY_DIRECTORY = 'https://plc.directory'; // Path to the directory server service to fetch the PDS of a given DID
|
||||
const BLUESKY_PDS = 'https://bsky.social'; // Path to the personal data server service (PDS) to fetch the DID for a given handle
|
||||
const BLUESKY_WEB = 'https://bsky.app'; // Path to the web interface with the user profile and posts
|
||||
|
||||
function bluesky_install()
|
||||
{
|
||||
Hook::register('load_config', __FILE__, 'bluesky_load_config');
|
||||
Hook::register('hook_fork', __FILE__, 'bluesky_hook_fork');
|
||||
Hook::register('post_local', __FILE__, 'bluesky_post_local');
|
||||
Hook::register('notifier_normal', __FILE__, 'bluesky_send');
|
||||
Hook::register('jot_networks', __FILE__, 'bluesky_jot_nets');
|
||||
Hook::register('connector_settings', __FILE__, 'bluesky_settings');
|
||||
Hook::register('connector_settings_post', __FILE__, 'bluesky_settings_post');
|
||||
Hook::register('cron', __FILE__, 'bluesky_cron');
|
||||
Hook::register('support_follow', __FILE__, 'bluesky_support_follow');
|
||||
Hook::register('support_probe', __FILE__, 'bluesky_support_probe');
|
||||
Hook::register('follow', __FILE__, 'bluesky_follow');
|
||||
Hook::register('unfollow', __FILE__, 'bluesky_unfollow');
|
||||
Hook::register('block', __FILE__, 'bluesky_block');
|
||||
Hook::register('unblock', __FILE__, 'bluesky_unblock');
|
||||
Hook::register('check_item_notification', __FILE__, 'bluesky_check_item_notification');
|
||||
Hook::register('probe_detect', __FILE__, 'bluesky_probe_detect');
|
||||
Hook::register('item_by_link', __FILE__, 'bluesky_item_by_link');
|
||||
}
|
||||
|
||||
function bluesky_load_config(ConfigFileManager $loader)
|
||||
{
|
||||
DI::app()->getConfigCache()->load($loader->loadAddonConfig('bluesky'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC);
|
||||
}
|
||||
|
||||
function bluesky_check_item_notification(array &$notification_data)
|
||||
{
|
||||
$did = DI::pConfig()->get($notification_data['uid'], 'bluesky', 'did');
|
||||
|
||||
if (!empty($did)) {
|
||||
$notification_data['profiles'][] = $did;
|
||||
}
|
||||
}
|
||||
|
||||
function bluesky_probe_detect(array &$hookData)
|
||||
{
|
||||
// Don't overwrite an existing result
|
||||
if (isset($hookData['result'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Avoid a lookup for the wrong network
|
||||
if (!in_array($hookData['network'], ['', Protocol::BLUESKY])) {
|
||||
return;
|
||||
}
|
||||
|
||||
$pconfig = DBA::selectFirst('pconfig', ['uid'], ["`cat` = ? AND `k` = ? AND `v` != ?", 'bluesky', 'access_token', '']);
|
||||
if (empty($pconfig['uid'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (parse_url($hookData['uri'], PHP_URL_SCHEME) == 'did') {
|
||||
$did = $hookData['uri'];
|
||||
} elseif (preg_match('#^' . BLUESKY_WEB . '/profile/(.+)#', $hookData['uri'], $matches)) {
|
||||
$did = bluesky_get_did($matches[1]);
|
||||
if (empty($did)) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
$token = bluesky_get_token($pconfig['uid']);
|
||||
if (empty($token)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$data = bluesky_xrpc_get($pconfig['uid'], 'app.bsky.actor.getProfile', ['actor' => $did]);
|
||||
if (empty($data)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$hookData['result'] = bluesky_get_contact_fields($data, 0, false);
|
||||
|
||||
$hookData['result']['baseurl'] = bluesky_get_pds($did);
|
||||
|
||||
// Preparing probe data. This differs slightly from the contact array
|
||||
$hookData['result']['about'] = HTML::toBBCode($data->description ?? '');
|
||||
$hookData['result']['photo'] = $data->avatar ?? '';
|
||||
$hookData['result']['header'] = $data->banner ?? '';
|
||||
$hookData['result']['batch'] = '';
|
||||
$hookData['result']['notify'] = '';
|
||||
$hookData['result']['poll'] = '';
|
||||
$hookData['result']['poco'] = '';
|
||||
$hookData['result']['pubkey'] = '';
|
||||
$hookData['result']['priority'] = 0;
|
||||
$hookData['result']['guid'] = '';
|
||||
}
|
||||
|
||||
function bluesky_item_by_link(array &$hookData)
|
||||
{
|
||||
// Don't overwrite an existing result
|
||||
if (isset($hookData['item_id'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
$token = bluesky_get_token($hookData['uid']);
|
||||
if (empty($token)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!preg_match('#^' . BLUESKY_WEB . '/profile/(.+)/post/(.+)#', $hookData['uri'], $matches)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$did = bluesky_get_did($matches[1]);
|
||||
if (empty($did)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Logger::debug('Found bluesky post', ['url' => $hookData['uri'], 'handle' => $matches[1], 'did' => $did, 'cid' => $matches[2]]);
|
||||
|
||||
$uri = 'at://' . $did . '/app.bsky.feed.post/' . $matches[2];
|
||||
|
||||
$uri = bluesky_fetch_missing_post($uri, $hookData['uid'], $hookData['uid'], 0, 0);
|
||||
Logger::debug('Got post', ['profile' => $matches[1], 'cid' => $matches[2], 'result' => $uri]);
|
||||
if (!empty($uri)) {
|
||||
$item = Post::selectFirst(['id'], ['uri' => $uri, 'uid' => $hookData['uid']]);
|
||||
if (!empty($item['id'])) {
|
||||
$hookData['item_id'] = $item['id'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function bluesky_support_follow(array &$data)
|
||||
{
|
||||
if ($data['protocol'] == Protocol::BLUESKY) {
|
||||
$data['result'] = true;
|
||||
}
|
||||
}
|
||||
|
||||
function bluesky_support_probe(array &$data)
|
||||
{
|
||||
if ($data['protocol'] == Protocol::BLUESKY) {
|
||||
$data['result'] = true;
|
||||
}
|
||||
}
|
||||
|
||||
function bluesky_follow(array &$hook_data)
|
||||
{
|
||||
$token = bluesky_get_token($hook_data['uid']);
|
||||
if (empty($token)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Logger::debug('Check if contact is bluesky', ['data' => $hook_data]);
|
||||
$contact = DBA::selectFirst('contact', [], ['network' => Protocol::BLUESKY, 'url' => $hook_data['url'], 'uid' => [0, $hook_data['uid']]]);
|
||||
if (empty($contact)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$record = [
|
||||
'subject' => $contact['url'],
|
||||
'createdAt' => DateTimeFormat::utcNow(DateTimeFormat::ATOM),
|
||||
'$type' => 'app.bsky.graph.follow'
|
||||
];
|
||||
|
||||
$post = [
|
||||
'collection' => 'app.bsky.graph.follow',
|
||||
'repo' => DI::pConfig()->get($hook_data['uid'], 'bluesky', 'did'),
|
||||
'record' => $record
|
||||
];
|
||||
|
||||
$activity = bluesky_xrpc_post($hook_data['uid'], 'com.atproto.repo.createRecord', $post);
|
||||
if (!empty($activity->uri)) {
|
||||
$hook_data['contact'] = $contact;
|
||||
Logger::debug('Successfully start following', ['url' => $contact['url'], 'uri' => $activity->uri]);
|
||||
}
|
||||
}
|
||||
|
||||
function bluesky_unfollow(array &$hook_data)
|
||||
{
|
||||
$token = bluesky_get_token($hook_data['uid']);
|
||||
if (empty($token)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($hook_data['contact']['network'] != Protocol::BLUESKY) {
|
||||
return;
|
||||
}
|
||||
|
||||
$data = bluesky_xrpc_get($hook_data['uid'], 'app.bsky.actor.getProfile', ['actor' => $hook_data['contact']['url']]);
|
||||
if (empty($data->viewer) || empty($data->viewer->following)) {
|
||||
return;
|
||||
}
|
||||
|
||||
bluesky_delete_post($data->viewer->following, $hook_data['uid']);
|
||||
|
||||
$hook_data['result'] = true;
|
||||
}
|
||||
|
||||
function bluesky_block(array &$hook_data)
|
||||
{
|
||||
$token = bluesky_get_token($hook_data['uid']);
|
||||
if (empty($token)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Logger::debug('Check if contact is bluesky', ['data' => $hook_data]);
|
||||
$contact = DBA::selectFirst('contact', [], ['network' => Protocol::BLUESKY, 'url' => $hook_data['url'], 'uid' => [0, $hook_data['uid']]]);
|
||||
if (empty($contact)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$record = [
|
||||
'subject' => $contact['url'],
|
||||
'createdAt' => DateTimeFormat::utcNow(DateTimeFormat::ATOM),
|
||||
'$type' => 'app.bsky.graph.block'
|
||||
];
|
||||
|
||||
$post = [
|
||||
'collection' => 'app.bsky.graph.block',
|
||||
'repo' => DI::pConfig()->get($hook_data['uid'], 'bluesky', 'did'),
|
||||
'record' => $record
|
||||
];
|
||||
|
||||
$activity = bluesky_xrpc_post($hook_data['uid'], 'com.atproto.repo.createRecord', $post);
|
||||
if (!empty($activity->uri)) {
|
||||
$cdata = Contact::getPublicAndUserContactID($hook_data['contact']['id'], $hook_data['uid']);
|
||||
if (!empty($cdata['user'])) {
|
||||
Contact::remove($cdata['user']);
|
||||
}
|
||||
Logger::debug('Successfully blocked contact', ['url' => $hook_data['contact']['url'], 'uri' => $activity->uri]);
|
||||
}
|
||||
}
|
||||
|
||||
function bluesky_unblock(array &$hook_data)
|
||||
{
|
||||
$token = bluesky_get_token($hook_data['uid']);
|
||||
if (empty($token)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($hook_data['contact']['network'] != Protocol::BLUESKY) {
|
||||
return;
|
||||
}
|
||||
|
||||
$data = bluesky_xrpc_get($hook_data['uid'], 'app.bsky.actor.getProfile', ['actor' => $hook_data['contact']['url']]);
|
||||
if (empty($data->viewer) || empty($data->viewer->blocking)) {
|
||||
return;
|
||||
}
|
||||
|
||||
bluesky_delete_post($data->viewer->blocking, $hook_data['uid']);
|
||||
|
||||
$hook_data['result'] = true;
|
||||
}
|
||||
|
||||
function bluesky_settings(array &$data)
|
||||
{
|
||||
if (!DI::userSession()->getLocalUserId()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$enabled = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'post') ?? false;
|
||||
$def_enabled = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'post_by_default') ?? false;
|
||||
$pds = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'pds');
|
||||
$handle = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'handle');
|
||||
$did = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'did');
|
||||
$token = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'access_token');
|
||||
$import = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'import') ?? false;
|
||||
$import_feeds = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'import_feeds') ?? false;
|
||||
|
||||
$t = Renderer::getMarkupTemplate('connector_settings.tpl', 'addon/bluesky/');
|
||||
$html = Renderer::replaceMacros($t, [
|
||||
'$enable' => ['bluesky', DI::l10n()->t('Enable Bluesky Post Addon'), $enabled],
|
||||
'$bydefault' => ['bluesky_bydefault', DI::l10n()->t('Post to Bluesky by default'), $def_enabled],
|
||||
'$import' => ['bluesky_import', DI::l10n()->t('Import the remote timeline'), $import],
|
||||
'$import_feeds' => ['bluesky_import_feeds', DI::l10n()->t('Import the pinned feeds'), $import_feeds, DI::l10n()->t('When activated, Posts will be imported from all the feeds that you pinned in Bluesky.')],
|
||||
'$pds' => ['bluesky_pds', DI::l10n()->t('Personal Data Server'), $pds, DI::l10n()->t('The personal data server (PDS) is the system that hosts your profile.'), '', 'readonly'],
|
||||
'$handle' => ['bluesky_handle', DI::l10n()->t('Bluesky handle'), $handle],
|
||||
'$did' => ['bluesky_did', DI::l10n()->t('Bluesky DID'), $did, DI::l10n()->t('This is the unique identifier. It will be fetched automatically, when the handle is entered.'), '', 'readonly'],
|
||||
'$password' => ['bluesky_password', DI::l10n()->t('Bluesky app password'), '', DI::l10n()->t("Please don't add your real password here, but instead create a specific app password in the Bluesky settings.")],
|
||||
'$status' => bluesky_get_status($handle, $did, $pds, $token),
|
||||
]);
|
||||
|
||||
$data = [
|
||||
'connector' => 'bluesky',
|
||||
'title' => DI::l10n()->t('Bluesky Import/Export'),
|
||||
'image' => 'images/bluesky.jpg',
|
||||
'enabled' => $enabled,
|
||||
'html' => $html,
|
||||
];
|
||||
}
|
||||
|
||||
function bluesky_get_status(string $handle = null, string $did = null, string $pds = null, string $token = null): string
|
||||
{
|
||||
if (empty($handle)) {
|
||||
return DI::l10n()->t('You are not authenticated. Please enter your handle and the app password.');
|
||||
}
|
||||
|
||||
$status = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'status') ?? BLUEKSY_STATUS_UNKNOWN;
|
||||
|
||||
// Fallback mechanism for connection that had been established before the introduction of the status
|
||||
if ($status == BLUEKSY_STATUS_UNKNOWN) {
|
||||
if (empty($did)) {
|
||||
$status = BLUEKSY_STATUS_DID_FAIL;
|
||||
} elseif (empty($pds)) {
|
||||
$status = BLUEKSY_STATUS_PDS_FAIL;
|
||||
} elseif (!empty($token)) {
|
||||
$status = BLUEKSY_STATUS_TOKEN_OK;
|
||||
} else {
|
||||
$status = BLUEKSY_STATUS_TOKEN_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
switch ($status) {
|
||||
case BLUEKSY_STATUS_TOKEN_OK:
|
||||
return DI::l10n()->t("You are authenticated to Bluesky. For security reasons the password isn't stored.");
|
||||
case BLUEKSY_STATUS_SUCCESS:
|
||||
return DI::l10n()->t('The communication with the personal data server service (PDS) is established.');
|
||||
case BLUEKSY_STATUS_API_FAIL;
|
||||
return DI::l10n()->t('Communication issues with the personal data server service (PDS).');
|
||||
case BLUEKSY_STATUS_DID_FAIL:
|
||||
return DI::l10n()->t('The DID for the provided handle could not be detected. Please check if you entered the correct handle.');
|
||||
case BLUEKSY_STATUS_PDS_FAIL:
|
||||
return DI::l10n()->t('The personal data server service (PDS) could not be detected.');
|
||||
case BLUEKSY_STATUS_TOKEN_FAIL:
|
||||
return DI::l10n()->t('The authentication with the provided handle and password failed. Please check if you entered the correct password.');
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
function bluesky_settings_post(array &$b)
|
||||
{
|
||||
if (empty($_POST['bluesky-submit'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
$old_pds = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'pds');
|
||||
$old_handle = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'handle');
|
||||
$old_did = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'did');
|
||||
|
||||
$handle = trim($_POST['bluesky_handle'], ' @');
|
||||
|
||||
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'bluesky', 'post', intval($_POST['bluesky']));
|
||||
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'bluesky', 'post_by_default', intval($_POST['bluesky_bydefault']));
|
||||
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'bluesky', 'handle', $handle);
|
||||
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'bluesky', 'import', intval($_POST['bluesky_import']));
|
||||
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'bluesky', 'import_feeds', intval($_POST['bluesky_import_feeds']));
|
||||
|
||||
if (!empty($handle)) {
|
||||
if (empty($old_did) || $old_handle != $handle) {
|
||||
$did = bluesky_get_did(DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'handle'));
|
||||
if (empty($did)) {
|
||||
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'bluesky', 'status', BLUEKSY_STATUS_DID_FAIL);
|
||||
}
|
||||
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'bluesky', 'did', $did);
|
||||
} else {
|
||||
$did = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'did');
|
||||
}
|
||||
if (!empty($did) && (empty($old_pds) || $old_handle != $handle)) {
|
||||
$pds = bluesky_get_pds($did);
|
||||
if (empty($pds)) {
|
||||
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'bluesky', 'status', BLUEKSY_STATUS_PDS_FAIL);
|
||||
}
|
||||
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'bluesky', 'pds', $pds);
|
||||
} else {
|
||||
$pds = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'pds');
|
||||
}
|
||||
} else {
|
||||
DI::pConfig()->delete(DI::userSession()->getLocalUserId(), 'bluesky', 'did');
|
||||
DI::pConfig()->delete(DI::userSession()->getLocalUserId(), 'bluesky', 'pds');
|
||||
DI::pConfig()->delete(DI::userSession()->getLocalUserId(), 'bluesky', 'access_token');
|
||||
DI::pConfig()->delete(DI::userSession()->getLocalUserId(), 'bluesky', 'refresh_token');
|
||||
DI::pConfig()->delete(DI::userSession()->getLocalUserId(), 'bluesky', 'token_created');
|
||||
DI::pConfig()->delete(DI::userSession()->getLocalUserId(), 'bluesky', 'status');
|
||||
}
|
||||
|
||||
if (!empty($did) && !empty($pds) && !empty($_POST['bluesky_password'])) {
|
||||
bluesky_create_token(DI::userSession()->getLocalUserId(), $_POST['bluesky_password']);
|
||||
}
|
||||
}
|
||||
|
||||
function bluesky_jot_nets(array &$jotnets_fields)
|
||||
{
|
||||
if (!DI::userSession()->getLocalUserId()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'post')) {
|
||||
$jotnets_fields[] = [
|
||||
'type' => 'checkbox',
|
||||
'field' => [
|
||||
'bluesky_enable',
|
||||
DI::l10n()->t('Post to Bluesky'),
|
||||
DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'post_by_default')
|
||||
]
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
function bluesky_cron()
|
||||
{
|
||||
$last = (int)DI::keyValue()->get('bluesky_last_poll');
|
||||
|
||||
$poll_interval = intval(DI::config()->get('bluesky', 'poll_interval'));
|
||||
if (!$poll_interval) {
|
||||
$poll_interval = BLUESKY_DEFAULT_POLL_INTERVAL;
|
||||
}
|
||||
|
||||
if ($last) {
|
||||
$next = $last + ($poll_interval * 60);
|
||||
if ($next > time()) {
|
||||
Logger::notice('poll interval not reached');
|
||||
return;
|
||||
}
|
||||
}
|
||||
Logger::notice('cron_start');
|
||||
|
||||
$abandon_days = intval(DI::config()->get('system', 'account_abandon_days'));
|
||||
if ($abandon_days < 1) {
|
||||
$abandon_days = 0;
|
||||
}
|
||||
|
||||
$abandon_limit = date(DateTimeFormat::MYSQL, time() - $abandon_days * 86400);
|
||||
|
||||
$pconfigs = DBA::selectToArray('pconfig', [], ['cat' => 'bluesky', 'k' => 'import', 'v' => true]);
|
||||
foreach ($pconfigs as $pconfig) {
|
||||
if ($abandon_days != 0) {
|
||||
if (!DBA::exists('user', ["`uid` = ? AND `login_date` >= ?", $pconfig['uid'], $abandon_limit])) {
|
||||
Logger::notice('abandoned account: timeline from user will not be imported', ['user' => $pconfig['uid']]);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// Refresh the token now, so that it doesn't need to be refreshed in parallel by the following workers
|
||||
bluesky_get_token($pconfig['uid']);
|
||||
|
||||
Worker::add(['priority' => Worker::PRIORITY_MEDIUM, 'force_priority' => true], 'addon/bluesky/bluesky_timeline.php', $pconfig['uid'], $last);
|
||||
Worker::add(['priority' => Worker::PRIORITY_MEDIUM, 'force_priority' => true], 'addon/bluesky/bluesky_notifications.php', $pconfig['uid'], $last);
|
||||
|
||||
if (DI::pConfig()->get($pconfig['uid'], 'bluesky', 'import_feeds')) {
|
||||
$feeds = bluesky_get_feeds($pconfig['uid']);
|
||||
foreach ($feeds as $feed) {
|
||||
Worker::add(['priority' => Worker::PRIORITY_MEDIUM, 'force_priority' => true], 'addon/bluesky/bluesky_feed.php', $pconfig['uid'], $feed, $last);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$last_clean = DI::keyValue()->get('bluesky_last_clean');
|
||||
if (empty($last_clean) || ($last_clean + 86400 < time())) {
|
||||
Logger::notice('Start contact cleanup');
|
||||
$contacts = DBA::select('account-user-view', ['id', 'pid'], ["`network` = ? AND `uid` != ? AND `rel` = ?", Protocol::BLUESKY, 0, Contact::NOTHING]);
|
||||
while ($contact = DBA::fetch($contacts)) {
|
||||
Worker::add(Worker::PRIORITY_LOW, 'MergeContact', $contact['pid'], $contact['id'], 0);
|
||||
}
|
||||
DBA::close($contacts);
|
||||
DI::keyValue()->set('bluesky_last_clean', time());
|
||||
Logger::notice('Contact cleanup done');
|
||||
}
|
||||
|
||||
Logger::notice('cron_end');
|
||||
|
||||
DI::keyValue()->set('bluesky_last_poll', time());
|
||||
}
|
||||
|
||||
function bluesky_hook_fork(array &$b)
|
||||
{
|
||||
if ($b['name'] != 'notifier_normal') {
|
||||
return;
|
||||
}
|
||||
|
||||
$post = $b['data'];
|
||||
|
||||
if (($post['created'] !== $post['edited']) && !$post['deleted']) {
|
||||
DI::logger()->info('Editing is not supported by the addon');
|
||||
$b['execute'] = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (DI::pConfig()->get($post['uid'], 'bluesky', 'import')) {
|
||||
// Don't post if it isn't a reply to a bluesky post
|
||||
if (($post['parent'] != $post['id']) && !Post::exists(['id' => $post['parent'], 'network' => Protocol::BLUESKY])) {
|
||||
Logger::notice('No bluesky parent found', ['item' => $post['id']]);
|
||||
$b['execute'] = false;
|
||||
return;
|
||||
}
|
||||
} elseif (!strstr($post['postopts'] ?? '', 'bluesky') || ($post['parent'] != $post['id']) || $post['private']) {
|
||||
DI::logger()->info('Activities are never exported when we don\'t import the bluesky timeline', ['uid' => $post['uid']]);
|
||||
$b['execute'] = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
function bluesky_post_local(array &$b)
|
||||
{
|
||||
if ($b['edit']) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!DI::userSession()->getLocalUserId() || (DI::userSession()->getLocalUserId() != $b['uid'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($b['private'] || $b['parent']) {
|
||||
return;
|
||||
}
|
||||
|
||||
$bluesky_post = intval(DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'post'));
|
||||
$bluesky_enable = (($bluesky_post && !empty($_REQUEST['bluesky_enable'])) ? intval($_REQUEST['bluesky_enable']) : 0);
|
||||
|
||||
// if API is used, default to the chosen settings
|
||||
if ($b['api_source'] && intval(DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'post_by_default'))) {
|
||||
$bluesky_enable = 1;
|
||||
}
|
||||
|
||||
if (!$bluesky_enable) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (strlen($b['postopts'])) {
|
||||
$b['postopts'] .= ',';
|
||||
}
|
||||
|
||||
$b['postopts'] .= 'bluesky';
|
||||
}
|
||||
|
||||
function bluesky_send(array &$b)
|
||||
{
|
||||
if (($b['created'] !== $b['edited']) && !$b['deleted']) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($b['gravity'] != Item::GRAVITY_PARENT) {
|
||||
Logger::debug('Got comment', ['item' => $b]);
|
||||
|
||||
if ($b['deleted']) {
|
||||
$uri = bluesky_get_uri_class($b['uri']);
|
||||
if (empty($uri)) {
|
||||
Logger::debug('Not a bluesky post', ['uri' => $b['uri']]);
|
||||
return;
|
||||
}
|
||||
bluesky_delete_post($b['uri'], $b['uid']);
|
||||
return;
|
||||
}
|
||||
|
||||
$root = bluesky_get_uri_class($b['parent-uri']);
|
||||
$parent = bluesky_get_uri_class($b['thr-parent']);
|
||||
|
||||
if (empty($root) || empty($parent)) {
|
||||
Logger::debug('No bluesky post', ['parent' => $b['parent'], 'thr-parent' => $b['thr-parent']]);
|
||||
return;
|
||||
}
|
||||
|
||||
if ($b['gravity'] == Item::GRAVITY_COMMENT) {
|
||||
Logger::debug('Posting comment', ['root' => $root, 'parent' => $parent]);
|
||||
bluesky_create_post($b, $root, $parent);
|
||||
return;
|
||||
} elseif (in_array($b['verb'], [Activity::LIKE, Activity::ANNOUNCE])) {
|
||||
bluesky_create_activity($b, $parent);
|
||||
}
|
||||
return;
|
||||
} elseif ($b['private'] || !strstr($b['postopts'], 'bluesky')) {
|
||||
return;
|
||||
}
|
||||
|
||||
bluesky_create_post($b);
|
||||
}
|
||||
|
||||
function bluesky_create_activity(array $item, stdClass $parent = null)
|
||||
{
|
||||
$uid = $item['uid'];
|
||||
$token = bluesky_get_token($uid);
|
||||
if (empty($token)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$did = DI::pConfig()->get($uid, 'bluesky', 'did');
|
||||
|
||||
if ($item['verb'] == Activity::LIKE) {
|
||||
$record = [
|
||||
'subject' => $parent,
|
||||
'createdAt' => DateTimeFormat::utcNow(DateTimeFormat::ATOM),
|
||||
'$type' => 'app.bsky.feed.like'
|
||||
];
|
||||
|
||||
$post = [
|
||||
'collection' => 'app.bsky.feed.like',
|
||||
'repo' => $did,
|
||||
'record' => $record
|
||||
];
|
||||
} elseif ($item['verb'] == Activity::ANNOUNCE) {
|
||||
$record = [
|
||||
'subject' => $parent,
|
||||
'createdAt' => DateTimeFormat::utcNow(DateTimeFormat::ATOM),
|
||||
'$type' => 'app.bsky.feed.repost'
|
||||
];
|
||||
|
||||
$post = [
|
||||
'collection' => 'app.bsky.feed.repost',
|
||||
'repo' => $did,
|
||||
'record' => $record
|
||||
];
|
||||
}
|
||||
|
||||
$activity = bluesky_xrpc_post($uid, 'com.atproto.repo.createRecord', $post);
|
||||
if (empty($activity)) {
|
||||
return;
|
||||
}
|
||||
Logger::debug('Activity done', ['return' => $activity]);
|
||||
$uri = bluesky_get_uri($activity);
|
||||
Item::update(['extid' => $uri], ['id' => $item['id']]);
|
||||
Logger::debug('Set extid', ['id' => $item['id'], 'extid' => $activity]);
|
||||
}
|
||||
|
||||
function bluesky_create_post(array $item, stdClass $root = null, stdClass $parent = null)
|
||||
{
|
||||
$uid = $item['uid'];
|
||||
$token = bluesky_get_token($uid);
|
||||
if (empty($token)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Try to fetch the language from the post itself
|
||||
if (!empty($item['language'])) {
|
||||
$language = array_key_first(json_decode($item['language'], true));
|
||||
} else {
|
||||
$language = '';
|
||||
}
|
||||
|
||||
$did = DI::pConfig()->get($uid, 'bluesky', 'did');
|
||||
$urls = bluesky_get_urls(Post\Media::removeFromBody($item['body']));
|
||||
$item['body'] = $urls['body'];
|
||||
|
||||
$msg = Plaintext::getPost($item, 300, false, BBCode::BLUESKY);
|
||||
foreach ($msg['parts'] as $key => $part) {
|
||||
|
||||
$facets = bluesky_get_facets($part, $urls['urls']);
|
||||
|
||||
$record = [
|
||||
'text' => $facets['body'],
|
||||
'$type' => 'app.bsky.feed.post',
|
||||
'createdAt' => DateTimeFormat::utcNow(DateTimeFormat::ATOM),
|
||||
];
|
||||
|
||||
if (!empty($language)) {
|
||||
$record['langs'] = [$language];
|
||||
}
|
||||
|
||||
if (!empty($facets['facets'])) {
|
||||
$record['facets'] = $facets['facets'];
|
||||
}
|
||||
|
||||
if (!empty($root)) {
|
||||
$record['reply'] = ['root' => $root, 'parent' => $parent];
|
||||
}
|
||||
|
||||
if ($key == count($msg['parts']) - 1) {
|
||||
$record = bluesky_add_embed($uid, $msg, $record);
|
||||
if (empty($record)) {
|
||||
if (Worker::getRetrial() < 3) {
|
||||
Worker::defer();
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$post = [
|
||||
'collection' => 'app.bsky.feed.post',
|
||||
'repo' => $did,
|
||||
'record' => $record
|
||||
];
|
||||
|
||||
$parent = bluesky_xrpc_post($uid, 'com.atproto.repo.createRecord', $post);
|
||||
if (empty($parent)) {
|
||||
if ($part == 0) {
|
||||
Worker::defer();
|
||||
}
|
||||
return;
|
||||
}
|
||||
Logger::debug('Posting done', ['return' => $parent]);
|
||||
if (empty($root)) {
|
||||
$root = $parent;
|
||||
}
|
||||
if (($key == 0) && ($item['gravity'] != Item::GRAVITY_PARENT)) {
|
||||
$uri = bluesky_get_uri($parent);
|
||||
Item::update(['extid' => $uri], ['id' => $item['id']]);
|
||||
Logger::debug('Set extid', ['id' => $item['id'], 'extid' => $uri]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function bluesky_get_urls(string $body): array
|
||||
{
|
||||
// Remove all hashtag and mention links
|
||||
$body = preg_replace("/([@!])\[url\=(.*?)\](.*?)\[\/url\]/ism", '$1$3', $body);
|
||||
|
||||
$body = BBCode::expandVideoLinks($body);
|
||||
$urls = [];
|
||||
|
||||
// Search for hash tags
|
||||
if (preg_match_all("/#\[url\=(https?:.*?)\](.*?)\[\/url\]/ism", $body, $matches, PREG_SET_ORDER)) {
|
||||
foreach ($matches as $match) {
|
||||
$text = '#' . $match[2];
|
||||
$urls[] = ['tag' => $match[2], 'text' => $text, 'hash' => $text];
|
||||
$body = str_replace($match[0], $text, $body);
|
||||
}
|
||||
}
|
||||
|
||||
// Search for pure links
|
||||
if (preg_match_all("/\[url\](https?:.*?)\[\/url\]/ism", $body, $matches, PREG_SET_ORDER)) {
|
||||
foreach ($matches as $match) {
|
||||
$text = Strings::getStyledURL($match[1]);
|
||||
$hash = bluesky_get_hash_for_url($match[0], mb_strlen($text));
|
||||
$urls[] = ['url' => $match[1], 'text' => $text, 'hash' => $hash];
|
||||
$body = str_replace($match[0], $hash, $body);
|
||||
}
|
||||
}
|
||||
|
||||
// Search for links with descriptions
|
||||
if (preg_match_all("/\[url\=(https?:.*?)\](.*?)\[\/url\]/ism", $body, $matches, PREG_SET_ORDER)) {
|
||||
foreach ($matches as $match) {
|
||||
if ($match[1] == $match[2]) {
|
||||
$text = Strings::getStyledURL($match[1]);
|
||||
} else {
|
||||
$text = $match[2];
|
||||
}
|
||||
if (mb_strlen($text) < 100) {
|
||||
$hash = bluesky_get_hash_for_url($match[0], mb_strlen($text));
|
||||
$urls[] = ['url' => $match[1], 'text' => $text, 'hash' => $hash];
|
||||
$body = str_replace($match[0], $hash, $body);
|
||||
} else {
|
||||
$text = Strings::getStyledURL($match[1]);
|
||||
$hash = bluesky_get_hash_for_url($match[0], mb_strlen($text));
|
||||
$urls[] = ['url' => $match[1], 'text' => $text, 'hash' => $hash];
|
||||
$body = str_replace($match[0], $text . ' ' . $hash, $body);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ['body' => $body, 'urls' => $urls];
|
||||
}
|
||||
|
||||
function bluesky_get_hash_for_url(string $text, int $linklength): string
|
||||
{
|
||||
if ($linklength <= 10) {
|
||||
return '|' . hash('crc32', $text) . '|';
|
||||
}
|
||||
return substr('|' . hash('crc32', $text) . base64_encode($text), 0, $linklength - 2) . '|';
|
||||
}
|
||||
|
||||
function bluesky_get_facets(string $body, array $urls): array
|
||||
{
|
||||
$facets = [];
|
||||
|
||||
foreach ($urls as $url) {
|
||||
$pos = strpos($body, $url['hash']);
|
||||
if ($pos === false) {
|
||||
continue;
|
||||
}
|
||||
if ($pos > 0) {
|
||||
$prefix = substr($body, 0, $pos);
|
||||
} else {
|
||||
$prefix = '';
|
||||
}
|
||||
|
||||
$body = $prefix . $url['text'] . substr($body, $pos + strlen($url['hash']));
|
||||
|
||||
$facet = new stdClass;
|
||||
$facet->index = new stdClass;
|
||||
$facet->index->byteEnd = $pos + strlen($url['text']);
|
||||
$facet->index->byteStart = $pos;
|
||||
|
||||
$feature = new stdClass;
|
||||
|
||||
$type = '$type';
|
||||
if (!empty($url['tag'])) {
|
||||
$feature->tag = $url['tag'];
|
||||
$feature->$type = 'app.bsky.richtext.facet#tag';
|
||||
} elseif (!empty($url['url'])) {
|
||||
$feature->uri = $url['url'];
|
||||
$feature->$type = 'app.bsky.richtext.facet#link';
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
|
||||
$facet->features = [$feature];
|
||||
$facets[] = $facet;
|
||||
}
|
||||
|
||||
return ['facets' => $facets, 'body' => $body];
|
||||
}
|
||||
|
||||
function bluesky_add_embed(int $uid, array $msg, array $record): array
|
||||
{
|
||||
if (($msg['type'] != 'link') && !empty($msg['images'])) {
|
||||
$images = [];
|
||||
foreach ($msg['images'] as $image) {
|
||||
if (count($images) == 4) {
|
||||
continue;
|
||||
}
|
||||
$photo = Photo::selectFirst([], ['id' => $image['id']]);
|
||||
$blob = bluesky_upload_blob($uid, $photo);
|
||||
if (empty($blob)) {
|
||||
return [];
|
||||
}
|
||||
$images[] = ['alt' => $image['description'] ?? '', 'image' => $blob];
|
||||
}
|
||||
if (!empty($images)) {
|
||||
$record['embed'] = ['$type' => 'app.bsky.embed.images', 'images' => $images];
|
||||
}
|
||||
} elseif ($msg['type'] == 'link') {
|
||||
$record['embed'] = [
|
||||
'$type' => 'app.bsky.embed.external',
|
||||
'external' => [
|
||||
'uri' => $msg['url'],
|
||||
'title' => $msg['title'] ?? '',
|
||||
'description' => $msg['description'] ?? '',
|
||||
]
|
||||
];
|
||||
if (!empty($msg['image'])) {
|
||||
$photo = Photo::createPhotoForExternalResource($msg['image']);
|
||||
$blob = bluesky_upload_blob($uid, $photo);
|
||||
if (!empty($blob)) {
|
||||
$record['embed']['external']['thumb'] = $blob;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $record;
|
||||
}
|
||||
|
||||
function bluesky_upload_blob(int $uid, array $photo): ?stdClass
|
||||
{
|
||||
$retrial = Worker::getRetrial();
|
||||
$content = Photo::getImageForPhoto($photo);
|
||||
|
||||
$picture = new Image($content, $photo['type']);
|
||||
$height = $picture->getHeight();
|
||||
$width = $picture->getWidth();
|
||||
$size = strlen($content);
|
||||
|
||||
$picture = Photo::resizeToFileSize($picture, BLUESKY_IMAGE_SIZE[$retrial]);
|
||||
$new_height = $picture->getHeight();
|
||||
$new_width = $picture->getWidth();
|
||||
$content = $picture->asString();
|
||||
$new_size = strlen($content);
|
||||
|
||||
Logger::info('Uploading', ['uid' => $uid, 'retrial' => $retrial, 'height' => $new_height, 'width' => $new_width, 'size' => $new_size, 'orig-height' => $height, 'orig-width' => $width, 'orig-size' => $size]);
|
||||
|
||||
$data = bluesky_post($uid, '/xrpc/com.atproto.repo.uploadBlob', $content, ['Content-type' => $photo['type'], 'Authorization' => ['Bearer ' . bluesky_get_token($uid)]]);
|
||||
if (empty($data)) {
|
||||
Logger::info('Uploading failed', ['uid' => $uid, 'retrial' => $retrial, 'height' => $new_height, 'width' => $new_width, 'size' => $new_size, 'orig-height' => $height, 'orig-width' => $width, 'orig-size' => $size]);
|
||||
return null;
|
||||
}
|
||||
|
||||
Logger::debug('Uploaded blob', ['return' => $data, 'uid' => $uid, 'retrial' => $retrial, 'height' => $new_height, 'width' => $new_width, 'size' => $new_size, 'orig-height' => $height, 'orig-width' => $width, 'orig-size' => $size]);
|
||||
return $data->blob;
|
||||
}
|
||||
|
||||
function bluesky_delete_post(string $uri, int $uid)
|
||||
{
|
||||
$parts = bluesky_get_uri_parts($uri);
|
||||
if (empty($parts)) {
|
||||
Logger::debug('No uri delected', ['uri' => $uri]);
|
||||
return;
|
||||
}
|
||||
bluesky_xrpc_post($uid, 'com.atproto.repo.deleteRecord', $parts);
|
||||
Logger::debug('Deleted', ['parts' => $parts]);
|
||||
}
|
||||
|
||||
function bluesky_fetch_timeline(int $uid, int $last_poll)
|
||||
{
|
||||
$data = bluesky_xrpc_get($uid, 'app.bsky.feed.getTimeline');
|
||||
if (empty($data)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (empty($data->feed)) {
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (array_reverse($data->feed) as $entry) {
|
||||
bluesky_process_post($entry->post, $uid, Item::PR_NONE, 0, $last_poll);
|
||||
if (!empty($entry->reason)) {
|
||||
bluesky_process_reason($entry->reason, bluesky_get_uri($entry->post), $uid);
|
||||
}
|
||||
}
|
||||
|
||||
// @todo Support paging
|
||||
// [cursor] => 1684670516000::bafyreidq3ilwslmlx72jf5vrk367xcc63s6lrhzlyup2bi3zwcvso6w2vi
|
||||
}
|
||||
|
||||
function bluesky_process_reason(stdClass $reason, string $uri, int $uid)
|
||||
{
|
||||
$type = '$type';
|
||||
if ($reason->$type != 'app.bsky.feed.defs#reasonRepost') {
|
||||
return;
|
||||
}
|
||||
|
||||
$contact = bluesky_get_contact($reason->by, $uid, $uid);
|
||||
|
||||
$item = [
|
||||
'network' => Protocol::BLUESKY,
|
||||
'uid' => $uid,
|
||||
'wall' => false,
|
||||
'uri' => $reason->by->did . '/app.bsky.feed.repost/' . $reason->indexedAt,
|
||||
'private' => Item::UNLISTED,
|
||||
'verb' => Activity::POST,
|
||||
'contact-id' => $contact['id'],
|
||||
'author-name' => $contact['name'],
|
||||
'author-link' => $contact['url'],
|
||||
'author-avatar' => $contact['avatar'],
|
||||
'verb' => Activity::ANNOUNCE,
|
||||
'body' => Activity::ANNOUNCE,
|
||||
'gravity' => Item::GRAVITY_ACTIVITY,
|
||||
'object-type' => Activity\ObjectType::NOTE,
|
||||
'thr-parent' => $uri,
|
||||
];
|
||||
|
||||
if (Post::exists(['uri' => $item['uri'], 'uid' => $uid])) {
|
||||
return;
|
||||
}
|
||||
|
||||
$item['guid'] = Item::guidFromUri($item['uri'], $contact['alias']);
|
||||
$item['owner-name'] = $item['author-name'];
|
||||
$item['owner-link'] = $item['author-link'];
|
||||
$item['owner-avatar'] = $item['author-avatar'];
|
||||
if (Item::insert($item)) {
|
||||
$cdata = Contact::getPublicAndUserContactID($contact['id'], $uid);
|
||||
Item::update(['post-reason' => Item::PR_ANNOUNCEMENT, 'causer-id' => $cdata['public']], ['uri' => $uri, 'uid' => $uid]);
|
||||
}
|
||||
}
|
||||
|
||||
function bluesky_fetch_notifications(int $uid, int $last_poll)
|
||||
{
|
||||
$data = bluesky_xrpc_get($uid, 'app.bsky.notification.listNotifications');
|
||||
if (empty($data->notifications)) {
|
||||
return;
|
||||
}
|
||||
foreach ($data->notifications as $notification) {
|
||||
$uri = bluesky_get_uri($notification);
|
||||
if (Post::exists(['uri' => $uri, 'uid' => $uid]) || Post::exists(['extid' => $uri, 'uid' => $uid])) {
|
||||
Logger::debug('Notification already processed', ['uid' => $uid, 'reason' => $notification->reason, 'uri' => $uri, 'indexedAt' => $notification->indexedAt]);
|
||||
continue;
|
||||
}
|
||||
Logger::debug('Process notification', ['uid' => $uid, 'reason' => $notification->reason, 'uri' => $uri, 'indexedAt' => $notification->indexedAt]);
|
||||
switch ($notification->reason) {
|
||||
case 'like':
|
||||
$item = bluesky_get_header($notification, $uri, $uid, $uid);
|
||||
$item['gravity'] = Item::GRAVITY_ACTIVITY;
|
||||
$item['body'] = $item['verb'] = Activity::LIKE;
|
||||
$item['thr-parent'] = bluesky_get_uri($notification->record->subject);
|
||||
$item['thr-parent'] = bluesky_fetch_missing_post($item['thr-parent'], $uid, $uid, $item['contact-id'], 0, $last_poll);
|
||||
if (!empty($item['thr-parent'])) {
|
||||
$data = Item::insert($item);
|
||||
Logger::debug('Got like', ['uid' => $uid, 'result' => $data, 'uri' => $uri]);
|
||||
} else {
|
||||
Logger::info('Thread parent not found', ['uid' => $uid, 'parent' => $item['thr-parent'], 'uri' => $uri]);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'repost':
|
||||
$item = bluesky_get_header($notification, $uri, $uid, $uid);
|
||||
$item['gravity'] = Item::GRAVITY_ACTIVITY;
|
||||
$item['body'] = $item['verb'] = Activity::ANNOUNCE;
|
||||
$item['thr-parent'] = bluesky_get_uri($notification->record->subject);
|
||||
$item['thr-parent'] = bluesky_fetch_missing_post($item['thr-parent'], $uid, $uid, $item['contact-id'], 0, $last_poll);
|
||||
if (!empty($item['thr-parent'])) {
|
||||
$data = Item::insert($item);
|
||||
Logger::debug('Got repost', ['uid' => $uid, 'result' => $data, 'uri' => $uri]);
|
||||
} else {
|
||||
Logger::info('Thread parent not found', ['uid' => $uid, 'parent' => $item['thr-parent'], 'uri' => $uri]);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'follow':
|
||||
$contact = bluesky_get_contact($notification->author, $uid, $uid);
|
||||
Logger::debug('New follower', ['uid' => $uid, 'nick' => $contact['nick'], 'uri' => $uri]);
|
||||
break;
|
||||
|
||||
case 'mention':
|
||||
$data = bluesky_process_post($notification, $uid, Item::PR_PUSHED, 0, $last_poll);
|
||||
Logger::debug('Got mention', ['uid' => $uid, 'result' => $data, 'uri' => $uri]);
|
||||
break;
|
||||
|
||||
case 'reply':
|
||||
$data = bluesky_process_post($notification, $uid, Item::PR_PUSHED, 0, $last_poll);
|
||||
Logger::debug('Got reply', ['uid' => $uid, 'result' => $data, 'uri' => $uri]);
|
||||
break;
|
||||
|
||||
case 'quote':
|
||||
$data = bluesky_process_post($notification, $uid, Item::PR_PUSHED, 0, $last_poll);
|
||||
Logger::debug('Got quote', ['uid' => $uid, 'result' => $data, 'uri' => $uri]);
|
||||
break;
|
||||
|
||||
default:
|
||||
Logger::notice('Unhandled reason', ['reason' => $notification->reason, 'uri' => $uri]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function bluesky_fetch_feed(int $uid, string $feed, int $last_poll)
|
||||
{
|
||||
$data = bluesky_xrpc_get($uid, 'app.bsky.feed.getFeed', ['feed' => $feed]);
|
||||
if (empty($data)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (empty($data->feed)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$feeddata = bluesky_xrpc_get($uid, 'app.bsky.feed.getFeedGenerator', ['feed' => $feed]);
|
||||
if (!empty($feeddata)) {
|
||||
$feedurl = $feeddata->view->uri;
|
||||
$feedname = $feeddata->view->displayName;
|
||||
} else {
|
||||
$feedurl = $feed;
|
||||
$feedname = $feed;
|
||||
}
|
||||
|
||||
foreach (array_reverse($data->feed) as $entry) {
|
||||
$contact = bluesky_get_contact($entry->post->author, 0, $uid);
|
||||
$languages = $entry->post->record->langs ?? [];
|
||||
|
||||
if (!Relay::isWantedLanguage($entry->post->record->text, 0, $contact['id'] ?? 0, $languages)) {
|
||||
Logger::debug('Unwanted language detected', ['text' => $entry->post->record->text]);
|
||||
continue;
|
||||
}
|
||||
$id = bluesky_process_post($entry->post, $uid, Item::PR_TAG, 0, $last_poll);
|
||||
if (!empty($id)) {
|
||||
$post = Post::selectFirst(['uri-id'], ['id' => $id]);
|
||||
if (!empty($post['uri-id'])) {
|
||||
$stored = Post\Category::storeFileByURIId($post['uri-id'], $uid, Post\Category::SUBCRIPTION, $feedname, $feedurl);
|
||||
Logger::debug('Stored tag subscription for user', ['uri-id' => $post['uri-id'], 'uid' => $uid, 'name' => $feedname, 'url' => $feedurl, 'stored' => $stored]);
|
||||
} else {
|
||||
Logger::notice('Post not found', ['id' => $id, 'entry' => $entry]);
|
||||
}
|
||||
}
|
||||
if (!empty($entry->reason)) {
|
||||
bluesky_process_reason($entry->reason, bluesky_get_uri($entry->post), $uid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function bluesky_process_post(stdClass $post, int $uid, int $post_reason, int $level, int $last_poll): int
|
||||
{
|
||||
$uri = bluesky_get_uri($post);
|
||||
|
||||
if ($id = Post::selectFirst(['id'], ['uri' => $uri, 'uid' => $uid])) {
|
||||
return $id['id'];
|
||||
}
|
||||
|
||||
if ($id = Post::selectFirst(['id'], ['extid' => $uri, 'uid' => $uid])) {
|
||||
return $id['id'];
|
||||
}
|
||||
|
||||
Logger::debug('Importing post', ['uid' => $uid, 'indexedAt' => $post->indexedAt, 'uri' => $post->uri, 'cid' => $post->cid, 'root' => $post->record->reply->root ?? '']);
|
||||
|
||||
$item = bluesky_get_header($post, $uri, $uid, $uid);
|
||||
$item = bluesky_get_content($item, $post->record, $uri, $uid, $uid, $level, $last_poll);
|
||||
if (empty($item)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!empty($post->embed)) {
|
||||
$item = bluesky_add_media($post->embed, $item, $uid, $level, $last_poll);
|
||||
}
|
||||
|
||||
if (empty($item['post-reason'])) {
|
||||
$item['post-reason'] = $post_reason;
|
||||
}
|
||||
|
||||
return Item::insert($item);
|
||||
}
|
||||
|
||||
function bluesky_get_header(stdClass $post, string $uri, int $uid, int $fetch_uid): array
|
||||
{
|
||||
$parts = bluesky_get_uri_parts($uri);
|
||||
if (empty($post->author)) {
|
||||
return [];
|
||||
}
|
||||
$contact = bluesky_get_contact($post->author, $uid, $fetch_uid);
|
||||
$item = [
|
||||
'network' => Protocol::BLUESKY,
|
||||
'uid' => $uid,
|
||||
'wall' => false,
|
||||
'uri' => $uri,
|
||||
'guid' => $post->cid,
|
||||
'private' => Item::UNLISTED,
|
||||
'verb' => Activity::POST,
|
||||
'contact-id' => $contact['id'],
|
||||
'author-name' => $contact['name'],
|
||||
'author-link' => $contact['url'],
|
||||
'author-avatar' => $contact['avatar'],
|
||||
'plink' => $contact['alias'] . '/post/' . $parts->rkey,
|
||||
'source' => json_encode($post),
|
||||
];
|
||||
|
||||
$item['uri-id'] = ItemURI::getIdByURI($uri);
|
||||
$item['owner-name'] = $item['author-name'];
|
||||
$item['owner-link'] = $item['author-link'];
|
||||
$item['owner-avatar'] = $item['author-avatar'];
|
||||
|
||||
if (in_array($contact['rel'], [Contact::SHARING, Contact::FRIEND])) {
|
||||
$item['post-reason'] = Item::PR_FOLLOWER;
|
||||
}
|
||||
|
||||
return $item;
|
||||
}
|
||||
|
||||
function bluesky_get_content(array $item, stdClass $record, string $uri, int $uid, int $fetch_uid, int $level, int $last_poll): array
|
||||
{
|
||||
if (empty($item)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
if (!empty($record->reply)) {
|
||||
$item['parent-uri'] = bluesky_get_uri($record->reply->root);
|
||||
if ($item['parent-uri'] != $uri) {
|
||||
$item['parent-uri'] = bluesky_fetch_missing_post($item['parent-uri'], $uid, $fetch_uid, $item['contact-id'], $level, $last_poll);
|
||||
if (empty($item['parent-uri'])) {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
$item['thr-parent'] = bluesky_get_uri($record->reply->parent);
|
||||
if (!in_array($item['thr-parent'], [$uri, $item['parent-uri']])) {
|
||||
$item['thr-parent'] = bluesky_fetch_missing_post($item['thr-parent'], $uid, $fetch_uid, $item['contact-id'], $level, $last_poll, $item['parent-uri']);
|
||||
if (empty($item['thr-parent'])) {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$item['body'] = bluesky_get_text($record, $item['uri-id']);
|
||||
$item['created'] = DateTimeFormat::utc($record->createdAt, DateTimeFormat::MYSQL);
|
||||
$item['transmitted-languages'] = $record->langs ?? [];
|
||||
|
||||
if (($last_poll != 0) && strtotime($item['created']) > $last_poll) {
|
||||
$item['received'] = $item['created'];
|
||||
}
|
||||
|
||||
return $item;
|
||||
}
|
||||
|
||||
function bluesky_get_text(stdClass $record, int $uri_id): string
|
||||
{
|
||||
$text = $record->text ?? '';
|
||||
|
||||
if (empty($record->facets)) {
|
||||
return $text;
|
||||
}
|
||||
|
||||
$facets = [];
|
||||
foreach ($record->facets as $facet) {
|
||||
$facets[$facet->index->byteStart] = $facet;
|
||||
}
|
||||
krsort($facets);
|
||||
|
||||
foreach ($facets as $facet) {
|
||||
$prefix = substr($text, 0, $facet->index->byteStart);
|
||||
$linktext = substr($text, $facet->index->byteStart, $facet->index->byteEnd - $facet->index->byteStart);
|
||||
$suffix = substr($text, $facet->index->byteEnd);
|
||||
|
||||
$url = '';
|
||||
$type = '$type';
|
||||
foreach ($facet->features as $feature) {
|
||||
|
||||
switch ($feature->$type) {
|
||||
case 'app.bsky.richtext.facet#link':
|
||||
$url = $feature->uri;
|
||||
break;
|
||||
|
||||
case 'app.bsky.richtext.facet#mention':
|
||||
$contact = Contact::getByURL($feature->did, null, ['id']);
|
||||
if (!empty($contact['id'])) {
|
||||
$url = DI::baseUrl() . '/contact/' . $contact['id'];
|
||||
if (substr($linktext, 0, 1) == '@') {
|
||||
$prefix .= '@';
|
||||
$linktext = substr($linktext, 1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 'app.bsky.richtext.facet#tag';
|
||||
Tag::store($uri_id, Tag::HASHTAG, $feature->tag);
|
||||
$url = DI::baseUrl() . '/search?tag=' . urlencode($feature->tag);
|
||||
$linktext = '#' . $feature->tag;
|
||||
break;
|
||||
|
||||
default:
|
||||
Logger::notice('Unhandled feature type', ['type' => $feature->$type, 'feature' => $feature, 'record' => $record]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!empty($url)) {
|
||||
$text = $prefix . '[url=' . $url . ']' . $linktext . '[/url]' . $suffix;
|
||||
}
|
||||
}
|
||||
return $text;
|
||||
}
|
||||
|
||||
function bluesky_add_media(stdClass $embed, array $item, int $fetch_uid, int $level, int $last_poll): array
|
||||
{
|
||||
$type = '$type';
|
||||
switch ($embed->$type) {
|
||||
case 'app.bsky.embed.images#view':
|
||||
foreach ($embed->images as $image) {
|
||||
$media = [
|
||||
'uri-id' => $item['uri-id'],
|
||||
'type' => Post\Media::IMAGE,
|
||||
'url' => $image->fullsize,
|
||||
'preview' => $image->thumb,
|
||||
'description' => $image->alt,
|
||||
];
|
||||
Post\Media::insert($media);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'app.bsky.embed.external#view':
|
||||
$media = [
|
||||
'uri-id' => $item['uri-id'],
|
||||
'type' => Post\Media::HTML,
|
||||
'url' => $embed->external->uri,
|
||||
'name' => $embed->external->title,
|
||||
'description' => $embed->external->description,
|
||||
];
|
||||
Post\Media::insert($media);
|
||||
break;
|
||||
|
||||
case 'app.bsky.embed.record#view':
|
||||
$uri = bluesky_get_uri($embed->record);
|
||||
$shared = Post::selectFirst(['uri-id'], ['uri' => $uri, 'uid' => $item['uid']]);
|
||||
if (empty($shared)) {
|
||||
if (empty($embed->record->value)) {
|
||||
Logger::info('Record has got no value', ['record' => $embed->record]);
|
||||
break;
|
||||
}
|
||||
$shared = bluesky_get_header($embed->record, $uri, 0, $fetch_uid);
|
||||
$shared = bluesky_get_content($shared, $embed->record->value, $uri, $item['uid'], $fetch_uid, $level, $last_poll);
|
||||
if (!empty($shared)) {
|
||||
if (!empty($embed->record->embeds)) {
|
||||
foreach ($embed->record->embeds as $single) {
|
||||
$shared = bluesky_add_media($single, $shared, $fetch_uid, $level, $last_poll);
|
||||
}
|
||||
}
|
||||
Item::insert($shared);
|
||||
}
|
||||
}
|
||||
if (!empty($shared['uri-id'])) {
|
||||
$item['quote-uri-id'] = $shared['uri-id'];
|
||||
}
|
||||
break;
|
||||
|
||||
case 'app.bsky.embed.recordWithMedia#view':
|
||||
$uri = bluesky_get_uri($embed->record->record);
|
||||
$shared = Post::selectFirst(['uri-id'], ['uri' => $uri, 'uid' => $item['uid']]);
|
||||
if (empty($shared)) {
|
||||
$shared = bluesky_get_header($embed->record->record, $uri, 0, $fetch_uid);
|
||||
$shared = bluesky_get_content($shared, $embed->record->record->value, $uri, $item['uid'], $fetch_uid, $level, $last_poll);
|
||||
if (!empty($shared)) {
|
||||
if (!empty($embed->record->record->embeds)) {
|
||||
foreach ($embed->record->record->embeds as $single) {
|
||||
$shared = bluesky_add_media($single, $shared, $fetch_uid, $level, $last_poll);
|
||||
}
|
||||
}
|
||||
Item::insert($shared);
|
||||
}
|
||||
}
|
||||
if (!empty($shared['uri-id'])) {
|
||||
$item['quote-uri-id'] = $shared['uri-id'];
|
||||
}
|
||||
|
||||
if (!empty($embed->media)) {
|
||||
$item = bluesky_add_media($embed->media, $item, $fetch_uid, $level, $last_poll);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
Logger::notice('Unhandled embed type', ['type' => $embed->$type, 'embed' => $embed]);
|
||||
break;
|
||||
}
|
||||
return $item;
|
||||
}
|
||||
|
||||
function bluesky_get_uri(stdClass $post): string
|
||||
{
|
||||
if (empty($post->cid)) {
|
||||
Logger::info('Invalid URI', ['post' => $post]);
|
||||
return '';
|
||||
}
|
||||
return $post->uri . ':' . $post->cid;
|
||||
}
|
||||
|
||||
function bluesky_get_uri_class(string $uri): ?stdClass
|
||||
{
|
||||
if (empty($uri)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$elements = explode(':', $uri);
|
||||
if (empty($elements) || ($elements[0] != 'at')) {
|
||||
$post = Post::selectFirstPost(['extid'], ['uri' => $uri]);
|
||||
return bluesky_get_uri_class($post['extid'] ?? '');
|
||||
}
|
||||
|
||||
$class = new stdClass;
|
||||
|
||||
$class->cid = array_pop($elements);
|
||||
$class->uri = implode(':', $elements);
|
||||
|
||||
if ((substr_count($class->uri, '/') == 2) && (substr_count($class->cid, '/') == 2)) {
|
||||
$class->uri .= ':' . $class->cid;
|
||||
$class->cid = '';
|
||||
}
|
||||
|
||||
return $class;
|
||||
}
|
||||
|
||||
function bluesky_get_uri_parts(string $uri): ?stdClass
|
||||
{
|
||||
$class = bluesky_get_uri_class($uri);
|
||||
if (empty($class)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$parts = explode('/', substr($class->uri, 5));
|
||||
|
||||
$class = new stdClass;
|
||||
|
||||
$class->repo = $parts[0];
|
||||
$class->collection = $parts[1];
|
||||
$class->rkey = $parts[2];
|
||||
|
||||
return $class;
|
||||
}
|
||||
|
||||
function bluesky_fetch_missing_post(string $uri, int $uid, int $fetch_uid, int $causer, int $level, int $last_poll = 0, string $fallback = ''): string
|
||||
{
|
||||
$fetched_uri = bluesky_fetch_post($uri, $uid);
|
||||
if (!empty($fetched_uri)) {
|
||||
return $fetched_uri;
|
||||
}
|
||||
|
||||
if (++$level > 100) {
|
||||
Logger::info('Recursion level too deep', ['level' => $level, 'uid' => $uid, 'uri' => $uri, 'fallback' => $fallback]);
|
||||
// When the level is too deep we will fallback to the parent uri.
|
||||
// Allthough the threading won't be correct, we at least had stored all posts and won't try again
|
||||
return $fallback;
|
||||
}
|
||||
|
||||
$class = bluesky_get_uri_class($uri);
|
||||
$fetch_uri = $class->uri;
|
||||
|
||||
Logger::debug('Fetch missing post', ['level' => $level, 'uid' => $uid, 'uri' => $uri]);
|
||||
$data = bluesky_xrpc_get($fetch_uid, 'app.bsky.feed.getPostThread', ['uri' => $fetch_uri]);
|
||||
if (empty($data)) {
|
||||
Logger::info('Thread was not fetched', ['level' => $level, 'uid' => $uid, 'uri' => $uri, 'fallback' => $fallback]);
|
||||
return $fallback;
|
||||
}
|
||||
|
||||
Logger::debug('Reply count', ['level' => $level, 'uid' => $uid, 'uri' => $uri]);
|
||||
|
||||
if ($causer != 0) {
|
||||
$cdata = Contact::getPublicAndUserContactID($causer, $uid);
|
||||
} else {
|
||||
$cdata = [];
|
||||
}
|
||||
|
||||
return bluesky_process_thread($data->thread, $uid, $fetch_uid, $cdata, $level, $last_poll);
|
||||
}
|
||||
|
||||
function bluesky_fetch_post(string $uri, int $uid): string
|
||||
{
|
||||
if (Post::exists(['uri' => $uri, 'uid' => [$uid, 0]])) {
|
||||
Logger::debug('Post exists', ['uri' => $uri]);
|
||||
return $uri;
|
||||
}
|
||||
|
||||
$reply = Post::selectFirst(['uri'], ['extid' => $uri, 'uid' => [$uid, 0]]);
|
||||
if (!empty($reply['uri'])) {
|
||||
Logger::debug('Post with extid exists', ['uri' => $uri]);
|
||||
return $reply['uri'];
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
function bluesky_process_thread(stdClass $thread, int $uid, int $fetch_uid, array $cdata, int $level, int $last_poll): string
|
||||
{
|
||||
if (empty($thread->post)) {
|
||||
Logger::info('Invalid post', ['post' => $thread]);
|
||||
return '';
|
||||
}
|
||||
$uri = bluesky_get_uri($thread->post);
|
||||
|
||||
$fetched_uri = bluesky_fetch_post($uri, $uid);
|
||||
if (empty($fetched_uri)) {
|
||||
Logger::debug('Process missing post', ['uri' => $uri]);
|
||||
$item = bluesky_get_header($thread->post, $uri, $uid, $uid);
|
||||
$item = bluesky_get_content($item, $thread->post->record, $uri, $uid, $fetch_uid, $level, $last_poll);
|
||||
if (!empty($item)) {
|
||||
$item['post-reason'] = Item::PR_FETCHED;
|
||||
|
||||
if (!empty($cdata['public'])) {
|
||||
$item['causer-id'] = $cdata['public'];
|
||||
}
|
||||
|
||||
if (!empty($thread->post->embed)) {
|
||||
$item = bluesky_add_media($thread->post->embed, $item, $uid, $level, $last_poll);
|
||||
}
|
||||
$id = Item::insert($item);
|
||||
if (!$id) {
|
||||
Logger::info('Item has not not been stored', ['uri' => $uri]);
|
||||
return '';
|
||||
}
|
||||
Logger::debug('Stored item', ['id' => $id, 'uri' => $uri]);
|
||||
} else {
|
||||
Logger::info('Post has not not been fetched', ['uri' => $uri]);
|
||||
return '';
|
||||
}
|
||||
} else {
|
||||
Logger::debug('Post exists', ['uri' => $uri]);
|
||||
$uri = $fetched_uri;
|
||||
}
|
||||
|
||||
foreach ($thread->replies ?? [] as $reply) {
|
||||
$reply_uri = bluesky_process_thread($reply, $uid, $fetch_uid, $cdata, $level, $last_poll);
|
||||
Logger::debug('Reply has been processed', ['uri' => $uri, 'reply' => $reply_uri]);
|
||||
}
|
||||
|
||||
return $uri;
|
||||
}
|
||||
|
||||
function bluesky_get_contact(stdClass $author, int $uid, int $fetch_uid): array
|
||||
{
|
||||
$condition = ['network' => Protocol::BLUESKY, 'uid' => 0, 'url' => $author->did];
|
||||
$contact = Contact::selectFirst(['id', 'updated'], $condition);
|
||||
|
||||
$update = empty($contact) || $contact['updated'] < DateTimeFormat::utc('now -24 hours');
|
||||
|
||||
$public_fields = $fields = bluesky_get_contact_fields($author, $fetch_uid, $update);
|
||||
|
||||
$public_fields['uid'] = 0;
|
||||
$public_fields['rel'] = Contact::NOTHING;
|
||||
|
||||
if (empty($contact)) {
|
||||
$cid = Contact::insert($public_fields);
|
||||
} else {
|
||||
$cid = $contact['id'];
|
||||
Contact::update($public_fields, ['id' => $cid], true);
|
||||
}
|
||||
|
||||
if ($uid != 0) {
|
||||
$condition = ['network' => Protocol::BLUESKY, 'uid' => $uid, 'url' => $author->did];
|
||||
|
||||
$contact = Contact::selectFirst(['id', 'rel', 'uid'], $condition);
|
||||
if (!isset($fields['rel']) && isset($contact['rel'])) {
|
||||
$fields['rel'] = $contact['rel'];
|
||||
} elseif (!isset($fields['rel'])) {
|
||||
$fields['rel'] = Contact::NOTHING;
|
||||
}
|
||||
}
|
||||
|
||||
if (($uid != 0) && ($fields['rel'] != Contact::NOTHING)) {
|
||||
if (empty($contact)) {
|
||||
$cid = Contact::insert($fields);
|
||||
} else {
|
||||
$cid = $contact['id'];
|
||||
Contact::update($fields, ['id' => $cid], true);
|
||||
}
|
||||
Logger::debug('Get user contact', ['id' => $cid, 'uid' => $uid, 'update' => $update]);
|
||||
} else {
|
||||
Logger::debug('Get public contact', ['id' => $cid, 'uid' => $uid, 'update' => $update]);
|
||||
}
|
||||
if (!empty($author->avatar)) {
|
||||
Contact::updateAvatar($cid, $author->avatar);
|
||||
}
|
||||
|
||||
return Contact::getById($cid);
|
||||
}
|
||||
|
||||
function bluesky_get_contact_fields(stdClass $author, int $uid, bool $update): array
|
||||
{
|
||||
$fields = [
|
||||
'uid' => $uid,
|
||||
'network' => Protocol::BLUESKY,
|
||||
'priority' => 1,
|
||||
'writable' => true,
|
||||
'blocked' => false,
|
||||
'readonly' => false,
|
||||
'pending' => false,
|
||||
'url' => $author->did,
|
||||
'nurl' => $author->did,
|
||||
'alias' => BLUESKY_WEB . '/profile/' . $author->handle,
|
||||
'name' => $author->displayName ?? $author->handle,
|
||||
'nick' => $author->handle,
|
||||
'addr' => $author->handle,
|
||||
];
|
||||
|
||||
if (!$update) {
|
||||
Logger::debug('Got contact fields', ['uid' => $uid, 'url' => $fields['url']]);
|
||||
return $fields;
|
||||
}
|
||||
|
||||
$fields['baseurl'] = bluesky_get_pds($author->did);
|
||||
if (!empty($fields['baseurl'])) {
|
||||
GServer::check($fields['baseurl'], Protocol::BLUESKY);
|
||||
$fields['gsid'] = GServer::getID($fields['baseurl'], true);
|
||||
}
|
||||
|
||||
$data = bluesky_xrpc_get($uid, 'app.bsky.actor.getProfile', ['actor' => $author->did]);
|
||||
if (empty($data)) {
|
||||
Logger::debug('Error fetching contact fields', ['uid' => $uid, 'url' => $fields['url']]);
|
||||
return $fields;
|
||||
}
|
||||
|
||||
$fields['updated'] = DateTimeFormat::utcNow(DateTimeFormat::MYSQL);
|
||||
|
||||
if (!empty($data->description)) {
|
||||
$fields['about'] = HTML::toBBCode($data->description);
|
||||
}
|
||||
|
||||
if (!empty($data->banner)) {
|
||||
$fields['header'] = $data->banner;
|
||||
}
|
||||
|
||||
if (!empty($data->viewer)) {
|
||||
if (!empty($data->viewer->following) && !empty($data->viewer->followedBy)) {
|
||||
$fields['rel'] = Contact::FRIEND;
|
||||
} elseif (!empty($data->viewer->following) && empty($data->viewer->followedBy)) {
|
||||
$fields['rel'] = Contact::SHARING;
|
||||
} elseif (empty($data->viewer->following) && !empty($data->viewer->followedBy)) {
|
||||
$fields['rel'] = Contact::FOLLOWER;
|
||||
} else {
|
||||
$fields['rel'] = Contact::NOTHING;
|
||||
}
|
||||
}
|
||||
|
||||
Logger::debug('Got updated contact fields', ['uid' => $uid, 'url' => $fields['url']]);
|
||||
return $fields;
|
||||
}
|
||||
|
||||
function bluesky_get_feeds(int $uid): array
|
||||
{
|
||||
$type = '$type';
|
||||
$preferences = bluesky_get_preferences($uid);
|
||||
foreach ($preferences->preferences as $preference) {
|
||||
if ($preference->$type == 'app.bsky.actor.defs#savedFeedsPref') {
|
||||
return $preference->pinned ?? [];
|
||||
}
|
||||
}
|
||||
return [];
|
||||
}
|
||||
|
||||
function bluesky_get_preferences(int $uid): stdClass
|
||||
{
|
||||
$cachekey = 'bluesky:preferences:' . $uid;
|
||||
$data = DI::cache()->get($cachekey);
|
||||
if (!is_null($data)) {
|
||||
return $data;
|
||||
}
|
||||
|
||||
$data = bluesky_xrpc_get($uid, 'app.bsky.actor.getPreferences');
|
||||
|
||||
DI::cache()->set($cachekey, $data, Duration::HOUR);
|
||||
return $data;
|
||||
}
|
||||
|
||||
function bluesky_get_did(string $handle): string
|
||||
{
|
||||
$data = bluesky_get(BLUESKY_PDS . '/xrpc/com.atproto.identity.resolveHandle?handle=' . urlencode($handle));
|
||||
if (empty($data)) {
|
||||
return '';
|
||||
}
|
||||
Logger::debug('Got DID', ['return' => $data]);
|
||||
return $data->did;
|
||||
}
|
||||
|
||||
function bluesky_get_user_pds(int $uid): string
|
||||
{
|
||||
$pds = DI::pConfig()->get($uid, 'bluesky', 'pds');
|
||||
if (!empty($pds)) {
|
||||
return $pds;
|
||||
}
|
||||
$did = DI::pConfig()->get($uid, 'bluesky', 'did');
|
||||
if (empty($did)) {
|
||||
Logger::notice('Empty did for user', ['uid' => $uid]);
|
||||
return '';
|
||||
}
|
||||
$pds = bluesky_get_pds($did);
|
||||
DI::pConfig()->set($uid, 'bluesky', 'pds', $pds);
|
||||
return $pds;
|
||||
}
|
||||
|
||||
function bluesky_get_pds(string $did): ?string
|
||||
{
|
||||
$data = bluesky_get(BLUESKY_DIRECTORY . '/' . $did);
|
||||
if (empty($data) || empty($data->service)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
foreach ($data->service as $service) {
|
||||
if (($service->id == '#atproto_pds') && ($service->type == 'AtprotoPersonalDataServer') && !empty($service->serviceEndpoint)) {
|
||||
return $service->serviceEndpoint;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
function bluesky_get_token(int $uid): string
|
||||
{
|
||||
$token = DI::pConfig()->get($uid, 'bluesky', 'access_token');
|
||||
$created = DI::pConfig()->get($uid, 'bluesky', 'token_created');
|
||||
if (empty($token)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
if ($created + 300 < time()) {
|
||||
return bluesky_refresh_token($uid);
|
||||
}
|
||||
return $token;
|
||||
}
|
||||
|
||||
function bluesky_refresh_token(int $uid): string
|
||||
{
|
||||
$token = DI::pConfig()->get($uid, 'bluesky', 'refresh_token');
|
||||
|
||||
$data = bluesky_post($uid, '/xrpc/com.atproto.server.refreshSession', '', ['Authorization' => ['Bearer ' . $token]]);
|
||||
if (empty($data)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
Logger::debug('Refreshed token', ['return' => $data]);
|
||||
DI::pConfig()->set($uid, 'bluesky', 'access_token', $data->accessJwt);
|
||||
DI::pConfig()->set($uid, 'bluesky', 'refresh_token', $data->refreshJwt);
|
||||
DI::pConfig()->set($uid, 'bluesky', 'token_created', time());
|
||||
return $data->accessJwt;
|
||||
}
|
||||
|
||||
function bluesky_create_token(int $uid, string $password): string
|
||||
{
|
||||
$did = DI::pConfig()->get($uid, 'bluesky', 'did');
|
||||
|
||||
$data = bluesky_post($uid, '/xrpc/com.atproto.server.createSession', json_encode(['identifier' => $did, 'password' => $password]), ['Content-type' => 'application/json']);
|
||||
if (empty($data)) {
|
||||
DI::pConfig()->set($uid, 'bluesky', 'status', BLUEKSY_STATUS_TOKEN_FAIL);
|
||||
return '';
|
||||
}
|
||||
|
||||
Logger::debug('Created token', ['return' => $data]);
|
||||
DI::pConfig()->set($uid, 'bluesky', 'access_token', $data->accessJwt);
|
||||
DI::pConfig()->set($uid, 'bluesky', 'refresh_token', $data->refreshJwt);
|
||||
DI::pConfig()->set($uid, 'bluesky', 'token_created', time());
|
||||
DI::pConfig()->set($uid, 'bluesky', 'status', BLUEKSY_STATUS_TOKEN_OK);
|
||||
return $data->accessJwt;
|
||||
}
|
||||
|
||||
function bluesky_xrpc_post(int $uid, string $url, $parameters): ?stdClass
|
||||
{
|
||||
return bluesky_post($uid, '/xrpc/' . $url, json_encode($parameters), ['Content-type' => 'application/json', 'Authorization' => ['Bearer ' . bluesky_get_token($uid)]]);
|
||||
}
|
||||
|
||||
function bluesky_post(int $uid, string $url, string $params, array $headers): ?stdClass
|
||||
{
|
||||
try {
|
||||
$curlResult = DI::httpClient()->post(bluesky_get_user_pds($uid) . $url, $params, $headers);
|
||||
} catch (\Exception $e) {
|
||||
Logger::notice('Exception on post', ['exception' => $e]);
|
||||
DI::pConfig()->set($uid, 'bluesky', 'status', BLUEKSY_STATUS_API_FAIL);
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!$curlResult->isSuccess()) {
|
||||
Logger::notice('API Error', ['error' => json_decode($curlResult->getBody()) ?: $curlResult->getBody()]);
|
||||
DI::pConfig()->set($uid, 'bluesky', 'status', BLUEKSY_STATUS_API_FAIL);
|
||||
return null;
|
||||
}
|
||||
|
||||
DI::pConfig()->set($uid, 'bluesky', 'status', BLUEKSY_STATUS_SUCCESS);
|
||||
return json_decode($curlResult->getBody());
|
||||
}
|
||||
|
||||
function bluesky_xrpc_get(int $uid, string $url, array $parameters = []): ?stdClass
|
||||
{
|
||||
if (!empty($parameters)) {
|
||||
$url .= '?' . http_build_query($parameters);
|
||||
}
|
||||
|
||||
$data = bluesky_get(bluesky_get_user_pds($uid) . '/xrpc/' . $url, HttpClientAccept::JSON, [HttpClientOptions::HEADERS => ['Authorization' => ['Bearer ' . bluesky_get_token($uid)]]]);
|
||||
DI::pConfig()->set($uid, 'bluesky', 'status', is_null($data) ? BLUEKSY_STATUS_API_FAIL : BLUEKSY_STATUS_SUCCESS);
|
||||
return $data;
|
||||
|
||||
}
|
||||
|
||||
function bluesky_get(string $url, string $accept_content = HttpClientAccept::DEFAULT, array $opts = []): ?stdClass
|
||||
{
|
||||
try {
|
||||
$curlResult = DI::httpClient()->get($url, $accept_content, $opts);
|
||||
} catch (\Exception $e) {
|
||||
Logger::notice('Exception on get', ['exception' => $e]);
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!$curlResult->isSuccess()) {
|
||||
Logger::notice('API Error', ['error' => json_decode($curlResult->getBody()) ?: $curlResult->getBody()]);
|
||||
return null;
|
||||
}
|
||||
|
||||
return json_decode($curlResult->getBody());
|
||||
}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
<?php
|
||||
|
||||
use Friendica\Core\Logger;
|
||||
|
||||
function bluesky_feed_run($argv, $argc)
|
||||
{
|
||||
require_once 'addon/bluesky/bluesky.php';
|
||||
|
||||
if ($argc != 4) {
|
||||
return;
|
||||
}
|
||||
|
||||
Logger::debug('Importing feed - start', ['user' => $argv[1], 'feed' => $argv[2], 'last_poll' => $argv[3]]);
|
||||
bluesky_fetch_feed($argv[1], $argv[2], $argv[3]);
|
||||
Logger::debug('Importing feed - done', ['user' => $argv[1], 'feed' => $argv[2], 'last_poll' => $argv[3]]);
|
||||
}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
<?php
|
||||
|
||||
use Friendica\Core\Logger;
|
||||
|
||||
function bluesky_notifications_run($argv, $argc)
|
||||
{
|
||||
require_once 'addon/bluesky/bluesky.php';
|
||||
|
||||
if ($argc != 3) {
|
||||
return;
|
||||
}
|
||||
|
||||
Logger::notice('importing notifications - start', ['user' => $argv[1], 'last_poll' => $argv[2]]);
|
||||
bluesky_fetch_notifications($argv[1], $argv[2]);
|
||||
Logger::notice('importing notifications - done', ['user' => $argv[1], 'last_poll' => $argv[2]]);
|
||||
}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
<?php
|
||||
|
||||
use Friendica\Core\Logger;
|
||||
|
||||
function bluesky_timeline_run($argv, $argc)
|
||||
{
|
||||
require_once 'addon/bluesky/bluesky.php';
|
||||
|
||||
if ($argc != 3) {
|
||||
return;
|
||||
}
|
||||
|
||||
Logger::notice('importing timeline - start', ['user' => $argv[1], 'last_poll' => $argv[2]]);
|
||||
bluesky_fetch_timeline($argv[1], $argv[2]);
|
||||
Logger::notice('importing timeline - done', ['user' => $argv[1], 'last_poll' => $argv[2]]);
|
||||
}
|
||||
|
|
@ -1,116 +0,0 @@
|
|||
# ADDON bluesky
|
||||
# Copyright (C)
|
||||
# This file is distributed under the same license as the Friendica bluesky addon package.
|
||||
#
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2023-12-06 06:30+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"
|
||||
"Language: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: bluesky.php:336
|
||||
msgid "Enable Bluesky Post Addon"
|
||||
msgstr ""
|
||||
|
||||
#: bluesky.php:337
|
||||
msgid "Post to Bluesky by default"
|
||||
msgstr ""
|
||||
|
||||
#: bluesky.php:338
|
||||
msgid "Import the remote timeline"
|
||||
msgstr ""
|
||||
|
||||
#: bluesky.php:339
|
||||
msgid "Import the pinned feeds"
|
||||
msgstr ""
|
||||
|
||||
#: bluesky.php:339
|
||||
msgid ""
|
||||
"When activated, Posts will be imported from all the feeds that you pinned in "
|
||||
"Bluesky."
|
||||
msgstr ""
|
||||
|
||||
#: bluesky.php:340
|
||||
msgid "Personal Data Server"
|
||||
msgstr ""
|
||||
|
||||
#: bluesky.php:340
|
||||
msgid "The personal data server (PDS) is the system that hosts your profile."
|
||||
msgstr ""
|
||||
|
||||
#: bluesky.php:341
|
||||
msgid "Bluesky handle"
|
||||
msgstr ""
|
||||
|
||||
#: bluesky.php:342
|
||||
msgid "Bluesky DID"
|
||||
msgstr ""
|
||||
|
||||
#: bluesky.php:342
|
||||
msgid ""
|
||||
"This is the unique identifier. It will be fetched automatically, when the "
|
||||
"handle is entered."
|
||||
msgstr ""
|
||||
|
||||
#: bluesky.php:343
|
||||
msgid "Bluesky app password"
|
||||
msgstr ""
|
||||
|
||||
#: bluesky.php:343
|
||||
msgid ""
|
||||
"Please don't add your real password here, but instead create a specific app "
|
||||
"password in the Bluesky settings."
|
||||
msgstr ""
|
||||
|
||||
#: bluesky.php:349
|
||||
msgid "Bluesky Import/Export"
|
||||
msgstr ""
|
||||
|
||||
#: bluesky.php:359
|
||||
msgid ""
|
||||
"You are not authenticated. Please enter your handle and the app password."
|
||||
msgstr ""
|
||||
|
||||
#: bluesky.php:379
|
||||
msgid ""
|
||||
"You are authenticated to Bluesky. For security reasons the password isn't "
|
||||
"stored."
|
||||
msgstr ""
|
||||
|
||||
#: bluesky.php:381
|
||||
msgid ""
|
||||
"The communication with the personal data server service (PDS) is established."
|
||||
msgstr ""
|
||||
|
||||
#: bluesky.php:383
|
||||
msgid "Communication issues with the personal data server service (PDS)."
|
||||
msgstr ""
|
||||
|
||||
#: bluesky.php:385
|
||||
msgid ""
|
||||
"The DID for the provided handle could not be detected. Please check if you "
|
||||
"entered the correct handle."
|
||||
msgstr ""
|
||||
|
||||
#: bluesky.php:387
|
||||
msgid "The personal data server service (PDS) could not be detected."
|
||||
msgstr ""
|
||||
|
||||
#: bluesky.php:389
|
||||
msgid ""
|
||||
"The authentication with the provided handle and password failed. Please "
|
||||
"check if you entered the correct password."
|
||||
msgstr ""
|
||||
|
||||
#: bluesky.php:457
|
||||
msgid "Post to Bluesky"
|
||||
msgstr ""
|
||||
|
|
@ -1,89 +0,0 @@
|
|||
# ADDON bluesky
|
||||
# Copyright (C)
|
||||
# This file is distributed under the same license as the Friendica bluesky addon package.
|
||||
#
|
||||
#
|
||||
# Translators:
|
||||
# Tobias Diekershoff <tobias.diekershoff@gmx.net>, 2023
|
||||
# haheute <haheute@posteo.de>, 2023
|
||||
# Raroun, 2023
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2023-05-24 05:52+0000\n"
|
||||
"PO-Revision-Date: 2023-05-24 06:02+0000\n"
|
||||
"Last-Translator: Raroun, 2023\n"
|
||||
"Language-Team: German (https://app.transifex.com/Friendica/teams/12172/de/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: de\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#: bluesky.php:100
|
||||
msgid ""
|
||||
"You are authenticated to Bluesky. For security reasons the password isn't "
|
||||
"stored."
|
||||
msgstr ""
|
||||
"Du bist auf Bluesky authentifiziert. Aus Sicherheitsgründen wird das "
|
||||
"Passwort nicht gespeichert."
|
||||
|
||||
#: bluesky.php:100
|
||||
msgid "You are not authenticated. Please enter the app password."
|
||||
msgstr ""
|
||||
"Du bist derzeit nicht authentifiziert. Bitte gib dein App Passwort ein."
|
||||
|
||||
#: bluesky.php:104
|
||||
msgid "Enable Bluesky Post Addon"
|
||||
msgstr "Bluesky Post Addon aktivieren"
|
||||
|
||||
#: bluesky.php:105
|
||||
msgid "Post to Bluesky by default"
|
||||
msgstr "Standardmäßig auf Bluesky veröffentlichen"
|
||||
|
||||
#: bluesky.php:106
|
||||
msgid "Import the remote timeline"
|
||||
msgstr "Importiere die entfernte Timeline"
|
||||
|
||||
#: bluesky.php:107
|
||||
msgid "Bluesky host"
|
||||
msgstr "Bluesky Host"
|
||||
|
||||
#: bluesky.php:108
|
||||
msgid "Bluesky handle"
|
||||
msgstr "Bluesky Handle"
|
||||
|
||||
#: bluesky.php:109
|
||||
msgid "Bluesky DID"
|
||||
msgstr "Bluesky DID"
|
||||
|
||||
#: bluesky.php:109
|
||||
msgid ""
|
||||
"This is the unique identifier. It will be fetched automatically, when the "
|
||||
"handle is entered."
|
||||
msgstr ""
|
||||
"Sobald das Handle eingegeben ist, wird diese einzigartige Kennung "
|
||||
"automatisch abgerufen."
|
||||
|
||||
#: bluesky.php:110
|
||||
msgid "Bluesky app password"
|
||||
msgstr "Bluesky App Passwort"
|
||||
|
||||
#: bluesky.php:110
|
||||
msgid ""
|
||||
"Please don't add your real password here, but instead create a specific app "
|
||||
"password in the Bluesky settings."
|
||||
msgstr ""
|
||||
"Bitte verwende hier nicht dein echtes Passwort, sondern stattdessen ein "
|
||||
"speziell für diese App in den Bluesky Einstellungen festgelegtes Passwort."
|
||||
|
||||
#: bluesky.php:116
|
||||
msgid "Bluesky Import/Export"
|
||||
msgstr "Bluesky Import/Export"
|
||||
|
||||
#: bluesky.php:167
|
||||
msgid "Post to Bluesky"
|
||||
msgstr "Auf Bluesky veröffentlichen"
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
<?php
|
||||
|
||||
if(! function_exists("string_plural_select_de")) {
|
||||
function string_plural_select_de($n){
|
||||
$n = intval($n);
|
||||
return intval($n != 1);
|
||||
}}
|
||||
$a->strings['You are authenticated to Bluesky. For security reasons the password isn\'t stored.'] = 'Du bist auf Bluesky authentifiziert. Aus Sicherheitsgründen wird das Passwort nicht gespeichert.';
|
||||
$a->strings['You are not authenticated. Please enter the app password.'] = 'Du bist derzeit nicht authentifiziert. Bitte gib dein App Passwort ein.';
|
||||
$a->strings['Enable Bluesky Post Addon'] = 'Bluesky Post Addon aktivieren';
|
||||
$a->strings['Post to Bluesky by default'] = 'Standardmäßig auf Bluesky veröffentlichen';
|
||||
$a->strings['Import the remote timeline'] = 'Importiere die entfernte Timeline';
|
||||
$a->strings['Bluesky host'] = 'Bluesky Host';
|
||||
$a->strings['Bluesky handle'] = 'Bluesky Handle';
|
||||
$a->strings['Bluesky DID'] = 'Bluesky DID';
|
||||
$a->strings['This is the unique identifier. It will be fetched automatically, when the handle is entered.'] = 'Sobald das Handle eingegeben ist, wird diese einzigartige Kennung automatisch abgerufen.';
|
||||
$a->strings['Bluesky app password'] = 'Bluesky App Passwort';
|
||||
$a->strings['Please don\'t add your real password here, but instead create a specific app password in the Bluesky settings.'] = 'Bitte verwende hier nicht dein echtes Passwort, sondern stattdessen ein speziell für diese App in den Bluesky Einstellungen festgelegtes Passwort.';
|
||||
$a->strings['Bluesky Import/Export'] = 'Bluesky Import/Export';
|
||||
$a->strings['Post to Bluesky'] = 'Auf Bluesky veröffentlichen';
|
||||
|
|
@ -1,80 +0,0 @@
|
|||
# ADDON bluesky
|
||||
# Copyright (C)
|
||||
# This file is distributed under the same license as the Friendica bluesky addon package.
|
||||
#
|
||||
#
|
||||
# Translators:
|
||||
# tslmuun, 2023
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2023-05-24 05:52+0000\n"
|
||||
"PO-Revision-Date: 2023-05-24 06:02+0000\n"
|
||||
"Last-Translator: tslmuun, 2023\n"
|
||||
"Language-Team: Chinese (China) (https://app.transifex.com/Friendica/teams/12172/zh_CN/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: zh_CN\n"
|
||||
"Plural-Forms: nplurals=1; plural=0;\n"
|
||||
|
||||
#: bluesky.php:100
|
||||
msgid ""
|
||||
"You are authenticated to Bluesky. For security reasons the password isn't "
|
||||
"stored."
|
||||
msgstr "您已通过 Bluesky 的身份验证。 出于安全原因,不存储密码。"
|
||||
|
||||
#: bluesky.php:100
|
||||
msgid "You are not authenticated. Please enter the app password."
|
||||
msgstr "您未通过身份验证。 请输入应用密码。"
|
||||
|
||||
#: bluesky.php:104
|
||||
msgid "Enable Bluesky Post Addon"
|
||||
msgstr "启用Bluesky插件"
|
||||
|
||||
#: bluesky.php:105
|
||||
msgid "Post to Bluesky by default"
|
||||
msgstr "默认发布到Bluesky"
|
||||
|
||||
#: bluesky.php:106
|
||||
msgid "Import the remote timeline"
|
||||
msgstr "导入远程时间线"
|
||||
|
||||
#: bluesky.php:107
|
||||
msgid "Bluesky host"
|
||||
msgstr "Bluesky地址"
|
||||
|
||||
#: bluesky.php:108
|
||||
msgid "Bluesky handle"
|
||||
msgstr "Bluesky handle"
|
||||
|
||||
#: bluesky.php:109
|
||||
msgid "Bluesky DID"
|
||||
msgstr "Bluesky DID"
|
||||
|
||||
#: bluesky.php:109
|
||||
msgid ""
|
||||
"This is the unique identifier. It will be fetched automatically, when the "
|
||||
"handle is entered."
|
||||
msgstr "这是唯一标识符。 输入句柄时,它将自动获取。"
|
||||
|
||||
#: bluesky.php:110
|
||||
msgid "Bluesky app password"
|
||||
msgstr "Bluesky 应用密码"
|
||||
|
||||
#: bluesky.php:110
|
||||
msgid ""
|
||||
"Please don't add your real password here, but instead create a specific app "
|
||||
"password in the Bluesky settings."
|
||||
msgstr "请不要在此处填写您的真实密码,而是在 Bluesky 设置中创建一个特定的应用程序密码。"
|
||||
|
||||
#: bluesky.php:116
|
||||
msgid "Bluesky Import/Export"
|
||||
msgstr "Bluesky 导入/导出"
|
||||
|
||||
#: bluesky.php:167
|
||||
msgid "Post to Bluesky"
|
||||
msgstr "发布到Bluesky"
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
<?php
|
||||
|
||||
if(! function_exists("string_plural_select_zh_cn")) {
|
||||
function string_plural_select_zh_cn($n){
|
||||
$n = intval($n);
|
||||
return intval(0);
|
||||
}}
|
||||
$a->strings['You are authenticated to Bluesky. For security reasons the password isn\'t stored.'] = '您已通过 Bluesky 的身份验证。 出于安全原因,不存储密码。';
|
||||
$a->strings['You are not authenticated. Please enter the app password.'] = '您未通过身份验证。 请输入应用密码。';
|
||||
$a->strings['Enable Bluesky Post Addon'] = '启用Bluesky插件';
|
||||
$a->strings['Post to Bluesky by default'] = '默认发布到Bluesky';
|
||||
$a->strings['Import the remote timeline'] = '导入远程时间线';
|
||||
$a->strings['Bluesky host'] = 'Bluesky地址';
|
||||
$a->strings['Bluesky handle'] = 'Bluesky handle';
|
||||
$a->strings['Bluesky DID'] = 'Bluesky DID';
|
||||
$a->strings['This is the unique identifier. It will be fetched automatically, when the handle is entered.'] = '这是唯一标识符。 输入句柄时,它将自动获取。';
|
||||
$a->strings['Bluesky app password'] = 'Bluesky 应用密码';
|
||||
$a->strings['Please don\'t add your real password here, but instead create a specific app password in the Bluesky settings.'] = '请不要在此处填写您的真实密码,而是在 Bluesky 设置中创建一个特定的应用程序密码。';
|
||||
$a->strings['Bluesky Import/Export'] = 'Bluesky 导入/导出';
|
||||
$a->strings['Post to Bluesky'] = '发布到Bluesky';
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
<p>{{$status}}</p>
|
||||
{{include file="field_checkbox.tpl" field=$enable}}
|
||||
{{include file="field_checkbox.tpl" field=$bydefault}}
|
||||
{{include file="field_checkbox.tpl" field=$import}}
|
||||
{{include file="field_checkbox.tpl" field=$import_feeds}}
|
||||
{{include file="field_input.tpl" field=$pds}}
|
||||
{{include file="field_input.tpl" field=$handle}}
|
||||
{{include file="field_input.tpl" field=$did}}
|
||||
{{include file="field_input.tpl" field=$password}}
|
||||
|
|
@ -5,7 +5,8 @@
|
|||
#
|
||||
# Translators:
|
||||
# Vladimir Núñez <lapoubelle111@gmail.com>, 2019
|
||||
# Florent C., 2023
|
||||
# Walter Bulbazor, 2021
|
||||
# Hypolite Petovan <hypolite@mrpetovan.com>, 2022
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
|
|
@ -14,8 +15,8 @@ msgstr ""
|
|||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-11-21 19:14-0500\n"
|
||||
"PO-Revision-Date: 2018-04-07 05:23+0000\n"
|
||||
"Last-Translator: Florent C., 2023\n"
|
||||
"Language-Team: French (https://app.transifex.com/Friendica/teams/12172/fr/)\n"
|
||||
"Last-Translator: Hypolite Petovan <hypolite@mrpetovan.com>, 2022\n"
|
||||
"Language-Team: French (https://www.transifex.com/Friendica/teams/12172/fr/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
|
@ -24,7 +25,7 @@ msgstr ""
|
|||
|
||||
#: catavatar.php:48
|
||||
msgid "Set default profile avatar or randomize the cat."
|
||||
msgstr "Mettre l'avatar par défaut ou tirer au sort le chat."
|
||||
msgstr "Mettre l'avatar par défaut ou tirer au sort le Chat."
|
||||
|
||||
#: catavatar.php:53
|
||||
msgid "Cat Avatar Settings"
|
||||
|
|
@ -32,15 +33,15 @@ msgstr "Paramètres de Chat avatar"
|
|||
|
||||
#: catavatar.php:56
|
||||
msgid "Use Cat as Avatar"
|
||||
msgstr "Utiliser ce Chat"
|
||||
msgstr "Utiliser Chat comme avatar"
|
||||
|
||||
#: catavatar.php:57
|
||||
msgid "Another random Cat!"
|
||||
msgstr "Un autre Chat aléatoire !"
|
||||
msgstr "Un autre chat aléatoire !"
|
||||
|
||||
#: catavatar.php:58
|
||||
msgid "Reset to email Cat"
|
||||
msgstr "Revenir au Chat par défaut"
|
||||
msgstr "Réinitialiser à Chat courriel"
|
||||
|
||||
#: catavatar.php:77
|
||||
msgid "The cat hadn't found itself."
|
||||
|
|
|
|||
|
|
@ -5,11 +5,11 @@ function string_plural_select_fr($n){
|
|||
$n = intval($n);
|
||||
if (($n == 0 || $n == 1)) { return 0; } else if ($n != 0 && $n % 1000000 == 0) { return 1; } else { return 2; }
|
||||
}}
|
||||
$a->strings['Set default profile avatar or randomize the cat.'] = 'Mettre l\'avatar par défaut ou tirer au sort le chat.';
|
||||
$a->strings['Set default profile avatar or randomize the cat.'] = 'Mettre l\'avatar par défaut ou tirer au sort le Chat.';
|
||||
$a->strings['Cat Avatar Settings'] = 'Paramètres de Chat avatar';
|
||||
$a->strings['Use Cat as Avatar'] = 'Utiliser ce Chat';
|
||||
$a->strings['Another random Cat!'] = 'Un autre Chat aléatoire !';
|
||||
$a->strings['Reset to email Cat'] = 'Revenir au Chat par défaut';
|
||||
$a->strings['Use Cat as Avatar'] = 'Utiliser Chat comme avatar';
|
||||
$a->strings['Another random Cat!'] = 'Un autre chat aléatoire !';
|
||||
$a->strings['Reset to email Cat'] = 'Réinitialiser à Chat courriel';
|
||||
$a->strings['The cat hadn\'t found itself.'] = 'Le Chat ne s\'y est pas retrouvé';
|
||||
$a->strings['There was an error, the cat ran away.'] = 'Il y a eu une erreur et le chat s\'est enfui';
|
||||
$a->strings['Profile Photos'] = 'Photos de profil';
|
||||
|
|
|
|||
|
|
@ -1,64 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Name: Circle Text
|
||||
* Description: Disable images in circle edit menu
|
||||
* Version: 1.0
|
||||
* Author: Thomas Willingham <https://kakste.com/profile/beardyunixer>
|
||||
*/
|
||||
|
||||
use Friendica\Core\Hook;
|
||||
use Friendica\Core\Renderer;
|
||||
use Friendica\DI;
|
||||
|
||||
function circle_text_install()
|
||||
{
|
||||
Hook::register('addon_settings', __FILE__, 'circle_text_settings');
|
||||
Hook::register('addon_settings_post', __FILE__, 'circle_text_settings_post');
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Callback from the settings post function.
|
||||
* $post contains the $_POST array.
|
||||
* We will make sure we've got a valid user account
|
||||
* and if so set our configuration setting for this person.
|
||||
*
|
||||
*/
|
||||
|
||||
function circle_text_settings_post(array $post)
|
||||
{
|
||||
if (!DI::userSession()->getLocalUserId() || empty($post['circle_text-submit'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'circle_edit_image_limit', intval($post['circle_text']));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Called from the Addon Setting form.
|
||||
* Add our own settings info to the page.
|
||||
*
|
||||
*/
|
||||
|
||||
function circle_text_settings(array &$data)
|
||||
{
|
||||
if (!DI::userSession()->getLocalUserId()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$enabled = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'circle_edit_image_limit') ??
|
||||
DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'groupedit_image_limit');
|
||||
|
||||
$t = Renderer::getMarkupTemplate('settings.tpl', 'addon/circle_text/');
|
||||
$html = Renderer::replaceMacros($t, [
|
||||
'$enabled' => ['circle_text', DI::l10n()->t('Use a text only (non-image) circle selector in the "circle edit" menu'), $enabled],
|
||||
]);
|
||||
|
||||
$data = [
|
||||
'addon' => 'circle_text',
|
||||
'title' => DI::l10n()->t('Circle Text'),
|
||||
'html' => $html,
|
||||
];
|
||||
}
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
# ADDON circle_text
|
||||
# Copyright (C)
|
||||
# This file is distributed under the same license as the Friendica circle_text addon package.
|
||||
#
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2023-06-03 15:48-0400\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"
|
||||
"Language: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: group_text.php:56
|
||||
msgid "Use a text only (non-image) circle selector in the \"circle edit\" menu"
|
||||
msgstr ""
|
||||
|
||||
#: group_text.php:61
|
||||
msgid "Circle Text"
|
||||
msgstr ""
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
# ADDON group_text
|
||||
# Copyright (C)
|
||||
# This file is distributed under the same license as the Friendica group_text addon package.
|
||||
#
|
||||
#
|
||||
# Translators:
|
||||
# Farida Khalaf <faridakhalaf@hotmail.com>, 2021
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: friendica\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-02-01 18:15+0100\n"
|
||||
"PO-Revision-Date: 2021-02-21 02:59+0000\n"
|
||||
"Last-Translator: Farida Khalaf <faridakhalaf@hotmail.com>\n"
|
||||
"Language-Team: Arabic (http://www.transifex.com/Friendica/friendica/language/ar/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: ar\n"
|
||||
"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n"
|
||||
|
||||
#: group_text.php:62
|
||||
msgid "Group Text"
|
||||
msgstr "نص المجموعة:"
|
||||
|
||||
#: group_text.php:64
|
||||
msgid "Use a text only (non-image) group selector in the \"group edit\" menu"
|
||||
msgstr "استخدم محدد نصي للمجموعة فقط (غير مصور) في قائمة \"تعديل المجموعة\""
|
||||
|
||||
#: group_text.php:70
|
||||
msgid "Save Settings"
|
||||
msgstr "حفظ الإعدادات"
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
<?php
|
||||
|
||||
if(! function_exists("string_plural_select_ar")) {
|
||||
function string_plural_select_ar($n){
|
||||
$n = intval($n);
|
||||
if ($n==0) { return 0; } else if ($n==1) { return 1; } else if ($n==2) { return 2; } else if ($n%100>=3 && $n%100<=10) { return 3; } else if ($n%100>=11 && $n%100<=99) { return 4; } else { return 5; }
|
||||
}}
|
||||
$a->strings['Group Text'] = 'نص المجموعة:';
|
||||
$a->strings['Use a text only (non-image) group selector in the "group edit" menu'] = 'استخدم محدد نصي للمجموعة فقط (غير مصور) في قائمة "تعديل المجموعة"';
|
||||
$a->strings['Save Settings'] = 'حفظ الإعدادات';
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
# ADDON group_text
|
||||
# Copyright (C)
|
||||
# This file is distributed under the same license as the Friendica group_text addon package.
|
||||
#
|
||||
#
|
||||
# Translators:
|
||||
# Joan Bar <friendica@tutanota.com>, 2019
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: friendica\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2013-02-27 05:01-0500\n"
|
||||
"PO-Revision-Date: 2019-10-14 00:45+0000\n"
|
||||
"Last-Translator: Joan Bar <friendica@tutanota.com>\n"
|
||||
"Language-Team: Catalan (http://www.transifex.com/Friendica/friendica/language/ca/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: ca\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#: group_text.php:46
|
||||
msgid "Group Text settings updated."
|
||||
msgstr "La configuració del text del grup s'ha actualitzat."
|
||||
|
||||
#: group_text.php:76
|
||||
msgid "Group Text"
|
||||
msgstr "Missatge del grup"
|
||||
|
||||
#: group_text.php:78
|
||||
msgid "Use a text only (non-image) group selector in the \"group edit\" menu"
|
||||
msgstr "Utilitzeu un selector de grup de només text (que no sigui una imatge) al menú 'Edita grup'"
|
||||
|
||||
#: group_text.php:84
|
||||
msgid "Submit"
|
||||
msgstr "sotmetre's"
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
<?php
|
||||
|
||||
if(! function_exists("string_plural_select_ca")) {
|
||||
function string_plural_select_ca($n){
|
||||
$n = intval($n);
|
||||
return intval($n != 1);
|
||||
}}
|
||||
$a->strings['Group Text settings updated.'] = 'La configuració del text del grup s\'ha actualitzat.';
|
||||
$a->strings['Group Text'] = 'Missatge del grup';
|
||||
$a->strings['Use a text only (non-image) group selector in the "group edit" menu'] = 'Utilitzeu un selector de grup de només text (que no sigui una imatge) al menú \'Edita grup\'';
|
||||
$a->strings['Submit'] = 'sotmetre\'s';
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
# ADDON group_text
|
||||
# Copyright (C)
|
||||
# This file is distributed under the same license as the Friendica group_text addon package.
|
||||
#
|
||||
#
|
||||
# Translators:
|
||||
# Aditoo, 2018
|
||||
# michal_s <msupler@gmail.com>, 2014-2015
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: friendica\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2013-02-27 05:01-0500\n"
|
||||
"PO-Revision-Date: 2018-09-12 09:47+0000\n"
|
||||
"Last-Translator: Aditoo\n"
|
||||
"Language-Team: Czech (http://www.transifex.com/Friendica/friendica/language/cs/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: cs\n"
|
||||
"Plural-Forms: nplurals=4; plural=(n == 1 && n % 1 == 0) ? 0 : (n >= 2 && n <= 4 && n % 1 == 0) ? 1: (n % 1 != 0 ) ? 2 : 3;\n"
|
||||
|
||||
#: group_text.php:46
|
||||
msgid "Group Text settings updated."
|
||||
msgstr "Nastavení Group Text aktualizována."
|
||||
|
||||
#: group_text.php:76
|
||||
msgid "Group Text"
|
||||
msgstr "Skupinový text"
|
||||
|
||||
#: group_text.php:78
|
||||
msgid "Use a text only (non-image) group selector in the \"group edit\" menu"
|
||||
msgstr "Použijte pouze textový (bezobrázkový) výběr skupiny v menu úpravy skupin."
|
||||
|
||||
#: group_text.php:84
|
||||
msgid "Submit"
|
||||
msgstr "Odeslat"
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
<?php
|
||||
|
||||
if(! function_exists("string_plural_select_cs")) {
|
||||
function string_plural_select_cs($n){
|
||||
$n = intval($n);
|
||||
if (($n == 1 && $n % 1 == 0)) { return 0; } else if (($n >= 2 && $n <= 4 && $n % 1 == 0)) { return 1; } else if (($n % 1 != 0 )) { return 2; } else { return 3; }
|
||||
}}
|
||||
$a->strings['Group Text settings updated.'] = 'Nastavení Group Text aktualizována.';
|
||||
$a->strings['Group Text'] = 'Skupinový text';
|
||||
$a->strings['Use a text only (non-image) group selector in the "group edit" menu'] = 'Použijte pouze textový (bezobrázkový) výběr skupiny v menu úpravy skupin.';
|
||||
$a->strings['Submit'] = 'Odeslat';
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
# ADDON group_text
|
||||
# Copyright (C)
|
||||
# This file is distributed under the same license as the Friendica group_text addon package.
|
||||
#
|
||||
#
|
||||
# Translators:
|
||||
# Anton <dev@atjn.dk>, 2022
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: friendica\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-11-21 19:14-0500\n"
|
||||
"PO-Revision-Date: 2014-06-23 08:35+0000\n"
|
||||
"Last-Translator: Anton <dev@atjn.dk>, 2022\n"
|
||||
"Language-Team: Danish (Denmark) (http://www.transifex.com/Friendica/friendica/language/da_DK/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: da_DK\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#: group_text.php:58
|
||||
msgid "Use a text only (non-image) group selector in the \"group edit\" menu"
|
||||
msgstr "Brug en kun-tekst (intet billede) gruppevælger i grupperedigeringsmenuen"
|
||||
|
||||
#: group_text.php:63
|
||||
msgid "Group Text"
|
||||
msgstr "Gruppebesked"
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
<?php
|
||||
|
||||
if(! function_exists("string_plural_select_da_dk")) {
|
||||
function string_plural_select_da_dk($n){
|
||||
$n = intval($n);
|
||||
return intval($n != 1);
|
||||
}}
|
||||
$a->strings['Use a text only (non-image) group selector in the "group edit" menu'] = 'Brug en kun-tekst (intet billede) gruppevælger i grupperedigeringsmenuen';
|
||||
$a->strings['Group Text'] = 'Gruppebesked';
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
# ADDON group_text
|
||||
# Copyright (C)
|
||||
# This file is distributed under the same license as the Friendica group_text addon package.
|
||||
#
|
||||
#
|
||||
# Translators:
|
||||
# Andreas H., 2014
|
||||
# Tobias Diekershoff <tobias.diekershoff@gmx.net>, 2014
|
||||
# Tobias Diekershoff <tobias.diekershoff@gmx.net>, 2021
|
||||
# Ulf Rompe <transifex.com@rompe.org>, 2019
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: friendica\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-11-21 19:14-0500\n"
|
||||
"PO-Revision-Date: 2014-06-23 08:35+0000\n"
|
||||
"Last-Translator: Tobias Diekershoff <tobias.diekershoff@gmx.net>, 2021\n"
|
||||
"Language-Team: German (http://app.transifex.com/Friendica/friendica/language/de/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: de\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#: group_text.php:58
|
||||
msgid "Use a text only (non-image) group selector in the \"group edit\" menu"
|
||||
msgstr "Beim Bearbeiten von Gruppen Text statt Bilder anzeigen"
|
||||
|
||||
#: group_text.php:63
|
||||
msgid "Group Text"
|
||||
msgstr "Gruppen als Text"
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
<?php
|
||||
|
||||
if(! function_exists("string_plural_select_de")) {
|
||||
function string_plural_select_de($n){
|
||||
$n = intval($n);
|
||||
return intval($n != 1);
|
||||
}}
|
||||
$a->strings['Use a text only (non-image) group selector in the "group edit" menu'] = 'Beim Bearbeiten von Gruppen Text statt Bilder anzeigen';
|
||||
$a->strings['Group Text'] = 'Gruppen als Text';
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
<?php
|
||||
|
||||
$a->strings["Group Text"] = "";
|
||||
$a->strings["Use a text only (non-image) group selector in the \"group edit\" menu"] = "";
|
||||
$a->strings["Submit"] = "Sendi";
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
# ADDON group_text
|
||||
# Copyright (C)
|
||||
# This file is distributed under the same license as the Friendica group_text addon package.
|
||||
#
|
||||
#
|
||||
# Translators:
|
||||
# Albert, 2016
|
||||
# Senex Petrovic <javierruizo@hotmail.com>, 2021
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: friendica\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-02-01 18:15+0100\n"
|
||||
"PO-Revision-Date: 2021-04-01 09:56+0000\n"
|
||||
"Last-Translator: Senex Petrovic <javierruizo@hotmail.com>\n"
|
||||
"Language-Team: Spanish (http://www.transifex.com/Friendica/friendica/language/es/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: es\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#: group_text.php:62
|
||||
msgid "Group Text"
|
||||
msgstr "Grupo de Texto"
|
||||
|
||||
#: group_text.php:64
|
||||
msgid "Use a text only (non-image) group selector in the \"group edit\" menu"
|
||||
msgstr "Utilice sólo el selector de grupo de texto (no imagen) en el menú \"edición de grupo\""
|
||||
|
||||
#: group_text.php:70
|
||||
msgid "Save Settings"
|
||||
msgstr "Guardar Ajustes"
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
<?php
|
||||
|
||||
if(! function_exists("string_plural_select_es")) {
|
||||
function string_plural_select_es($n){
|
||||
$n = intval($n);
|
||||
return intval($n != 1);
|
||||
}}
|
||||
$a->strings['Group Text'] = 'Grupo de Texto';
|
||||
$a->strings['Use a text only (non-image) group selector in the "group edit" menu'] = 'Utilice sólo el selector de grupo de texto (no imagen) en el menú "edición de grupo"';
|
||||
$a->strings['Save Settings'] = 'Guardar Ajustes';
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
# ADDON group_text
|
||||
# Copyright (C)
|
||||
# This file is distributed under the same license as the Friendica group_text addon package.
|
||||
#
|
||||
#
|
||||
# Translators:
|
||||
# Kris, 2018
|
||||
# Kris, 2018
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: friendica\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2013-02-27 05:01-0500\n"
|
||||
"PO-Revision-Date: 2018-04-08 15:51+0000\n"
|
||||
"Last-Translator: Kris\n"
|
||||
"Language-Team: Finnish (Finland) (http://www.transifex.com/Friendica/friendica/language/fi_FI/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: fi_FI\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#: group_text.php:46
|
||||
msgid "Group Text settings updated."
|
||||
msgstr "Group Text -asetukset päivitetty."
|
||||
|
||||
#: group_text.php:76
|
||||
msgid "Group Text"
|
||||
msgstr "Group Text"
|
||||
|
||||
#: group_text.php:78
|
||||
msgid "Use a text only (non-image) group selector in the \"group edit\" menu"
|
||||
msgstr ""
|
||||
|
||||
#: group_text.php:84
|
||||
msgid "Submit"
|
||||
msgstr "Lähetä"
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
<?php
|
||||
|
||||
if(! function_exists("string_plural_select_fi_fi")) {
|
||||
function string_plural_select_fi_fi($n){
|
||||
$n = intval($n);
|
||||
return intval($n != 1);
|
||||
}}
|
||||
$a->strings['Group Text settings updated.'] = 'Group Text -asetukset päivitetty.';
|
||||
$a->strings['Group Text'] = 'Group Text';
|
||||
$a->strings['Submit'] = 'Lähetä';
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
# ADDON group_text
|
||||
# Copyright (C)
|
||||
# This file is distributed under the same license as the Friendica group_text addon package.
|
||||
#
|
||||
#
|
||||
# Translators:
|
||||
# bob lebonche <lebonche@tutanota.com>, 2021
|
||||
# Hypolite Petovan <hypolite@mrpetovan.com>, 2016
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: friendica\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-11-21 19:14-0500\n"
|
||||
"PO-Revision-Date: 2014-06-23 08:35+0000\n"
|
||||
"Last-Translator: bob lebonche <lebonche@tutanota.com>, 2021\n"
|
||||
"Language-Team: French (http://www.transifex.com/Friendica/friendica/language/fr/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: fr\n"
|
||||
"Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n"
|
||||
|
||||
#: group_text.php:58
|
||||
msgid "Use a text only (non-image) group selector in the \"group edit\" menu"
|
||||
msgstr "Utiliser uniquement un groupe de texte (pas d'image) dans le menu \"groupedit\""
|
||||
|
||||
#: group_text.php:63
|
||||
msgid "Group Text"
|
||||
msgstr "Groupe de texte"
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
<?php
|
||||
|
||||
if(! function_exists("string_plural_select_fr")) {
|
||||
function string_plural_select_fr($n){
|
||||
$n = intval($n);
|
||||
if (($n == 0 || $n == 1)) { return 0; } else if ($n != 0 && $n % 1000000 == 0) { return 1; } else { return 2; }
|
||||
}}
|
||||
$a->strings['Use a text only (non-image) group selector in the "group edit" menu'] = 'Utiliser uniquement un groupe de texte (pas d\'image) dans le menu "groupedit"';
|
||||
$a->strings['Group Text'] = 'Groupe de texte';
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
# ADDON group_text
|
||||
# Copyright (C)
|
||||
# This file is distributed under the same license as the Friendica group_text addon package.
|
||||
#
|
||||
#
|
||||
# Translators:
|
||||
# Balázs Úr, 2020-2021
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: friendica\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-11-21 19:14-0500\n"
|
||||
"PO-Revision-Date: 2014-06-23 08:35+0000\n"
|
||||
"Last-Translator: Balázs Úr, 2020-2021\n"
|
||||
"Language-Team: Hungarian (http://www.transifex.com/Friendica/friendica/language/hu/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: hu\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#: group_text.php:58
|
||||
msgid "Use a text only (non-image) group selector in the \"group edit\" menu"
|
||||
msgstr "Csak szöveges (kép nélküli) csoportválasztó használata a „csoportszerkesztés” menüben"
|
||||
|
||||
#: group_text.php:63
|
||||
msgid "Group Text"
|
||||
msgstr "Csoportszöveg"
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
<?php
|
||||
|
||||
if(! function_exists("string_plural_select_hu")) {
|
||||
function string_plural_select_hu($n){
|
||||
$n = intval($n);
|
||||
return intval($n != 1);
|
||||
}}
|
||||
$a->strings['Use a text only (non-image) group selector in the "group edit" menu'] = 'Csak szöveges (kép nélküli) csoportválasztó használata a „csoportszerkesztés” menüben';
|
||||
$a->strings['Group Text'] = 'Csoportszöveg';
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
<?php
|
||||
|
||||
$a->strings["Group Text"] = "";
|
||||
$a->strings["Use a text only (non-image) group selector in the \"group edit\" menu"] = "";
|
||||
$a->strings["Submit"] = "Senda inn";
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
# ADDON group_text
|
||||
# Copyright (C)
|
||||
# This file is distributed under the same license as the Friendica group_text addon package.
|
||||
#
|
||||
#
|
||||
# Translators:
|
||||
# fabrixxm <fabrix.xm@gmail.com>, 2014-2015
|
||||
# Sylke Vicious <silkevicious@gmail.com>, 2021
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: friendica\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-02-01 18:15+0100\n"
|
||||
"PO-Revision-Date: 2021-02-16 12:48+0000\n"
|
||||
"Last-Translator: Sylke Vicious <silkevicious@gmail.com>\n"
|
||||
"Language-Team: Italian (http://www.transifex.com/Friendica/friendica/language/it/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: it\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#: group_text.php:62
|
||||
msgid "Group Text"
|
||||
msgstr "Editor Gruppi Testuale"
|
||||
|
||||
#: group_text.php:64
|
||||
msgid "Use a text only (non-image) group selector in the \"group edit\" menu"
|
||||
msgstr "Usa un selettore testuale (senza immagini) nella pagina \"modifica gruppo\""
|
||||
|
||||
#: group_text.php:70
|
||||
msgid "Save Settings"
|
||||
msgstr "Salva Impostazioni"
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
<?php
|
||||
|
||||
if(! function_exists("string_plural_select_it")) {
|
||||
function string_plural_select_it($n){
|
||||
$n = intval($n);
|
||||
return intval($n != 1);
|
||||
}}
|
||||
$a->strings['Group Text'] = 'Editor Gruppi Testuale';
|
||||
$a->strings['Use a text only (non-image) group selector in the "group edit" menu'] = 'Usa un selettore testuale (senza immagini) nella pagina "modifica gruppo"';
|
||||
$a->strings['Save Settings'] = 'Salva Impostazioni';
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
<?php
|
||||
|
||||
$a->strings["Group Text"] = "";
|
||||
$a->strings["Use a text only (non-image) group selector in the \"group edit\" menu"] = "";
|
||||
$a->strings["Submit"] = "Lagre";
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
# ADDON group_text
|
||||
# Copyright (C)
|
||||
# This file is distributed under the same license as the Friendica group_text addon package.
|
||||
#
|
||||
#
|
||||
# Translators:
|
||||
# Jeroen De Meerleer <me@jeroened.be>, 2018
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: friendica\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2013-02-27 05:01-0500\n"
|
||||
"PO-Revision-Date: 2018-08-24 13:48+0000\n"
|
||||
"Last-Translator: Jeroen De Meerleer <me@jeroened.be>\n"
|
||||
"Language-Team: Dutch (http://www.transifex.com/Friendica/friendica/language/nl/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: nl\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#: group_text.php:46
|
||||
msgid "Group Text settings updated."
|
||||
msgstr "Groupsberichten instellingen opgeslagen"
|
||||
|
||||
#: group_text.php:76
|
||||
msgid "Group Text"
|
||||
msgstr "Groepsbericht"
|
||||
|
||||
#: group_text.php:78
|
||||
msgid "Use a text only (non-image) group selector in the \"group edit\" menu"
|
||||
msgstr ""
|
||||
|
||||
#: group_text.php:84
|
||||
msgid "Submit"
|
||||
msgstr ""
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
<?php
|
||||
|
||||
if(! function_exists("string_plural_select_nl")) {
|
||||
function string_plural_select_nl($n){
|
||||
$n = intval($n);
|
||||
return intval($n != 1);
|
||||
}}
|
||||
$a->strings['Group Text settings updated.'] = 'Groupsberichten instellingen opgeslagen';
|
||||
$a->strings['Group Text'] = 'Groepsbericht';
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
# ADDON group_text
|
||||
# Copyright (C)
|
||||
# This file is distributed under the same license as the Friendica group_text addon package.
|
||||
#
|
||||
#
|
||||
# Translators:
|
||||
# Waldemar Stoczkowski, 2018
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: friendica\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-11-21 19:14-0500\n"
|
||||
"PO-Revision-Date: 2014-06-23 08:35+0000\n"
|
||||
"Last-Translator: Waldemar Stoczkowski, 2018\n"
|
||||
"Language-Team: Polish (http://www.transifex.com/Friendica/friendica/language/pl/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: pl\n"
|
||||
"Plural-Forms: nplurals=4; plural=(n==1 ? 0 : (n%10>=2 && n%10<=4) && (n%100<12 || n%100>14) ? 1 : n!=1 && (n%10>=0 && n%10<=1) || (n%10>=5 && n%10<=9) || (n%100>=12 && n%100<=14) ? 2 : 3);\n"
|
||||
|
||||
#: group_text.php:58
|
||||
msgid "Use a text only (non-image) group selector in the \"group edit\" menu"
|
||||
msgstr "Użyj tylko tekst (bez obrazu) selektor grupy w menu \"Edycja grupy\""
|
||||
|
||||
#: group_text.php:63
|
||||
msgid "Group Text"
|
||||
msgstr "Grupuj tekst"
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
<?php
|
||||
|
||||
if(! function_exists("string_plural_select_pl")) {
|
||||
function string_plural_select_pl($n){
|
||||
$n = intval($n);
|
||||
if ($n==1) { return 0; } else if (($n%10>=2 && $n%10<=4) && ($n%100<12 || $n%100>14)) { return 1; } else if ($n!=1 && ($n%10>=0 && $n%10<=1) || ($n%10>=5 && $n%10<=9) || ($n%100>=12 && $n%100<=14)) { return 2; } else { return 3; }
|
||||
}}
|
||||
$a->strings['Use a text only (non-image) group selector in the "group edit" menu'] = 'Użyj tylko tekst (bez obrazu) selektor grupy w menu "Edycja grupy"';
|
||||
$a->strings['Group Text'] = 'Grupuj tekst';
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
<?php
|
||||
|
||||
$a->strings["Group Text"] = "";
|
||||
$a->strings["Use a text only (non-image) group selector in the \"group edit\" menu"] = "";
|
||||
$a->strings["Submit"] = "Enviar";
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
# ADDON group_text
|
||||
# Copyright (C)
|
||||
# This file is distributed under the same license as the Friendica group_text addon package.
|
||||
#
|
||||
#
|
||||
# Translators:
|
||||
# Doru DEACONU <dumitrudeaconu@yahoo.com>, 2014
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: friendica\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2013-02-27 05:01-0500\n"
|
||||
"PO-Revision-Date: 2014-11-27 14:15+0000\n"
|
||||
"Last-Translator: Doru DEACONU <dumitrudeaconu@yahoo.com>\n"
|
||||
"Language-Team: Romanian (Romania) (http://www.transifex.com/projects/p/friendica/language/ro_RO/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: ro_RO\n"
|
||||
"Plural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1));\n"
|
||||
|
||||
#: group_text.php:46
|
||||
msgid "Group Text settings updated."
|
||||
msgstr "Configurările Text Grup, au fost actualizate."
|
||||
|
||||
#: group_text.php:76
|
||||
msgid "Group Text"
|
||||
msgstr "Text Grup"
|
||||
|
||||
#: group_text.php:78
|
||||
msgid "Use a text only (non-image) group selector in the \"group edit\" menu"
|
||||
msgstr "Folosiți în meniul \"editare grup\" un selector de grup strict textual (fără-imagine)"
|
||||
|
||||
#: group_text.php:84
|
||||
msgid "Submit"
|
||||
msgstr "Trimite"
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
<?php
|
||||
|
||||
if(! function_exists("string_plural_select_ro")) {
|
||||
function string_plural_select_ro($n){
|
||||
$n = intval($n);
|
||||
if ($n==1) { return 0; } else if ((($n%100>19)||(($n%100==0)&&($n!=0)))) { return 2; } else { return 1; }
|
||||
}}
|
||||
$a->strings['Group Text settings updated.'] = 'Configurările Text Grup, au fost actualizate.';
|
||||
$a->strings['Group Text'] = 'Text Grup';
|
||||
$a->strings['Use a text only (non-image) group selector in the "group edit" menu'] = 'Folosiți în meniul "editare grup" un selector de grup strict textual (fără-imagine)';
|
||||
$a->strings['Submit'] = 'Trimite';
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
# ADDON group_text
|
||||
# Copyright (C)
|
||||
# This file is distributed under the same license as the Friendica group_text addon package.
|
||||
#
|
||||
#
|
||||
# Translators:
|
||||
# Stanislav N. <pztrn@pztrn.name>, 2017
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: friendica\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2013-02-27 05:01-0500\n"
|
||||
"PO-Revision-Date: 2017-04-08 17:26+0000\n"
|
||||
"Last-Translator: Stanislav N. <pztrn@pztrn.name>\n"
|
||||
"Language-Team: Russian (http://www.transifex.com/Friendica/friendica/language/ru/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: ru\n"
|
||||
"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n"
|
||||
|
||||
#: group_text.php:46
|
||||
msgid "Group Text settings updated."
|
||||
msgstr "Настройки Group Text обновлены."
|
||||
|
||||
#: group_text.php:76
|
||||
msgid "Group Text"
|
||||
msgstr "Group Text"
|
||||
|
||||
#: group_text.php:78
|
||||
msgid "Use a text only (non-image) group selector in the \"group edit\" menu"
|
||||
msgstr "Используйте текстовый (не изображение) селектор группы в режиме редактирования группы"
|
||||
|
||||
#: group_text.php:84
|
||||
msgid "Submit"
|
||||
msgstr "Добавить"
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
<?php
|
||||
|
||||
if(! function_exists("string_plural_select_ru")) {
|
||||
function string_plural_select_ru($n){
|
||||
$n = intval($n);
|
||||
if ($n%10==1 && $n%100!=11) { return 0; } else if ($n%10>=2 && $n%10<=4 && ($n%100<12 || $n%100>14)) { return 1; } else if ($n%10==0 || ($n%10>=5 && $n%10<=9) || ($n%100>=11 && $n%100<=14)) { return 2; } else { return 3; }
|
||||
}}
|
||||
$a->strings['Group Text settings updated.'] = 'Настройки Group Text обновлены.';
|
||||
$a->strings['Group Text'] = 'Group Text';
|
||||
$a->strings['Use a text only (non-image) group selector in the "group edit" menu'] = 'Используйте текстовый (не изображение) селектор группы в режиме редактирования группы';
|
||||
$a->strings['Submit'] = 'Добавить';
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
# ADDON group_text
|
||||
# Copyright (C)
|
||||
# This file is distributed under the same license as the Friendica group_text addon package.
|
||||
#
|
||||
#
|
||||
# Translators:
|
||||
# Kristoffer Grundström <lovaren@gmail.com>, 2022
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: friendica\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-11-21 19:14-0500\n"
|
||||
"PO-Revision-Date: 2022-01-16 00:35+0000\n"
|
||||
"Last-Translator: Kristoffer Grundström <lovaren@gmail.com>\n"
|
||||
"Language-Team: Swedish (http://www.transifex.com/Friendica/friendica/language/sv/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: sv\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#: group_text.php:58
|
||||
msgid "Use a text only (non-image) group selector in the \"group edit\" menu"
|
||||
msgstr ""
|
||||
|
||||
#: group_text.php:63
|
||||
msgid "Group Text"
|
||||
msgstr "Grupptext"
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
<?php
|
||||
|
||||
if(! function_exists("string_plural_select_sv")) {
|
||||
function string_plural_select_sv($n){
|
||||
$n = intval($n);
|
||||
return intval($n != 1);
|
||||
}}
|
||||
$a->strings['Group Text'] = 'Grupptext';
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
<?php
|
||||
|
||||
$a->strings["Group Text settings updated."] = "组正文设置更新了。";
|
||||
$a->strings["Group Text"] = "组正文";
|
||||
$a->strings["Use a text only (non-image) group selector in the \"group edit\" menu"] = "用光正文(无图片)组选择器在「组编辑」单";
|
||||
$a->strings["Submit"] = "提交";
|
||||
|
|
@ -1 +0,0 @@
|
|||
{{include file="field_checkbox.tpl" field=$enabled}}
|
||||
|
|
@ -1,85 +0,0 @@
|
|||
Compact Language Detector
|
||||
===
|
||||
CLD2 is an advanced language dectection library with a high reliability.
|
||||
|
||||
This addon depends on the CLD PHP module which is not included in any Linux distribution.
|
||||
It needs to be built and installed by hand, which is not totally straightforward.
|
||||
|
||||
Prerequisite
|
||||
---
|
||||
To be able to build the extension, you need the CLD module and the files for the PHP module development.
|
||||
On Debian you install the packages php-dev, libcld2-dev and libcld2-0.
|
||||
Make sure to have installed the correct PHP version.
|
||||
Means: When you have got both PHP 8.0 and 8.2 on your system, you have to install php8.0-dev as well.
|
||||
|
||||
Installation
|
||||
---
|
||||
The original PHP extension is https://github.com/fntlnz/cld2-php-ext.
|
||||
However, it doesn't support PHP8.
|
||||
So https://github.com/hiteule/cld2-php-ext/tree/support-php8 has to be used.
|
||||
|
||||
Download the source code:
|
||||
```
|
||||
wget https://github.com/hiteule/cld2-php-ext/archive/refs/heads/support-php8.zip
|
||||
```
|
||||
|
||||
Unzip it:
|
||||
```
|
||||
unzip support-php8.zip
|
||||
```
|
||||
|
||||
Change into the folder:
|
||||
```
|
||||
cd cld2-php-ext-support-php8/
|
||||
```
|
||||
|
||||
Configure for the PHP Api version:
|
||||
```
|
||||
phpize
|
||||
```
|
||||
(if you have got several PHP versions on your system, execute the command with the version that you run Friendica with, e.g. `phpize8.0`)
|
||||
|
||||
Create the Makefile:
|
||||
```
|
||||
./configure --with-cld2=/usr/include/cld2
|
||||
```
|
||||
|
||||
Have a look at the line `checking for PHP includes`.
|
||||
When the output (for example `/usr/include/php/20220829` doesn't match the API version that you got from `phpize`, then you have to change all the version codes in your `Makefile` afterwards)
|
||||
|
||||
Create the module:
|
||||
```
|
||||
make -j
|
||||
```
|
||||
|
||||
Install it:
|
||||
```
|
||||
sudo make install
|
||||
```
|
||||
|
||||
Change to the folder with the available modules. When you use PHP 8.2 on Debian it is:
|
||||
```
|
||||
cd /etc/php/8.2/mods-available
|
||||
```
|
||||
|
||||
Create the file `cld2.ini` with this content:
|
||||
```
|
||||
; configuration for php cld2 module
|
||||
; priority=20
|
||||
extension=cld2.so
|
||||
```
|
||||
|
||||
Enable the module for all versions and all sapi:
|
||||
```
|
||||
phpenmod -v ALL -s ALL cld2
|
||||
```
|
||||
|
||||
Then restart the apache or fpm (or whatever you use) to load the changed configuration.
|
||||
|
||||
Call `/admin/phpinfo` on your webserver.
|
||||
You then see the PHP Info.
|
||||
Search for "cld2".
|
||||
The module is installed, when you find it here.
|
||||
**Only proceed when the module is installed**
|
||||
|
||||
Now you can enable the addon.
|
||||
71
cld/cld.php
71
cld/cld.php
|
|
@ -1,71 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Name: Compact Language Detector
|
||||
* Description: Improved language detection
|
||||
* Version: 0.1
|
||||
* Author: Michael Vogel <heluecht@pirati.ca>
|
||||
*/
|
||||
|
||||
use Friendica\Core\Hook;
|
||||
use Friendica\Core\Logger;
|
||||
use Friendica\DI;
|
||||
|
||||
function cld_install()
|
||||
{
|
||||
Hook::register('detect_languages', __FILE__, 'cld_detect_languages');
|
||||
}
|
||||
|
||||
function cld_detect_languages(array &$data)
|
||||
{
|
||||
if (!in_array('cld2', get_loaded_extensions())) {
|
||||
Logger::warning('CLD2 is not installed.');
|
||||
return;
|
||||
}
|
||||
|
||||
$cld2 = new \CLD2Detector();
|
||||
|
||||
$cld2->setEncodingHint(CLD2Encoding::UTF8); // optional, hints about text encoding
|
||||
$cld2->setPlainText(true);
|
||||
|
||||
$result = $cld2->detect($data['text']);
|
||||
|
||||
if ($data['detected']) {
|
||||
$original = array_key_first($data['detected']);
|
||||
} else {
|
||||
$original = '';
|
||||
}
|
||||
|
||||
$detected = DI::l10n()->toISO6391($result['language_code']);
|
||||
|
||||
// languages that aren't supported via the base language detection or tend to false detections
|
||||
if ((strlen($detected) == 3) || in_array($detected, ['ht', 'kk', 'ku', 'ky', 'lg', 'mg', 'mk', 'mt', 'ny', 'rw', 'st', 'su', 'tg', 'ts', 'xx'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!$result['is_reliable']) {
|
||||
Logger::debug('Unreliable detection', ['uri-id' => $data['uri-id'], 'original' => $original, 'detected' => $detected, 'name' => $result['language_name'], 'probability' => $result['language_probability'], 'text' => $data['text']]);
|
||||
if (($original == $detected) && ($data['detected'][$original] < $result['language_probability'] / 100)) {
|
||||
$data['detected'][$original] = $result['language_probability'] / 100;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
$available = array_keys(DI::l10n()->getLanguageCodes());
|
||||
|
||||
if (!in_array($detected, $available)) {
|
||||
Logger::debug('Unsupported language', ['uri-id' => $data['uri-id'], 'original' => $original, 'detected' => $detected, 'name' => $result['language_name'], 'probability' => $result['language_probability'], 'text' => $data['text']]);
|
||||
return;
|
||||
}
|
||||
|
||||
if ($original != $detected) {
|
||||
Logger::debug('Detected different language', ['uri-id' => $data['uri-id'], 'original' => $original, 'detected' => $detected, 'name' => $result['language_name'], 'probability' => $result['language_probability'], 'text' => $data['text']]);
|
||||
}
|
||||
|
||||
$length = count($data['detected']);
|
||||
if ($length > 0) {
|
||||
unset($data['detected'][$detected]);
|
||||
$data['detected'] = array_merge([$detected => $result['language_probability'] / 100], array_slice($data['detected'], 0, $length - 1));
|
||||
} else {
|
||||
$data['detected'] = [$detected => $result['language_probability'] / 100];
|
||||
}
|
||||
}
|
||||
|
|
@ -205,7 +205,7 @@ function diaspora_send(array &$b)
|
|||
$b['body'] = Post\Media::addAttachmentsToBody($b['uri-id'], DI::contentItem()->addSharedPost($b));
|
||||
|
||||
// Dont't post if the post doesn't belong to us.
|
||||
// This is a check for group postings
|
||||
// This is a check for forum postings
|
||||
$self = DBA::selectFirst('contact', ['id'], ['uid' => $b['uid'], 'self' => true]);
|
||||
|
||||
if ($b['contact-id'] != $self['id']) {
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2023-06-03 15:48-0400\n"
|
||||
"POT-Creation-Date: 2021-11-21 19:17-0500\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"
|
||||
|
|
@ -17,84 +17,84 @@ msgstr ""
|
|||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: diaspora.php:43
|
||||
#: diaspora.php:44
|
||||
msgid "Post to Diaspora"
|
||||
msgstr ""
|
||||
|
||||
#: diaspora.php:66
|
||||
#: diaspora.php:67
|
||||
#, php-format
|
||||
msgid ""
|
||||
"Please remember: You can always be reached from Diaspora with your Friendica "
|
||||
"handle <strong>%s</strong>. "
|
||||
msgstr ""
|
||||
|
||||
#: diaspora.php:67
|
||||
#: diaspora.php:68
|
||||
msgid ""
|
||||
"This connector is only meant if you still want to use your old Diaspora "
|
||||
"account for some time. "
|
||||
msgstr ""
|
||||
|
||||
#: diaspora.php:68
|
||||
#: diaspora.php:69
|
||||
#, php-format
|
||||
msgid ""
|
||||
"However, it is preferred that you tell your Diaspora contacts the new handle "
|
||||
"<strong>%s</strong> instead."
|
||||
msgstr ""
|
||||
|
||||
#: diaspora.php:78
|
||||
#: diaspora.php:79
|
||||
msgid "All aspects"
|
||||
msgstr ""
|
||||
|
||||
#: diaspora.php:79
|
||||
#: diaspora.php:80
|
||||
msgid "Public"
|
||||
msgstr ""
|
||||
|
||||
#: diaspora.php:85
|
||||
#: diaspora.php:86
|
||||
msgid "Post to aspect:"
|
||||
msgstr ""
|
||||
|
||||
#: diaspora.php:86
|
||||
#: diaspora.php:87
|
||||
#, php-format
|
||||
msgid "Connected with your Diaspora account <strong>%s</strong>"
|
||||
msgstr ""
|
||||
|
||||
#: diaspora.php:89
|
||||
#: diaspora.php:90
|
||||
msgid ""
|
||||
"Can't login to your Diaspora account. Please check handle (in the format "
|
||||
"user@domain.tld) and password."
|
||||
msgstr ""
|
||||
|
||||
#: diaspora.php:96
|
||||
#: diaspora.php:97
|
||||
msgid "Information"
|
||||
msgstr ""
|
||||
|
||||
#: diaspora.php:97
|
||||
#: diaspora.php:98
|
||||
msgid "Error"
|
||||
msgstr ""
|
||||
|
||||
#: diaspora.php:103
|
||||
#: diaspora.php:104
|
||||
msgid "Enable Diaspora Post Addon"
|
||||
msgstr ""
|
||||
|
||||
#: diaspora.php:104
|
||||
#: diaspora.php:105
|
||||
msgid "Diaspora handle"
|
||||
msgstr ""
|
||||
|
||||
#: diaspora.php:105
|
||||
#: diaspora.php:106
|
||||
msgid "Diaspora password"
|
||||
msgstr ""
|
||||
|
||||
#: diaspora.php:105
|
||||
#: diaspora.php:106
|
||||
msgid ""
|
||||
"Privacy notice: Your Diaspora password will be stored unencrypted to "
|
||||
"authenticate you with your Diaspora pod. This means your Friendica node "
|
||||
"administrator can have access to it."
|
||||
msgstr ""
|
||||
|
||||
#: diaspora.php:107
|
||||
#: diaspora.php:108
|
||||
msgid "Post to Diaspora by default"
|
||||
msgstr ""
|
||||
|
||||
#: diaspora.php:112
|
||||
#: diaspora.php:113
|
||||
msgid "Diaspora Export"
|
||||
msgstr ""
|
||||
|
|
|
|||
|
|
@ -4,8 +4,6 @@
|
|||
* Description: Add a directory of forums hosted on your server, with verbose descriptions.
|
||||
* Version: 1.1
|
||||
* Author: Thomas Willingham <https://beardyunixer.com/profile/beardyunixer>
|
||||
* Status: Unsupported
|
||||
* Note: Please use Group Directory instead
|
||||
*/
|
||||
|
||||
use Friendica\App;
|
||||
|
|
|
|||
|
|
@ -4,8 +4,6 @@
|
|||
* Description: Disable images in group edit menu
|
||||
* Version: 1.0
|
||||
* Author: Thomas Willingham <https://kakste.com/profile/beardyunixer>
|
||||
* Status: Unsupported
|
||||
* Note: Please use Circle Text instead
|
||||
*/
|
||||
|
||||
use Friendica\App;
|
||||
|
|
|
|||
|
|
@ -1,155 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Name: Group Directory
|
||||
* Description: Add a directory of groups hosted on your server, with verbose descriptions.
|
||||
* Version: 1.1
|
||||
* Author: Thomas Willingham <https://beardyunixer.com/profile/beardyunixer>
|
||||
*/
|
||||
|
||||
use Friendica\Content\Nav;
|
||||
use Friendica\Content\Pager;
|
||||
use Friendica\Content\Widget;
|
||||
use Friendica\Core\Hook;
|
||||
use Friendica\Core\Renderer;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\DI;
|
||||
use Friendica\Model\Profile;
|
||||
use Friendica\Model\User;
|
||||
|
||||
global $groupdirectory_search;
|
||||
|
||||
function groupdirectory_install()
|
||||
{
|
||||
Hook::register('app_menu', __FILE__, 'groupdirectory_app_menu');
|
||||
}
|
||||
|
||||
/**
|
||||
* This is a statement rather than an actual function definition. The simple
|
||||
* existence of this method is checked to figure out if the addon offers a
|
||||
* module.
|
||||
*/
|
||||
/**
|
||||
* This is a statement rather than an actual function definition. The simple
|
||||
* existence of this method is checked to figure out if the addon offers a
|
||||
* module.
|
||||
*/
|
||||
function groupdirectory_module() {}
|
||||
|
||||
function groupdirectory_app_menu(array &$b)
|
||||
{
|
||||
$b['app_menu'][] = '<div class="app-title"><a href="groupdirectory">' . DI::l10n()->t('Group Directory') . '</a></div>';
|
||||
}
|
||||
|
||||
function groupdirectory_init()
|
||||
{
|
||||
if (DI::userSession()->getLocalUserId()) {
|
||||
DI::page()['aside'] .= Widget::findPeople();
|
||||
}
|
||||
}
|
||||
|
||||
function groupdirectory_post()
|
||||
{
|
||||
global $groupdirectory_search;
|
||||
|
||||
if (!empty($_POST['search'])) {
|
||||
$groupdirectory_search = $_POST['search'];
|
||||
}
|
||||
}
|
||||
|
||||
function groupdirectory_content()
|
||||
{
|
||||
global $groupdirectory_search;
|
||||
|
||||
if (DI::config()->get('system', 'block_public') && !DI::userSession()->getLocalUserId() && !DI::userSession()->getRemoteUserId()) {
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Public access denied.'));
|
||||
return '';
|
||||
}
|
||||
|
||||
$o = '';
|
||||
$entries = [];
|
||||
|
||||
Nav::setSelected('directory');
|
||||
|
||||
if (!empty($groupdirectory_search)) {
|
||||
$search = trim($groupdirectory_search);
|
||||
} else {
|
||||
$search = (!empty($_GET['search']) ? trim(rawurldecode($_GET['search'])) : '');
|
||||
}
|
||||
|
||||
$gdirpath = '';
|
||||
$dirurl = DI::config()->get('system', 'directory');
|
||||
if (strlen($dirurl)) {
|
||||
$gdirpath = Profile::zrl($dirurl, true);
|
||||
}
|
||||
|
||||
$sql_extra = '';
|
||||
if (strlen($search)) {
|
||||
$search = DBA::escape($search);
|
||||
|
||||
$sql_extra = " AND ((`profile`.`name` LIKE '%$search%') OR
|
||||
(`user`.`nickname` LIKE '%$search%') OR
|
||||
(`profile`.`about` LIKE '%$search%') OR
|
||||
(`profile`.`locality` LIKE '%$search%') OR
|
||||
(`profile`.`region` LIKE '%$search%') OR
|
||||
(`profile`.`country-name` LIKE '%$search%') OR
|
||||
(`profile`.`pub_keywords` LIKE '%$search%') OR
|
||||
(`profile`.`prv_keywords` LIKE '%$search%'))";
|
||||
}
|
||||
|
||||
$publish = DI::config()->get('system', 'publish_all') ? '' : "`publish` = 1";
|
||||
|
||||
$total = 0;
|
||||
$cnt = DBA::fetchFirst("SELECT COUNT(*) AS `total` FROM `profile`
|
||||
INNER JOIN `user` ON `user`.`uid` = `profile`.`uid`
|
||||
WHERE $publish AND NOT `user`.`blocked` AND NOT `user`.`account_removed` AND `user`.`page-flags` = ? $sql_extra",
|
||||
User::PAGE_FLAGS_COMMUNITY);
|
||||
if (DBA::isResult($cnt)) {
|
||||
$total = $cnt['total'];
|
||||
}
|
||||
|
||||
$pager = new Pager(DI::l10n(), DI::args()->getQueryString(), 60);
|
||||
|
||||
$order = " ORDER BY `name` ASC ";
|
||||
|
||||
$limit = $pager->getStart() . "," . $pager->getItemsPerPage();
|
||||
|
||||
$r = DBA::p("SELECT `profile`.*, `user`.`nickname`, `user`.`timezone` , `user`.`page-flags`,
|
||||
`contact`.`addr`, `contact`.`url` FROM `profile`
|
||||
INNER JOIN `user` ON `user`.`uid` = `profile`.`uid`
|
||||
INNER JOIN `contact` ON `contact`.`uid` = `user`.`uid`
|
||||
WHERE $publish AND NOT `user`.`blocked` AND NOT `user`.`account_removed` AND `user`.`page-flags` = ? AND `contact`.`self`
|
||||
$sql_extra $order LIMIT $limit", User::PAGE_FLAGS_COMMUNITY
|
||||
);
|
||||
|
||||
if (DBA::isResult($r)) {
|
||||
if (in_array('small', DI::args()->getArgv())) {
|
||||
$photo = 'thumb';
|
||||
} else {
|
||||
$photo = 'photo';
|
||||
}
|
||||
|
||||
while ($rr = DBA::fetch($r)) {
|
||||
$entries[] = Friendica\Module\Directory::formatEntry($rr, $photo);
|
||||
}
|
||||
DBA::close($r);
|
||||
} else {
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('No entries (some entries may be hidden).'));
|
||||
}
|
||||
|
||||
$tpl = Renderer::getMarkupTemplate('directory_header.tpl');
|
||||
$o .= Renderer::replaceMacros($tpl, [
|
||||
'$search' => $search,
|
||||
'$globaldir' => DI::l10n()->t('Global Directory'),
|
||||
'$gdirpath' => $gdirpath,
|
||||
'$desc' => DI::l10n()->t('Find on this site'),
|
||||
'$contacts' => $entries,
|
||||
'$finding' => DI::l10n()->t('Results for:'),
|
||||
'$findterm' => (strlen($search) ? $search : ""),
|
||||
'$title' => DI::l10n()->t('Group Directory'),
|
||||
'$search_mod' => 'groupdirectory',
|
||||
'$submit' => DI::l10n()->t('Find'),
|
||||
'$paginate' => $pager->renderFull($total),
|
||||
]);
|
||||
|
||||
return $o;
|
||||
}
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
# ADDON groupdirectory
|
||||
# Copyright (C)
|
||||
# This file is distributed under the same license as the Friendica groupdirectory addon package.
|
||||
#
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2023-06-03 15:49-0400\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"
|
||||
"Language: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: groupdirectory.php:40 groupdirectory.php:148
|
||||
msgid "Group Directory"
|
||||
msgstr ""
|
||||
|
||||
#: groupdirectory.php:64
|
||||
msgid "Public access denied."
|
||||
msgstr ""
|
||||
|
||||
#: groupdirectory.php:136
|
||||
msgid "No entries (some entries may be hidden)."
|
||||
msgstr ""
|
||||
|
||||
#: groupdirectory.php:142
|
||||
msgid "Global Directory"
|
||||
msgstr ""
|
||||
|
||||
#: groupdirectory.php:144
|
||||
msgid "Find on this site"
|
||||
msgstr ""
|
||||
|
||||
#: groupdirectory.php:146
|
||||
msgid "Results for:"
|
||||
msgstr ""
|
||||
|
||||
#: groupdirectory.php:150
|
||||
msgid "Find"
|
||||
msgstr ""
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
# ADDON forumdirectory
|
||||
# Copyright (C)
|
||||
# This file is distributed under the same license as the Friendica forumdirectory addon package.
|
||||
#
|
||||
#
|
||||
# Translators:
|
||||
# abidin toumi <abidin24@tutanota.com>, 2021
|
||||
# ButterflyOfFire, 2019
|
||||
# Farida Khalaf <faridakhalaf@hotmail.com>, 2021
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: friendica\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-02-01 18:15+0100\n"
|
||||
"PO-Revision-Date: 2021-10-29 10:27+0000\n"
|
||||
"Last-Translator: abidin toumi <abidin24@tutanota.com>\n"
|
||||
"Language-Team: Arabic (http://www.transifex.com/Friendica/friendica/language/ar/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: ar\n"
|
||||
"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n"
|
||||
|
||||
#: forumdirectory.php:33 forumdirectory.php:137
|
||||
msgid "Forum Directory"
|
||||
msgstr "دليل المنتدى"
|
||||
|
||||
#: forumdirectory.php:53
|
||||
msgid "Public access denied."
|
||||
msgstr "رُفض الوصول العمومي."
|
||||
|
||||
#: forumdirectory.php:125
|
||||
msgid "No entries (some entries may be hidden)."
|
||||
msgstr "لا توجد مدخلات (قد تكون بعض المدخلات مخفية)."
|
||||
|
||||
#: forumdirectory.php:131
|
||||
msgid "Global Directory"
|
||||
msgstr "الدليل العالمي"
|
||||
|
||||
#: forumdirectory.php:133
|
||||
msgid "Find on this site"
|
||||
msgstr "ابحث في هذا الموقع"
|
||||
|
||||
#: forumdirectory.php:135
|
||||
msgid "Results for:"
|
||||
msgstr "النتائج:"
|
||||
|
||||
#: forumdirectory.php:139
|
||||
msgid "Find"
|
||||
msgstr "ابحث"
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
<?php
|
||||
|
||||
if(! function_exists("string_plural_select_ar")) {
|
||||
function string_plural_select_ar($n){
|
||||
$n = intval($n);
|
||||
if ($n==0) { return 0; } else if ($n==1) { return 1; } else if ($n==2) { return 2; } else if ($n%100>=3 && $n%100<=10) { return 3; } else if ($n%100>=11 && $n%100<=99) { return 4; } else { return 5; }
|
||||
}}
|
||||
$a->strings['Forum Directory'] = 'دليل المنتدى';
|
||||
$a->strings['Public access denied.'] = 'رُفض الوصول العمومي.';
|
||||
$a->strings['No entries (some entries may be hidden).'] = 'لا توجد مدخلات (قد تكون بعض المدخلات مخفية).';
|
||||
$a->strings['Global Directory'] = 'الدليل العالمي';
|
||||
$a->strings['Find on this site'] = 'ابحث في هذا الموقع';
|
||||
$a->strings['Results for:'] = 'النتائج:';
|
||||
$a->strings['Find'] = 'ابحث';
|
||||
|
|
@ -1,80 +0,0 @@
|
|||
# ADDON forumdirectory
|
||||
# Copyright (C)
|
||||
# This file is distributed under the same license as the Friendica forumdirectory addon package.
|
||||
#
|
||||
#
|
||||
# Translators:
|
||||
# Joan Bar <friendica@tutanota.com>, 2019
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: friendica\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2013-02-27 05:01-0500\n"
|
||||
"PO-Revision-Date: 2019-10-18 18:57+0000\n"
|
||||
"Last-Translator: Joan Bar <friendica@tutanota.com>\n"
|
||||
"Language-Team: Catalan (http://www.transifex.com/Friendica/friendica/language/ca/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: ca\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#: forumdirectory.php:22
|
||||
msgid "Forum Directory"
|
||||
msgstr "Directori de fòrums"
|
||||
|
||||
#: forumdirectory.php:53
|
||||
msgid "Public access denied."
|
||||
msgstr "L'accés al públic s'ha denegat."
|
||||
|
||||
#: forumdirectory.php:71
|
||||
msgid "Global Directory"
|
||||
msgstr "Directori global"
|
||||
|
||||
#: forumdirectory.php:79
|
||||
msgid "Find on this site"
|
||||
msgstr "Cerqueu en aquest lloc"
|
||||
|
||||
#: forumdirectory.php:81
|
||||
msgid "Finding: "
|
||||
msgstr "Trobament:"
|
||||
|
||||
#: forumdirectory.php:82
|
||||
msgid "Site Directory"
|
||||
msgstr "Directori de llocs"
|
||||
|
||||
#: forumdirectory.php:83
|
||||
msgid "Find"
|
||||
msgstr "trobar"
|
||||
|
||||
#: forumdirectory.php:133
|
||||
msgid "Age: "
|
||||
msgstr "Edat:"
|
||||
|
||||
#: forumdirectory.php:136
|
||||
msgid "Gender: "
|
||||
msgstr "Gènere:"
|
||||
|
||||
#: forumdirectory.php:156
|
||||
msgid "Location:"
|
||||
msgstr "Ubicació:"
|
||||
|
||||
#: forumdirectory.php:158
|
||||
msgid "Gender:"
|
||||
msgstr "Gènere:"
|
||||
|
||||
#: forumdirectory.php:160
|
||||
msgid "Status:"
|
||||
msgstr "Estat:"
|
||||
|
||||
#: forumdirectory.php:162
|
||||
msgid "Homepage:"
|
||||
msgstr "Pàgina inicial:"
|
||||
|
||||
#: forumdirectory.php:164
|
||||
msgid "About:"
|
||||
msgstr "Sobre:"
|
||||
|
||||
#: forumdirectory.php:201
|
||||
msgid "No entries (some entries may be hidden)."
|
||||
msgstr "No hi ha entrades (algunes entrades poden estar ocultes)."
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
<?php
|
||||
|
||||
if(! function_exists("string_plural_select_ca")) {
|
||||
function string_plural_select_ca($n){
|
||||
$n = intval($n);
|
||||
return intval($n != 1);
|
||||
}}
|
||||
$a->strings['Forum Directory'] = 'Directori de fòrums';
|
||||
$a->strings['Public access denied.'] = 'L\'accés al públic s\'ha denegat.';
|
||||
$a->strings['Global Directory'] = 'Directori global';
|
||||
$a->strings['Find on this site'] = 'Cerqueu en aquest lloc';
|
||||
$a->strings['Finding: '] = 'Trobament:';
|
||||
$a->strings['Site Directory'] = 'Directori de llocs';
|
||||
$a->strings['Find'] = 'trobar';
|
||||
$a->strings['Age: '] = 'Edat:';
|
||||
$a->strings['Gender: '] = 'Gènere:';
|
||||
$a->strings['Location:'] = 'Ubicació:';
|
||||
$a->strings['Gender:'] = 'Gènere:';
|
||||
$a->strings['Status:'] = 'Estat:';
|
||||
$a->strings['Homepage:'] = 'Pàgina inicial:';
|
||||
$a->strings['About:'] = 'Sobre:';
|
||||
$a->strings['No entries (some entries may be hidden).'] = 'No hi ha entrades (algunes entrades poden estar ocultes).';
|
||||
|
|
@ -1,81 +0,0 @@
|
|||
# ADDON forumdirectory
|
||||
# Copyright (C)
|
||||
# This file is distributed under the same license as the Friendica forumdirectory addon package.
|
||||
#
|
||||
#
|
||||
# Translators:
|
||||
# Aditoo, 2018
|
||||
# michal_s <msupler@gmail.com>, 2014
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: friendica\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2013-02-27 05:01-0500\n"
|
||||
"PO-Revision-Date: 2018-09-11 19:04+0000\n"
|
||||
"Last-Translator: Aditoo\n"
|
||||
"Language-Team: Czech (http://www.transifex.com/Friendica/friendica/language/cs/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: cs\n"
|
||||
"Plural-Forms: nplurals=4; plural=(n == 1 && n % 1 == 0) ? 0 : (n >= 2 && n <= 4 && n % 1 == 0) ? 1: (n % 1 != 0 ) ? 2 : 3;\n"
|
||||
|
||||
#: forumdirectory.php:22
|
||||
msgid "Forum Directory"
|
||||
msgstr "Adresář fór"
|
||||
|
||||
#: forumdirectory.php:53
|
||||
msgid "Public access denied."
|
||||
msgstr "Veřejný přístup odepřen."
|
||||
|
||||
#: forumdirectory.php:71
|
||||
msgid "Global Directory"
|
||||
msgstr "Globální adresář"
|
||||
|
||||
#: forumdirectory.php:79
|
||||
msgid "Find on this site"
|
||||
msgstr "Najít na tomto webu"
|
||||
|
||||
#: forumdirectory.php:81
|
||||
msgid "Finding: "
|
||||
msgstr "Hledání: "
|
||||
|
||||
#: forumdirectory.php:82
|
||||
msgid "Site Directory"
|
||||
msgstr "Adresář serveru"
|
||||
|
||||
#: forumdirectory.php:83
|
||||
msgid "Find"
|
||||
msgstr "Najít"
|
||||
|
||||
#: forumdirectory.php:133
|
||||
msgid "Age: "
|
||||
msgstr "Věk: "
|
||||
|
||||
#: forumdirectory.php:136
|
||||
msgid "Gender: "
|
||||
msgstr "Pohlaví: "
|
||||
|
||||
#: forumdirectory.php:156
|
||||
msgid "Location:"
|
||||
msgstr "Poloha:"
|
||||
|
||||
#: forumdirectory.php:158
|
||||
msgid "Gender:"
|
||||
msgstr "Pohlaví:"
|
||||
|
||||
#: forumdirectory.php:160
|
||||
msgid "Status:"
|
||||
msgstr "Stav:"
|
||||
|
||||
#: forumdirectory.php:162
|
||||
msgid "Homepage:"
|
||||
msgstr "Domovská stránka:"
|
||||
|
||||
#: forumdirectory.php:164
|
||||
msgid "About:"
|
||||
msgstr "O mě:"
|
||||
|
||||
#: forumdirectory.php:201
|
||||
msgid "No entries (some entries may be hidden)."
|
||||
msgstr "Žádné záznamy (některé položky mohou být skryty)."
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
<?php
|
||||
|
||||
if(! function_exists("string_plural_select_cs")) {
|
||||
function string_plural_select_cs($n){
|
||||
$n = intval($n);
|
||||
if (($n == 1 && $n % 1 == 0)) { return 0; } else if (($n >= 2 && $n <= 4 && $n % 1 == 0)) { return 1; } else if (($n % 1 != 0 )) { return 2; } else { return 3; }
|
||||
}}
|
||||
$a->strings['Forum Directory'] = 'Adresář fór';
|
||||
$a->strings['Public access denied.'] = 'Veřejný přístup odepřen.';
|
||||
$a->strings['Global Directory'] = 'Globální adresář';
|
||||
$a->strings['Find on this site'] = 'Najít na tomto webu';
|
||||
$a->strings['Finding: '] = 'Hledání: ';
|
||||
$a->strings['Site Directory'] = 'Adresář serveru';
|
||||
$a->strings['Find'] = 'Najít';
|
||||
$a->strings['Age: '] = 'Věk: ';
|
||||
$a->strings['Gender: '] = 'Pohlaví: ';
|
||||
$a->strings['Location:'] = 'Poloha:';
|
||||
$a->strings['Gender:'] = 'Pohlaví:';
|
||||
$a->strings['Status:'] = 'Stav:';
|
||||
$a->strings['Homepage:'] = 'Domovská stránka:';
|
||||
$a->strings['About:'] = 'O mě:';
|
||||
$a->strings['No entries (some entries may be hidden).'] = 'Žádné záznamy (některé položky mohou být skryty).';
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
# ADDON forumdirectory
|
||||
# Copyright (C)
|
||||
# This file is distributed under the same license as the Friendica forumdirectory addon package.
|
||||
#
|
||||
#
|
||||
# Translators:
|
||||
# Anton <dev@atjn.dk>, 2022
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: friendica\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-02-01 18:15+0100\n"
|
||||
"PO-Revision-Date: 2014-06-22 12:31+0000\n"
|
||||
"Last-Translator: Anton <dev@atjn.dk>, 2022\n"
|
||||
"Language-Team: Danish (Denmark) (http://www.transifex.com/Friendica/friendica/language/da_DK/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: da_DK\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#: forumdirectory.php:33 forumdirectory.php:137
|
||||
msgid "Forum Directory"
|
||||
msgstr "Forum adressebog"
|
||||
|
||||
#: forumdirectory.php:53
|
||||
msgid "Public access denied."
|
||||
msgstr "Offentlig adgang nægtet."
|
||||
|
||||
#: forumdirectory.php:125
|
||||
msgid "No entries (some entries may be hidden)."
|
||||
msgstr "Ingen poster (nogle poster er måske skjulte)."
|
||||
|
||||
#: forumdirectory.php:131
|
||||
msgid "Global Directory"
|
||||
msgstr "Global adressebog"
|
||||
|
||||
#: forumdirectory.php:133
|
||||
msgid "Find on this site"
|
||||
msgstr "Find på denne side"
|
||||
|
||||
#: forumdirectory.php:135
|
||||
msgid "Results for:"
|
||||
msgstr "Resultater for:"
|
||||
|
||||
#: forumdirectory.php:139
|
||||
msgid "Find"
|
||||
msgstr "Find"
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
<?php
|
||||
|
||||
if(! function_exists("string_plural_select_da_dk")) {
|
||||
function string_plural_select_da_dk($n){
|
||||
$n = intval($n);
|
||||
return intval($n != 1);
|
||||
}}
|
||||
$a->strings['Forum Directory'] = 'Forum adressebog';
|
||||
$a->strings['Public access denied.'] = 'Offentlig adgang nægtet.';
|
||||
$a->strings['No entries (some entries may be hidden).'] = 'Ingen poster (nogle poster er måske skjulte).';
|
||||
$a->strings['Global Directory'] = 'Global adressebog';
|
||||
$a->strings['Find on this site'] = 'Find på denne side';
|
||||
$a->strings['Results for:'] = 'Resultater for:';
|
||||
$a->strings['Find'] = 'Find';
|
||||
|
|
@ -1,49 +0,0 @@
|
|||
# ADDON forumdirectory
|
||||
# Copyright (C)
|
||||
# This file is distributed under the same license as the Friendica forumdirectory addon package.
|
||||
#
|
||||
#
|
||||
# Translators:
|
||||
# Tobias Diekershoff <tobias.diekershoff@gmx.net>, 2014
|
||||
# Tobias Diekershoff <tobias.diekershoff@gmx.net>, 2021
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: friendica\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-02-01 18:15+0100\n"
|
||||
"PO-Revision-Date: 2014-06-22 12:31+0000\n"
|
||||
"Last-Translator: Tobias Diekershoff <tobias.diekershoff@gmx.net>, 2021\n"
|
||||
"Language-Team: German (http://app.transifex.com/Friendica/friendica/language/de/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: de\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#: forumdirectory.php:33 forumdirectory.php:137
|
||||
msgid "Forum Directory"
|
||||
msgstr "Foren Verzeichnis"
|
||||
|
||||
#: forumdirectory.php:53
|
||||
msgid "Public access denied."
|
||||
msgstr "Öffentlicher Zugriff verweigert."
|
||||
|
||||
#: forumdirectory.php:125
|
||||
msgid "No entries (some entries may be hidden)."
|
||||
msgstr "Keine Einträge (einige Einträge könnten versteckt sein)."
|
||||
|
||||
#: forumdirectory.php:131
|
||||
msgid "Global Directory"
|
||||
msgstr "Weltweites Verzeichnis"
|
||||
|
||||
#: forumdirectory.php:133
|
||||
msgid "Find on this site"
|
||||
msgstr "Auf diesem Server suchen"
|
||||
|
||||
#: forumdirectory.php:135
|
||||
msgid "Results for:"
|
||||
msgstr "Ergebnis für:"
|
||||
|
||||
#: forumdirectory.php:139
|
||||
msgid "Find"
|
||||
msgstr "Finde"
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
<?php
|
||||
|
||||
if(! function_exists("string_plural_select_de")) {
|
||||
function string_plural_select_de($n){
|
||||
$n = intval($n);
|
||||
return intval($n != 1);
|
||||
}}
|
||||
$a->strings['Forum Directory'] = 'Foren Verzeichnis';
|
||||
$a->strings['Public access denied.'] = 'Öffentlicher Zugriff verweigert.';
|
||||
$a->strings['No entries (some entries may be hidden).'] = 'Keine Einträge (einige Einträge könnten versteckt sein).';
|
||||
$a->strings['Global Directory'] = 'Weltweites Verzeichnis';
|
||||
$a->strings['Find on this site'] = 'Auf diesem Server suchen';
|
||||
$a->strings['Results for:'] = 'Ergebnis für:';
|
||||
$a->strings['Find'] = 'Finde';
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
<?php
|
||||
|
||||
$a->strings["Public access denied."] = "Publika atingo ne permesita.";
|
||||
$a->strings["Global Directory"] = "Tutmonda Katalogo";
|
||||
$a->strings["Find on this site"] = "Trovi en ĉi retejo";
|
||||
$a->strings["Finding: "] = "Trovata:";
|
||||
$a->strings["Site Directory"] = "Reteja Katalogo";
|
||||
$a->strings["Find"] = "Trovi";
|
||||
$a->strings["Age: "] = "Aĝo:";
|
||||
$a->strings["Gender: "] = "Sekso:";
|
||||
$a->strings["Location:"] = "Loko:";
|
||||
$a->strings["Gender:"] = "Sekso:";
|
||||
$a->strings["Status:"] = "Stato:";
|
||||
$a->strings["Homepage:"] = "Hejmpaĝo:";
|
||||
$a->strings["About:"] = "Pri:";
|
||||
$a->strings["No entries (some entries may be hidden)."] = "Neniom da afiŝoj (kelkaj afiŝoj eble ne estas videbla).";
|
||||
|
|
@ -1,49 +0,0 @@
|
|||
# ADDON forumdirectory
|
||||
# Copyright (C)
|
||||
# This file is distributed under the same license as the Friendica forumdirectory addon package.
|
||||
#
|
||||
#
|
||||
# Translators:
|
||||
# Albert, 2016
|
||||
# Senex Petrovic <javierruizo@hotmail.com>, 2021
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: friendica\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-02-01 18:15+0100\n"
|
||||
"PO-Revision-Date: 2021-04-01 09:54+0000\n"
|
||||
"Last-Translator: Senex Petrovic <javierruizo@hotmail.com>\n"
|
||||
"Language-Team: Spanish (http://www.transifex.com/Friendica/friendica/language/es/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: es\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#: forumdirectory.php:33 forumdirectory.php:137
|
||||
msgid "Forum Directory"
|
||||
msgstr "Directorio de foro"
|
||||
|
||||
#: forumdirectory.php:53
|
||||
msgid "Public access denied."
|
||||
msgstr "Acceso público denegado."
|
||||
|
||||
#: forumdirectory.php:125
|
||||
msgid "No entries (some entries may be hidden)."
|
||||
msgstr "Sin entradas (algunas entradas pueden estar ocultas)."
|
||||
|
||||
#: forumdirectory.php:131
|
||||
msgid "Global Directory"
|
||||
msgstr "Directorio global"
|
||||
|
||||
#: forumdirectory.php:133
|
||||
msgid "Find on this site"
|
||||
msgstr "Encontrar en esta página"
|
||||
|
||||
#: forumdirectory.php:135
|
||||
msgid "Results for:"
|
||||
msgstr "Resultados para:"
|
||||
|
||||
#: forumdirectory.php:139
|
||||
msgid "Find"
|
||||
msgstr "Encontrar"
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
<?php
|
||||
|
||||
if(! function_exists("string_plural_select_es")) {
|
||||
function string_plural_select_es($n){
|
||||
$n = intval($n);
|
||||
return intval($n != 1);
|
||||
}}
|
||||
$a->strings['Forum Directory'] = 'Directorio de foro';
|
||||
$a->strings['Public access denied.'] = 'Acceso público denegado.';
|
||||
$a->strings['No entries (some entries may be hidden).'] = 'Sin entradas (algunas entradas pueden estar ocultas).';
|
||||
$a->strings['Global Directory'] = 'Directorio global';
|
||||
$a->strings['Find on this site'] = 'Encontrar en esta página';
|
||||
$a->strings['Results for:'] = 'Resultados para:';
|
||||
$a->strings['Find'] = 'Encontrar';
|
||||
|
|
@ -1,81 +0,0 @@
|
|||
# ADDON forumdirectory
|
||||
# Copyright (C)
|
||||
# This file is distributed under the same license as the Friendica forumdirectory addon package.
|
||||
#
|
||||
#
|
||||
# Translators:
|
||||
# Kris, 2018
|
||||
# Kris, 2018
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: friendica\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2013-02-27 05:01-0500\n"
|
||||
"PO-Revision-Date: 2018-05-12 12:50+0000\n"
|
||||
"Last-Translator: Kris\n"
|
||||
"Language-Team: Finnish (Finland) (http://www.transifex.com/Friendica/friendica/language/fi_FI/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: fi_FI\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#: forumdirectory.php:22
|
||||
msgid "Forum Directory"
|
||||
msgstr "Foorumihakemisto"
|
||||
|
||||
#: forumdirectory.php:53
|
||||
msgid "Public access denied."
|
||||
msgstr "Julkinen käyttö estetty."
|
||||
|
||||
#: forumdirectory.php:71
|
||||
msgid "Global Directory"
|
||||
msgstr "Maailmanlaajuinen hakemisto"
|
||||
|
||||
#: forumdirectory.php:79
|
||||
msgid "Find on this site"
|
||||
msgstr "Sivustohaku"
|
||||
|
||||
#: forumdirectory.php:81
|
||||
msgid "Finding: "
|
||||
msgstr ""
|
||||
|
||||
#: forumdirectory.php:82
|
||||
msgid "Site Directory"
|
||||
msgstr "Sivustoluettelo"
|
||||
|
||||
#: forumdirectory.php:83
|
||||
msgid "Find"
|
||||
msgstr "Etsi"
|
||||
|
||||
#: forumdirectory.php:133
|
||||
msgid "Age: "
|
||||
msgstr "Ikä:"
|
||||
|
||||
#: forumdirectory.php:136
|
||||
msgid "Gender: "
|
||||
msgstr "Sukupuoli:"
|
||||
|
||||
#: forumdirectory.php:156
|
||||
msgid "Location:"
|
||||
msgstr "Sijainti:"
|
||||
|
||||
#: forumdirectory.php:158
|
||||
msgid "Gender:"
|
||||
msgstr "Sukupuoli:"
|
||||
|
||||
#: forumdirectory.php:160
|
||||
msgid "Status:"
|
||||
msgstr "Tila:"
|
||||
|
||||
#: forumdirectory.php:162
|
||||
msgid "Homepage:"
|
||||
msgstr "Kotisivu:"
|
||||
|
||||
#: forumdirectory.php:164
|
||||
msgid "About:"
|
||||
msgstr "Lisätietoja:"
|
||||
|
||||
#: forumdirectory.php:201
|
||||
msgid "No entries (some entries may be hidden)."
|
||||
msgstr "Ei kohteita (jotkut kohteet saattaa olla piilotettuja)."
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
<?php
|
||||
|
||||
if(! function_exists("string_plural_select_fi_fi")) {
|
||||
function string_plural_select_fi_fi($n){
|
||||
$n = intval($n);
|
||||
return intval($n != 1);
|
||||
}}
|
||||
$a->strings['Forum Directory'] = 'Foorumihakemisto';
|
||||
$a->strings['Public access denied.'] = 'Julkinen käyttö estetty.';
|
||||
$a->strings['Global Directory'] = 'Maailmanlaajuinen hakemisto';
|
||||
$a->strings['Find on this site'] = 'Sivustohaku';
|
||||
$a->strings['Site Directory'] = 'Sivustoluettelo';
|
||||
$a->strings['Find'] = 'Etsi';
|
||||
$a->strings['Age: '] = 'Ikä:';
|
||||
$a->strings['Gender: '] = 'Sukupuoli:';
|
||||
$a->strings['Location:'] = 'Sijainti:';
|
||||
$a->strings['Gender:'] = 'Sukupuoli:';
|
||||
$a->strings['Status:'] = 'Tila:';
|
||||
$a->strings['Homepage:'] = 'Kotisivu:';
|
||||
$a->strings['About:'] = 'Lisätietoja:';
|
||||
$a->strings['No entries (some entries may be hidden).'] = 'Ei kohteita (jotkut kohteet saattaa olla piilotettuja).';
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
# ADDON forumdirectory
|
||||
# Copyright (C)
|
||||
# This file is distributed under the same license as the Friendica forumdirectory addon package.
|
||||
#
|
||||
#
|
||||
# Translators:
|
||||
# bob lebonche <lebonche@tutanota.com>, 2021
|
||||
# Hypolite Petovan <hypolite@mrpetovan.com>, 2016
|
||||
# StefOfficiel <pichard.stephane@free.fr>, 2015
|
||||
# Valvin <vincent-forum@valvin.fr>, 2019
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: friendica\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-02-01 18:15+0100\n"
|
||||
"PO-Revision-Date: 2014-06-22 12:31+0000\n"
|
||||
"Last-Translator: bob lebonche <lebonche@tutanota.com>, 2021\n"
|
||||
"Language-Team: French (http://www.transifex.com/Friendica/friendica/language/fr/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: fr\n"
|
||||
"Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n"
|
||||
|
||||
#: forumdirectory.php:33 forumdirectory.php:137
|
||||
msgid "Forum Directory"
|
||||
msgstr "Annuaire de Forums"
|
||||
|
||||
#: forumdirectory.php:53
|
||||
msgid "Public access denied."
|
||||
msgstr "Accès public refusé."
|
||||
|
||||
#: forumdirectory.php:125
|
||||
msgid "No entries (some entries may be hidden)."
|
||||
msgstr "Pas de résultats (certains résultats peuvent être cachés)."
|
||||
|
||||
#: forumdirectory.php:131
|
||||
msgid "Global Directory"
|
||||
msgstr "Annuaire Global"
|
||||
|
||||
#: forumdirectory.php:133
|
||||
msgid "Find on this site"
|
||||
msgstr "Trouver sur cette instance"
|
||||
|
||||
#: forumdirectory.php:135
|
||||
msgid "Results for:"
|
||||
msgstr "Résultats pour :"
|
||||
|
||||
#: forumdirectory.php:139
|
||||
msgid "Find"
|
||||
msgstr "Chercher"
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
<?php
|
||||
|
||||
if(! function_exists("string_plural_select_fr")) {
|
||||
function string_plural_select_fr($n){
|
||||
$n = intval($n);
|
||||
if (($n == 0 || $n == 1)) { return 0; } else if ($n != 0 && $n % 1000000 == 0) { return 1; } else { return 2; }
|
||||
}}
|
||||
$a->strings['Forum Directory'] = 'Annuaire de Forums';
|
||||
$a->strings['Public access denied.'] = 'Accès public refusé.';
|
||||
$a->strings['No entries (some entries may be hidden).'] = 'Pas de résultats (certains résultats peuvent être cachés).';
|
||||
$a->strings['Global Directory'] = 'Annuaire Global';
|
||||
$a->strings['Find on this site'] = 'Trouver sur cette instance';
|
||||
$a->strings['Results for:'] = 'Résultats pour :';
|
||||
$a->strings['Find'] = 'Chercher';
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
# ADDON forumdirectory
|
||||
# Copyright (C)
|
||||
# This file is distributed under the same license as the Friendica forumdirectory addon package.
|
||||
#
|
||||
#
|
||||
# Translators:
|
||||
# Balázs Úr, 2020-2021
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: friendica\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-02-01 18:15+0100\n"
|
||||
"PO-Revision-Date: 2014-06-22 12:31+0000\n"
|
||||
"Last-Translator: Balázs Úr, 2020-2021\n"
|
||||
"Language-Team: Hungarian (http://www.transifex.com/Friendica/friendica/language/hu/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: hu\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#: forumdirectory.php:33 forumdirectory.php:137
|
||||
msgid "Forum Directory"
|
||||
msgstr "Fórumkönyvtár"
|
||||
|
||||
#: forumdirectory.php:53
|
||||
msgid "Public access denied."
|
||||
msgstr "Nyilvános hozzáférés megtagadva."
|
||||
|
||||
#: forumdirectory.php:125
|
||||
msgid "No entries (some entries may be hidden)."
|
||||
msgstr "Nincsenek bejegyzések (néhány bejegyzés rejtve lehet)."
|
||||
|
||||
#: forumdirectory.php:131
|
||||
msgid "Global Directory"
|
||||
msgstr "Globális könyvtár"
|
||||
|
||||
#: forumdirectory.php:133
|
||||
msgid "Find on this site"
|
||||
msgstr "Keresés ezen az oldalon"
|
||||
|
||||
#: forumdirectory.php:135
|
||||
msgid "Results for:"
|
||||
msgstr "Találatok ehhez:"
|
||||
|
||||
#: forumdirectory.php:139
|
||||
msgid "Find"
|
||||
msgstr "Keresés"
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
<?php
|
||||
|
||||
if(! function_exists("string_plural_select_hu")) {
|
||||
function string_plural_select_hu($n){
|
||||
$n = intval($n);
|
||||
return intval($n != 1);
|
||||
}}
|
||||
$a->strings['Forum Directory'] = 'Fórumkönyvtár';
|
||||
$a->strings['Public access denied.'] = 'Nyilvános hozzáférés megtagadva.';
|
||||
$a->strings['No entries (some entries may be hidden).'] = 'Nincsenek bejegyzések (néhány bejegyzés rejtve lehet).';
|
||||
$a->strings['Global Directory'] = 'Globális könyvtár';
|
||||
$a->strings['Find on this site'] = 'Keresés ezen az oldalon';
|
||||
$a->strings['Results for:'] = 'Találatok ehhez:';
|
||||
$a->strings['Find'] = 'Keresés';
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
<?php
|
||||
|
||||
$a->strings["Public access denied."] = "Alemennings aðgangur ekki veittur.";
|
||||
$a->strings["Global Directory"] = "Heims tengiliða skrá";
|
||||
$a->strings["Find on this site"] = "Leita á þessum vef";
|
||||
$a->strings["Finding: "] = "Niðurstöður:";
|
||||
$a->strings["Site Directory"] = "Vef tengiliða skrá";
|
||||
$a->strings["Find"] = "Finna";
|
||||
$a->strings["Age: "] = "Aldur:";
|
||||
$a->strings["Gender: "] = "Kyn:";
|
||||
$a->strings["Location:"] = "Staðsetning:";
|
||||
$a->strings["Gender:"] = "Kyn:";
|
||||
$a->strings["Status:"] = "Staða:";
|
||||
$a->strings["Homepage:"] = "Heimasíða:";
|
||||
$a->strings["About:"] = "Um:";
|
||||
$a->strings["No entries (some entries may be hidden)."] = "Engar færslur (sumar geta verið faldar).";
|
||||
|
|
@ -1,49 +0,0 @@
|
|||
# ADDON forumdirectory
|
||||
# Copyright (C)
|
||||
# This file is distributed under the same license as the Friendica forumdirectory addon package.
|
||||
#
|
||||
#
|
||||
# Translators:
|
||||
# fabrixxm <fabrix.xm@gmail.com>, 2014
|
||||
# Sylke Vicious <silkevicious@gmail.com>, 2021
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: friendica\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-02-01 18:15+0100\n"
|
||||
"PO-Revision-Date: 2021-02-16 12:56+0000\n"
|
||||
"Last-Translator: Sylke Vicious <silkevicious@gmail.com>\n"
|
||||
"Language-Team: Italian (http://www.transifex.com/Friendica/friendica/language/it/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: it\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#: forumdirectory.php:33 forumdirectory.php:137
|
||||
msgid "Forum Directory"
|
||||
msgstr "Elenco Forum"
|
||||
|
||||
#: forumdirectory.php:53
|
||||
msgid "Public access denied."
|
||||
msgstr "Accesso negato."
|
||||
|
||||
#: forumdirectory.php:125
|
||||
msgid "No entries (some entries may be hidden)."
|
||||
msgstr "Nessuna voce (qualche voce potrebbe essere nascosta)."
|
||||
|
||||
#: forumdirectory.php:131
|
||||
msgid "Global Directory"
|
||||
msgstr "Elenco globale"
|
||||
|
||||
#: forumdirectory.php:133
|
||||
msgid "Find on this site"
|
||||
msgstr "Cerca nel sito"
|
||||
|
||||
#: forumdirectory.php:135
|
||||
msgid "Results for:"
|
||||
msgstr "Risultati per:"
|
||||
|
||||
#: forumdirectory.php:139
|
||||
msgid "Find"
|
||||
msgstr "Trova"
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
<?php
|
||||
|
||||
if(! function_exists("string_plural_select_it")) {
|
||||
function string_plural_select_it($n){
|
||||
$n = intval($n);
|
||||
return intval($n != 1);
|
||||
}}
|
||||
$a->strings['Forum Directory'] = 'Elenco Forum';
|
||||
$a->strings['Public access denied.'] = 'Accesso negato.';
|
||||
$a->strings['No entries (some entries may be hidden).'] = 'Nessuna voce (qualche voce potrebbe essere nascosta).';
|
||||
$a->strings['Global Directory'] = 'Elenco globale';
|
||||
$a->strings['Find on this site'] = 'Cerca nel sito';
|
||||
$a->strings['Results for:'] = 'Risultati per:';
|
||||
$a->strings['Find'] = 'Trova';
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
<?php
|
||||
|
||||
$a->strings["Forum Directory"] = "";
|
||||
$a->strings["Public access denied."] = "Offentlig tilgang ikke tillatt.";
|
||||
$a->strings["Global Directory"] = "Global katalog";
|
||||
$a->strings["Find on this site"] = "";
|
||||
$a->strings["Finding: "] = "Fant:";
|
||||
$a->strings["Site Directory"] = "Stedets katalog";
|
||||
$a->strings["Find"] = "Finn";
|
||||
$a->strings["Age: "] = "Alder:";
|
||||
$a->strings["Gender: "] = "Kjønn:";
|
||||
$a->strings["Location:"] = "Plassering:";
|
||||
$a->strings["Gender:"] = "Kjønn:";
|
||||
$a->strings["Status:"] = "Status:";
|
||||
$a->strings["Homepage:"] = "Hjemmeside:";
|
||||
$a->strings["About:"] = "Om:";
|
||||
$a->strings["No entries (some entries may be hidden)."] = "Ingen oppføringer (noen oppføringer kan være skjulte).";
|
||||
|
|
@ -1,80 +0,0 @@
|
|||
# ADDON forumdirectory
|
||||
# Copyright (C)
|
||||
# This file is distributed under the same license as the Friendica forumdirectory addon package.
|
||||
#
|
||||
#
|
||||
# Translators:
|
||||
# Jeroen De Meerleer <me@jeroened.be>, 2018
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: friendica\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2013-02-27 05:01-0500\n"
|
||||
"PO-Revision-Date: 2018-08-24 13:21+0000\n"
|
||||
"Last-Translator: Jeroen De Meerleer <me@jeroened.be>\n"
|
||||
"Language-Team: Dutch (http://www.transifex.com/Friendica/friendica/language/nl/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: nl\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#: forumdirectory.php:22
|
||||
msgid "Forum Directory"
|
||||
msgstr "Forum index"
|
||||
|
||||
#: forumdirectory.php:53
|
||||
msgid "Public access denied."
|
||||
msgstr "Publieke toegang geweigerd"
|
||||
|
||||
#: forumdirectory.php:71
|
||||
msgid "Global Directory"
|
||||
msgstr "Globaal overzicht"
|
||||
|
||||
#: forumdirectory.php:79
|
||||
msgid "Find on this site"
|
||||
msgstr "Zoeken"
|
||||
|
||||
#: forumdirectory.php:81
|
||||
msgid "Finding: "
|
||||
msgstr "Zoeken..."
|
||||
|
||||
#: forumdirectory.php:82
|
||||
msgid "Site Directory"
|
||||
msgstr "Site overzicht"
|
||||
|
||||
#: forumdirectory.php:83
|
||||
msgid "Find"
|
||||
msgstr "Zoek"
|
||||
|
||||
#: forumdirectory.php:133
|
||||
msgid "Age: "
|
||||
msgstr "Leeftijd:"
|
||||
|
||||
#: forumdirectory.php:136
|
||||
msgid "Gender: "
|
||||
msgstr "Geslacht:"
|
||||
|
||||
#: forumdirectory.php:156
|
||||
msgid "Location:"
|
||||
msgstr "Woonplaats:"
|
||||
|
||||
#: forumdirectory.php:158
|
||||
msgid "Gender:"
|
||||
msgstr "Geslacht:"
|
||||
|
||||
#: forumdirectory.php:160
|
||||
msgid "Status:"
|
||||
msgstr "Status:"
|
||||
|
||||
#: forumdirectory.php:162
|
||||
msgid "Homepage:"
|
||||
msgstr "Website:"
|
||||
|
||||
#: forumdirectory.php:164
|
||||
msgid "About:"
|
||||
msgstr "Over:"
|
||||
|
||||
#: forumdirectory.php:201
|
||||
msgid "No entries (some entries may be hidden)."
|
||||
msgstr "Geen berichten (sommige berichten kunnen verborgen zijn)."
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
<?php
|
||||
|
||||
if(! function_exists("string_plural_select_nl")) {
|
||||
function string_plural_select_nl($n){
|
||||
$n = intval($n);
|
||||
return intval($n != 1);
|
||||
}}
|
||||
$a->strings['Forum Directory'] = 'Forum index';
|
||||
$a->strings['Public access denied.'] = 'Publieke toegang geweigerd';
|
||||
$a->strings['Global Directory'] = 'Globaal overzicht';
|
||||
$a->strings['Find on this site'] = 'Zoeken';
|
||||
$a->strings['Finding: '] = 'Zoeken...';
|
||||
$a->strings['Site Directory'] = 'Site overzicht';
|
||||
$a->strings['Find'] = 'Zoek';
|
||||
$a->strings['Age: '] = 'Leeftijd:';
|
||||
$a->strings['Gender: '] = 'Geslacht:';
|
||||
$a->strings['Location:'] = 'Woonplaats:';
|
||||
$a->strings['Gender:'] = 'Geslacht:';
|
||||
$a->strings['Status:'] = 'Status:';
|
||||
$a->strings['Homepage:'] = 'Website:';
|
||||
$a->strings['About:'] = 'Over:';
|
||||
$a->strings['No entries (some entries may be hidden).'] = 'Geen berichten (sommige berichten kunnen verborgen zijn).';
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
# ADDON forumdirectory
|
||||
# Copyright (C)
|
||||
# This file is distributed under the same license as the Friendica forumdirectory addon package.
|
||||
#
|
||||
#
|
||||
# Translators:
|
||||
# TORminator <dominik+foss@danelski.pl>, 2015
|
||||
# Piotr Strębski <strebski@gmail.com>, 2022
|
||||
# Waldemar Stoczkowski, 2018
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: friendica\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-02-01 18:15+0100\n"
|
||||
"PO-Revision-Date: 2014-06-22 12:31+0000\n"
|
||||
"Last-Translator: Piotr Strębski <strebski@gmail.com>, 2022\n"
|
||||
"Language-Team: Polish (http://www.transifex.com/Friendica/friendica/language/pl/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: pl\n"
|
||||
"Plural-Forms: nplurals=4; plural=(n==1 ? 0 : (n%10>=2 && n%10<=4) && (n%100<12 || n%100>14) ? 1 : n!=1 && (n%10>=0 && n%10<=1) || (n%10>=5 && n%10<=9) || (n%100>=12 && n%100<=14) ? 2 : 3);\n"
|
||||
|
||||
#: forumdirectory.php:33 forumdirectory.php:137
|
||||
msgid "Forum Directory"
|
||||
msgstr "Katalog forum"
|
||||
|
||||
#: forumdirectory.php:53
|
||||
msgid "Public access denied."
|
||||
msgstr "Odmowa dostępu publicznego."
|
||||
|
||||
#: forumdirectory.php:125
|
||||
msgid "No entries (some entries may be hidden)."
|
||||
msgstr "Brak wpisów (niektóre wpisy mogą być ukryte)."
|
||||
|
||||
#: forumdirectory.php:131
|
||||
msgid "Global Directory"
|
||||
msgstr "Globalny katalog"
|
||||
|
||||
#: forumdirectory.php:133
|
||||
msgid "Find on this site"
|
||||
msgstr "Znajdź na tej stronie"
|
||||
|
||||
#: forumdirectory.php:135
|
||||
msgid "Results for:"
|
||||
msgstr "Wyniki dla:"
|
||||
|
||||
#: forumdirectory.php:139
|
||||
msgid "Find"
|
||||
msgstr "Szukaj"
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
<?php
|
||||
|
||||
if(! function_exists("string_plural_select_pl")) {
|
||||
function string_plural_select_pl($n){
|
||||
$n = intval($n);
|
||||
if ($n==1) { return 0; } else if (($n%10>=2 && $n%10<=4) && ($n%100<12 || $n%100>14)) { return 1; } else if ($n!=1 && ($n%10>=0 && $n%10<=1) || ($n%10>=5 && $n%10<=9) || ($n%100>=12 && $n%100<=14)) { return 2; } else { return 3; }
|
||||
}}
|
||||
$a->strings['Forum Directory'] = 'Katalog forum';
|
||||
$a->strings['Public access denied.'] = 'Odmowa dostępu publicznego.';
|
||||
$a->strings['No entries (some entries may be hidden).'] = 'Brak wpisów (niektóre wpisy mogą być ukryte).';
|
||||
$a->strings['Global Directory'] = 'Globalny katalog';
|
||||
$a->strings['Find on this site'] = 'Znajdź na tej stronie';
|
||||
$a->strings['Results for:'] = 'Wyniki dla:';
|
||||
$a->strings['Find'] = 'Szukaj';
|
||||
|
|
@ -1,80 +0,0 @@
|
|||
# ADDON forumdirectory
|
||||
# Copyright (C)
|
||||
# This file is distributed under the same license as the Friendica forumdirectory addon package.
|
||||
#
|
||||
#
|
||||
# Translators:
|
||||
# Beatriz Vital <vitalb@riseup.net>, 2016
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: friendica\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2013-02-27 05:01-0500\n"
|
||||
"PO-Revision-Date: 2016-08-19 17:03+0000\n"
|
||||
"Last-Translator: Beatriz Vital <vitalb@riseup.net>\n"
|
||||
"Language-Team: Portuguese (Brazil) (http://www.transifex.com/Friendica/friendica/language/pt_BR/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: pt_BR\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
|
||||
|
||||
#: forumdirectory.php:22
|
||||
msgid "Forum Directory"
|
||||
msgstr "Diretório de Fóruns"
|
||||
|
||||
#: forumdirectory.php:53
|
||||
msgid "Public access denied."
|
||||
msgstr "Acesso do público negado."
|
||||
|
||||
#: forumdirectory.php:71
|
||||
msgid "Global Directory"
|
||||
msgstr "Diretório Global"
|
||||
|
||||
#: forumdirectory.php:79
|
||||
msgid "Find on this site"
|
||||
msgstr "Procurar neste site"
|
||||
|
||||
#: forumdirectory.php:81
|
||||
msgid "Finding: "
|
||||
msgstr "Procurando:"
|
||||
|
||||
#: forumdirectory.php:82
|
||||
msgid "Site Directory"
|
||||
msgstr "Diretório do Site"
|
||||
|
||||
#: forumdirectory.php:83
|
||||
msgid "Find"
|
||||
msgstr "Procurar"
|
||||
|
||||
#: forumdirectory.php:133
|
||||
msgid "Age: "
|
||||
msgstr "Idade:"
|
||||
|
||||
#: forumdirectory.php:136
|
||||
msgid "Gender: "
|
||||
msgstr "Sexo:"
|
||||
|
||||
#: forumdirectory.php:156
|
||||
msgid "Location:"
|
||||
msgstr "Local:"
|
||||
|
||||
#: forumdirectory.php:158
|
||||
msgid "Gender:"
|
||||
msgstr "Sexo:"
|
||||
|
||||
#: forumdirectory.php:160
|
||||
msgid "Status:"
|
||||
msgstr "Estado:"
|
||||
|
||||
#: forumdirectory.php:162
|
||||
msgid "Homepage:"
|
||||
msgstr "Página principal:"
|
||||
|
||||
#: forumdirectory.php:164
|
||||
msgid "About:"
|
||||
msgstr "Sobre:"
|
||||
|
||||
#: forumdirectory.php:201
|
||||
msgid "No entries (some entries may be hidden)."
|
||||
msgstr "Sem resultados (alguns resultados podem estar ocultos)."
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
<?php
|
||||
|
||||
if(! function_exists("string_plural_select_pt_br")) {
|
||||
function string_plural_select_pt_br($n){
|
||||
$n = intval($n);
|
||||
return intval($n > 1);
|
||||
}}
|
||||
$a->strings['Forum Directory'] = 'Diretório de Fóruns';
|
||||
$a->strings['Public access denied.'] = 'Acesso do público negado.';
|
||||
$a->strings['Global Directory'] = 'Diretório Global';
|
||||
$a->strings['Find on this site'] = 'Procurar neste site';
|
||||
$a->strings['Finding: '] = 'Procurando:';
|
||||
$a->strings['Site Directory'] = 'Diretório do Site';
|
||||
$a->strings['Find'] = 'Procurar';
|
||||
$a->strings['Age: '] = 'Idade:';
|
||||
$a->strings['Gender: '] = 'Sexo:';
|
||||
$a->strings['Location:'] = 'Local:';
|
||||
$a->strings['Gender:'] = 'Sexo:';
|
||||
$a->strings['Status:'] = 'Estado:';
|
||||
$a->strings['Homepage:'] = 'Página principal:';
|
||||
$a->strings['About:'] = 'Sobre:';
|
||||
$a->strings['No entries (some entries may be hidden).'] = 'Sem resultados (alguns resultados podem estar ocultos).';
|
||||
|
|
@ -1,79 +0,0 @@
|
|||
# ADDON forumdirectory
|
||||
# Copyright (C)
|
||||
# This file is distributed under the same license as the Friendica forumdirectory addon package.
|
||||
#
|
||||
#
|
||||
# Translators:
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: friendica\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2013-02-27 05:01-0500\n"
|
||||
"PO-Revision-Date: 2014-07-08 11:49+0000\n"
|
||||
"Last-Translator: Arian - Cazare Muncitori <arianserv@gmail.com>\n"
|
||||
"Language-Team: Romanian (Romania) (http://www.transifex.com/projects/p/friendica/language/ro_RO/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: ro_RO\n"
|
||||
"Plural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1));\n"
|
||||
|
||||
#: forumdirectory.php:22
|
||||
msgid "Forum Directory"
|
||||
msgstr "Director Forum"
|
||||
|
||||
#: forumdirectory.php:53
|
||||
msgid "Public access denied."
|
||||
msgstr "Acces public refuzat."
|
||||
|
||||
#: forumdirectory.php:71
|
||||
msgid "Global Directory"
|
||||
msgstr "Director Global"
|
||||
|
||||
#: forumdirectory.php:79
|
||||
msgid "Find on this site"
|
||||
msgstr "Căutați pe acest site"
|
||||
|
||||
#: forumdirectory.php:81
|
||||
msgid "Finding: "
|
||||
msgstr "Căutare:"
|
||||
|
||||
#: forumdirectory.php:82
|
||||
msgid "Site Directory"
|
||||
msgstr "Director Site"
|
||||
|
||||
#: forumdirectory.php:83
|
||||
msgid "Find"
|
||||
msgstr "Căutați"
|
||||
|
||||
#: forumdirectory.php:133
|
||||
msgid "Age: "
|
||||
msgstr "Vârsta:"
|
||||
|
||||
#: forumdirectory.php:136
|
||||
msgid "Gender: "
|
||||
msgstr "Sex:"
|
||||
|
||||
#: forumdirectory.php:156
|
||||
msgid "Location:"
|
||||
msgstr "Locație:"
|
||||
|
||||
#: forumdirectory.php:158
|
||||
msgid "Gender:"
|
||||
msgstr "Sex:"
|
||||
|
||||
#: forumdirectory.php:160
|
||||
msgid "Status:"
|
||||
msgstr "Status:"
|
||||
|
||||
#: forumdirectory.php:162
|
||||
msgid "Homepage:"
|
||||
msgstr "Pagină web:"
|
||||
|
||||
#: forumdirectory.php:164
|
||||
msgid "About:"
|
||||
msgstr "Despre:"
|
||||
|
||||
#: forumdirectory.php:201
|
||||
msgid "No entries (some entries may be hidden)."
|
||||
msgstr "Fără înregistrări (unele înregistrări pot fi ascunse)."
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
<?php
|
||||
|
||||
if(! function_exists("string_plural_select_ro")) {
|
||||
function string_plural_select_ro($n){
|
||||
$n = intval($n);
|
||||
if ($n==1) { return 0; } else if ((($n%100>19)||(($n%100==0)&&($n!=0)))) { return 2; } else { return 1; }
|
||||
}}
|
||||
$a->strings['Forum Directory'] = 'Director Forum';
|
||||
$a->strings['Public access denied.'] = 'Acces public refuzat.';
|
||||
$a->strings['Global Directory'] = 'Director Global';
|
||||
$a->strings['Find on this site'] = 'Căutați pe acest site';
|
||||
$a->strings['Finding: '] = 'Căutare:';
|
||||
$a->strings['Site Directory'] = 'Director Site';
|
||||
$a->strings['Find'] = 'Căutați';
|
||||
$a->strings['Age: '] = 'Vârsta:';
|
||||
$a->strings['Gender: '] = 'Sex:';
|
||||
$a->strings['Location:'] = 'Locație:';
|
||||
$a->strings['Gender:'] = 'Sex:';
|
||||
$a->strings['Status:'] = 'Status:';
|
||||
$a->strings['Homepage:'] = 'Pagină web:';
|
||||
$a->strings['About:'] = 'Despre:';
|
||||
$a->strings['No entries (some entries may be hidden).'] = 'Fără înregistrări (unele înregistrări pot fi ascunse).';
|
||||
|
|
@ -1,80 +0,0 @@
|
|||
# ADDON forumdirectory
|
||||
# Copyright (C)
|
||||
# This file is distributed under the same license as the Friendica forumdirectory addon package.
|
||||
#
|
||||
#
|
||||
# Translators:
|
||||
# Stanislav N. <pztrn@pztrn.name>, 2017
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: friendica\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2013-02-27 05:01-0500\n"
|
||||
"PO-Revision-Date: 2017-04-08 17:12+0000\n"
|
||||
"Last-Translator: Stanislav N. <pztrn@pztrn.name>\n"
|
||||
"Language-Team: Russian (http://www.transifex.com/Friendica/friendica/language/ru/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: ru\n"
|
||||
"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n"
|
||||
|
||||
#: forumdirectory.php:22
|
||||
msgid "Forum Directory"
|
||||
msgstr "Каталог форумов"
|
||||
|
||||
#: forumdirectory.php:53
|
||||
msgid "Public access denied."
|
||||
msgstr "Свободный доступ закрыт."
|
||||
|
||||
#: forumdirectory.php:71
|
||||
msgid "Global Directory"
|
||||
msgstr "Глобальный каталог"
|
||||
|
||||
#: forumdirectory.php:79
|
||||
msgid "Find on this site"
|
||||
msgstr "Найти на этом сайте"
|
||||
|
||||
#: forumdirectory.php:81
|
||||
msgid "Finding: "
|
||||
msgstr "Результат поиска: "
|
||||
|
||||
#: forumdirectory.php:82
|
||||
msgid "Site Directory"
|
||||
msgstr "Каталог сайта"
|
||||
|
||||
#: forumdirectory.php:83
|
||||
msgid "Find"
|
||||
msgstr "Найти"
|
||||
|
||||
#: forumdirectory.php:133
|
||||
msgid "Age: "
|
||||
msgstr "Возраст: "
|
||||
|
||||
#: forumdirectory.php:136
|
||||
msgid "Gender: "
|
||||
msgstr "Пол: "
|
||||
|
||||
#: forumdirectory.php:156
|
||||
msgid "Location:"
|
||||
msgstr "Откуда:"
|
||||
|
||||
#: forumdirectory.php:158
|
||||
msgid "Gender:"
|
||||
msgstr "Пол:"
|
||||
|
||||
#: forumdirectory.php:160
|
||||
msgid "Status:"
|
||||
msgstr "Статус:"
|
||||
|
||||
#: forumdirectory.php:162
|
||||
msgid "Homepage:"
|
||||
msgstr "Домашняя страничка:"
|
||||
|
||||
#: forumdirectory.php:164
|
||||
msgid "About:"
|
||||
msgstr "О себе:"
|
||||
|
||||
#: forumdirectory.php:201
|
||||
msgid "No entries (some entries may be hidden)."
|
||||
msgstr "Нет записей (некоторые записи могут быть скрыты)."
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
<?php
|
||||
|
||||
if(! function_exists("string_plural_select_ru")) {
|
||||
function string_plural_select_ru($n){
|
||||
$n = intval($n);
|
||||
if ($n%10==1 && $n%100!=11) { return 0; } else if ($n%10>=2 && $n%10<=4 && ($n%100<12 || $n%100>14)) { return 1; } else if ($n%10==0 || ($n%10>=5 && $n%10<=9) || ($n%100>=11 && $n%100<=14)) { return 2; } else { return 3; }
|
||||
}}
|
||||
$a->strings['Forum Directory'] = 'Каталог форумов';
|
||||
$a->strings['Public access denied.'] = 'Свободный доступ закрыт.';
|
||||
$a->strings['Global Directory'] = 'Глобальный каталог';
|
||||
$a->strings['Find on this site'] = 'Найти на этом сайте';
|
||||
$a->strings['Finding: '] = 'Результат поиска: ';
|
||||
$a->strings['Site Directory'] = 'Каталог сайта';
|
||||
$a->strings['Find'] = 'Найти';
|
||||
$a->strings['Age: '] = 'Возраст: ';
|
||||
$a->strings['Gender: '] = 'Пол: ';
|
||||
$a->strings['Location:'] = 'Откуда:';
|
||||
$a->strings['Gender:'] = 'Пол:';
|
||||
$a->strings['Status:'] = 'Статус:';
|
||||
$a->strings['Homepage:'] = 'Домашняя страничка:';
|
||||
$a->strings['About:'] = 'О себе:';
|
||||
$a->strings['No entries (some entries may be hidden).'] = 'Нет записей (некоторые записи могут быть скрыты).';
|
||||
|
|
@ -1,49 +0,0 @@
|
|||
# ADDON forumdirectory
|
||||
# Copyright (C)
|
||||
# This file is distributed under the same license as the Friendica forumdirectory addon package.
|
||||
#
|
||||
#
|
||||
# Translators:
|
||||
# Hypolite Petovan <hypolite@mrpetovan.com>, 2019
|
||||
# Kristoffer Grundström <lovaren@gmail.com>, 2022
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: friendica\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-02-01 18:15+0100\n"
|
||||
"PO-Revision-Date: 2022-01-15 23:39+0000\n"
|
||||
"Last-Translator: Kristoffer Grundström <lovaren@gmail.com>\n"
|
||||
"Language-Team: Swedish (http://www.transifex.com/Friendica/friendica/language/sv/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: sv\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#: forumdirectory.php:33 forumdirectory.php:137
|
||||
msgid "Forum Directory"
|
||||
msgstr "Forum-mapp"
|
||||
|
||||
#: forumdirectory.php:53
|
||||
msgid "Public access denied."
|
||||
msgstr "Publik åtkomst nekades."
|
||||
|
||||
#: forumdirectory.php:125
|
||||
msgid "No entries (some entries may be hidden)."
|
||||
msgstr "Inget att visa. (Man kan välja att inte synas här)"
|
||||
|
||||
#: forumdirectory.php:131
|
||||
msgid "Global Directory"
|
||||
msgstr "Medlemskatalog för flera sajter (global)"
|
||||
|
||||
#: forumdirectory.php:133
|
||||
msgid "Find on this site"
|
||||
msgstr "Hitta på den här sidan"
|
||||
|
||||
#: forumdirectory.php:135
|
||||
msgid "Results for:"
|
||||
msgstr ""
|
||||
|
||||
#: forumdirectory.php:139
|
||||
msgid "Find"
|
||||
msgstr "Sök"
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
<?php
|
||||
|
||||
if(! function_exists("string_plural_select_sv")) {
|
||||
function string_plural_select_sv($n){
|
||||
$n = intval($n);
|
||||
return intval($n != 1);
|
||||
}}
|
||||
$a->strings['Forum Directory'] = 'Forum-mapp';
|
||||
$a->strings['Public access denied.'] = 'Publik åtkomst nekades.';
|
||||
$a->strings['No entries (some entries may be hidden).'] = 'Inget att visa. (Man kan välja att inte synas här)';
|
||||
$a->strings['Global Directory'] = 'Medlemskatalog för flera sajter (global)';
|
||||
$a->strings['Find on this site'] = 'Hitta på den här sidan';
|
||||
$a->strings['Find'] = 'Sök';
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
<?php
|
||||
|
||||
$a->strings["Forum Directory"] = "评坛目录";
|
||||
$a->strings["Public access denied."] = "公众看拒绝";
|
||||
$a->strings["Global Directory"] = "综合目录";
|
||||
$a->strings["Find on this site"] = "找在这网站";
|
||||
$a->strings["Finding: "] = "找着:";
|
||||
$a->strings["Site Directory"] = "网站目录";
|
||||
$a->strings["Find"] = "搜索";
|
||||
$a->strings["Age: "] = "年纪:";
|
||||
$a->strings["Gender: "] = "性别:";
|
||||
$a->strings["Location:"] = "位置:";
|
||||
$a->strings["Gender:"] = "性别:";
|
||||
$a->strings["Status:"] = "现状:";
|
||||
$a->strings["Homepage:"] = "主页:";
|
||||
$a->strings["About:"] = "关于:";
|
||||
$a->strings["No entries (some entries may be hidden)."] = "没有文章(有的文章会被隐藏)。";
|
||||
|
|
@ -180,5 +180,5 @@ function ifttt_message($uid, $item)
|
|||
$link = hash('ripemd128', $item['msg']);
|
||||
}
|
||||
|
||||
Post\Delayed::add($link, $post, Worker::PRIORITY_MEDIUM, Post\Delayed::UNPREPARED);
|
||||
Post\Delayed::add($link, $post, Worker::PRIORITY_MEDIUM, Post\Delayed::PREPARED);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ use Friendica\Core\Logger;
|
|||
use Friendica\Core\Renderer;
|
||||
use Friendica\DI;
|
||||
use Friendica\Core\Config\Util\ConfigFileManager;
|
||||
use Friendica\Model\User;
|
||||
use Friendica\Util\Proxy as ProxyUtils;
|
||||
|
||||
function impressum_install()
|
||||
{
|
||||
|
|
@ -45,7 +45,7 @@ function obfuscate_email (string $s): string
|
|||
|
||||
function impressum_footer(string &$body)
|
||||
{
|
||||
$text = BBCode::convertForUriId(User::getSystemUriId(), DI::config()->get('impressum', 'footer_text'));
|
||||
$text = ProxyUtils::proxifyHtml(BBCode::convert(DI::config()->get('impressum', 'footer_text')));
|
||||
|
||||
if ($text != '') {
|
||||
DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::baseUrl() . '/addon/impressum/impressum.css" media="all" />';
|
||||
|
|
@ -64,8 +64,8 @@ function impressum_show(string &$body)
|
|||
$body .= '<h3>' . DI::l10n()->t('Impressum') . '</h3>';
|
||||
$owner = DI::config()->get('impressum', 'owner');
|
||||
$owner_profile = DI::config()->get('impressum', 'ownerprofile');
|
||||
$postal = BBCode::convertForUriId(User::getSystemUriId(), DI::config()->get('impressum', 'postal'));
|
||||
$notes = BBCode::convertForUriId(User::getSystemUriId(), DI::config()->get('impressum', 'notes'));
|
||||
$postal = ProxyUtils::proxifyHtml(BBCode::convert(DI::config()->get('impressum', 'postal')));
|
||||
$notes = ProxyUtils::proxifyHtml(BBCode::convert(DI::config()->get('impressum', 'notes')));
|
||||
|
||||
if ($owner) {
|
||||
if ($owner_profile) {
|
||||
|
|
|
|||
|
|
@ -1,4 +0,0 @@
|
|||
invidious Addon for Friendica
|
||||
==========================
|
||||
|
||||
This addon will replace "youtube.com" with the chosen Invidious instance
|
||||
|
|
@ -1,103 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
* Name: invidious
|
||||
* Description: Replaces links to youtube.com to an invidious instance in all displays of postings on a node.
|
||||
* Version: 0.3
|
||||
* Author: Matthias Ebers <https://loma.ml/profile/feb>
|
||||
* Author: Michael Vogel <https://pirati.ca/profile/heluecht>
|
||||
*
|
||||
*/
|
||||
|
||||
use Friendica\Core\Hook;
|
||||
use Friendica\Core\Renderer;
|
||||
use Friendica\DI;
|
||||
|
||||
CONST INVIDIOUS_DEFAULT = 'https://invidio.us';
|
||||
|
||||
function invidious_install()
|
||||
{
|
||||
Hook::register('prepare_body_final', __FILE__, 'invidious_render');
|
||||
Hook::register('addon_settings', __FILE__, 'invidious_settings');
|
||||
Hook::register('addon_settings_post', __FILE__, 'invidious_settings_post');
|
||||
}
|
||||
|
||||
/* Handle the send data from the admin settings
|
||||
*/
|
||||
function invidious_addon_admin_post()
|
||||
{
|
||||
DI::config()->set('invidious', 'server', trim($_POST['invidiousserver'], " \n\r\t\v\x00/"));
|
||||
}
|
||||
|
||||
/* Hook into the admin settings to let the admin choose an
|
||||
* invidious server to use for the replacement.
|
||||
*/
|
||||
function invidious_addon_admin(string &$o)
|
||||
{
|
||||
$invidiousserver = DI::config()->get('invidious', 'server', INVIDIOUS_DEFAULT);
|
||||
$t = Renderer::getMarkupTemplate('admin.tpl', 'addon/invidious/');
|
||||
$o = Renderer::replaceMacros($t, [
|
||||
'$settingdescription' => DI::l10n()->t('Which Invidious server shall be used for the replacements in the post bodies? Use the URL with servername and protocol. See %s for a list of available public Invidious servers.', 'https://redirect.invidious.io'),
|
||||
'$invidiousserver' => ['invidiousserver', DI::l10n()->t('Invidious server'), $invidiousserver, DI::l10n()->t('See %s for a list of available Invidious servers.', '<a href="https://api.invidious.io/">https://api.invidious.io/</a>')],
|
||||
'$submit' => DI::l10n()->t('Save Settings'),
|
||||
]);
|
||||
}
|
||||
|
||||
function invidious_settings(array &$data)
|
||||
{
|
||||
if (!DI::userSession()->getLocalUserId()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$enabled = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'invidious', 'enabled');
|
||||
$server = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'invidious', 'server', DI::config()->get('invidious', 'server', INVIDIOUS_DEFAULT));
|
||||
|
||||
$t = Renderer::getMarkupTemplate('settings.tpl', 'addon/invidious/');
|
||||
$html = Renderer::replaceMacros($t, [
|
||||
'$enabled' => ['enabled', DI::l10n()->t('Replace Youtube links with links to an Invidious server'), $enabled, DI::l10n()->t('If enabled, Youtube links are replaced with the links to the specified Invidious server.')],
|
||||
'$server' => ['server', DI::l10n()->t('Invidious server'), $server, DI::l10n()->t('See %s for a list of available Invidious servers.', '<a href="https://api.invidious.io/">https://api.invidious.io/</a>')],
|
||||
]);
|
||||
|
||||
$data = [
|
||||
'addon' => 'invidious',
|
||||
'title' => DI::l10n()->t('Invidious Settings'),
|
||||
'html' => $html,
|
||||
];
|
||||
}
|
||||
|
||||
function invidious_settings_post(array &$b)
|
||||
{
|
||||
if (!DI::userSession()->getLocalUserId() || empty($_POST['invidious-submit'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'invidious', 'enabled', (bool)$_POST['enabled']);
|
||||
|
||||
$server = trim($_POST['server'], " \n\r\t\v\x00/");
|
||||
if ($server != DI::config()->get('invidious', 'server', INVIDIOUS_DEFAULT) && !empty($server)) {
|
||||
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'invidious', 'server', $server);
|
||||
} else {
|
||||
DI::pConfig()->delete(DI::userSession()->getLocalUserId(), 'invidious', 'server');
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* replace "youtube.com" with the chosen Invidious instance
|
||||
*/
|
||||
function invidious_render(array &$b)
|
||||
{
|
||||
if (!DI::userSession()->getLocalUserId() || !DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'invidious', 'enabled')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$original = $b['html'];
|
||||
$server = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'invidious', 'server', DI::config()->get('invidious', 'server', INVIDIOUS_DEFAULT));
|
||||
|
||||
$b['html'] = preg_replace("/https?:\/\/www.youtube.com\/watch\?v\=(.*?)/ism", $server . '/watch?v=$1', $b['html']);
|
||||
$b['html'] = preg_replace("/https?:\/\/www.youtube.com\/embed\/(.*?)/ism", $server . '/embed/$1', $b['html']);
|
||||
$b['html'] = preg_replace("/https?:\/\/www.youtube.com\/shorts\/(.*?)/ism", $server . '/shorts/$1', $b['html']);
|
||||
$b['html'] = preg_replace("/https?:\/\/youtu.be\/(.*?)/ism", $server . '/watch?v=$1', $b['html']);
|
||||
|
||||
if ($original != $b['html']) {
|
||||
$b['html'] .= '<hr><p><small>' . DI::l10n()->t('(Invidious addon enabled: YouTube links via %s)', $server) . '</small></p>';
|
||||
}
|
||||
}
|
||||
|
|
@ -1,58 +0,0 @@
|
|||
# ADDON invidious
|
||||
# Copyright (C)
|
||||
# This file is distributed under the same license as the Friendica invidious addon package.
|
||||
#
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2023-12-18 17:23+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"
|
||||
"Language: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: invidious.php:39
|
||||
#, php-format
|
||||
msgid ""
|
||||
"Which Invidious server shall be used for the replacements in the post "
|
||||
"bodies? Use the URL with servername and protocol. See %s for a list of "
|
||||
"available public Invidious servers."
|
||||
msgstr ""
|
||||
|
||||
#: invidious.php:40 invidious.php:57
|
||||
msgid "Invidious server"
|
||||
msgstr ""
|
||||
|
||||
#: invidious.php:40 invidious.php:57
|
||||
#, php-format
|
||||
msgid "See %s for a list of available Invidious servers."
|
||||
msgstr ""
|
||||
|
||||
#: invidious.php:41
|
||||
msgid "Save Settings"
|
||||
msgstr ""
|
||||
|
||||
#: invidious.php:56
|
||||
msgid "Replace Youtube links with links to an Invidious server"
|
||||
msgstr ""
|
||||
|
||||
#: invidious.php:56
|
||||
msgid ""
|
||||
"If enabled, Youtube links are replaced with the links to the specified "
|
||||
"Invidious server."
|
||||
msgstr ""
|
||||
|
||||
#: invidious.php:62
|
||||
msgid "Invidious Settings"
|
||||
msgstr ""
|
||||
|
||||
#: invidious.php:101
|
||||
#, php-format
|
||||
msgid "(Invidious addon enabled: YouTube links via %s)"
|
||||
msgstr ""
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
<p>{{$settingdescription}}</p>
|
||||
|
||||
{{include file="field_input.tpl" field=$invidiousserver}}
|
||||
|
||||
<div class="submit"><input type="submit" name="page_site" value="{{$submit}}" /></div>
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
{{include file="field_checkbox.tpl" field=$enabled}}
|
||||
{{include file="field_input.tpl" field=$server}}
|
||||
|
|
@ -8,7 +8,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2023-06-03 15:49-0400\n"
|
||||
"POT-Creation-Date: 2021-03-23 23:53-0400\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"
|
||||
|
|
@ -17,40 +17,40 @@ msgstr ""
|
|||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: js_upload.php:37
|
||||
#: js_upload.php:34
|
||||
msgid "Select files for upload"
|
||||
msgstr ""
|
||||
|
||||
#: js_upload.php:38
|
||||
#: js_upload.php:35
|
||||
msgid "Drop files here to upload"
|
||||
msgstr ""
|
||||
|
||||
#: js_upload.php:39
|
||||
#: js_upload.php:36
|
||||
msgid "Cancel"
|
||||
msgstr ""
|
||||
|
||||
#: js_upload.php:40
|
||||
#: js_upload.php:37
|
||||
msgid "Failed"
|
||||
msgstr ""
|
||||
|
||||
#: js_upload.php:209
|
||||
#: js_upload.php:215
|
||||
msgid "No files were uploaded."
|
||||
msgstr ""
|
||||
|
||||
#: js_upload.php:215
|
||||
#: js_upload.php:221
|
||||
msgid "Uploaded file is empty"
|
||||
msgstr ""
|
||||
|
||||
#: js_upload.php:227
|
||||
#: js_upload.php:233
|
||||
#, php-format
|
||||
msgid "Image exceeds size limit of %s"
|
||||
msgstr ""
|
||||
|
||||
#: js_upload.php:239
|
||||
#: js_upload.php:245
|
||||
#, php-format
|
||||
msgid "File has an invalid extension, it should be one of %s."
|
||||
msgstr ""
|
||||
|
||||
#: js_upload.php:250
|
||||
#: js_upload.php:256
|
||||
msgid "Upload was cancelled, or server error encountered"
|
||||
msgstr ""
|
||||
|
|
|
|||
|
|
@ -35,18 +35,18 @@
|
|||
let albumElm = document.getElementById('photos-upload-album-select');
|
||||
|
||||
let contact_allow = document.querySelector('[name="contact_allow"]:not(:disabled)');
|
||||
let circle_allow = document.querySelector('[name="circle_allow"]:not(:disabled)');
|
||||
let contact_deny = document.querySelector('[name="contact_deny"]:not(:disabled)');
|
||||
let circle_deny = document.querySelector('[name="circle_deny"]:not(:disabled)');
|
||||
let group_allow = document.querySelector('[name="group_allow"]:not(:disabled)');
|
||||
let contact_deny = document.querySelector('[name="contact_deny"]:not(:disabled)');
|
||||
let group_deny = document.querySelector('[name="group_deny"]:not(:disabled)');
|
||||
|
||||
uploader.setParams({
|
||||
newalbum : newalbumElm ? newalbumElm.value : '',
|
||||
album : albumElm ? albumElm.value : '',
|
||||
not_visible : document.getElementById('photos-upload-noshare').checked,
|
||||
contact_allow : contact_allow ? contact_allow.value : '',
|
||||
circle_allow : circle_allow ? circle_allow.value : '',
|
||||
group_allow : group_allow ? group_allow.value : '',
|
||||
contact_deny : contact_deny ? contact_deny.value : '',
|
||||
circle_deny : circle_deny ? circle_deny.value : '',
|
||||
group_deny : group_deny ? group_deny.value : '',
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -4,59 +4,63 @@
|
|||
#
|
||||
#
|
||||
# Translators:
|
||||
# Alexander An <ravnina@gmail.com>, 2020,2023
|
||||
# Alexander An <ravnina@gmail.com>, 2020
|
||||
# Stanislav N. <pztrn@pztrn.name>, 2018
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: friendica\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-11-21 19:15-0500\n"
|
||||
"PO-Revision-Date: 2015-07-25 08:05+0000\n"
|
||||
"Last-Translator: Alexander An <ravnina@gmail.com>, 2020,2023\n"
|
||||
"Language-Team: Russian (http://app.transifex.com/Friendica/friendica/language/ru/)\n"
|
||||
"POT-Creation-Date: 2020-10-03 22:02-0400\n"
|
||||
"PO-Revision-Date: 2020-10-09 17:48+0000\n"
|
||||
"Last-Translator: Alexander An <ravnina@gmail.com>\n"
|
||||
"Language-Team: Russian (http://www.transifex.com/Friendica/friendica/language/ru/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: ru\n"
|
||||
"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n"
|
||||
|
||||
#: langfilter.php:49
|
||||
#: langfilter.php:52
|
||||
msgid "Language Filter"
|
||||
msgstr "Языковой фильтр"
|
||||
|
||||
#: langfilter.php:53
|
||||
msgid ""
|
||||
"This addon tries to identify the language posts are written in. If it does "
|
||||
"not match any language specified below, posts will be hidden by collapsing "
|
||||
"them."
|
||||
msgstr "Это дополнение пытается идентифицировать язык, на котором сделаны записи. Если язык не соответствует ни одному, указанному ниже, то такие посты будут свёрнуты."
|
||||
msgstr "Это дополнение пытается идентифицировать язык, на котором написаны посты. Если язык не соответствует ни одному, указанному ниже, то такие посты будут скрыты."
|
||||
|
||||
#: langfilter.php:50
|
||||
#: langfilter.php:54
|
||||
msgid "Use the language filter"
|
||||
msgstr "Использовать языковой фильтр"
|
||||
|
||||
#: langfilter.php:51
|
||||
#: langfilter.php:55
|
||||
msgid "Able to read"
|
||||
msgstr "Возможность читать"
|
||||
|
||||
#: langfilter.php:51
|
||||
#: langfilter.php:55
|
||||
msgid ""
|
||||
"List of abbreviations (ISO 639-1 codes) for languages you speak, comma "
|
||||
"separated. For example \"de,it\"."
|
||||
msgstr "Список аббревиатур (кодов по ISO 639-1 ) для языков, на которых вы говорите. Например, \"ru,en\"."
|
||||
|
||||
#: langfilter.php:52
|
||||
#: langfilter.php:56
|
||||
msgid "Minimum confidence in language detection"
|
||||
msgstr "Минимальная уверенность в определении языка"
|
||||
|
||||
#: langfilter.php:52
|
||||
#: langfilter.php:56
|
||||
msgid ""
|
||||
"Minimum confidence in language detection being correct, from 0 to 100. Posts"
|
||||
" will not be filtered when the confidence of language detection is below "
|
||||
"this percent value."
|
||||
msgstr "Минимальная уверенность в правильном определении языка, от 0 до 100. Посты не будут скрыты, если уверенность в правильном определении языка в процентах ниже этого значения."
|
||||
|
||||
#: langfilter.php:53
|
||||
#: langfilter.php:57
|
||||
msgid "Minimum length of message body"
|
||||
msgstr "Минимальная длина тела сообщения"
|
||||
|
||||
#: langfilter.php:53
|
||||
#: langfilter.php:57
|
||||
msgid ""
|
||||
"Minimum number of characters in message body for filter to be used. Posts "
|
||||
"shorter than this will not be filtered. Note: Language detection is "
|
||||
|
|
@ -64,14 +68,10 @@ msgid ""
|
|||
msgstr "Минимальное количество знаков в теле сообщения для применения фильтрации. Посты, длина которых меньше указанного значения, не будут отфильтрованы. Обратите внимание, что определение языка работает ненадежно для небольших постов (<200 символов)."
|
||||
|
||||
#: langfilter.php:58
|
||||
msgid "Language Filter"
|
||||
msgstr "Языковой фильтр"
|
||||
|
||||
#: langfilter.php:60
|
||||
msgid "Save Settings"
|
||||
msgstr "Сохранить настройки"
|
||||
|
||||
#: langfilter.php:193
|
||||
#: langfilter.php:189
|
||||
#, php-format
|
||||
msgid "Filtered language: %s"
|
||||
msgstr "Отфильтрованный язык: %s"
|
||||
|
|
|
|||
|
|
@ -5,7 +5,8 @@ function string_plural_select_ru($n){
|
|||
$n = intval($n);
|
||||
if ($n%10==1 && $n%100!=11) { return 0; } else if ($n%10>=2 && $n%10<=4 && ($n%100<12 || $n%100>14)) { return 1; } else if ($n%10==0 || ($n%10>=5 && $n%10<=9) || ($n%100>=11 && $n%100<=14)) { return 2; } else { return 3; }
|
||||
}}
|
||||
$a->strings['This addon tries to identify the language posts are written in. If it does not match any language specified below, posts will be hidden by collapsing them.'] = 'Это дополнение пытается идентифицировать язык, на котором сделаны записи. Если язык не соответствует ни одному, указанному ниже, то такие посты будут свёрнуты.';
|
||||
$a->strings['Language Filter'] = 'Языковой фильтр';
|
||||
$a->strings['This addon tries to identify the language posts are written in. If it does not match any language specified below, posts will be hidden by collapsing them.'] = 'Это дополнение пытается идентифицировать язык, на котором написаны посты. Если язык не соответствует ни одному, указанному ниже, то такие посты будут скрыты.';
|
||||
$a->strings['Use the language filter'] = 'Использовать языковой фильтр';
|
||||
$a->strings['Able to read'] = 'Возможность читать';
|
||||
$a->strings['List of abbreviations (ISO 639-1 codes) for languages you speak, comma separated. For example "de,it".'] = 'Список аббревиатур (кодов по ISO 639-1 ) для языков, на которых вы говорите. Например, "ru,en".';
|
||||
|
|
@ -13,6 +14,5 @@ $a->strings['Minimum confidence in language detection'] = 'Минимальна
|
|||
$a->strings['Minimum confidence in language detection being correct, from 0 to 100. Posts will not be filtered when the confidence of language detection is below this percent value.'] = 'Минимальная уверенность в правильном определении языка, от 0 до 100. Посты не будут скрыты, если уверенность в правильном определении языка в процентах ниже этого значения.';
|
||||
$a->strings['Minimum length of message body'] = 'Минимальная длина тела сообщения';
|
||||
$a->strings['Minimum number of characters in message body for filter to be used. Posts shorter than this will not be filtered. Note: Language detection is unreliable for short content (<200 characters).'] = 'Минимальное количество знаков в теле сообщения для применения фильтрации. Посты, длина которых меньше указанного значения, не будут отфильтрованы. Обратите внимание, что определение языка работает ненадежно для небольших постов (<200 символов).';
|
||||
$a->strings['Language Filter'] = 'Языковой фильтр';
|
||||
$a->strings['Save Settings'] = 'Сохранить настройки';
|
||||
$a->strings['Filtered language: %s'] = 'Отфильтрованный язык: %s';
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ function langfilter_prepare_body_content_filter(&$hook_data)
|
|||
$naked_body = strip_tags(
|
||||
$hook_data['item']['rendered-html']
|
||||
??''?: // Equivalent of !empty()
|
||||
BBCode::convertForUriId($hook_data['item']['uri-id'], $hook_data['item']['body'], BBCode::ACTIVITYPUB)
|
||||
BBCode::convert($hook_data['item']['body'], false, BBCode::ACTIVITYPUB, true)
|
||||
);
|
||||
|
||||
$naked_body = preg_replace('#\s+#', ' ', trim($naked_body));
|
||||
|
|
@ -163,7 +163,7 @@ function langfilter_prepare_body_content_filter(&$hook_data)
|
|||
return;
|
||||
}
|
||||
|
||||
$lang = $iso639->languageByCode1(substr($iso2, 0, 2));
|
||||
$lang = $iso639->languageByCode1($iso2);
|
||||
} else {
|
||||
$opts = $hook_data['item']['postopts'];
|
||||
if (!$opts) {
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2023-06-03 15:49-0400\n"
|
||||
"POT-Creation-Date: 2021-11-21 19:17-0500\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"
|
||||
|
|
@ -21,22 +21,22 @@ msgstr ""
|
|||
msgid "Post to libertree"
|
||||
msgstr ""
|
||||
|
||||
#: libertree.php:59
|
||||
#: libertree.php:60
|
||||
msgid "Enable Libertree Post Addon"
|
||||
msgstr ""
|
||||
|
||||
#: libertree.php:60
|
||||
#: libertree.php:61
|
||||
msgid "Libertree site URL"
|
||||
msgstr ""
|
||||
|
||||
#: libertree.php:61
|
||||
#: libertree.php:62
|
||||
msgid "Libertree API token"
|
||||
msgstr ""
|
||||
|
||||
#: libertree.php:62
|
||||
#: libertree.php:63
|
||||
msgid "Post to Libertree by default"
|
||||
msgstr ""
|
||||
|
||||
#: libertree.php:67
|
||||
#: libertree.php:68
|
||||
msgid "Libertree Export"
|
||||
msgstr ""
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ function libertree_send(array &$b)
|
|||
}
|
||||
|
||||
// Dont't post if the post doesn't belong to us.
|
||||
// This is a check for group postings
|
||||
// This is a check for forum postings
|
||||
$self = DBA::selectFirst('contact', ['id'], ['uid' => $b['uid'], 'self' => true]);
|
||||
if ($b['contact-id'] != $self['id']) {
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
#
|
||||
#
|
||||
# Translators:
|
||||
# Florent C., 2023
|
||||
# Nicolas Derive, 2022
|
||||
# ea1cd8241cb389ffb6f92bc6891eff5d_dc12308 <70dced5587d47e18d88f9298024d96f8_93383>, 2015
|
||||
# StefOfficiel <pichard.stephane@free.fr>, 2015
|
||||
|
|
@ -14,8 +13,8 @@ msgstr ""
|
|||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-11-21 19:15-0500\n"
|
||||
"PO-Revision-Date: 2014-06-23 09:54+0000\n"
|
||||
"Last-Translator: Florent C., 2023\n"
|
||||
"Language-Team: French (http://app.transifex.com/Friendica/friendica/language/fr/)\n"
|
||||
"Last-Translator: Nicolas Derive, 2022\n"
|
||||
"Language-Team: French (http://www.transifex.com/Friendica/friendica/language/fr/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
|
@ -34,72 +33,68 @@ msgstr "Adresse de courriel de laquelle les éléments du flux sembleront proven
|
|||
msgid "Save Settings"
|
||||
msgstr "Sauvegarder les paramètres"
|
||||
|
||||
#: mailstream.php:311
|
||||
#: mailstream.php:301
|
||||
msgid "Re:"
|
||||
msgstr "Re :"
|
||||
|
||||
#: mailstream.php:324 mailstream.php:327
|
||||
#: mailstream.php:314 mailstream.php:317
|
||||
msgid "Friendica post"
|
||||
msgstr "Message Friendica"
|
||||
|
||||
#: mailstream.php:330
|
||||
#: mailstream.php:320
|
||||
msgid "Diaspora post"
|
||||
msgstr "Message Diaspora"
|
||||
|
||||
#: mailstream.php:340
|
||||
#: mailstream.php:330
|
||||
msgid "Feed item"
|
||||
msgstr "Élément du flux"
|
||||
|
||||
#: mailstream.php:343
|
||||
#: mailstream.php:333
|
||||
msgid "Email"
|
||||
msgstr "Courriel"
|
||||
|
||||
#: mailstream.php:345
|
||||
#: mailstream.php:335
|
||||
msgid "Friendica Item"
|
||||
msgstr "Élément de Friendica"
|
||||
|
||||
#: mailstream.php:419
|
||||
#: mailstream.php:404
|
||||
msgid "Upstream"
|
||||
msgstr "En amont"
|
||||
|
||||
#: mailstream.php:420
|
||||
msgid "URI"
|
||||
msgstr "URI"
|
||||
|
||||
#: mailstream.php:421
|
||||
#: mailstream.php:405
|
||||
msgid "Local"
|
||||
msgstr "Local"
|
||||
|
||||
#: mailstream.php:499
|
||||
#: mailstream.php:481
|
||||
msgid "Enabled"
|
||||
msgstr "Activer"
|
||||
|
||||
#: mailstream.php:504
|
||||
#: mailstream.php:486
|
||||
msgid "Email Address"
|
||||
msgstr "Adresse de courriel"
|
||||
|
||||
#: mailstream.php:506
|
||||
#: mailstream.php:488
|
||||
msgid "Leave blank to use your account email address"
|
||||
msgstr "Laissez vide pour utiliser l'adresse de courriel de votre compte"
|
||||
|
||||
#: mailstream.php:510
|
||||
#: mailstream.php:492
|
||||
msgid "Exclude Likes"
|
||||
msgstr "Exclure les \"j'aime\""
|
||||
|
||||
#: mailstream.php:512
|
||||
#: mailstream.php:494
|
||||
msgid "Check this to omit mailing \"Like\" notifications"
|
||||
msgstr "Cochez ceci pour éviter d'envoyer les notifications des \"J'aime\""
|
||||
|
||||
#: mailstream.php:516
|
||||
#: mailstream.php:498
|
||||
msgid "Attach Images"
|
||||
msgstr "Attacher les images"
|
||||
|
||||
#: mailstream.php:518
|
||||
#: mailstream.php:500
|
||||
msgid ""
|
||||
"Download images in posts and attach them to the email. Useful for reading "
|
||||
"email while offline."
|
||||
msgstr "Télécharger les images des messages et les attacher au courriel. Utile pour les les courriels hors-ligne."
|
||||
|
||||
#: mailstream.php:525
|
||||
#: mailstream.php:507
|
||||
msgid "Mail Stream Settings"
|
||||
msgstr "Paramètres de Mail Stream"
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ $a->strings['Feed item'] = 'Élément du flux';
|
|||
$a->strings['Email'] = 'Courriel';
|
||||
$a->strings['Friendica Item'] = 'Élément de Friendica';
|
||||
$a->strings['Upstream'] = 'En amont';
|
||||
$a->strings['URI'] = 'URI';
|
||||
$a->strings['Local'] = 'Local';
|
||||
$a->strings['Enabled'] = 'Activer';
|
||||
$a->strings['Email Address'] = 'Adresse de courriel';
|
||||
|
|
|
|||
|
|
@ -4,15 +4,15 @@
|
|||
#
|
||||
#
|
||||
# Translators:
|
||||
# Balázs Úr, 2020-2021,2023
|
||||
# Balázs Úr, 2020-2021
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: friendica\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-11-21 19:15-0500\n"
|
||||
"PO-Revision-Date: 2014-06-23 09:54+0000\n"
|
||||
"Last-Translator: Balázs Úr, 2020-2021,2023\n"
|
||||
"Language-Team: Hungarian (http://app.transifex.com/Friendica/friendica/language/hu/)\n"
|
||||
"Last-Translator: Balázs Úr, 2020-2021\n"
|
||||
"Language-Team: Hungarian (http://www.transifex.com/Friendica/friendica/language/hu/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
|
@ -31,72 +31,68 @@ msgstr "E-mail-cím, ahonnan úgy tűnik, hogy a folyam elemei származnak."
|
|||
msgid "Save Settings"
|
||||
msgstr "Beállítások mentése"
|
||||
|
||||
#: mailstream.php:311
|
||||
#: mailstream.php:301
|
||||
msgid "Re:"
|
||||
msgstr "Vá:"
|
||||
|
||||
#: mailstream.php:324 mailstream.php:327
|
||||
#: mailstream.php:314 mailstream.php:317
|
||||
msgid "Friendica post"
|
||||
msgstr "Friendica-bejegyzés"
|
||||
|
||||
#: mailstream.php:330
|
||||
#: mailstream.php:320
|
||||
msgid "Diaspora post"
|
||||
msgstr "Diaspora-bejegyzés"
|
||||
|
||||
#: mailstream.php:340
|
||||
#: mailstream.php:330
|
||||
msgid "Feed item"
|
||||
msgstr "Hírforráselem"
|
||||
|
||||
#: mailstream.php:343
|
||||
#: mailstream.php:333
|
||||
msgid "Email"
|
||||
msgstr "E-mail"
|
||||
|
||||
#: mailstream.php:345
|
||||
#: mailstream.php:335
|
||||
msgid "Friendica Item"
|
||||
msgstr "Friendica-elem"
|
||||
|
||||
#: mailstream.php:419
|
||||
#: mailstream.php:404
|
||||
msgid "Upstream"
|
||||
msgstr "Távoli"
|
||||
|
||||
#: mailstream.php:420
|
||||
msgid "URI"
|
||||
msgstr "URI"
|
||||
|
||||
#: mailstream.php:421
|
||||
#: mailstream.php:405
|
||||
msgid "Local"
|
||||
msgstr "Helyi"
|
||||
|
||||
#: mailstream.php:499
|
||||
#: mailstream.php:481
|
||||
msgid "Enabled"
|
||||
msgstr "Engedélyezve"
|
||||
|
||||
#: mailstream.php:504
|
||||
#: mailstream.php:486
|
||||
msgid "Email Address"
|
||||
msgstr "E-mail-cím"
|
||||
|
||||
#: mailstream.php:506
|
||||
#: mailstream.php:488
|
||||
msgid "Leave blank to use your account email address"
|
||||
msgstr "Hagyja üresen a fiókja e-mail-címének használatához"
|
||||
|
||||
#: mailstream.php:510
|
||||
#: mailstream.php:492
|
||||
msgid "Exclude Likes"
|
||||
msgstr "Kedvelések kizárása"
|
||||
|
||||
#: mailstream.php:512
|
||||
#: mailstream.php:494
|
||||
msgid "Check this to omit mailing \"Like\" notifications"
|
||||
msgstr "Jelölje be ezt a „Tetszik” értesítések elküldésének kihagyásához"
|
||||
|
||||
#: mailstream.php:516
|
||||
#: mailstream.php:498
|
||||
msgid "Attach Images"
|
||||
msgstr "Képek csatolása"
|
||||
|
||||
#: mailstream.php:518
|
||||
#: mailstream.php:500
|
||||
msgid ""
|
||||
"Download images in posts and attach them to the email. Useful for reading "
|
||||
"email while offline."
|
||||
msgstr "Képek letöltése a bejegyzésekből és csatolás az e-mailhez. Hasznos az e-mailek kapcsolat nélküli olvasásakor."
|
||||
|
||||
#: mailstream.php:525
|
||||
#: mailstream.php:507
|
||||
msgid "Mail Stream Settings"
|
||||
msgstr "Levelezőfolyam beállításai"
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ $a->strings['Feed item'] = 'Hírforráselem';
|
|||
$a->strings['Email'] = 'E-mail';
|
||||
$a->strings['Friendica Item'] = 'Friendica-elem';
|
||||
$a->strings['Upstream'] = 'Távoli';
|
||||
$a->strings['URI'] = 'URI';
|
||||
$a->strings['Local'] = 'Helyi';
|
||||
$a->strings['Enabled'] = 'Engedélyezve';
|
||||
$a->strings['Email Address'] = 'E-mail-cím';
|
||||
|
|
|
|||
|
|
@ -66,9 +66,10 @@ function mailstream_module() {}
|
|||
/**
|
||||
* Adds an item in "addon features" in the admin menu of the site
|
||||
*
|
||||
* @param App $a App object (unused)
|
||||
* @param string $o HTML form data
|
||||
*/
|
||||
function mailstream_addon_admin(string &$o)
|
||||
function mailstream_addon_admin(App $a, string &$o)
|
||||
{
|
||||
$frommail = DI::config()->get('mailstream', 'frommail');
|
||||
$template = Renderer::getMarkupTemplate('admin.tpl', 'addon/mailstream/');
|
||||
|
|
@ -102,14 +103,14 @@ function mailstream_addon_admin_post()
|
|||
*/
|
||||
function mailstream_generate_id(string $uri): string
|
||||
{
|
||||
$host = DI::baseUrl()->getHost();
|
||||
$host = DI::baseUrl()->getHostname();
|
||||
$resource = hash('md5', $uri);
|
||||
$message_id = "<" . $resource . "@" . $host . ">";
|
||||
Logger::debug('mailstream: Generated message ID ' . $message_id . ' for URI ' . $uri);
|
||||
return $message_id;
|
||||
}
|
||||
|
||||
function mailstream_send_hook(array $data)
|
||||
function mailstream_send_hook(App $a, array $data)
|
||||
{
|
||||
$criteria = array('uid' => $data['uid'], 'contact-id' => $data['contact-id'], 'uri' => $data['uri']);
|
||||
$item = Post::selectFirst([], $criteria);
|
||||
|
|
@ -118,28 +119,9 @@ function mailstream_send_hook(array $data)
|
|||
return;
|
||||
}
|
||||
|
||||
if ($item['deleted']) {
|
||||
Logger::debug('mailstream_send_hook skipping deleted item', ['guid' => $item['guid']]);
|
||||
return;
|
||||
}
|
||||
|
||||
$user = User::getById($item['uid']);
|
||||
if (empty($user)) {
|
||||
Logger::error('mailstream_send_hook could not find user', ['uid' => $item['uid']]);
|
||||
return;
|
||||
}
|
||||
|
||||
$contact = DBA::selectFirst('contact', [], ['id' => $item['contact-id'], 'self' => false]);
|
||||
if (!DBA::isResult($contact)) {
|
||||
Logger::error('mailstream_send_hook could not find contact', ['guid' => $item['guid'], 'contact-id' => $item['contact-id']]);
|
||||
return;
|
||||
}
|
||||
if ($contact['blocked']) {
|
||||
Logger::error('mailstream_send_hook contact is blocked', ['guid' => $item['guid'], 'contact-id' => $item['contact-id']]);
|
||||
return;
|
||||
}
|
||||
if (array_key_exists('ignored', $contact) && $contact['ignored']) {
|
||||
Logger::error('mailstream_send_hook contact is ignored', ['guid' => $item['guid'], 'contact-id' => $item['contact-id']]);
|
||||
Logger::error('mailstream_send_hook could not fund user', ['uid' => $item['uid']]);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -156,16 +138,17 @@ function mailstream_send_hook(array $data)
|
|||
* mailstream is enabled and the necessary data is available, forks a
|
||||
* workerqueue item to send the email.
|
||||
*
|
||||
* @param App $a App object (unused)
|
||||
* @param array $item content of the item (may or may not already be stored in the item table)
|
||||
* @return void
|
||||
*/
|
||||
function mailstream_post_hook(array &$item)
|
||||
function mailstream_post_hook(App $a, array &$item)
|
||||
{
|
||||
mailstream_check_version();
|
||||
|
||||
if (!DI::pConfig()->get($item['uid'], 'mailstream', 'enabled')) {
|
||||
Logger::debug('mailstream: not enabled for item ' . $item['id'] . ' uid ' . $item['uid']);
|
||||
// return;
|
||||
Logger::debug('mailstream: not enabled.', ['item' => $item['id'], ' uid ' => $item['uid']]);
|
||||
return;
|
||||
}
|
||||
if (!$item['uid']) {
|
||||
Logger::debug('mailstream: no uid for item ' . $item['id']);
|
||||
|
|
@ -233,12 +216,7 @@ function mailstream_do_images(array &$item, array &$attachments)
|
|||
}
|
||||
|
||||
$cookiejar = tempnam(System::getTempPath(), 'cookiejar-mailstream-');
|
||||
try {
|
||||
$curlResult = DI::httpClient()->fetchFull($url, HttpClientAccept::DEFAULT, 0, $cookiejar);
|
||||
} catch (InvalidArgumentException $e) {
|
||||
Logger::error('mailstream_do_images exception fetching url', ['url' => $url, 'item_id' => $item['id']]);
|
||||
continue;
|
||||
}
|
||||
$curlResult = DI::httpClient()->fetchFull($url, HttpClientAccept::DEFAULT, 0, $cookiejar);
|
||||
$attachments[$url] = [
|
||||
'data' => $curlResult->getBody(),
|
||||
'guid' => hash('crc32', $url),
|
||||
|
|
@ -277,13 +255,12 @@ function mailstream_sender(array $item): string
|
|||
* Converts a bbcode-encoded subject line into a plaintext version suitable for the subject line of an email
|
||||
*
|
||||
* @param string $subject bbcode-encoded subject line
|
||||
* @param int $uri_id
|
||||
*
|
||||
* @return string plaintext subject line
|
||||
*/
|
||||
function mailstream_decode_subject(string $subject, int $uri_id): string
|
||||
function mailstream_decode_subject(string $subject): string
|
||||
{
|
||||
$html = BBCode::convertForUriId($uri_id, $subject);
|
||||
$html = BBCode::convert($subject);
|
||||
if (!$html) {
|
||||
return $subject;
|
||||
}
|
||||
|
|
@ -318,7 +295,7 @@ function mailstream_decode_subject(string $subject, int $uri_id): string
|
|||
function mailstream_subject(array $item): string
|
||||
{
|
||||
if ($item['title']) {
|
||||
return mailstream_decode_subject($item['title'], $item['uri-id']);
|
||||
return mailstream_decode_subject($item['title']);
|
||||
}
|
||||
$parent = $item['thr-parent'];
|
||||
// Don't look more than 100 levels deep for a subject, in case of loops
|
||||
|
|
@ -331,7 +308,7 @@ function mailstream_subject(array $item): string
|
|||
break;
|
||||
}
|
||||
if ($parent_item['title']) {
|
||||
return DI::l10n()->t('Re:') . ' ' . mailstream_decode_subject($parent_item['title'], $item['uri-id']);
|
||||
return DI::l10n()->t('Re:') . ' ' . mailstream_decode_subject($parent_item['title']);
|
||||
}
|
||||
$parent = $parent_item['thr-parent'];
|
||||
}
|
||||
|
|
@ -353,7 +330,7 @@ function mailstream_subject(array $item): string
|
|||
return DI::l10n()->t("Diaspora post");
|
||||
}
|
||||
if ($contact['network'] === 'face') {
|
||||
$text = mailstream_decode_subject($item['body'], $item['uri-id']);
|
||||
$text = mailstream_decode_subject($item['body']);
|
||||
// For some reason these do show up in Facebook
|
||||
$text = preg_replace('/\xA0$/', '', $text);
|
||||
$subject = (strlen($text) > 150) ? (substr($text, 0, 140) . '...') : $text;
|
||||
|
|
@ -437,7 +414,7 @@ function mailstream_send(string $message_id, array $item, array $user): bool
|
|||
$template = Renderer::getMarkupTemplate('mail.tpl', 'addon/mailstream/');
|
||||
$mail->AltBody = BBCode::toPlaintext($item['body']);
|
||||
$item['body'] = BBCode::convertForUriId($item['uri-id'], $item['body'], BBCode::CONNECTORS);
|
||||
$item['url'] = DI::baseUrl() . '/display/' . $item['guid'];
|
||||
$item['url'] = DI::baseUrl()->get() . '/display/' . $item['guid'];
|
||||
$mail->Body = Renderer::replaceMacros($template, [
|
||||
'$upstream' => DI::l10n()->t('Upstream'),
|
||||
'$uri' => DI::l10n()->t('URI'),
|
||||
|
|
@ -491,7 +468,7 @@ function mailstream_convert_table_entries()
|
|||
'message_id' => $ms_item_id['message-id'],
|
||||
'tries' => 0);
|
||||
if (!$ms_item_id['message-id'] || !strlen($ms_item_id['message-id'])) {
|
||||
Logger::info('mailstream_convert_table_entries: item has no message-id.', ['item' => $ms_item_id['id'], 'uri' => $ms_item_id['uri']]);
|
||||
Logger::info('mailstream_convert_table_entries: item has no message-id.', 'item' => $ms_item_id['id'], 'uri' => $ms_item_id['uri']]);
|
||||
continue;
|
||||
}
|
||||
Logger::info('mailstream_convert_table_entries: convert item to workerqueue', $send_hook_data);
|
||||
|
|
@ -503,10 +480,11 @@ function mailstream_convert_table_entries()
|
|||
/**
|
||||
* Form for configuring mailstream features for a user
|
||||
*
|
||||
* @param App $a App object
|
||||
* @param array $data Hook data array
|
||||
* @throws \Friendica\Network\HTTPException\ServiceUnavailableException
|
||||
*/
|
||||
function mailstream_addon_settings(array &$data)
|
||||
function mailstream_addon_settings(App &$a, array &$data)
|
||||
{
|
||||
$enabled = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'mailstream', 'enabled');
|
||||
$address = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'mailstream', 'address');
|
||||
|
|
@ -550,10 +528,11 @@ function mailstream_addon_settings(array &$data)
|
|||
|
||||
/**
|
||||
* Process data submitted to user's mailstream features form
|
||||
* @param App $a
|
||||
* @param array $post POST data
|
||||
* @return void
|
||||
*/
|
||||
function mailstream_addon_settings_post(array $post)
|
||||
function mailstream_addon_settings_post(App $a, array $post)
|
||||
{
|
||||
if (!DI::userSession()->getLocalUserId() || empty($post['mailstream-submit'])) {
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@
|
|||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=7.3",
|
||||
"monolog/monolog": "^2.9"
|
||||
"php": ">=7.0",
|
||||
"monolog/monolog": "^3.2"
|
||||
},
|
||||
"license": "3-clause BSD license",
|
||||
"config": {
|
||||
|
|
|
|||
53
monolog/composer.lock
generated
53
monolog/composer.lock
generated
|
|
@ -4,46 +4,45 @@
|
|||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "6fd294bd163b37ac6cc400e0f8785222",
|
||||
"content-hash": "e812bcd051a73d1c9b19c91ec88a6a21",
|
||||
"packages": [
|
||||
{
|
||||
"name": "monolog/monolog",
|
||||
"version": "2.9.1",
|
||||
"version": "3.2.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Seldaek/monolog.git",
|
||||
"reference": "f259e2b15fb95494c83f52d3caad003bbf5ffaa1"
|
||||
"reference": "305444bc6fb6c89e490f4b34fa6e979584d7fa81"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/f259e2b15fb95494c83f52d3caad003bbf5ffaa1",
|
||||
"reference": "f259e2b15fb95494c83f52d3caad003bbf5ffaa1",
|
||||
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/305444bc6fb6c89e490f4b34fa6e979584d7fa81",
|
||||
"reference": "305444bc6fb6c89e490f4b34fa6e979584d7fa81",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.2",
|
||||
"psr/log": "^1.0.1 || ^2.0 || ^3.0"
|
||||
"php": ">=8.1",
|
||||
"psr/log": "^2.0 || ^3.0"
|
||||
},
|
||||
"provide": {
|
||||
"psr/log-implementation": "1.0.0 || 2.0.0 || 3.0.0"
|
||||
"psr/log-implementation": "3.0.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"aws/aws-sdk-php": "^2.4.9 || ^3.0",
|
||||
"aws/aws-sdk-php": "^3.0",
|
||||
"doctrine/couchdb": "~1.0@dev",
|
||||
"elasticsearch/elasticsearch": "^7 || ^8",
|
||||
"ext-json": "*",
|
||||
"graylog2/gelf-php": "^1.4.2 || ^2@dev",
|
||||
"graylog2/gelf-php": "^1.4.2",
|
||||
"guzzlehttp/guzzle": "^7.4",
|
||||
"guzzlehttp/psr7": "^2.2",
|
||||
"mongodb/mongodb": "^1.8",
|
||||
"php-amqplib/php-amqplib": "~2.4 || ^3",
|
||||
"phpspec/prophecy": "^1.15",
|
||||
"phpstan/phpstan": "^0.12.91",
|
||||
"phpunit/phpunit": "^8.5.14",
|
||||
"predis/predis": "^1.1 || ^2.0",
|
||||
"rollbar/rollbar": "^1.3 || ^2 || ^3",
|
||||
"phpstan/phpstan": "^1.4",
|
||||
"phpstan/phpstan-deprecation-rules": "^1.0",
|
||||
"phpstan/phpstan-strict-rules": "^1.1",
|
||||
"phpunit/phpunit": "^9.5.16",
|
||||
"predis/predis": "^1.1",
|
||||
"ruflin/elastica": "^7",
|
||||
"swiftmailer/swiftmailer": "^5.3|^6.0",
|
||||
"symfony/mailer": "^5.4 || ^6",
|
||||
"symfony/mime": "^5.4 || ^6"
|
||||
},
|
||||
|
|
@ -66,7 +65,7 @@
|
|||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "2.x-dev"
|
||||
"dev-main": "3.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
|
|
@ -102,34 +101,34 @@
|
|||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2023-02-06T13:44:46+00:00"
|
||||
"time": "2022-07-24T12:00:55+00:00"
|
||||
},
|
||||
{
|
||||
"name": "psr/log",
|
||||
"version": "1.1.4",
|
||||
"version": "3.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/php-fig/log.git",
|
||||
"reference": "d49695b909c3b7628b6289db5479a1c204601f11"
|
||||
"reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11",
|
||||
"reference": "d49695b909c3b7628b6289db5479a1c204601f11",
|
||||
"url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001",
|
||||
"reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.0"
|
||||
"php": ">=8.0.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.1.x-dev"
|
||||
"dev-master": "3.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Psr\\Log\\": "Psr/Log/"
|
||||
"Psr\\Log\\": "src"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
|
|
@ -149,7 +148,7 @@
|
|||
"psr",
|
||||
"psr-3"
|
||||
],
|
||||
"time": "2021-05-03T11:20:27+00:00"
|
||||
"time": "2021-07-14T16:46:02+00:00"
|
||||
}
|
||||
],
|
||||
"packages-dev": [],
|
||||
|
|
@ -159,7 +158,7 @@
|
|||
"prefer-stable": false,
|
||||
"prefer-lowest": false,
|
||||
"platform": {
|
||||
"php": ">=7.3"
|
||||
"php": ">=7.0"
|
||||
},
|
||||
"platform-dev": [],
|
||||
"plugin-api-version": "1.1.0"
|
||||
|
|
|
|||
|
|
@ -5,3 +5,62 @@
|
|||
* Version: 1.0
|
||||
* Author: Philipp Holzer
|
||||
*/
|
||||
|
||||
use Friendica\App;
|
||||
use Friendica\Core\Hook;
|
||||
use Friendica\Addon\monolog\src\IntrospectionProcessor;
|
||||
use Friendica\DI;
|
||||
use Psr\Log\LogLevel;
|
||||
|
||||
require_once __DIR__ . '/vendor/autoload.php';
|
||||
|
||||
function monolog_install()
|
||||
{
|
||||
Hook::register('logger_instance' , __FILE__, 'monolog_instance');
|
||||
}
|
||||
|
||||
function monolog_uninstall()
|
||||
{
|
||||
Hook::unregister('logger_instance', __FILE__, 'monolog_instance');
|
||||
}
|
||||
|
||||
function monolog_instance(array &$data)
|
||||
{
|
||||
if ($data['name'] !== 'monolog') {
|
||||
return;
|
||||
}
|
||||
|
||||
$loggerTimeZone = new \DateTimeZone('UTC');
|
||||
|
||||
$logger = new Monolog\Logger($data['channel']);
|
||||
$logger->setTimezone($loggerTimeZone);
|
||||
$logger->pushProcessor(new Monolog\Processor\PsrLogMessageProcessor());
|
||||
$logger->pushProcessor(new Monolog\Processor\ProcessIdProcessor());
|
||||
$logger->pushProcessor(new Monolog\Processor\UidProcessor());
|
||||
$logger->pushProcessor(new IntrospectionProcessor($data['introspection'], LogLevel::DEBUG));
|
||||
|
||||
$stream = DI::config()->get('system', 'logfile');
|
||||
|
||||
// just add a stream in case it's either writable or not file
|
||||
if (!is_file($stream) || is_writable($stream)) {
|
||||
try {
|
||||
$loglevel = Monolog\Logger::toMonologLevel($data['loglevel']);
|
||||
|
||||
// fallback to notice if an invalid loglevel is set
|
||||
if (!is_int($loglevel)) {
|
||||
$loglevel = LogLevel::NOTICE;
|
||||
}
|
||||
|
||||
$fileHandler = new Monolog\Handler\StreamHandler($stream, $loglevel);
|
||||
|
||||
$formatter = new Monolog\Formatter\LineFormatter("%datetime% %channel% [%level_name%]: %message% %context% %extra%\n");
|
||||
$fileHandler->setFormatter($formatter);
|
||||
|
||||
$logger->pushHandler($fileHandler);
|
||||
} catch (\Throwable $e) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$data['storage'] = $logger;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
namespace Friendica\Addon\monolog\src\Monolog;
|
||||
namespace Friendica\Addon\monolog\src;
|
||||
|
||||
use Friendica\App\Request;
|
||||
use Monolog\Handler;
|
||||
|
|
@ -1,54 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace Friendica\Addon\monolog\src\Factory;
|
||||
|
||||
use Friendica\Addon\monolog\src\Monolog\IntrospectionProcessor;
|
||||
use Friendica\Core\Config\Capability\IManageConfigValues;
|
||||
use Friendica\Core\Logger\Factory\AbstractLoggerTypeFactory;
|
||||
use Monolog\Formatter\LineFormatter;
|
||||
use Monolog\Handler\StreamHandler;
|
||||
use Monolog\Logger;
|
||||
use Monolog\Processor\ProcessIdProcessor;
|
||||
use Monolog\Processor\PsrLogMessageProcessor;
|
||||
use Monolog\Processor\UidProcessor;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Psr\Log\LogLevel;
|
||||
|
||||
require_once __DIR__ . '/../../vendor/autoload.php';
|
||||
|
||||
class Monolog extends AbstractLoggerTypeFactory
|
||||
{
|
||||
public function create(IManageConfigValues $config, string $loglevel = null): LoggerInterface
|
||||
{
|
||||
$loggerTimeZone = new \DateTimeZone('UTC');
|
||||
|
||||
$logger = new Logger($this->channel);
|
||||
$logger->setTimezone($loggerTimeZone);
|
||||
$logger->pushProcessor(new PsrLogMessageProcessor());
|
||||
$logger->pushProcessor(new ProcessIdProcessor());
|
||||
$logger->pushProcessor(new UidProcessor());
|
||||
$logger->pushProcessor(new IntrospectionProcessor($this->introspection, LogLevel::DEBUG));
|
||||
|
||||
$logfile = $config->get('system', 'logfile');
|
||||
|
||||
// just add a stream in case it's either writable or not file
|
||||
if (is_writable($logfile)) {
|
||||
$loglevel = $loglevel ?? static::mapLegacyConfigDebugLevel($config->get('system', 'loglevel'));
|
||||
$loglevel = Logger::toMonologLevel($loglevel);
|
||||
|
||||
// fallback to notice if an invalid loglevel is set
|
||||
if (!is_int($loglevel)) {
|
||||
$loglevel = LogLevel::NOTICE;
|
||||
}
|
||||
|
||||
$fileHandler = new StreamHandler($logfile, $loglevel);
|
||||
|
||||
$formatter = new LineFormatter("%datetime% %channel% [%level_name%]: %message% %context% %extra%\n");
|
||||
$fileHandler->setFormatter($formatter);
|
||||
|
||||
$logger->pushHandler($fileHandler);
|
||||
}
|
||||
|
||||
return $logger;
|
||||
}
|
||||
}
|
||||
|
|
@ -19,10 +19,11 @@
|
|||
*
|
||||
*/
|
||||
|
||||
namespace Friendica\Addon\monolog\src\Monolog;
|
||||
namespace Friendica\Addon\monolog\src;
|
||||
|
||||
use Friendica\Core\Logger\Util\Introspection;
|
||||
use Monolog\Logger;
|
||||
use Monolog\LogRecord;
|
||||
use Monolog\Processor\ProcessorInterface;
|
||||
|
||||
/**
|
||||
|
|
@ -41,19 +42,19 @@ class IntrospectionProcessor implements ProcessorInterface
|
|||
public function __construct(Introspection $introspection, $level = Logger::DEBUG)
|
||||
{
|
||||
$this->level = Logger::toMonologLevel($level);
|
||||
$introspection->addClasses(['Monolog\\', static::class]);
|
||||
$introspection->addClasses(['Monolog\\']);
|
||||
$this->introspection = $introspection;
|
||||
}
|
||||
|
||||
public function __invoke(array $record): array
|
||||
public function __invoke(LogRecord $record): LogRecord
|
||||
{
|
||||
// return if the level is not high enough
|
||||
if ($record['level'] < $this->level) {
|
||||
if ($record->level < $this->level) {
|
||||
return $record;
|
||||
}
|
||||
// we should have the call source now
|
||||
$record['extra'] = array_merge(
|
||||
$record['extra'],
|
||||
$record->extra = array_merge(
|
||||
$record->extra,
|
||||
$this->introspection->getRecord()
|
||||
);
|
||||
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* @copyright Copyright (C) 2010-2023, the Friendica project
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
return [
|
||||
\Monolog\Logger::class => [
|
||||
'instanceOf' => \Friendica\Addon\monolog\src\Factory\Monolog::class,
|
||||
'call' => [
|
||||
['create', [], \Dice\Dice::CHAIN_CALL],
|
||||
],
|
||||
],
|
||||
];
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* @copyright Copyright (C) 2010-2023, the Friendica project
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
return [
|
||||
\Psr\Log\LoggerInterface::class => [
|
||||
\Monolog\Logger::class => ['monolog'],
|
||||
],
|
||||
];
|
||||
21
monolog/vendor/composer/autoload_classmap.php
vendored
21
monolog/vendor/composer/autoload_classmap.php
vendored
|
|
@ -26,6 +26,7 @@ return array(
|
|||
'Monolog\\Formatter\\MongoDBFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/MongoDBFormatter.php',
|
||||
'Monolog\\Formatter\\NormalizerFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php',
|
||||
'Monolog\\Formatter\\ScalarFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/ScalarFormatter.php',
|
||||
'Monolog\\Formatter\\SyslogFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/SyslogFormatter.php',
|
||||
'Monolog\\Formatter\\WildfireFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/WildfireFormatter.php',
|
||||
'Monolog\\Handler\\AbstractHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/AbstractHandler.php',
|
||||
'Monolog\\Handler\\AbstractProcessingHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php',
|
||||
|
|
@ -91,7 +92,6 @@ return array(
|
|||
'Monolog\\Handler\\SocketHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/SocketHandler.php',
|
||||
'Monolog\\Handler\\SqsHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/SqsHandler.php',
|
||||
'Monolog\\Handler\\StreamHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/StreamHandler.php',
|
||||
'Monolog\\Handler\\SwiftMailerHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/SwiftMailerHandler.php',
|
||||
'Monolog\\Handler\\SymfonyMailerHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/SymfonyMailerHandler.php',
|
||||
'Monolog\\Handler\\SyslogHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/SyslogHandler.php',
|
||||
'Monolog\\Handler\\SyslogUdpHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/SyslogUdpHandler.php',
|
||||
|
|
@ -121,15 +121,12 @@ return array(
|
|||
'Monolog\\SignalHandler' => $vendorDir . '/monolog/monolog/src/Monolog/SignalHandler.php',
|
||||
'Monolog\\Test\\TestCase' => $vendorDir . '/monolog/monolog/src/Monolog/Test/TestCase.php',
|
||||
'Monolog\\Utils' => $vendorDir . '/monolog/monolog/src/Monolog/Utils.php',
|
||||
'Psr\\Log\\AbstractLogger' => $vendorDir . '/psr/log/Psr/Log/AbstractLogger.php',
|
||||
'Psr\\Log\\InvalidArgumentException' => $vendorDir . '/psr/log/Psr/Log/InvalidArgumentException.php',
|
||||
'Psr\\Log\\LogLevel' => $vendorDir . '/psr/log/Psr/Log/LogLevel.php',
|
||||
'Psr\\Log\\LoggerAwareInterface' => $vendorDir . '/psr/log/Psr/Log/LoggerAwareInterface.php',
|
||||
'Psr\\Log\\LoggerAwareTrait' => $vendorDir . '/psr/log/Psr/Log/LoggerAwareTrait.php',
|
||||
'Psr\\Log\\LoggerInterface' => $vendorDir . '/psr/log/Psr/Log/LoggerInterface.php',
|
||||
'Psr\\Log\\LoggerTrait' => $vendorDir . '/psr/log/Psr/Log/LoggerTrait.php',
|
||||
'Psr\\Log\\NullLogger' => $vendorDir . '/psr/log/Psr/Log/NullLogger.php',
|
||||
'Psr\\Log\\Test\\DummyTest' => $vendorDir . '/psr/log/Psr/Log/Test/DummyTest.php',
|
||||
'Psr\\Log\\Test\\LoggerInterfaceTest' => $vendorDir . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php',
|
||||
'Psr\\Log\\Test\\TestLogger' => $vendorDir . '/psr/log/Psr/Log/Test/TestLogger.php',
|
||||
'Psr\\Log\\AbstractLogger' => $vendorDir . '/psr/log/src/AbstractLogger.php',
|
||||
'Psr\\Log\\InvalidArgumentException' => $vendorDir . '/psr/log/src/InvalidArgumentException.php',
|
||||
'Psr\\Log\\LogLevel' => $vendorDir . '/psr/log/src/LogLevel.php',
|
||||
'Psr\\Log\\LoggerAwareInterface' => $vendorDir . '/psr/log/src/LoggerAwareInterface.php',
|
||||
'Psr\\Log\\LoggerAwareTrait' => $vendorDir . '/psr/log/src/LoggerAwareTrait.php',
|
||||
'Psr\\Log\\LoggerInterface' => $vendorDir . '/psr/log/src/LoggerInterface.php',
|
||||
'Psr\\Log\\LoggerTrait' => $vendorDir . '/psr/log/src/LoggerTrait.php',
|
||||
'Psr\\Log\\NullLogger' => $vendorDir . '/psr/log/src/NullLogger.php',
|
||||
);
|
||||
|
|
|
|||
2
monolog/vendor/composer/autoload_psr4.php
vendored
2
monolog/vendor/composer/autoload_psr4.php
vendored
|
|
@ -6,6 +6,6 @@ $vendorDir = dirname(dirname(__FILE__));
|
|||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'),
|
||||
'Psr\\Log\\' => array($vendorDir . '/psr/log/src'),
|
||||
'Monolog\\' => array($vendorDir . '/monolog/monolog/src/Monolog'),
|
||||
);
|
||||
|
|
|
|||
23
monolog/vendor/composer/autoload_static.php
vendored
23
monolog/vendor/composer/autoload_static.php
vendored
|
|
@ -20,7 +20,7 @@ class ComposerStaticInitMonologAddon
|
|||
public static $prefixDirsPsr4 = array (
|
||||
'Psr\\Log\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/psr/log/Psr/Log',
|
||||
0 => __DIR__ . '/..' . '/psr/log/src',
|
||||
),
|
||||
'Monolog\\' =>
|
||||
array (
|
||||
|
|
@ -49,6 +49,7 @@ class ComposerStaticInitMonologAddon
|
|||
'Monolog\\Formatter\\MongoDBFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/MongoDBFormatter.php',
|
||||
'Monolog\\Formatter\\NormalizerFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php',
|
||||
'Monolog\\Formatter\\ScalarFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/ScalarFormatter.php',
|
||||
'Monolog\\Formatter\\SyslogFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/SyslogFormatter.php',
|
||||
'Monolog\\Formatter\\WildfireFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/WildfireFormatter.php',
|
||||
'Monolog\\Handler\\AbstractHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/AbstractHandler.php',
|
||||
'Monolog\\Handler\\AbstractProcessingHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php',
|
||||
|
|
@ -114,7 +115,6 @@ class ComposerStaticInitMonologAddon
|
|||
'Monolog\\Handler\\SocketHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/SocketHandler.php',
|
||||
'Monolog\\Handler\\SqsHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/SqsHandler.php',
|
||||
'Monolog\\Handler\\StreamHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/StreamHandler.php',
|
||||
'Monolog\\Handler\\SwiftMailerHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/SwiftMailerHandler.php',
|
||||
'Monolog\\Handler\\SymfonyMailerHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/SymfonyMailerHandler.php',
|
||||
'Monolog\\Handler\\SyslogHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/SyslogHandler.php',
|
||||
'Monolog\\Handler\\SyslogUdpHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/SyslogUdpHandler.php',
|
||||
|
|
@ -144,17 +144,14 @@ class ComposerStaticInitMonologAddon
|
|||
'Monolog\\SignalHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/SignalHandler.php',
|
||||
'Monolog\\Test\\TestCase' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Test/TestCase.php',
|
||||
'Monolog\\Utils' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Utils.php',
|
||||
'Psr\\Log\\AbstractLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/AbstractLogger.php',
|
||||
'Psr\\Log\\InvalidArgumentException' => __DIR__ . '/..' . '/psr/log/Psr/Log/InvalidArgumentException.php',
|
||||
'Psr\\Log\\LogLevel' => __DIR__ . '/..' . '/psr/log/Psr/Log/LogLevel.php',
|
||||
'Psr\\Log\\LoggerAwareInterface' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerAwareInterface.php',
|
||||
'Psr\\Log\\LoggerAwareTrait' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerAwareTrait.php',
|
||||
'Psr\\Log\\LoggerInterface' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerInterface.php',
|
||||
'Psr\\Log\\LoggerTrait' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerTrait.php',
|
||||
'Psr\\Log\\NullLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/NullLogger.php',
|
||||
'Psr\\Log\\Test\\DummyTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/DummyTest.php',
|
||||
'Psr\\Log\\Test\\LoggerInterfaceTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php',
|
||||
'Psr\\Log\\Test\\TestLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/TestLogger.php',
|
||||
'Psr\\Log\\AbstractLogger' => __DIR__ . '/..' . '/psr/log/src/AbstractLogger.php',
|
||||
'Psr\\Log\\InvalidArgumentException' => __DIR__ . '/..' . '/psr/log/src/InvalidArgumentException.php',
|
||||
'Psr\\Log\\LogLevel' => __DIR__ . '/..' . '/psr/log/src/LogLevel.php',
|
||||
'Psr\\Log\\LoggerAwareInterface' => __DIR__ . '/..' . '/psr/log/src/LoggerAwareInterface.php',
|
||||
'Psr\\Log\\LoggerAwareTrait' => __DIR__ . '/..' . '/psr/log/src/LoggerAwareTrait.php',
|
||||
'Psr\\Log\\LoggerInterface' => __DIR__ . '/..' . '/psr/log/src/LoggerInterface.php',
|
||||
'Psr\\Log\\LoggerTrait' => __DIR__ . '/..' . '/psr/log/src/LoggerTrait.php',
|
||||
'Psr\\Log\\NullLogger' => __DIR__ . '/..' . '/psr/log/src/NullLogger.php',
|
||||
);
|
||||
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
|
|
|
|||
53
monolog/vendor/composer/installed.json
vendored
53
monolog/vendor/composer/installed.json
vendored
|
|
@ -1,43 +1,42 @@
|
|||
[
|
||||
{
|
||||
"name": "monolog/monolog",
|
||||
"version": "2.9.1",
|
||||
"version_normalized": "2.9.1.0",
|
||||
"version": "3.2.0",
|
||||
"version_normalized": "3.2.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Seldaek/monolog.git",
|
||||
"reference": "f259e2b15fb95494c83f52d3caad003bbf5ffaa1"
|
||||
"reference": "305444bc6fb6c89e490f4b34fa6e979584d7fa81"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/f259e2b15fb95494c83f52d3caad003bbf5ffaa1",
|
||||
"reference": "f259e2b15fb95494c83f52d3caad003bbf5ffaa1",
|
||||
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/305444bc6fb6c89e490f4b34fa6e979584d7fa81",
|
||||
"reference": "305444bc6fb6c89e490f4b34fa6e979584d7fa81",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.2",
|
||||
"psr/log": "^1.0.1 || ^2.0 || ^3.0"
|
||||
"php": ">=8.1",
|
||||
"psr/log": "^2.0 || ^3.0"
|
||||
},
|
||||
"provide": {
|
||||
"psr/log-implementation": "1.0.0 || 2.0.0 || 3.0.0"
|
||||
"psr/log-implementation": "3.0.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"aws/aws-sdk-php": "^2.4.9 || ^3.0",
|
||||
"aws/aws-sdk-php": "^3.0",
|
||||
"doctrine/couchdb": "~1.0@dev",
|
||||
"elasticsearch/elasticsearch": "^7 || ^8",
|
||||
"ext-json": "*",
|
||||
"graylog2/gelf-php": "^1.4.2 || ^2@dev",
|
||||
"graylog2/gelf-php": "^1.4.2",
|
||||
"guzzlehttp/guzzle": "^7.4",
|
||||
"guzzlehttp/psr7": "^2.2",
|
||||
"mongodb/mongodb": "^1.8",
|
||||
"php-amqplib/php-amqplib": "~2.4 || ^3",
|
||||
"phpspec/prophecy": "^1.15",
|
||||
"phpstan/phpstan": "^0.12.91",
|
||||
"phpunit/phpunit": "^8.5.14",
|
||||
"predis/predis": "^1.1 || ^2.0",
|
||||
"rollbar/rollbar": "^1.3 || ^2 || ^3",
|
||||
"phpstan/phpstan": "^1.4",
|
||||
"phpstan/phpstan-deprecation-rules": "^1.0",
|
||||
"phpstan/phpstan-strict-rules": "^1.1",
|
||||
"phpunit/phpunit": "^9.5.16",
|
||||
"predis/predis": "^1.1",
|
||||
"ruflin/elastica": "^7",
|
||||
"swiftmailer/swiftmailer": "^5.3|^6.0",
|
||||
"symfony/mailer": "^5.4 || ^6",
|
||||
"symfony/mime": "^5.4 || ^6"
|
||||
},
|
||||
|
|
@ -57,11 +56,11 @@
|
|||
"rollbar/rollbar": "Allow sending log messages to Rollbar",
|
||||
"ruflin/elastica": "Allow sending log messages to an Elastic Search server"
|
||||
},
|
||||
"time": "2023-02-06T13:44:46+00:00",
|
||||
"time": "2022-07-24T12:00:55+00:00",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "2.x-dev"
|
||||
"dev-main": "3.x-dev"
|
||||
}
|
||||
},
|
||||
"installation-source": "dist",
|
||||
|
|
@ -101,33 +100,33 @@
|
|||
},
|
||||
{
|
||||
"name": "psr/log",
|
||||
"version": "1.1.4",
|
||||
"version_normalized": "1.1.4.0",
|
||||
"version": "3.0.0",
|
||||
"version_normalized": "3.0.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/php-fig/log.git",
|
||||
"reference": "d49695b909c3b7628b6289db5479a1c204601f11"
|
||||
"reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11",
|
||||
"reference": "d49695b909c3b7628b6289db5479a1c204601f11",
|
||||
"url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001",
|
||||
"reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.0"
|
||||
"php": ">=8.0.0"
|
||||
},
|
||||
"time": "2021-05-03T11:20:27+00:00",
|
||||
"time": "2021-07-14T16:46:02+00:00",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.1.x-dev"
|
||||
"dev-master": "3.x-dev"
|
||||
}
|
||||
},
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Psr\\Log\\": "Psr/Log/"
|
||||
"Psr\\Log\\": "src"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
|
|
|
|||
75
monolog/vendor/monolog/monolog/CHANGELOG.md
vendored
75
monolog/vendor/monolog/monolog/CHANGELOG.md
vendored
|
|
@ -1,17 +1,70 @@
|
|||
### 2.9.1 (2023-02-06)
|
||||
### 3.2.0 (2022-07-24)
|
||||
|
||||
* Fixed Logger not being serializable anymore (#1792)
|
||||
* Deprecated `CubeHandler` and `PHPConsoleHandler` as both projects are abandoned and those should not be used anymore (#1734)
|
||||
* Marked `Logger` `@final` as it should not be extended, prefer composition or talk to us if you are missing something
|
||||
* Added RFC 5424 level (`7` to `0`) support to `Logger::log` and `Logger::addRecord` to increase interoperability (#1723)
|
||||
* Added `SyslogFormatter` to output syslog-like files which can be consumed by tools like [lnav](https://lnav.org/) (#1689)
|
||||
* Added support for `__toString` for objects which are not json serializable in `JsonFormatter` (#1733)
|
||||
* Added `GoogleCloudLoggingFormatter` (#1719)
|
||||
* Added support for Predis 2.x (#1732)
|
||||
* Added `AmqpHandler->setExtraAttributes` to allow configuring attributes when using an AMQPExchange (#1724)
|
||||
* Fixed serialization/unserialization of handlers to make sure private properties are included (#1727)
|
||||
* Fixed allowInlineLineBreaks in LineFormatter causing issues with windows paths containing `\n` or `\r` sequences (#1720)
|
||||
* Fixed max normalization depth not being taken into account when formatting exceptions with a deep chain of previous exceptions (#1726)
|
||||
* Fixed PHP 8.2 deprecation warnings (#1722)
|
||||
* Fixed rare race condition or filesystem issue where StreamHandler is unable to create the directory the log should go into yet it exists already (#1678)
|
||||
|
||||
### 2.9.0 (2023-02-05)
|
||||
### 3.1.0 (2022-06-09)
|
||||
|
||||
* Deprecated FlowdockHandler & Formatter as the flowdock service was shutdown (#1748)
|
||||
* Added support for enum context values in PsrLogMessageProcessor (#1773)
|
||||
* Added graylog2/gelf-php 2.x support (#1747)
|
||||
* Improved `BrowserConsoleHandler` logging to use more appropriate methods than just console.log in the browser (#1739)
|
||||
* Fixed `WhatFailureGroupHandler` not catching errors happening inside `close()` (#1791)
|
||||
* Fixed datetime field in `GoogleCloudLoggingFormatter` (#1758)
|
||||
* Fixed infinite loop detection within Fibers (#1753)
|
||||
* Fixed `AmqpHandler->setExtraAttributes` not working with buffering handler wrappers (#1781)
|
||||
* Added `$datetime` parameter to `Logger::addRecord` as low level API to allow logging into the past or future (#1682)
|
||||
* Added `Logger::useLoggingLoopDetection` to allow disabling cyclic logging detection in concurrent frameworks (#1681)
|
||||
* Fixed handling of fatal errors if callPrevious is disabled in ErrorHandler (#1670)
|
||||
* Fixed interop issue by removing the need for a return type in ProcessorInterface (#1680)
|
||||
* Marked the reusable `Monolog\Test\TestCase` class as `@internal` to make sure PHPStorm does not show it above PHPUnit, you may still use it to test your own handlers/etc though (#1677)
|
||||
* Fixed RotatingFileHandler issue when the date format contained slashes (#1671)
|
||||
|
||||
### 3.0.0 (2022-05-10)
|
||||
|
||||
Changes from RC1
|
||||
|
||||
- The `Monolog\LevelName` enum does not exist anymore, use `Monolog\Level->getName()` instead.
|
||||
|
||||
### 3.0.0-RC1 (2022-05-08)
|
||||
|
||||
This is mostly a cleanup release offering stronger type guarantees for integrators with the
|
||||
array->object/enum changes, but there is no big new feature for end users.
|
||||
|
||||
See [UPGRADE notes](UPGRADE.md#300) for details on all breaking changes especially if you are extending/implementing Monolog classes/interfaces.
|
||||
|
||||
Noteworthy BC Breaks:
|
||||
|
||||
- The minimum supported PHP version is now `8.1.0`.
|
||||
- Log records have been converted from an array to a [`Monolog\LogRecord` object](src/Monolog/LogRecord.php)
|
||||
with public (and mostly readonly) properties. e.g. instead of doing
|
||||
`$record['context']` use `$record->context`.
|
||||
In formatters or handlers if you rather need an array to work with you can use `$record->toArray()`
|
||||
to get back a Monolog 1/2 style record array. This will contain the enum values instead of enum cases
|
||||
in the `level` and `level_name` keys to be more backwards compatible and use simpler data types.
|
||||
- `FormatterInterface`, `HandlerInterface`, `ProcessorInterface`, etc. changed to contain `LogRecord $record`
|
||||
instead of `array $record` parameter types. If you want to support multiple Monolog versions this should
|
||||
be possible by type-hinting nothing, or `array|LogRecord` if you support PHP 8.0+. You can then code
|
||||
against the $record using Monolog 2 style as LogRecord implements ArrayAccess for BC.
|
||||
The interfaces do not require a `LogRecord` return type even where it would be applicable, but if you only
|
||||
support Monolog 3 in integration code I would recommend you use `LogRecord` return types wherever fitting
|
||||
to ensure forward compatibility as it may be added in Monolog 4.
|
||||
- Log levels are now enums [`Monolog\Level`](src/Monolog/Level.php) and [`Monolog\LevelName`](src/Monolog/LevelName.php)
|
||||
- Removed deprecated SwiftMailerHandler, migrate to SymfonyMailerHandler instead.
|
||||
- `ResettableInterface::reset()` now requires a void return type.
|
||||
- All properties have had types added, which may require you to do so as well if you extended
|
||||
a Monolog class and declared the same property.
|
||||
|
||||
New deprecations:
|
||||
|
||||
- `Logger::DEBUG`, `Logger::ERROR`, etc. are now deprecated in favor of the `Monolog\Level` enum.
|
||||
e.g. instead of `Logger::WARNING` use `Level::Warning` if you need to pass the enum case
|
||||
to Monolog or one of its handlers, or `Level::Warning->value` if you need the integer
|
||||
value equal to what `Logger::WARNING` was giving you.
|
||||
- `Logger::getLevelName()` is now deprecated.
|
||||
|
||||
### 2.8.0 (2022-07-24)
|
||||
|
||||
|
|
|
|||
13
monolog/vendor/monolog/monolog/README.md
vendored
13
monolog/vendor/monolog/monolog/README.md
vendored
|
|
@ -3,6 +3,8 @@
|
|||
[](https://packagist.org/packages/monolog/monolog)
|
||||
[](https://packagist.org/packages/monolog/monolog)
|
||||
|
||||
> ⚠ This is the **documentation for Monolog 3.x**, if you are using older releases
|
||||
> see the documentation for [Monolog 2.x](https://github.com/Seldaek/monolog/blob/2.x/README.md) or [Monolog 1.x](https://github.com/Seldaek/monolog/blob/1.x/README.md) ⚠
|
||||
|
||||
Monolog sends your logs to files, sockets, inboxes, databases and various
|
||||
web services. See the complete list of handlers below. Special handlers
|
||||
|
|
@ -28,12 +30,13 @@ $ composer require monolog/monolog
|
|||
```php
|
||||
<?php
|
||||
|
||||
use Monolog\Level;
|
||||
use Monolog\Logger;
|
||||
use Monolog\Handler\StreamHandler;
|
||||
|
||||
// create a log channel
|
||||
$log = new Logger('name');
|
||||
$log->pushHandler(new StreamHandler('path/to/your.log', Logger::WARNING));
|
||||
$log->pushHandler(new StreamHandler('path/to/your.log', Level::Warning));
|
||||
|
||||
// add records to the log
|
||||
$log->warning('Foo');
|
||||
|
|
@ -50,7 +53,7 @@ $log->error('Bar');
|
|||
|
||||
## Support Monolog Financially
|
||||
|
||||
Get supported Monolog and help fund the project with the [Tidelift Subscription](https://tidelift.com/subscription/pkg/packagist-monolog-monolog?utm_source=packagist-monolog-monolog&utm_medium=referral&utm_campaign=enterprise) or via [GitHub sponsorship](https://github.com/sponsors/Seldaek).
|
||||
Get supported Monolog and help fund the project with the [Tidelift Subscription](https://tidelift.com/subscription/pkg/packagist-monolog-monolog?utm_source=packagist-monolog-monolog&utm_medium=referral&utm_campaign=enterprise) or via [GitHub sponsorship](https://github.com/sponsors/Seldaek).
|
||||
|
||||
Tidelift delivers commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use.
|
||||
|
||||
|
|
@ -64,11 +67,13 @@ can also add your own there if you publish one.
|
|||
|
||||
### Requirements
|
||||
|
||||
- Monolog `^2.0` works with PHP 7.2 or above, use Monolog `^1.25` for PHP 5.3+ support.
|
||||
- Monolog `^3.0` works with PHP 8.1 or above.
|
||||
- Monolog `^2.5` works with PHP 7.2 or above.
|
||||
- Monolog `^1.25` works with PHP 5.3 up to 8.1, but is not very maintained anymore and will not receive PHP support fixes anymore.
|
||||
|
||||
### Support
|
||||
|
||||
Monolog 1.x support is somewhat limited at this point and only important fixes will be done. You should migrate to Monolog 2 where possible to benefit from all the latest features and fixes.
|
||||
Monolog 1.x support is somewhat limited at this point and only important fixes will be done. You should migrate to Monolog 2 or 3 where possible to benefit from all the latest features and fixes.
|
||||
|
||||
### Submitting bugs and feature requests
|
||||
|
||||
|
|
|
|||
28
monolog/vendor/monolog/monolog/composer.json
vendored
28
monolog/vendor/monolog/monolog/composer.json
vendored
|
|
@ -13,26 +13,25 @@
|
|||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=7.2",
|
||||
"psr/log": "^1.0.1 || ^2.0 || ^3.0"
|
||||
"php": ">=8.1",
|
||||
"psr/log": "^2.0 || ^3.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"ext-json": "*",
|
||||
"aws/aws-sdk-php": "^2.4.9 || ^3.0",
|
||||
"aws/aws-sdk-php": "^3.0",
|
||||
"doctrine/couchdb": "~1.0@dev",
|
||||
"elasticsearch/elasticsearch": "^7 || ^8",
|
||||
"graylog2/gelf-php": "^1.4.2 || ^2@dev",
|
||||
"graylog2/gelf-php": "^1.4.2",
|
||||
"guzzlehttp/guzzle": "^7.4",
|
||||
"guzzlehttp/psr7": "^2.2",
|
||||
"mongodb/mongodb": "^1.8",
|
||||
"php-amqplib/php-amqplib": "~2.4 || ^3",
|
||||
"phpspec/prophecy": "^1.15",
|
||||
"phpstan/phpstan": "^0.12.91",
|
||||
"phpunit/phpunit": "^8.5.14",
|
||||
"predis/predis": "^1.1 || ^2.0",
|
||||
"rollbar/rollbar": "^1.3 || ^2 || ^3",
|
||||
"phpstan/phpstan": "^1.4",
|
||||
"phpstan/phpstan-deprecation-rules": "^1.0",
|
||||
"phpstan/phpstan-strict-rules": "^1.1",
|
||||
"phpunit/phpunit": "^9.5.16",
|
||||
"predis/predis": "^1.1",
|
||||
"ruflin/elastica": "^7",
|
||||
"swiftmailer/swiftmailer": "^5.3|^6.0",
|
||||
"symfony/mailer": "^5.4 || ^6",
|
||||
"symfony/mime": "^5.4 || ^6"
|
||||
},
|
||||
|
|
@ -59,11 +58,11 @@
|
|||
"psr-4": {"Monolog\\": "tests/Monolog"}
|
||||
},
|
||||
"provide": {
|
||||
"psr/log-implementation": "1.0.0 || 2.0.0 || 3.0.0"
|
||||
"psr/log-implementation": "3.0.0"
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "2.x-dev"
|
||||
"dev-main": "3.x-dev"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
|
|
@ -73,9 +72,6 @@
|
|||
"config": {
|
||||
"lock": false,
|
||||
"sort-packages": true,
|
||||
"platform-check": false,
|
||||
"allow-plugins": {
|
||||
"composer/package-versions-deprecated": true
|
||||
}
|
||||
"platform-check": false
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,34 +13,24 @@ namespace Monolog\Attribute;
|
|||
|
||||
/**
|
||||
* A reusable attribute to help configure a class or a method as a processor.
|
||||
*
|
||||
*
|
||||
* Using it offers no guarantee: it needs to be leveraged by a Monolog third-party consumer.
|
||||
*
|
||||
*
|
||||
* Using it with the Monolog library only has no effect at all: processors should still be turned into a callable if
|
||||
* needed and manually pushed to the loggers and to the processable handlers.
|
||||
*/
|
||||
#[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
|
||||
class AsMonologProcessor
|
||||
{
|
||||
/** @var string|null */
|
||||
public $channel = null;
|
||||
/** @var string|null */
|
||||
public $handler = null;
|
||||
/** @var string|null */
|
||||
public $method = null;
|
||||
|
||||
/**
|
||||
* @param string|null $channel The logging channel the processor should be pushed to.
|
||||
* @param string|null $handler The handler the processor should be pushed to.
|
||||
* @param string|null $method The method that processes the records (if the attribute is used at the class level).
|
||||
* @param string|null $channel The logging channel the processor should be pushed to.
|
||||
* @param string|null $handler The handler the processor should be pushed to.
|
||||
* @param string|null $method The method that processes the records (if the attribute is used at the class level).
|
||||
*/
|
||||
public function __construct(
|
||||
?string $channel = null,
|
||||
?string $handler = null,
|
||||
?string $method = null
|
||||
public readonly ?string $channel = null,
|
||||
public readonly ?string $handler = null,
|
||||
public readonly ?string $method = null
|
||||
) {
|
||||
$this->channel = $channel;
|
||||
$this->handler = $handler;
|
||||
$this->method = $method;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,10 +21,7 @@ use DateTimeZone;
|
|||
*/
|
||||
class DateTimeImmutable extends \DateTimeImmutable implements \JsonSerializable
|
||||
{
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
private $useMicroseconds;
|
||||
private bool $useMicroseconds;
|
||||
|
||||
public function __construct(bool $useMicroseconds, ?DateTimeZone $timezone = null)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
namespace Monolog;
|
||||
|
||||
use Closure;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Psr\Log\LogLevel;
|
||||
|
||||
|
|
@ -25,35 +26,33 @@ use Psr\Log\LogLevel;
|
|||
*/
|
||||
class ErrorHandler
|
||||
{
|
||||
/** @var LoggerInterface */
|
||||
private $logger;
|
||||
private Closure|null $previousExceptionHandler = null;
|
||||
|
||||
/** @var ?callable */
|
||||
private $previousExceptionHandler = null;
|
||||
/** @var array<class-string, LogLevel::*> an array of class name to LogLevel::* constant mapping */
|
||||
private $uncaughtExceptionLevelMap = [];
|
||||
private array $uncaughtExceptionLevelMap = [];
|
||||
|
||||
/** @var Closure|true|null */
|
||||
private Closure|bool|null $previousErrorHandler = null;
|
||||
|
||||
/** @var callable|true|null */
|
||||
private $previousErrorHandler = null;
|
||||
/** @var array<int, LogLevel::*> an array of E_* constant to LogLevel::* constant mapping */
|
||||
private $errorLevelMap = [];
|
||||
/** @var bool */
|
||||
private $handleOnlyReportedErrors = true;
|
||||
private array $errorLevelMap = [];
|
||||
|
||||
private bool $handleOnlyReportedErrors = true;
|
||||
|
||||
private bool $hasFatalErrorHandler = false;
|
||||
|
||||
private string $fatalLevel = LogLevel::ALERT;
|
||||
|
||||
private string|null $reservedMemory = null;
|
||||
|
||||
/** @var bool */
|
||||
private $hasFatalErrorHandler = false;
|
||||
/** @var LogLevel::* */
|
||||
private $fatalLevel = LogLevel::ALERT;
|
||||
/** @var ?string */
|
||||
private $reservedMemory = null;
|
||||
/** @var ?array{type: int, message: string, file: string, line: int, trace: mixed} */
|
||||
private $lastFatalData = null;
|
||||
/** @var int[] */
|
||||
private static $fatalErrors = [E_ERROR, E_PARSE, E_CORE_ERROR, E_COMPILE_ERROR, E_USER_ERROR];
|
||||
private array|null $lastFatalData = null;
|
||||
|
||||
public function __construct(LoggerInterface $logger)
|
||||
{
|
||||
$this->logger = $logger;
|
||||
private const FATAL_ERRORS = [E_ERROR, E_PARSE, E_CORE_ERROR, E_COMPILE_ERROR, E_USER_ERROR];
|
||||
|
||||
public function __construct(
|
||||
private LoggerInterface $logger
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -61,7 +60,6 @@ class ErrorHandler
|
|||
*
|
||||
* By default it will handle errors, exceptions and fatal errors
|
||||
*
|
||||
* @param LoggerInterface $logger
|
||||
* @param array<int, LogLevel::*>|false $errorLevelMap an array of E_* constant to LogLevel::* constant mapping, or false to disable error handling
|
||||
* @param array<class-string, LogLevel::*>|false $exceptionLevelMap an array of class name to LogLevel::* constant mapping, or false to disable exception handling
|
||||
* @param LogLevel::*|null|false $fatalLevel a LogLevel::* constant, null to use the default LogLevel::ALERT or false to disable fatal error handling
|
||||
|
|
@ -99,8 +97,8 @@ class ErrorHandler
|
|||
$this->uncaughtExceptionLevelMap[$class] = $level;
|
||||
}
|
||||
}
|
||||
if ($callPrevious && $prev) {
|
||||
$this->previousExceptionHandler = $prev;
|
||||
if ($callPrevious && null !== $prev) {
|
||||
$this->previousExceptionHandler = $prev(...);
|
||||
}
|
||||
|
||||
return $this;
|
||||
|
|
@ -112,10 +110,10 @@ class ErrorHandler
|
|||
*/
|
||||
public function registerErrorHandler(array $levelMap = [], bool $callPrevious = true, int $errorTypes = -1, bool $handleOnlyReportedErrors = true): self
|
||||
{
|
||||
$prev = set_error_handler([$this, 'handleError'], $errorTypes);
|
||||
$prev = set_error_handler($this->handleError(...), $errorTypes);
|
||||
$this->errorLevelMap = array_replace($this->defaultErrorLevelMap(), $levelMap);
|
||||
if ($callPrevious) {
|
||||
$this->previousErrorHandler = $prev ?: true;
|
||||
$this->previousErrorHandler = $prev !== null ? $prev(...) : true;
|
||||
} else {
|
||||
$this->previousErrorHandler = null;
|
||||
}
|
||||
|
|
@ -131,7 +129,7 @@ class ErrorHandler
|
|||
*/
|
||||
public function registerFatalHandler($level = null, int $reservedMemorySize = 20): self
|
||||
{
|
||||
register_shutdown_function([$this, 'handleFatalError']);
|
||||
register_shutdown_function($this->handleFatalError(...));
|
||||
|
||||
$this->reservedMemory = str_repeat(' ', 1024 * $reservedMemorySize);
|
||||
$this->fatalLevel = null === $level ? LogLevel::ALERT : $level;
|
||||
|
|
@ -175,10 +173,7 @@ class ErrorHandler
|
|||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @phpstan-return never
|
||||
*/
|
||||
private function handleException(\Throwable $e): void
|
||||
private function handleException(\Throwable $e): never
|
||||
{
|
||||
$level = LogLevel::ERROR;
|
||||
foreach ($this->uncaughtExceptionLevelMap as $class => $candidate) {
|
||||
|
|
@ -194,30 +189,25 @@ class ErrorHandler
|
|||
['exception' => $e]
|
||||
);
|
||||
|
||||
if ($this->previousExceptionHandler) {
|
||||
if (null !== $this->previousExceptionHandler) {
|
||||
($this->previousExceptionHandler)($e);
|
||||
}
|
||||
|
||||
if (!headers_sent() && !ini_get('display_errors')) {
|
||||
if (!headers_sent() && !(bool) ini_get('display_errors')) {
|
||||
http_response_code(500);
|
||||
}
|
||||
|
||||
exit(255);
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*
|
||||
* @param mixed[] $context
|
||||
*/
|
||||
public function handleError(int $code, string $message, string $file = '', int $line = 0, ?array $context = []): bool
|
||||
private function handleError(int $code, string $message, string $file = '', int $line = 0): bool
|
||||
{
|
||||
if ($this->handleOnlyReportedErrors && !(error_reporting() & $code)) {
|
||||
if ($this->handleOnlyReportedErrors && 0 === (error_reporting() & $code)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// fatal error codes are ignored if a fatal error handler is present as well to avoid duplicate log entries
|
||||
if (!$this->hasFatalErrorHandler || !in_array($code, self::$fatalErrors, true)) {
|
||||
if (!$this->hasFatalErrorHandler || !in_array($code, self::FATAL_ERRORS, true)) {
|
||||
$level = $this->errorLevelMap[$code] ?? LogLevel::CRITICAL;
|
||||
$this->logger->log($level, self::codeToString($code).': '.$message, ['code' => $code, 'message' => $message, 'file' => $file, 'line' => $line]);
|
||||
} else {
|
||||
|
|
@ -228,8 +218,9 @@ class ErrorHandler
|
|||
|
||||
if ($this->previousErrorHandler === true) {
|
||||
return false;
|
||||
} elseif ($this->previousErrorHandler) {
|
||||
return (bool) ($this->previousErrorHandler)($code, $message, $file, $line, $context);
|
||||
}
|
||||
if ($this->previousErrorHandler instanceof Closure) {
|
||||
return (bool) ($this->previousErrorHandler)($code, $message, $file, $line);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
@ -247,8 +238,7 @@ class ErrorHandler
|
|||
} else {
|
||||
$lastError = error_get_last();
|
||||
}
|
||||
|
||||
if ($lastError && in_array($lastError['type'], self::$fatalErrors, true)) {
|
||||
if (is_array($lastError) && in_array($lastError['type'], self::FATAL_ERRORS, true)) {
|
||||
$trace = $lastError['trace'] ?? null;
|
||||
$this->logger->log(
|
||||
$this->fatalLevel,
|
||||
|
|
@ -264,44 +254,25 @@ class ErrorHandler
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $code
|
||||
*/
|
||||
private static function codeToString($code): string
|
||||
private static function codeToString(int $code): string
|
||||
{
|
||||
switch ($code) {
|
||||
case E_ERROR:
|
||||
return 'E_ERROR';
|
||||
case E_WARNING:
|
||||
return 'E_WARNING';
|
||||
case E_PARSE:
|
||||
return 'E_PARSE';
|
||||
case E_NOTICE:
|
||||
return 'E_NOTICE';
|
||||
case E_CORE_ERROR:
|
||||
return 'E_CORE_ERROR';
|
||||
case E_CORE_WARNING:
|
||||
return 'E_CORE_WARNING';
|
||||
case E_COMPILE_ERROR:
|
||||
return 'E_COMPILE_ERROR';
|
||||
case E_COMPILE_WARNING:
|
||||
return 'E_COMPILE_WARNING';
|
||||
case E_USER_ERROR:
|
||||
return 'E_USER_ERROR';
|
||||
case E_USER_WARNING:
|
||||
return 'E_USER_WARNING';
|
||||
case E_USER_NOTICE:
|
||||
return 'E_USER_NOTICE';
|
||||
case E_STRICT:
|
||||
return 'E_STRICT';
|
||||
case E_RECOVERABLE_ERROR:
|
||||
return 'E_RECOVERABLE_ERROR';
|
||||
case E_DEPRECATED:
|
||||
return 'E_DEPRECATED';
|
||||
case E_USER_DEPRECATED:
|
||||
return 'E_USER_DEPRECATED';
|
||||
}
|
||||
|
||||
return 'Unknown PHP error';
|
||||
return match ($code) {
|
||||
E_ERROR => 'E_ERROR',
|
||||
E_WARNING => 'E_WARNING',
|
||||
E_PARSE => 'E_PARSE',
|
||||
E_NOTICE => 'E_NOTICE',
|
||||
E_CORE_ERROR => 'E_CORE_ERROR',
|
||||
E_CORE_WARNING => 'E_CORE_WARNING',
|
||||
E_COMPILE_ERROR => 'E_COMPILE_ERROR',
|
||||
E_COMPILE_WARNING => 'E_COMPILE_WARNING',
|
||||
E_USER_ERROR => 'E_USER_ERROR',
|
||||
E_USER_WARNING => 'E_USER_WARNING',
|
||||
E_USER_NOTICE => 'E_USER_NOTICE',
|
||||
E_STRICT => 'E_STRICT',
|
||||
E_RECOVERABLE_ERROR => 'E_RECOVERABLE_ERROR',
|
||||
E_DEPRECATED => 'E_DEPRECATED',
|
||||
E_USER_DEPRECATED => 'E_USER_DEPRECATED',
|
||||
default => 'Unknown PHP error',
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,8 @@
|
|||
|
||||
namespace Monolog\Formatter;
|
||||
|
||||
use Monolog\Logger;
|
||||
use Monolog\Level;
|
||||
use Monolog\LogRecord;
|
||||
|
||||
/**
|
||||
* Formats a log message according to the ChromePHP array format
|
||||
|
|
@ -23,52 +24,55 @@ class ChromePHPFormatter implements FormatterInterface
|
|||
/**
|
||||
* Translates Monolog log levels to Wildfire levels.
|
||||
*
|
||||
* @var array<int, 'log'|'info'|'warn'|'error'>
|
||||
* @return 'log'|'info'|'warn'|'error'
|
||||
*/
|
||||
private $logLevels = [
|
||||
Logger::DEBUG => 'log',
|
||||
Logger::INFO => 'info',
|
||||
Logger::NOTICE => 'info',
|
||||
Logger::WARNING => 'warn',
|
||||
Logger::ERROR => 'error',
|
||||
Logger::CRITICAL => 'error',
|
||||
Logger::ALERT => 'error',
|
||||
Logger::EMERGENCY => 'error',
|
||||
];
|
||||
private function toWildfireLevel(Level $level): string
|
||||
{
|
||||
return match ($level) {
|
||||
Level::Debug => 'log',
|
||||
Level::Info => 'info',
|
||||
Level::Notice => 'info',
|
||||
Level::Warning => 'warn',
|
||||
Level::Error => 'error',
|
||||
Level::Critical => 'error',
|
||||
Level::Alert => 'error',
|
||||
Level::Emergency => 'error',
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function format(array $record)
|
||||
public function format(LogRecord $record)
|
||||
{
|
||||
// Retrieve the line and file if set and remove them from the formatted extra
|
||||
$backtrace = 'unknown';
|
||||
if (isset($record['extra']['file'], $record['extra']['line'])) {
|
||||
$backtrace = $record['extra']['file'].' : '.$record['extra']['line'];
|
||||
unset($record['extra']['file'], $record['extra']['line']);
|
||||
if (isset($record->extra['file'], $record->extra['line'])) {
|
||||
$backtrace = $record->extra['file'].' : '.$record->extra['line'];
|
||||
unset($record->extra['file'], $record->extra['line']);
|
||||
}
|
||||
|
||||
$message = ['message' => $record['message']];
|
||||
if ($record['context']) {
|
||||
$message['context'] = $record['context'];
|
||||
$message = ['message' => $record->message];
|
||||
if (\count($record->context) > 0) {
|
||||
$message['context'] = $record->context;
|
||||
}
|
||||
if ($record['extra']) {
|
||||
$message['extra'] = $record['extra'];
|
||||
if (\count($record->extra) > 0) {
|
||||
$message['extra'] = $record->extra;
|
||||
}
|
||||
if (count($message) === 1) {
|
||||
$message = reset($message);
|
||||
}
|
||||
|
||||
return [
|
||||
$record['channel'],
|
||||
$record->channel,
|
||||
$message,
|
||||
$backtrace,
|
||||
$this->logLevels[$record['level']],
|
||||
$this->toWildfireLevel($record->level),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function formatBatch(array $records)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -12,25 +12,24 @@
|
|||
namespace Monolog\Formatter;
|
||||
|
||||
use Elastica\Document;
|
||||
use Monolog\LogRecord;
|
||||
|
||||
/**
|
||||
* Format a log message into an Elastica Document
|
||||
*
|
||||
* @author Jelle Vink <jelle.vink@gmail.com>
|
||||
*
|
||||
* @phpstan-import-type Record from \Monolog\Logger
|
||||
*/
|
||||
class ElasticaFormatter extends NormalizerFormatter
|
||||
{
|
||||
/**
|
||||
* @var string Elastic search index name
|
||||
*/
|
||||
protected $index;
|
||||
protected string $index;
|
||||
|
||||
/**
|
||||
* @var ?string Elastic search document type
|
||||
* @var string|null Elastic search document type
|
||||
*/
|
||||
protected $type;
|
||||
protected string|null $type;
|
||||
|
||||
/**
|
||||
* @param string $index Elastic Search index name
|
||||
|
|
@ -46,9 +45,9 @@ class ElasticaFormatter extends NormalizerFormatter
|
|||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function format(array $record)
|
||||
public function format(LogRecord $record)
|
||||
{
|
||||
$record = parent::format($record);
|
||||
|
||||
|
|
@ -72,14 +71,13 @@ class ElasticaFormatter extends NormalizerFormatter
|
|||
/**
|
||||
* Convert a log message into an Elastica Document
|
||||
*
|
||||
* @phpstan-param Record $record
|
||||
* @param mixed[] $record
|
||||
*/
|
||||
protected function getDocument(array $record): Document
|
||||
{
|
||||
$document = new Document();
|
||||
$document->setData($record);
|
||||
if (method_exists($document, 'setType')) {
|
||||
/** @phpstan-ignore-next-line */
|
||||
$document->setType($this->type);
|
||||
}
|
||||
$document->setIndex($this->index);
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
namespace Monolog\Formatter;
|
||||
|
||||
use DateTimeInterface;
|
||||
use Monolog\LogRecord;
|
||||
|
||||
/**
|
||||
* Format a log message into an Elasticsearch record
|
||||
|
|
@ -23,12 +24,12 @@ class ElasticsearchFormatter extends NormalizerFormatter
|
|||
/**
|
||||
* @var string Elasticsearch index name
|
||||
*/
|
||||
protected $index;
|
||||
protected string $index;
|
||||
|
||||
/**
|
||||
* @var string Elasticsearch record type
|
||||
*/
|
||||
protected $type;
|
||||
protected string $type;
|
||||
|
||||
/**
|
||||
* @param string $index Elasticsearch index name
|
||||
|
|
@ -44,9 +45,9 @@ class ElasticsearchFormatter extends NormalizerFormatter
|
|||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function format(array $record)
|
||||
public function format(LogRecord $record)
|
||||
{
|
||||
$record = parent::format($record);
|
||||
|
||||
|
|
@ -55,8 +56,6 @@ class ElasticsearchFormatter extends NormalizerFormatter
|
|||
|
||||
/**
|
||||
* Getter index
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getIndex(): string
|
||||
{
|
||||
|
|
@ -65,8 +64,6 @@ class ElasticsearchFormatter extends NormalizerFormatter
|
|||
|
||||
/**
|
||||
* Getter type
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getType(): string
|
||||
{
|
||||
|
|
|
|||
|
|
@ -11,23 +11,18 @@
|
|||
|
||||
namespace Monolog\Formatter;
|
||||
|
||||
use Monolog\LogRecord;
|
||||
|
||||
/**
|
||||
* formats the record to be used in the FlowdockHandler
|
||||
*
|
||||
* @author Dominik Liebler <liebler.dominik@gmail.com>
|
||||
* @deprecated Since 2.9.0 and 3.3.0, Flowdock was shutdown we will thus drop this handler in Monolog 4
|
||||
*/
|
||||
class FlowdockFormatter implements FormatterInterface
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $source;
|
||||
private string $source;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $sourceEmail;
|
||||
private string $sourceEmail;
|
||||
|
||||
public function __construct(string $source, string $sourceEmail)
|
||||
{
|
||||
|
|
@ -36,43 +31,41 @@ class FlowdockFormatter implements FormatterInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @inheritDoc
|
||||
*
|
||||
* @return mixed[]
|
||||
*/
|
||||
public function format(array $record): array
|
||||
public function format(LogRecord $record): array
|
||||
{
|
||||
$tags = [
|
||||
'#logs',
|
||||
'#' . strtolower($record['level_name']),
|
||||
'#' . $record['channel'],
|
||||
'#' . $record->level->toPsrLogLevel(),
|
||||
'#' . $record->channel,
|
||||
];
|
||||
|
||||
foreach ($record['extra'] as $value) {
|
||||
foreach ($record->extra as $value) {
|
||||
$tags[] = '#' . $value;
|
||||
}
|
||||
|
||||
$subject = sprintf(
|
||||
'in %s: %s - %s',
|
||||
$this->source,
|
||||
$record['level_name'],
|
||||
$this->getShortMessage($record['message'])
|
||||
$record->level->getName(),
|
||||
$this->getShortMessage($record->message)
|
||||
);
|
||||
|
||||
$record['flowdock'] = [
|
||||
return [
|
||||
'source' => $this->source,
|
||||
'from_address' => $this->sourceEmail,
|
||||
'subject' => $subject,
|
||||
'content' => $record['message'],
|
||||
'content' => $record->message,
|
||||
'tags' => $tags,
|
||||
'project' => $this->source,
|
||||
];
|
||||
|
||||
return $record;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @inheritDoc
|
||||
*
|
||||
* @return mixed[][]
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
namespace Monolog\Formatter;
|
||||
|
||||
use Monolog\Utils;
|
||||
use Monolog\LogRecord;
|
||||
|
||||
/**
|
||||
* Class FluentdFormatter
|
||||
|
|
@ -39,7 +40,7 @@ class FluentdFormatter implements FormatterInterface
|
|||
/**
|
||||
* @var bool $levelTag should message level be a part of the fluentd tag
|
||||
*/
|
||||
protected $levelTag = false;
|
||||
protected bool $levelTag = false;
|
||||
|
||||
public function __construct(bool $levelTag = false)
|
||||
{
|
||||
|
|
@ -55,25 +56,25 @@ class FluentdFormatter implements FormatterInterface
|
|||
return $this->levelTag;
|
||||
}
|
||||
|
||||
public function format(array $record): string
|
||||
public function format(LogRecord $record): string
|
||||
{
|
||||
$tag = $record['channel'];
|
||||
$tag = $record->channel;
|
||||
if ($this->levelTag) {
|
||||
$tag .= '.' . strtolower($record['level_name']);
|
||||
$tag .= '.' . $record->level->toPsrLogLevel();
|
||||
}
|
||||
|
||||
$message = [
|
||||
'message' => $record['message'],
|
||||
'context' => $record['context'],
|
||||
'extra' => $record['extra'],
|
||||
'message' => $record->message,
|
||||
'context' => $record->context,
|
||||
'extra' => $record->extra,
|
||||
];
|
||||
|
||||
if (!$this->levelTag) {
|
||||
$message['level'] = $record['level'];
|
||||
$message['level_name'] = $record['level_name'];
|
||||
$message['level'] = $record->level->value;
|
||||
$message['level_name'] = $record->level->getName();
|
||||
}
|
||||
|
||||
return Utils::jsonEncode([$tag, $record['datetime']->getTimestamp(), $message]);
|
||||
return Utils::jsonEncode([$tag, $record->datetime->getTimestamp(), $message]);
|
||||
}
|
||||
|
||||
public function formatBatch(array $records): string
|
||||
|
|
|
|||
|
|
@ -11,32 +11,28 @@
|
|||
|
||||
namespace Monolog\Formatter;
|
||||
|
||||
use Monolog\LogRecord;
|
||||
|
||||
/**
|
||||
* Interface for formatters
|
||||
*
|
||||
* @author Jordi Boggiano <j.boggiano@seld.be>
|
||||
*
|
||||
* @phpstan-import-type Record from \Monolog\Logger
|
||||
*/
|
||||
interface FormatterInterface
|
||||
{
|
||||
/**
|
||||
* Formats a log record.
|
||||
*
|
||||
* @param array $record A record to format
|
||||
* @return mixed The formatted record
|
||||
*
|
||||
* @phpstan-param Record $record
|
||||
* @param LogRecord $record A record to format
|
||||
* @return mixed The formatted record
|
||||
*/
|
||||
public function format(array $record);
|
||||
public function format(LogRecord $record);
|
||||
|
||||
/**
|
||||
* Formats a set of log records.
|
||||
*
|
||||
* @param array $records A set of records to format
|
||||
* @return mixed The formatted set of records
|
||||
*
|
||||
* @phpstan-param Record[] $records
|
||||
* @param array<LogRecord> $records A set of records to format
|
||||
* @return mixed The formatted set of records
|
||||
*/
|
||||
public function formatBatch(array $records);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,17 +11,16 @@
|
|||
|
||||
namespace Monolog\Formatter;
|
||||
|
||||
use Monolog\Logger;
|
||||
use Monolog\Level;
|
||||
use Gelf\Message;
|
||||
use Monolog\Utils;
|
||||
use Monolog\LogRecord;
|
||||
|
||||
/**
|
||||
* Serializes a log message to GELF
|
||||
* @see http://docs.graylog.org/en/latest/pages/gelf.html
|
||||
*
|
||||
* @author Matt Lehner <mlehner@gmail.com>
|
||||
*
|
||||
* @phpstan-import-type Level from \Monolog\Logger
|
||||
*/
|
||||
class GelfMessageFormatter extends NormalizerFormatter
|
||||
{
|
||||
|
|
@ -30,45 +29,39 @@ class GelfMessageFormatter extends NormalizerFormatter
|
|||
/**
|
||||
* @var string the name of the system for the Gelf log message
|
||||
*/
|
||||
protected $systemName;
|
||||
protected string $systemName;
|
||||
|
||||
/**
|
||||
* @var string a prefix for 'extra' fields from the Monolog record (optional)
|
||||
*/
|
||||
protected $extraPrefix;
|
||||
protected string $extraPrefix;
|
||||
|
||||
/**
|
||||
* @var string a prefix for 'context' fields from the Monolog record (optional)
|
||||
*/
|
||||
protected $contextPrefix;
|
||||
protected string $contextPrefix;
|
||||
|
||||
/**
|
||||
* @var int max length per field
|
||||
*/
|
||||
protected $maxLength;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
private $gelfVersion = 2;
|
||||
protected int $maxLength;
|
||||
|
||||
/**
|
||||
* Translates Monolog log levels to Graylog2 log priorities.
|
||||
*
|
||||
* @var array<int, int>
|
||||
*
|
||||
* @phpstan-var array<Level, int>
|
||||
*/
|
||||
private $logLevels = [
|
||||
Logger::DEBUG => 7,
|
||||
Logger::INFO => 6,
|
||||
Logger::NOTICE => 5,
|
||||
Logger::WARNING => 4,
|
||||
Logger::ERROR => 3,
|
||||
Logger::CRITICAL => 2,
|
||||
Logger::ALERT => 1,
|
||||
Logger::EMERGENCY => 0,
|
||||
];
|
||||
private function getGraylog2Priority(Level $level): int
|
||||
{
|
||||
return match ($level) {
|
||||
Level::Debug => 7,
|
||||
Level::Info => 6,
|
||||
Level::Notice => 5,
|
||||
Level::Warning => 4,
|
||||
Level::Error => 3,
|
||||
Level::Critical => 2,
|
||||
Level::Alert => 1,
|
||||
Level::Emergency => 0,
|
||||
};
|
||||
}
|
||||
|
||||
public function __construct(?string $systemName = null, ?string $extraPrefix = null, string $contextPrefix = 'ctxt_', ?int $maxLength = null)
|
||||
{
|
||||
|
|
@ -78,64 +71,52 @@ class GelfMessageFormatter extends NormalizerFormatter
|
|||
|
||||
parent::__construct('U.u');
|
||||
|
||||
$this->systemName = (is_null($systemName) || $systemName === '') ? (string) gethostname() : $systemName;
|
||||
$this->systemName = (null === $systemName || $systemName === '') ? (string) gethostname() : $systemName;
|
||||
|
||||
$this->extraPrefix = is_null($extraPrefix) ? '' : $extraPrefix;
|
||||
$this->extraPrefix = null === $extraPrefix ? '' : $extraPrefix;
|
||||
$this->contextPrefix = $contextPrefix;
|
||||
$this->maxLength = is_null($maxLength) ? self::DEFAULT_MAX_LENGTH : $maxLength;
|
||||
|
||||
if (method_exists(Message::class, 'setFacility')) {
|
||||
$this->gelfVersion = 1;
|
||||
}
|
||||
$this->maxLength = null === $maxLength ? self::DEFAULT_MAX_LENGTH : $maxLength;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function format(array $record): Message
|
||||
public function format(LogRecord $record): Message
|
||||
{
|
||||
$context = $extra = [];
|
||||
if (isset($record['context'])) {
|
||||
if (isset($record->context)) {
|
||||
/** @var mixed[] $context */
|
||||
$context = parent::normalize($record['context']);
|
||||
$context = parent::normalize($record->context);
|
||||
}
|
||||
if (isset($record['extra'])) {
|
||||
if (isset($record->extra)) {
|
||||
/** @var mixed[] $extra */
|
||||
$extra = parent::normalize($record['extra']);
|
||||
}
|
||||
|
||||
if (!isset($record['datetime'], $record['message'], $record['level'])) {
|
||||
throw new \InvalidArgumentException('The record should at least contain datetime, message and level keys, '.var_export($record, true).' given');
|
||||
$extra = parent::normalize($record->extra);
|
||||
}
|
||||
|
||||
$message = new Message();
|
||||
$message
|
||||
->setTimestamp($record['datetime'])
|
||||
->setShortMessage((string) $record['message'])
|
||||
->setTimestamp($record->datetime)
|
||||
->setShortMessage($record->message)
|
||||
->setHost($this->systemName)
|
||||
->setLevel($this->logLevels[$record['level']]);
|
||||
->setLevel($this->getGraylog2Priority($record->level));
|
||||
|
||||
// message length + system name length + 200 for padding / metadata
|
||||
$len = 200 + strlen((string) $record['message']) + strlen($this->systemName);
|
||||
$len = 200 + strlen($record->message) + strlen($this->systemName);
|
||||
|
||||
if ($len > $this->maxLength) {
|
||||
$message->setShortMessage(Utils::substr($record['message'], 0, $this->maxLength));
|
||||
$message->setShortMessage(Utils::substr($record->message, 0, $this->maxLength));
|
||||
}
|
||||
|
||||
if ($this->gelfVersion === 1) {
|
||||
if (isset($record['channel'])) {
|
||||
$message->setFacility($record['channel']);
|
||||
}
|
||||
if (isset($extra['line'])) {
|
||||
$message->setLine($extra['line']);
|
||||
unset($extra['line']);
|
||||
}
|
||||
if (isset($extra['file'])) {
|
||||
$message->setFile($extra['file']);
|
||||
unset($extra['file']);
|
||||
}
|
||||
} else {
|
||||
$message->setAdditional('facility', $record['channel']);
|
||||
if (isset($record->channel)) {
|
||||
$message->setAdditional('facility', $record->channel);
|
||||
}
|
||||
if (isset($extra['line'])) {
|
||||
$message->setAdditional('line', $extra['line']);
|
||||
unset($extra['line']);
|
||||
}
|
||||
if (isset($extra['file'])) {
|
||||
$message->setAdditional('file', $extra['file']);
|
||||
unset($extra['file']);
|
||||
}
|
||||
|
||||
foreach ($extra as $key => $val) {
|
||||
|
|
@ -160,13 +141,10 @@ class GelfMessageFormatter extends NormalizerFormatter
|
|||
$message->setAdditional($this->contextPrefix . $key, $val);
|
||||
}
|
||||
|
||||
if ($this->gelfVersion === 1) {
|
||||
/** @phpstan-ignore-next-line */
|
||||
if (null === $message->getFile() && isset($context['exception']['file'])) {
|
||||
if (preg_match("/^(.+):([0-9]+)$/", $context['exception']['file'], $matches)) {
|
||||
$message->setFile($matches[1]);
|
||||
$message->setLine($matches[2]);
|
||||
}
|
||||
if (!$message->hasAdditional('file') && isset($context['exception']['file'])) {
|
||||
if (1 === preg_match("/^(.+):([0-9]+)$/", $context['exception']['file'], $matches)) {
|
||||
$message->setAdditional('file', $matches[1]);
|
||||
$message->setAdditional('line', $matches[2]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,24 +17,23 @@ use Monolog\LogRecord;
|
|||
/**
|
||||
* Encodes message information into JSON in a format compatible with Cloud logging.
|
||||
*
|
||||
* @see https://cloud.google.com/logging/docs/structured-logging
|
||||
* @see https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry
|
||||
*
|
||||
* @author Luís Cobucci <lcobucci@gmail.com>
|
||||
*/
|
||||
final class GoogleCloudLoggingFormatter extends JsonFormatter
|
||||
{
|
||||
/** {@inheritdoc} **/
|
||||
public function format(array $record): string
|
||||
protected function normalizeRecord(LogRecord $record): array
|
||||
{
|
||||
$normalized = parent::normalizeRecord($record);
|
||||
|
||||
// Re-key level for GCP logging
|
||||
$record['severity'] = $record['level_name'];
|
||||
$record['time'] = $record['datetime']->format(DateTimeInterface::RFC3339_EXTENDED);
|
||||
$normalized['severity'] = $normalized['level_name'];
|
||||
$normalized['timestamp'] = $record->datetime->format(DateTimeInterface::RFC3339_EXTENDED);
|
||||
|
||||
// Remove keys that are not used by GCP
|
||||
unset($record['level'], $record['level_name'], $record['datetime']);
|
||||
unset($normalized['level'], $normalized['level_name'], $normalized['datetime']);
|
||||
|
||||
return parent::format($record);
|
||||
return $normalized;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,8 +11,9 @@
|
|||
|
||||
namespace Monolog\Formatter;
|
||||
|
||||
use Monolog\Logger;
|
||||
use Monolog\Level;
|
||||
use Monolog\Utils;
|
||||
use Monolog\LogRecord;
|
||||
|
||||
/**
|
||||
* Formats incoming records into an HTML table
|
||||
|
|
@ -25,19 +26,20 @@ class HtmlFormatter extends NormalizerFormatter
|
|||
{
|
||||
/**
|
||||
* Translates Monolog log levels to html color priorities.
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $logLevels = [
|
||||
Logger::DEBUG => '#CCCCCC',
|
||||
Logger::INFO => '#28A745',
|
||||
Logger::NOTICE => '#17A2B8',
|
||||
Logger::WARNING => '#FFC107',
|
||||
Logger::ERROR => '#FD7E14',
|
||||
Logger::CRITICAL => '#DC3545',
|
||||
Logger::ALERT => '#821722',
|
||||
Logger::EMERGENCY => '#000000',
|
||||
];
|
||||
protected function getLevelColor(Level $level): string
|
||||
{
|
||||
return match ($level) {
|
||||
Level::Debug => '#CCCCCC',
|
||||
Level::Info => '#28A745',
|
||||
Level::Notice => '#17A2B8',
|
||||
Level::Warning => '#FFC107',
|
||||
Level::Error => '#FD7E14',
|
||||
Level::Critical => '#DC3545',
|
||||
Level::Alert => '#821722',
|
||||
Level::Emergency => '#000000',
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|null $dateFormat The format of the timestamp: one supported by DateTime::format
|
||||
|
|
@ -67,15 +69,13 @@ class HtmlFormatter extends NormalizerFormatter
|
|||
/**
|
||||
* Create a HTML h1 tag
|
||||
*
|
||||
* @param string $title Text to be in the h1
|
||||
* @param int $level Error level
|
||||
* @return string
|
||||
* @param string $title Text to be in the h1
|
||||
*/
|
||||
protected function addTitle(string $title, int $level): string
|
||||
protected function addTitle(string $title, Level $level): string
|
||||
{
|
||||
$title = htmlspecialchars($title, ENT_NOQUOTES, 'UTF-8');
|
||||
|
||||
return '<h1 style="background: '.$this->logLevels[$level].';color: #ffffff;padding: 5px;" class="monolog-output">'.$title.'</h1>';
|
||||
return '<h1 style="background: '.$this->getLevelColor($level).';color: #ffffff;padding: 5px;" class="monolog-output">'.$title.'</h1>';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -83,25 +83,25 @@ class HtmlFormatter extends NormalizerFormatter
|
|||
*
|
||||
* @return string The formatted record
|
||||
*/
|
||||
public function format(array $record): string
|
||||
public function format(LogRecord $record): string
|
||||
{
|
||||
$output = $this->addTitle($record['level_name'], $record['level']);
|
||||
$output = $this->addTitle($record->level->getName(), $record->level);
|
||||
$output .= '<table cellspacing="1" width="100%" class="monolog-output">';
|
||||
|
||||
$output .= $this->addRow('Message', (string) $record['message']);
|
||||
$output .= $this->addRow('Time', $this->formatDate($record['datetime']));
|
||||
$output .= $this->addRow('Channel', $record['channel']);
|
||||
if ($record['context']) {
|
||||
$output .= $this->addRow('Message', $record->message);
|
||||
$output .= $this->addRow('Time', $this->formatDate($record->datetime));
|
||||
$output .= $this->addRow('Channel', $record->channel);
|
||||
if (\count($record->context) > 0) {
|
||||
$embeddedTable = '<table cellspacing="1" width="100%">';
|
||||
foreach ($record['context'] as $key => $value) {
|
||||
foreach ($record->context as $key => $value) {
|
||||
$embeddedTable .= $this->addRow((string) $key, $this->convertToString($value));
|
||||
}
|
||||
$embeddedTable .= '</table>';
|
||||
$output .= $this->addRow('Context', $embeddedTable, false);
|
||||
}
|
||||
if ($record['extra']) {
|
||||
if (\count($record->extra) > 0) {
|
||||
$embeddedTable = '<table cellspacing="1" width="100%">';
|
||||
foreach ($record['extra'] as $key => $value) {
|
||||
foreach ($record->extra as $key => $value) {
|
||||
$embeddedTable .= $this->addRow((string) $key, $this->convertToString($value));
|
||||
}
|
||||
$embeddedTable .= '</table>';
|
||||
|
|
|
|||
|
|
@ -11,7 +11,9 @@
|
|||
|
||||
namespace Monolog\Formatter;
|
||||
|
||||
use Stringable;
|
||||
use Throwable;
|
||||
use Monolog\LogRecord;
|
||||
|
||||
/**
|
||||
* Encodes whatever record data is passed to it as json
|
||||
|
|
@ -19,8 +21,6 @@ use Throwable;
|
|||
* This can be useful to log to databases or remote APIs
|
||||
*
|
||||
* @author Jordi Boggiano <j.boggiano@seld.be>
|
||||
*
|
||||
* @phpstan-import-type Record from \Monolog\Logger
|
||||
*/
|
||||
class JsonFormatter extends NormalizerFormatter
|
||||
{
|
||||
|
|
@ -28,13 +28,13 @@ class JsonFormatter extends NormalizerFormatter
|
|||
public const BATCH_MODE_NEWLINES = 2;
|
||||
|
||||
/** @var self::BATCH_MODE_* */
|
||||
protected $batchMode;
|
||||
/** @var bool */
|
||||
protected $appendNewline;
|
||||
/** @var bool */
|
||||
protected $ignoreEmptyContextAndExtra;
|
||||
/** @var bool */
|
||||
protected $includeStacktraces = false;
|
||||
protected int $batchMode;
|
||||
|
||||
protected bool $appendNewline;
|
||||
|
||||
protected bool $ignoreEmptyContextAndExtra;
|
||||
|
||||
protected bool $includeStacktraces = false;
|
||||
|
||||
/**
|
||||
* @param self::BATCH_MODE_* $batchMode
|
||||
|
|
@ -70,11 +70,11 @@ class JsonFormatter extends NormalizerFormatter
|
|||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function format(array $record): string
|
||||
public function format(LogRecord $record): string
|
||||
{
|
||||
$normalized = $this->normalize($record);
|
||||
$normalized = parent::format($record);
|
||||
|
||||
if (isset($normalized['context']) && $normalized['context'] === []) {
|
||||
if ($this->ignoreEmptyContextAndExtra) {
|
||||
|
|
@ -95,23 +95,16 @@ class JsonFormatter extends NormalizerFormatter
|
|||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function formatBatch(array $records): string
|
||||
{
|
||||
switch ($this->batchMode) {
|
||||
case static::BATCH_MODE_NEWLINES:
|
||||
return $this->formatBatchNewlines($records);
|
||||
|
||||
case static::BATCH_MODE_JSON:
|
||||
default:
|
||||
return $this->formatBatchJson($records);
|
||||
}
|
||||
return match ($this->batchMode) {
|
||||
static::BATCH_MODE_NEWLINES => $this->formatBatchNewlines($records),
|
||||
default => $this->formatBatchJson($records),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @return self
|
||||
*/
|
||||
public function includeStacktraces(bool $include = true): self
|
||||
{
|
||||
$this->includeStacktraces = $include;
|
||||
|
|
@ -122,7 +115,7 @@ class JsonFormatter extends NormalizerFormatter
|
|||
/**
|
||||
* Return a JSON-encoded array of records.
|
||||
*
|
||||
* @phpstan-param Record[] $records
|
||||
* @phpstan-param LogRecord[] $records
|
||||
*/
|
||||
protected function formatBatchJson(array $records): string
|
||||
{
|
||||
|
|
@ -133,30 +126,24 @@ class JsonFormatter extends NormalizerFormatter
|
|||
* Use new lines to separate records instead of a
|
||||
* JSON-encoded array.
|
||||
*
|
||||
* @phpstan-param Record[] $records
|
||||
* @phpstan-param LogRecord[] $records
|
||||
*/
|
||||
protected function formatBatchNewlines(array $records): string
|
||||
{
|
||||
$instance = $this;
|
||||
|
||||
$oldNewline = $this->appendNewline;
|
||||
$this->appendNewline = false;
|
||||
array_walk($records, function (&$value, $key) use ($instance) {
|
||||
$value = $instance->format($value);
|
||||
});
|
||||
$formatted = array_map(fn (LogRecord $record) => $this->format($record), $records);
|
||||
$this->appendNewline = $oldNewline;
|
||||
|
||||
return implode("\n", $records);
|
||||
return implode("\n", $formatted);
|
||||
}
|
||||
|
||||
/**
|
||||
* Normalizes given $data.
|
||||
*
|
||||
* @param mixed $data
|
||||
*
|
||||
* @return mixed
|
||||
* @return null|scalar|array<mixed[]|scalar|null|object>|object
|
||||
*/
|
||||
protected function normalize($data, int $depth = 0)
|
||||
protected function normalize(mixed $data, int $depth = 0): mixed
|
||||
{
|
||||
if ($depth > $this->maxNormalizeDepth) {
|
||||
return 'Over '.$this->maxNormalizeDepth.' levels deep, aborting normalization';
|
||||
|
|
@ -192,7 +179,7 @@ class JsonFormatter extends NormalizerFormatter
|
|||
return $data;
|
||||
}
|
||||
|
||||
if (method_exists($data, '__toString')) {
|
||||
if ($data instanceof Stringable) {
|
||||
return $data->__toString();
|
||||
}
|
||||
|
||||
|
|
@ -210,7 +197,7 @@ class JsonFormatter extends NormalizerFormatter
|
|||
* Normalizes given exception with or without its own stack trace based on
|
||||
* `includeStacktraces` property.
|
||||
*
|
||||
* {@inheritDoc}
|
||||
* @inheritDoc
|
||||
*/
|
||||
protected function normalizeException(Throwable $e, int $depth = 0): array
|
||||
{
|
||||
|
|
|
|||
|
|
@ -11,7 +11,9 @@
|
|||
|
||||
namespace Monolog\Formatter;
|
||||
|
||||
use Closure;
|
||||
use Monolog\Utils;
|
||||
use Monolog\LogRecord;
|
||||
|
||||
/**
|
||||
* Formats incoming records into a one-line string
|
||||
|
|
@ -25,22 +27,16 @@ class LineFormatter extends NormalizerFormatter
|
|||
{
|
||||
public const SIMPLE_FORMAT = "[%datetime%] %channel%.%level_name%: %message% %context% %extra%\n";
|
||||
|
||||
/** @var string */
|
||||
protected $format;
|
||||
/** @var bool */
|
||||
protected $allowInlineLineBreaks;
|
||||
/** @var bool */
|
||||
protected $ignoreEmptyContextAndExtra;
|
||||
/** @var bool */
|
||||
protected $includeStacktraces;
|
||||
/** @var ?callable */
|
||||
protected $stacktracesParser;
|
||||
protected string $format;
|
||||
protected bool $allowInlineLineBreaks;
|
||||
protected bool $ignoreEmptyContextAndExtra;
|
||||
protected bool $includeStacktraces;
|
||||
protected Closure|null $stacktracesParser = null;
|
||||
|
||||
/**
|
||||
* @param string|null $format The format of the message
|
||||
* @param string|null $dateFormat The format of the timestamp: one supported by DateTime::format
|
||||
* @param bool $allowInlineLineBreaks Whether to allow inline line breaks in log entries
|
||||
* @param bool $ignoreEmptyContextAndExtra
|
||||
* @param string|null $format The format of the message
|
||||
* @param string|null $dateFormat The format of the timestamp: one supported by DateTime::format
|
||||
* @param bool $allowInlineLineBreaks Whether to allow inline line breaks in log entries
|
||||
*/
|
||||
public function __construct(?string $format = null, ?string $dateFormat = null, bool $allowInlineLineBreaks = false, bool $ignoreEmptyContextAndExtra = false, bool $includeStacktraces = false)
|
||||
{
|
||||
|
|
@ -51,7 +47,7 @@ class LineFormatter extends NormalizerFormatter
|
|||
parent::__construct($dateFormat);
|
||||
}
|
||||
|
||||
public function includeStacktraces(bool $include = true, ?callable $parser = null): self
|
||||
public function includeStacktraces(bool $include = true, ?Closure $parser = null): self
|
||||
{
|
||||
$this->includeStacktraces = $include;
|
||||
if ($this->includeStacktraces) {
|
||||
|
|
@ -77,14 +73,13 @@ class LineFormatter extends NormalizerFormatter
|
|||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function format(array $record): string
|
||||
public function format(LogRecord $record): string
|
||||
{
|
||||
$vars = parent::format($record);
|
||||
|
||||
$output = $this->format;
|
||||
|
||||
foreach ($vars['extra'] as $var => $val) {
|
||||
if (false !== strpos($output, '%extra.'.$var.'%')) {
|
||||
$output = str_replace('%extra.'.$var.'%', $this->stringify($val), $output);
|
||||
|
|
@ -100,12 +95,12 @@ class LineFormatter extends NormalizerFormatter
|
|||
}
|
||||
|
||||
if ($this->ignoreEmptyContextAndExtra) {
|
||||
if (empty($vars['context'])) {
|
||||
if (\count($vars['context']) === 0) {
|
||||
unset($vars['context']);
|
||||
$output = str_replace('%context%', '', $output);
|
||||
}
|
||||
|
||||
if (empty($vars['extra'])) {
|
||||
if (\count($vars['extra']) === 0) {
|
||||
unset($vars['extra']);
|
||||
$output = str_replace('%extra%', '', $output);
|
||||
}
|
||||
|
|
@ -122,6 +117,7 @@ class LineFormatter extends NormalizerFormatter
|
|||
$output = preg_replace('/%(?:extra|context)\..+?%/', '', $output);
|
||||
if (null === $output) {
|
||||
$pcreErrorCode = preg_last_error();
|
||||
|
||||
throw new \RuntimeException('Failed to run preg_replace: ' . $pcreErrorCode . ' / ' . Utils::pcreLastErrorMessage($pcreErrorCode));
|
||||
}
|
||||
}
|
||||
|
|
@ -151,7 +147,7 @@ class LineFormatter extends NormalizerFormatter
|
|||
{
|
||||
$str = $this->formatException($e);
|
||||
|
||||
if ($previous = $e->getPrevious()) {
|
||||
if (($previous = $e->getPrevious()) instanceof \Throwable) {
|
||||
do {
|
||||
$depth++;
|
||||
if ($depth > $this->maxNormalizeDepth) {
|
||||
|
|
@ -232,7 +228,7 @@ class LineFormatter extends NormalizerFormatter
|
|||
{
|
||||
$trace = $e->getTraceAsString();
|
||||
|
||||
if ($this->stacktracesParser) {
|
||||
if ($this->stacktracesParser !== null) {
|
||||
$trace = $this->stacktracesParserCustom($trace);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@
|
|||
|
||||
namespace Monolog\Formatter;
|
||||
|
||||
use Monolog\LogRecord;
|
||||
|
||||
/**
|
||||
* Encodes message information into JSON in a format compatible with Loggly.
|
||||
*
|
||||
|
|
@ -33,13 +35,13 @@ class LogglyFormatter extends JsonFormatter
|
|||
* @see https://www.loggly.com/docs/automated-parsing/#json
|
||||
* @see \Monolog\Formatter\JsonFormatter::format()
|
||||
*/
|
||||
public function format(array $record): string
|
||||
protected function normalizeRecord(LogRecord $record): array
|
||||
{
|
||||
if (isset($record["datetime"]) && ($record["datetime"] instanceof \DateTimeInterface)) {
|
||||
$record["timestamp"] = $record["datetime"]->format("Y-m-d\TH:i:s.uO");
|
||||
unset($record["datetime"]);
|
||||
}
|
||||
$recordData = parent::normalizeRecord($record);
|
||||
|
||||
return parent::format($record);
|
||||
$recordData["timestamp"] = $record->datetime->format("Y-m-d\TH:i:s.uO");
|
||||
unset($recordData["datetime"]);
|
||||
|
||||
return $recordData;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@
|
|||
|
||||
namespace Monolog\Formatter;
|
||||
|
||||
use Monolog\LogRecord;
|
||||
|
||||
/**
|
||||
* Encodes message information into JSON in a format compatible with Logmatic.
|
||||
*
|
||||
|
|
@ -20,15 +22,9 @@ class LogmaticFormatter extends JsonFormatter
|
|||
{
|
||||
protected const MARKERS = ["sourcecode", "php"];
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $hostname = '';
|
||||
protected string $hostname = '';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $appname = '';
|
||||
protected string $appName = '';
|
||||
|
||||
public function setHostname(string $hostname): self
|
||||
{
|
||||
|
|
@ -37,9 +33,9 @@ class LogmaticFormatter extends JsonFormatter
|
|||
return $this;
|
||||
}
|
||||
|
||||
public function setAppname(string $appname): self
|
||||
public function setAppName(string $appName): self
|
||||
{
|
||||
$this->appname = $appname;
|
||||
$this->appName = $appName;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
|
@ -50,17 +46,19 @@ class LogmaticFormatter extends JsonFormatter
|
|||
* @see http://doc.logmatic.io/docs/basics-to-send-data
|
||||
* @see \Monolog\Formatter\JsonFormatter::format()
|
||||
*/
|
||||
public function format(array $record): string
|
||||
public function normalizeRecord(LogRecord $record): array
|
||||
{
|
||||
if (!empty($this->hostname)) {
|
||||
$record = parent::normalizeRecord($record);
|
||||
|
||||
if ($this->hostname !== '') {
|
||||
$record["hostname"] = $this->hostname;
|
||||
}
|
||||
if (!empty($this->appname)) {
|
||||
$record["appname"] = $this->appname;
|
||||
if ($this->appName !== '') {
|
||||
$record["appname"] = $this->appName;
|
||||
}
|
||||
|
||||
$record["@marker"] = static::MARKERS;
|
||||
|
||||
return parent::format($record);
|
||||
return $record;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@
|
|||
|
||||
namespace Monolog\Formatter;
|
||||
|
||||
use Monolog\LogRecord;
|
||||
|
||||
/**
|
||||
* Serializes a log message to Logstash Event Format
|
||||
*
|
||||
|
|
@ -24,22 +26,22 @@ class LogstashFormatter extends NormalizerFormatter
|
|||
/**
|
||||
* @var string the name of the system for the Logstash log message, used to fill the @source field
|
||||
*/
|
||||
protected $systemName;
|
||||
protected string $systemName;
|
||||
|
||||
/**
|
||||
* @var string an application name for the Logstash log message, used to fill the @type field
|
||||
*/
|
||||
protected $applicationName;
|
||||
protected string $applicationName;
|
||||
|
||||
/**
|
||||
* @var string the key for 'extra' fields from the Monolog record
|
||||
*/
|
||||
protected $extraKey;
|
||||
protected string $extraKey;
|
||||
|
||||
/**
|
||||
* @var string the key for 'context' fields from the Monolog record
|
||||
*/
|
||||
protected $contextKey;
|
||||
protected string $contextKey;
|
||||
|
||||
/**
|
||||
* @param string $applicationName The application that sends the data, used as the "type" field of logstash
|
||||
|
|
@ -59,41 +61,38 @@ class LogstashFormatter extends NormalizerFormatter
|
|||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function format(array $record): string
|
||||
public function format(LogRecord $record): string
|
||||
{
|
||||
$record = parent::format($record);
|
||||
$recordData = parent::format($record);
|
||||
|
||||
if (empty($record['datetime'])) {
|
||||
$record['datetime'] = gmdate('c');
|
||||
}
|
||||
$message = [
|
||||
'@timestamp' => $record['datetime'],
|
||||
'@timestamp' => $recordData['datetime'],
|
||||
'@version' => 1,
|
||||
'host' => $this->systemName,
|
||||
];
|
||||
if (isset($record['message'])) {
|
||||
$message['message'] = $record['message'];
|
||||
if (isset($recordData['message'])) {
|
||||
$message['message'] = $recordData['message'];
|
||||
}
|
||||
if (isset($record['channel'])) {
|
||||
$message['type'] = $record['channel'];
|
||||
$message['channel'] = $record['channel'];
|
||||
if (isset($recordData['channel'])) {
|
||||
$message['type'] = $recordData['channel'];
|
||||
$message['channel'] = $recordData['channel'];
|
||||
}
|
||||
if (isset($record['level_name'])) {
|
||||
$message['level'] = $record['level_name'];
|
||||
if (isset($recordData['level_name'])) {
|
||||
$message['level'] = $recordData['level_name'];
|
||||
}
|
||||
if (isset($record['level'])) {
|
||||
$message['monolog_level'] = $record['level'];
|
||||
if (isset($recordData['level'])) {
|
||||
$message['monolog_level'] = $recordData['level'];
|
||||
}
|
||||
if ($this->applicationName) {
|
||||
if ('' !== $this->applicationName) {
|
||||
$message['type'] = $this->applicationName;
|
||||
}
|
||||
if (!empty($record['extra'])) {
|
||||
$message[$this->extraKey] = $record['extra'];
|
||||
if (\count($recordData['extra']) > 0) {
|
||||
$message[$this->extraKey] = $recordData['extra'];
|
||||
}
|
||||
if (!empty($record['context'])) {
|
||||
$message[$this->contextKey] = $record['context'];
|
||||
if (\count($recordData['context']) > 0) {
|
||||
$message[$this->contextKey] = $recordData['context'];
|
||||
}
|
||||
|
||||
return $this->toJson($message) . "\n";
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ namespace Monolog\Formatter;
|
|||
use MongoDB\BSON\Type;
|
||||
use MongoDB\BSON\UTCDateTime;
|
||||
use Monolog\Utils;
|
||||
use Monolog\LogRecord;
|
||||
|
||||
/**
|
||||
* Formats a record for use with the MongoDBHandler.
|
||||
|
|
@ -22,15 +23,12 @@ use Monolog\Utils;
|
|||
*/
|
||||
class MongoDBFormatter implements FormatterInterface
|
||||
{
|
||||
/** @var bool */
|
||||
private $exceptionTraceAsString;
|
||||
/** @var int */
|
||||
private $maxNestingLevel;
|
||||
/** @var bool */
|
||||
private $isLegacyMongoExt;
|
||||
private bool $exceptionTraceAsString;
|
||||
private int $maxNestingLevel;
|
||||
private bool $isLegacyMongoExt;
|
||||
|
||||
/**
|
||||
* @param int $maxNestingLevel 0 means infinite nesting, the $record itself is level 1, $record['context'] is 2
|
||||
* @param int $maxNestingLevel 0 means infinite nesting, the $record itself is level 1, $record->context is 2
|
||||
* @param bool $exceptionTraceAsString set to false to log exception traces as a sub documents instead of strings
|
||||
*/
|
||||
public function __construct(int $maxNestingLevel = 3, bool $exceptionTraceAsString = true)
|
||||
|
|
@ -42,20 +40,20 @@ class MongoDBFormatter implements FormatterInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @inheritDoc
|
||||
*
|
||||
* @return mixed[]
|
||||
*/
|
||||
public function format(array $record): array
|
||||
public function format(LogRecord $record): array
|
||||
{
|
||||
/** @var mixed[] $res */
|
||||
$res = $this->formatArray($record);
|
||||
$res = $this->formatArray($record->toArray());
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @inheritDoc
|
||||
*
|
||||
* @return array<mixed[]>
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ namespace Monolog\Formatter;
|
|||
use Monolog\DateTimeImmutable;
|
||||
use Monolog\Utils;
|
||||
use Throwable;
|
||||
use Monolog\LogRecord;
|
||||
|
||||
/**
|
||||
* Normalizes incoming records to remove objects/resources so it's easier to dump to various targets
|
||||
|
|
@ -24,15 +25,11 @@ class NormalizerFormatter implements FormatterInterface
|
|||
{
|
||||
public const SIMPLE_DATE = "Y-m-d\TH:i:sP";
|
||||
|
||||
/** @var string */
|
||||
protected $dateFormat;
|
||||
/** @var int */
|
||||
protected $maxNormalizeDepth = 9;
|
||||
/** @var int */
|
||||
protected $maxNormalizeItemCount = 1000;
|
||||
protected string $dateFormat;
|
||||
protected int $maxNormalizeDepth = 9;
|
||||
protected int $maxNormalizeItemCount = 1000;
|
||||
|
||||
/** @var int */
|
||||
private $jsonEncodeOptions = Utils::DEFAULT_JSON_FLAGS;
|
||||
private int $jsonEncodeOptions = Utils::DEFAULT_JSON_FLAGS;
|
||||
|
||||
/**
|
||||
* @param string|null $dateFormat The format of the timestamp: one supported by DateTime::format
|
||||
|
|
@ -46,17 +43,25 @@ class NormalizerFormatter implements FormatterInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* @param mixed[] $record
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function format(array $record)
|
||||
public function format(LogRecord $record)
|
||||
{
|
||||
return $this->normalize($record);
|
||||
return $this->normalizeRecord($record);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* Normalize an arbitrary value to a scalar|array|null
|
||||
*
|
||||
* @return null|scalar|array<mixed[]|scalar|null>
|
||||
*/
|
||||
public function normalizeValue(mixed $data): mixed
|
||||
{
|
||||
return $this->normalize($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function formatBatch(array $records)
|
||||
{
|
||||
|
|
@ -124,10 +129,25 @@ class NormalizerFormatter implements FormatterInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @param mixed $data
|
||||
* @return null|scalar|array<array|scalar|null>
|
||||
* Provided as extension point
|
||||
*
|
||||
* Because normalize is called with sub-values of context data etc, normalizeRecord can be
|
||||
* extended when data needs to be appended on the record array but not to other normalized data.
|
||||
*
|
||||
* @return array<mixed[]|scalar|null>
|
||||
*/
|
||||
protected function normalize($data, int $depth = 0)
|
||||
protected function normalizeRecord(LogRecord $record): array
|
||||
{
|
||||
/** @var array<mixed> $normalized */
|
||||
$normalized = $this->normalize($record->toArray());
|
||||
|
||||
return $normalized;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return null|scalar|array<mixed[]|scalar|null>
|
||||
*/
|
||||
protected function normalize(mixed $data, int $depth = 0): mixed
|
||||
{
|
||||
if ($depth > $this->maxNormalizeDepth) {
|
||||
return 'Over ' . $this->maxNormalizeDepth . ' levels deep, aborting normalization';
|
||||
|
|
@ -172,14 +192,14 @@ class NormalizerFormatter implements FormatterInterface
|
|||
}
|
||||
|
||||
if ($data instanceof \JsonSerializable) {
|
||||
/** @var null|scalar|array<array|scalar|null> $value */
|
||||
/** @var null|scalar|array<mixed[]|scalar|null> $value */
|
||||
$value = $data->jsonSerialize();
|
||||
} elseif (method_exists($data, '__toString')) {
|
||||
/** @var string $value */
|
||||
$value = $data->__toString();
|
||||
} else {
|
||||
// the rest is normalized by json encoding and decoding it
|
||||
/** @var null|scalar|array<array|scalar|null> $value */
|
||||
/** @var null|scalar|array<mixed[]|scalar|null> $value */
|
||||
$value = json_decode($this->toJson($data, true), true);
|
||||
}
|
||||
|
||||
|
|
@ -233,12 +253,12 @@ class NormalizerFormatter implements FormatterInterface
|
|||
|
||||
$trace = $e->getTrace();
|
||||
foreach ($trace as $frame) {
|
||||
if (isset($frame['file'])) {
|
||||
if (isset($frame['file'], $frame['line'])) {
|
||||
$data['trace'][] = $frame['file'].':'.$frame['line'];
|
||||
}
|
||||
}
|
||||
|
||||
if ($previous = $e->getPrevious()) {
|
||||
if (($previous = $e->getPrevious()) instanceof \Throwable) {
|
||||
$data['previous'] = $this->normalizeException($previous, $depth + 1);
|
||||
}
|
||||
|
||||
|
|
@ -257,10 +277,7 @@ class NormalizerFormatter implements FormatterInterface
|
|||
return Utils::jsonEncode($data, $this->jsonEncodeOptions, $ignoreErrors);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
protected function formatDate(\DateTimeInterface $date)
|
||||
protected function formatDate(\DateTimeInterface $date): string
|
||||
{
|
||||
// in case the date format isn't custom then we defer to the custom DateTimeImmutable
|
||||
// formatting logic, which will pick the right format based on whether useMicroseconds is on
|
||||
|
|
|
|||
|
|
@ -11,8 +11,10 @@
|
|||
|
||||
namespace Monolog\Formatter;
|
||||
|
||||
use Monolog\LogRecord;
|
||||
|
||||
/**
|
||||
* Formats data into an associative array of scalar values.
|
||||
* Formats data into an associative array of scalar (+ null) values.
|
||||
* Objects and arrays will be JSON encoded.
|
||||
*
|
||||
* @author Andrew Lawson <adlawson@gmail.com>
|
||||
|
|
@ -20,25 +22,21 @@ namespace Monolog\Formatter;
|
|||
class ScalarFormatter extends NormalizerFormatter
|
||||
{
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @inheritDoc
|
||||
*
|
||||
* @phpstan-return array<string, scalar|null> $record
|
||||
*/
|
||||
public function format(array $record): array
|
||||
public function format(LogRecord $record): array
|
||||
{
|
||||
$result = [];
|
||||
foreach ($record as $key => $value) {
|
||||
$result[$key] = $this->normalizeValue($value);
|
||||
foreach ($record->toArray() as $key => $value) {
|
||||
$result[$key] = $this->toScalar($value);
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $value
|
||||
* @return scalar|null
|
||||
*/
|
||||
protected function normalizeValue($value)
|
||||
protected function toScalar(mixed $value): string|int|float|bool|null
|
||||
{
|
||||
$normalized = $this->normalize($value);
|
||||
|
||||
|
|
|
|||
66
monolog/vendor/monolog/monolog/src/Monolog/Formatter/SyslogFormatter.php
vendored
Normal file
66
monolog/vendor/monolog/monolog/src/Monolog/Formatter/SyslogFormatter.php
vendored
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
<?php declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of the Monolog package.
|
||||
*
|
||||
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Monolog\Formatter;
|
||||
|
||||
use Monolog\Level;
|
||||
use Monolog\LogRecord;
|
||||
|
||||
/**
|
||||
* Serializes a log message according to RFC 5424
|
||||
*
|
||||
* @author Dalibor Karlović <dalibor.karlovic@sigwin.hr>
|
||||
* @author Renat Gabdullin <renatobyj@gmail.com>
|
||||
*/
|
||||
class SyslogFormatter extends LineFormatter
|
||||
{
|
||||
private const SYSLOG_FACILITY_USER = 1;
|
||||
private const FORMAT = "<%extra.priority%>1 %datetime% %extra.hostname% %extra.app-name% %extra.procid% %channel% %extra.structured-data% %level_name%: %message% %context% %extra%\n";
|
||||
private const NILVALUE = '-';
|
||||
|
||||
private string $hostname;
|
||||
private int $procid;
|
||||
|
||||
public function __construct(private string $applicationName = self::NILVALUE)
|
||||
{
|
||||
parent::__construct(self::FORMAT, 'Y-m-d\TH:i:s.uP', true, true);
|
||||
$this->hostname = (string) gethostname();
|
||||
$this->procid = (int) getmypid();
|
||||
}
|
||||
|
||||
public function format(LogRecord $record): string
|
||||
{
|
||||
$record->extra = $this->formatExtra($record);
|
||||
|
||||
return parent::format($record);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param LogRecord $record
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
private function formatExtra(LogRecord $record): array
|
||||
{
|
||||
$extra = $record->extra;
|
||||
$extra['app-name'] = $this->applicationName;
|
||||
$extra['hostname'] = $this->hostname;
|
||||
$extra['procid'] = $this->procid;
|
||||
$extra['priority'] = self::calculatePriority($record->level);
|
||||
$extra['structured-data'] = self::NILVALUE;
|
||||
|
||||
return $extra;
|
||||
}
|
||||
|
||||
private static function calculatePriority(Level $level): int
|
||||
{
|
||||
return (self::SYSLOG_FACILITY_USER * 8) + $level->toRFC5424Level();
|
||||
}
|
||||
}
|
||||
|
|
@ -11,7 +11,8 @@
|
|||
|
||||
namespace Monolog\Formatter;
|
||||
|
||||
use Monolog\Logger;
|
||||
use Monolog\Level;
|
||||
use Monolog\LogRecord;
|
||||
|
||||
/**
|
||||
* Serializes a log message according to Wildfire's header requirements
|
||||
|
|
@ -19,27 +20,9 @@ use Monolog\Logger;
|
|||
* @author Eric Clemmons (@ericclemmons) <eric@uxdriven.com>
|
||||
* @author Christophe Coevoet <stof@notk.org>
|
||||
* @author Kirill chEbba Chebunin <iam@chebba.org>
|
||||
*
|
||||
* @phpstan-import-type Level from \Monolog\Logger
|
||||
*/
|
||||
class WildfireFormatter extends NormalizerFormatter
|
||||
{
|
||||
/**
|
||||
* Translates Monolog log levels to Wildfire levels.
|
||||
*
|
||||
* @var array<Level, string>
|
||||
*/
|
||||
private $logLevels = [
|
||||
Logger::DEBUG => 'LOG',
|
||||
Logger::INFO => 'INFO',
|
||||
Logger::NOTICE => 'INFO',
|
||||
Logger::WARNING => 'WARN',
|
||||
Logger::ERROR => 'ERROR',
|
||||
Logger::CRITICAL => 'ERROR',
|
||||
Logger::ALERT => 'ERROR',
|
||||
Logger::EMERGENCY => 'ERROR',
|
||||
];
|
||||
|
||||
/**
|
||||
* @param string|null $dateFormat The format of the timestamp: one supported by DateTime::format
|
||||
*/
|
||||
|
|
@ -52,46 +35,61 @@ class WildfireFormatter extends NormalizerFormatter
|
|||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* Translates Monolog log levels to Wildfire levels.
|
||||
*
|
||||
* @return string
|
||||
* @return 'LOG'|'INFO'|'WARN'|'ERROR'
|
||||
*/
|
||||
public function format(array $record): string
|
||||
private function toWildfireLevel(Level $level): string
|
||||
{
|
||||
return match ($level) {
|
||||
Level::Debug => 'LOG',
|
||||
Level::Info => 'INFO',
|
||||
Level::Notice => 'INFO',
|
||||
Level::Warning => 'WARN',
|
||||
Level::Error => 'ERROR',
|
||||
Level::Critical => 'ERROR',
|
||||
Level::Alert => 'ERROR',
|
||||
Level::Emergency => 'ERROR',
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function format(LogRecord $record): string
|
||||
{
|
||||
// Retrieve the line and file if set and remove them from the formatted extra
|
||||
$file = $line = '';
|
||||
if (isset($record['extra']['file'])) {
|
||||
$file = $record['extra']['file'];
|
||||
unset($record['extra']['file']);
|
||||
if (isset($record->extra['file'])) {
|
||||
$file = $record->extra['file'];
|
||||
unset($record->extra['file']);
|
||||
}
|
||||
if (isset($record['extra']['line'])) {
|
||||
$line = $record['extra']['line'];
|
||||
unset($record['extra']['line']);
|
||||
if (isset($record->extra['line'])) {
|
||||
$line = $record->extra['line'];
|
||||
unset($record->extra['line']);
|
||||
}
|
||||
|
||||
/** @var mixed[] $record */
|
||||
$record = $this->normalize($record);
|
||||
$message = ['message' => $record['message']];
|
||||
$message = ['message' => $record->message];
|
||||
$handleError = false;
|
||||
if ($record['context']) {
|
||||
$message['context'] = $record['context'];
|
||||
if (count($record->context) > 0) {
|
||||
$message['context'] = $this->normalize($record->context);
|
||||
$handleError = true;
|
||||
}
|
||||
if ($record['extra']) {
|
||||
$message['extra'] = $record['extra'];
|
||||
if (count($record->extra) > 0) {
|
||||
$message['extra'] = $this->normalize($record->extra);
|
||||
$handleError = true;
|
||||
}
|
||||
if (count($message) === 1) {
|
||||
$message = reset($message);
|
||||
}
|
||||
|
||||
if (isset($record['context']['table'])) {
|
||||
if (is_array($message) && isset($message['context']['table'])) {
|
||||
$type = 'TABLE';
|
||||
$label = $record['channel'] .': '. $record['message'];
|
||||
$message = $record['context']['table'];
|
||||
$label = $record->channel .': '. $record->message;
|
||||
$message = $message['context']['table'];
|
||||
} else {
|
||||
$type = $this->logLevels[$record['level']];
|
||||
$label = $record['channel'];
|
||||
$type = $this->toWildfireLevel($record->level);
|
||||
$label = $record->channel;
|
||||
}
|
||||
|
||||
// Create JSON object describing the appearance of the message in the console
|
||||
|
|
@ -114,7 +112,7 @@ class WildfireFormatter extends NormalizerFormatter
|
|||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @inheritDoc
|
||||
*
|
||||
* @phpstan-return never
|
||||
*/
|
||||
|
|
@ -124,11 +122,11 @@ class WildfireFormatter extends NormalizerFormatter
|
|||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @inheritDoc
|
||||
*
|
||||
* @return null|scalar|array<array|scalar|null>|object
|
||||
* @return null|scalar|array<mixed[]|scalar|null>|object
|
||||
*/
|
||||
protected function normalize($data, int $depth = 0)
|
||||
protected function normalize(mixed $data, int $depth = 0): mixed
|
||||
{
|
||||
if (is_object($data) && !$data instanceof \DateTimeInterface) {
|
||||
return $data;
|
||||
|
|
|
|||
|
|
@ -11,55 +11,50 @@
|
|||
|
||||
namespace Monolog\Handler;
|
||||
|
||||
use Monolog\Level;
|
||||
use Monolog\Logger;
|
||||
use Monolog\ResettableInterface;
|
||||
use Psr\Log\LogLevel;
|
||||
use Monolog\LogRecord;
|
||||
|
||||
/**
|
||||
* Base Handler class providing basic level/bubble support
|
||||
*
|
||||
* @author Jordi Boggiano <j.boggiano@seld.be>
|
||||
*
|
||||
* @phpstan-import-type Level from \Monolog\Logger
|
||||
* @phpstan-import-type LevelName from \Monolog\Logger
|
||||
*/
|
||||
abstract class AbstractHandler extends Handler implements ResettableInterface
|
||||
{
|
||||
/**
|
||||
* @var int
|
||||
* @phpstan-var Level
|
||||
*/
|
||||
protected $level = Logger::DEBUG;
|
||||
/** @var bool */
|
||||
protected $bubble = true;
|
||||
protected Level $level = Level::Debug;
|
||||
protected bool $bubble = true;
|
||||
|
||||
/**
|
||||
* @param int|string $level The minimum logging level at which this handler will be triggered
|
||||
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
|
||||
* @param int|string|Level|LogLevel::* $level The minimum logging level at which this handler will be triggered
|
||||
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
|
||||
*
|
||||
* @phpstan-param Level|LevelName|LogLevel::* $level
|
||||
* @phpstan-param value-of<Level::VALUES>|value-of<Level::NAMES>|Level|LogLevel::* $level
|
||||
*/
|
||||
public function __construct($level = Logger::DEBUG, bool $bubble = true)
|
||||
public function __construct(int|string|Level $level = Level::Debug, bool $bubble = true)
|
||||
{
|
||||
$this->setLevel($level);
|
||||
$this->bubble = $bubble;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function isHandling(array $record): bool
|
||||
public function isHandling(LogRecord $record): bool
|
||||
{
|
||||
return $record['level'] >= $this->level;
|
||||
return $record->level->value >= $this->level->value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets minimum logging level at which this handler will be triggered.
|
||||
*
|
||||
* @param Level|LevelName|LogLevel::* $level Level or level name
|
||||
* @return self
|
||||
* @param Level|LogLevel::* $level Level or level name
|
||||
*
|
||||
* @phpstan-param value-of<Level::VALUES>|value-of<Level::NAMES>|Level|LogLevel::* $level
|
||||
*/
|
||||
public function setLevel($level): self
|
||||
public function setLevel(int|string|Level $level): self
|
||||
{
|
||||
$this->level = Logger::toMonologLevel($level);
|
||||
|
||||
|
|
@ -68,12 +63,8 @@ abstract class AbstractHandler extends Handler implements ResettableInterface
|
|||
|
||||
/**
|
||||
* Gets minimum logging level at which this handler will be triggered.
|
||||
*
|
||||
* @return int
|
||||
*
|
||||
* @phpstan-return Level
|
||||
*/
|
||||
public function getLevel(): int
|
||||
public function getLevel(): Level
|
||||
{
|
||||
return $this->level;
|
||||
}
|
||||
|
|
@ -81,9 +72,8 @@ abstract class AbstractHandler extends Handler implements ResettableInterface
|
|||
/**
|
||||
* Sets the bubbling behavior.
|
||||
*
|
||||
* @param bool $bubble true means that this handler allows bubbling.
|
||||
* false means that bubbling is not permitted.
|
||||
* @return self
|
||||
* @param bool $bubble true means that this handler allows bubbling.
|
||||
* false means that bubbling is not permitted.
|
||||
*/
|
||||
public function setBubble(bool $bubble): self
|
||||
{
|
||||
|
|
@ -104,9 +94,9 @@ abstract class AbstractHandler extends Handler implements ResettableInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function reset()
|
||||
public function reset(): void
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue