Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/edge' into edge
Browse files Browse the repository at this point in the history
  • Loading branch information
math-GH committed Apr 19, 2024
2 parents 4bafff8 + dcd3b80 commit 66976e9
Show file tree
Hide file tree
Showing 54 changed files with 501 additions and 499 deletions.
1 change: 1 addition & 0 deletions CREDITS.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,3 +247,4 @@ People are sorted by name so please keep this order.
* [yzqzss|一座桥在水上](https://github.com/yzqzss): [contributions](https://github.com/FreshRSS/FreshRSS/pulls?q=is:pr+author:yzqzss), [Web](https://blog.othing.xyz/)
* [Zhaofeng Li](https://github.com/zhaofengli): [contributions](https://github.com/FreshRSS/FreshRSS/pulls?q=is:pr+author:zhaofengli), [Web](https://zhaofeng.li/)
* [Zhiyuan Zheng](https://github.com/zhzy0077): [contributions](https://github.com/FreshRSS/FreshRSS/pulls?q=is:pr+author:zhzy0077)
* [zukizukizuki](https://github.com/zukizukizuki): [contributions](https://github.com/FreshRSS/FreshRSS/pulls?q=is:pr+author:zukizukizuki), [Web](https://zukkie.link/)
2 changes: 1 addition & 1 deletion app/Models/Feed.php
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ public function loadJson(): ?SimplePie {
$json_dotpath = $this->attributeArray('json_dotpath') ?? [];
$dotPaths = $this->kind() === FreshRSS_Feed::KIND_JSONFEED ? $this->dotPathsForStandardJsonFeed() : $json_dotpath;

$feedContent = FreshRSS_dotpath_Util::convertJsonToRss($jf, $feedSourceUrl, $dotPaths, $this->name());
$feedContent = FreshRSS_dotNotation_Util::convertJsonToRss($jf, $feedSourceUrl, $dotPaths, $this->name());
if ($feedContent == null) {
return null;
}
Expand Down
33 changes: 17 additions & 16 deletions app/Utils/dotpathUtil.php → app/Utils/dotNotationUtil.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
declare(strict_types=1);

final class FreshRSS_dotpath_Util
final class FreshRSS_dotNotation_Util
{

/**
Expand Down Expand Up @@ -112,28 +113,28 @@ public static function convertJsonToRss(array $jf, string $feedSourceUrl, array
$view->entries = [];

$view->rss_title = isset($dotPaths['feedTitle'])
? (htmlspecialchars(FreshRSS_dotpath_Util::getString($jf, $dotPaths['feedTitle']) ?? '', ENT_COMPAT, 'UTF-8') ?: $defaultRssTitle)
? (htmlspecialchars(FreshRSS_dotNotation_Util::getString($jf, $dotPaths['feedTitle']) ?? '', ENT_COMPAT, 'UTF-8') ?: $defaultRssTitle)
: $defaultRssTitle;

$jsonItems = FreshRSS_dotpath_Util::get($jf, $dotPaths['item']);
$jsonItems = FreshRSS_dotNotation_Util::get($jf, $dotPaths['item']);
if (!is_array($jsonItems) || count($jsonItems) === 0) {
return null;
}

foreach ($jsonItems as $jsonItem) {
$rssItem = [];
$rssItem['link'] = isset($dotPaths['itemUri']) ? FreshRSS_dotpath_Util::getString($jsonItem, $dotPaths['itemUri']) ?? '' : '';
$rssItem['link'] = isset($dotPaths['itemUri']) ? FreshRSS_dotNotation_Util::getString($jsonItem, $dotPaths['itemUri']) ?? '' : '';
if (empty($rssItem['link'])) {
continue;
}
$rssItem['title'] = isset($dotPaths['itemTitle']) ? FreshRSS_dotpath_Util::getString($jsonItem, $dotPaths['itemTitle']) ?? '' : '';
$rssItem['author'] = isset($dotPaths['itemAuthor']) ? FreshRSS_dotpath_Util::getString($jsonItem, $dotPaths['itemAuthor']) ?? '' : '';
$rssItem['timestamp'] = isset($dotPaths['itemTimestamp']) ? FreshRSS_dotpath_Util::getString($jsonItem, $dotPaths['itemTimestamp']) ?? '' : '';
$rssItem['title'] = isset($dotPaths['itemTitle']) ? FreshRSS_dotNotation_Util::getString($jsonItem, $dotPaths['itemTitle']) ?? '' : '';
$rssItem['author'] = isset($dotPaths['itemAuthor']) ? FreshRSS_dotNotation_Util::getString($jsonItem, $dotPaths['itemAuthor']) ?? '' : '';
$rssItem['timestamp'] = isset($dotPaths['itemTimestamp']) ? FreshRSS_dotNotation_Util::getString($jsonItem, $dotPaths['itemTimestamp']) ?? '' : '';

//get simple content, but if a path for HTML content has been provided, replace the simple content with HTML content
$rssItem['content'] = isset($dotPaths['itemContent']) ? FreshRSS_dotpath_Util::getString($jsonItem, $dotPaths['itemContent']) ?? '' : '';
$rssItem['content'] = isset($dotPaths['itemContent']) ? FreshRSS_dotNotation_Util::getString($jsonItem, $dotPaths['itemContent']) ?? '' : '';
$rssItem['content'] = isset($dotPaths['itemContentHTML'])
? FreshRSS_dotpath_Util::getString($jsonItem, $dotPaths['itemContentHTML']) ?? ''
? FreshRSS_dotNotation_Util::getString($jsonItem, $dotPaths['itemContentHTML']) ?? ''
: $rssItem['content'];

if (isset($dotPaths['itemTimeFormat']) && is_string($dotPaths['itemTimeFormat'])) {
Expand All @@ -144,7 +145,7 @@ public static function convertJsonToRss(array $jf, string $feedSourceUrl, array
}

if (isset($dotPaths['itemCategories'])) {
$jsonItemCategories = FreshRSS_dotpath_Util::get($jsonItem, $dotPaths['itemCategories']);
$jsonItemCategories = FreshRSS_dotNotation_Util::get($jsonItem, $dotPaths['itemCategories']);
if (is_string($jsonItemCategories) && $jsonItemCategories !== '') {
$rssItem['tags'] = [$jsonItemCategories];
} elseif (is_array($jsonItemCategories) && count($jsonItemCategories) > 0) {
Expand All @@ -157,31 +158,31 @@ public static function convertJsonToRss(array $jf, string $feedSourceUrl, array
}
}

$rssItem['thumbnail'] = isset($dotPaths['itemThumbnail']) ? FreshRSS_dotpath_Util::getString($jsonItem, $dotPaths['itemThumbnail']) ?? '' : '';
$rssItem['thumbnail'] = isset($dotPaths['itemThumbnail']) ? FreshRSS_dotNotation_Util::getString($jsonItem, $dotPaths['itemThumbnail']) ?? '' : '';

//Enclosures?
if (isset($dotPaths['itemAttachment'])) {
$jsonItemAttachments = FreshRSS_dotpath_Util::get($jsonItem, $dotPaths['itemAttachment']);
$jsonItemAttachments = FreshRSS_dotNotation_Util::get($jsonItem, $dotPaths['itemAttachment']);
if (is_array($jsonItemAttachments) && count($jsonItemAttachments) > 0) {
$rssItem['attachments'] = [];
foreach ($jsonItemAttachments as $attachment) {
$rssAttachment = [];
$rssAttachment['url'] = isset($dotPaths['itemAttachmentUrl'])
? FreshRSS_dotpath_Util::getString($attachment, $dotPaths['itemAttachmentUrl'])
? FreshRSS_dotNotation_Util::getString($attachment, $dotPaths['itemAttachmentUrl'])
: '';
$rssAttachment['type'] = isset($dotPaths['itemAttachmentType'])
? FreshRSS_dotpath_Util::getString($attachment, $dotPaths['itemAttachmentType'])
? FreshRSS_dotNotation_Util::getString($attachment, $dotPaths['itemAttachmentType'])
: '';
$rssAttachment['length'] = isset($dotPaths['itemAttachmentLength'])
? FreshRSS_dotpath_Util::get($attachment, $dotPaths['itemAttachmentLength'])
? FreshRSS_dotNotation_Util::get($attachment, $dotPaths['itemAttachmentLength'])
: '';
$rssItem['attachments'][] = $rssAttachment;
}
}
}

if (isset($dotPaths['itemUid'])) {
$rssItem['guid'] = FreshRSS_dotpath_Util::getString($jsonItem, $dotPaths['itemUid']);
$rssItem['guid'] = FreshRSS_dotNotation_Util::getString($jsonItem, $dotPaths['itemUid']);
}

if (empty($rssItem['guid'])) {
Expand Down
10 changes: 5 additions & 5 deletions app/i18n/cz/sub.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,13 @@
'relative' => 'XPath (vzhledem k položce) pro:',
'xpath' => 'XPath pro:',
),
'json_dotpath' => array(
'_' => 'JSON (Dotted paths)', // TODO
'json_dotnotation' => array(
'_' => 'JSON (dot notation)', // TODO
'feed_title' => array(
'_' => 'feed title', // TODO
'help' => 'Example: <code>meta.title</code> or a static string: <code>"My custom feed"</code>', // TODO
),
'help' => 'A JSON dotted path uses dots between objects and brackets for arrays (e.g. <code>data.items[0].title</code>)', // TODO
'help' => 'A JSON dot notated uses dots between objects and brackets for arrays (e.g. <code>data.items[0].title</code>)', // TODO
'item' => array(
'_' => 'finding news <strong>items</strong><br /><small>(most important)</small>', // TODO
'help' => 'JSON path to the array containing the items, e.g. <code>newsItems</code>', // TODO
Expand Down Expand Up @@ -161,8 +161,8 @@
'_' => 'item link (URL)', // TODO
'help' => 'Example: <code>permalink</code>', // TODO
),
'json' => 'Dotted Path for:', // TODO
'relative' => 'Dotted Path (relative to item) for:', // TODO
'json' => 'dot notation for:', // TODO
'relative' => 'dot notated path (relative to item) for:', // TODO
),
'jsonfeed' => 'JSON Feed', // TODO
'rss' => 'RSS / Atom (výchozí)',
Expand Down
12 changes: 6 additions & 6 deletions app/i18n/de/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
'http' => 'HTTP (HTTPS für erfahrene Benutzer)',
'none' => 'Keine (gefährlich)',
'title' => 'Authentifizierung',
'token' => 'Master authentication token', // TODO
'token_help' => 'Allows access to all RSS outputs of the user as well as refreshing feeds without authentication:', // TODO
'token' => 'Master-Authentifizierungs-Token',
'token_help' => 'Zugriff auf alle vom Nutzer erstellten RSS-Feeds freigeben (inkl. Aktualisierung ohne Authenthentifizierung):',
'type' => 'Authentifizierungsmethode',
'unsafe_autologin' => 'Erlaube unsicheres automatisches Anmelden mit folgendem Format: ',
),
Expand Down Expand Up @@ -160,8 +160,8 @@
'_' => 'Systemeinstellungen',
'auto-update-url' => 'Auto-Update URL',
'base-url' => array(
'_' => 'Base URL', // TODO
'recommendation' => 'Automatic recommendation: <kbd>%s</kbd>', // TODO
'_' => 'Base URL', // IGNORE
'recommendation' => 'Automatische Empfehlung: <kbd>%s</kbd>',
),
'cookie-duration' => array(
'help' => 'in Sekunden',
Expand All @@ -187,14 +187,14 @@
),
'title' => 'Benutzer-Registrierungsformular',
),
'sensitive-parameter' => 'Sensitive parameter. Edit manually in <kbd>./data/config.php</kbd>', // TODO
'sensitive-parameter' => 'Sensitive Einstellung. Manuell in <kbd>./data/config.php</kbd> anpassbar.',
'tos' => array(
'disabled' => 'sind nicht aktiviert',
'enabled' => '<a href="./?a=tos">sind aktiv</a>',
'help' => 'So werden die <a href="https://freshrss.github.io/FreshRSS/en/admins/12_User_management.html#enable-terms-of-service-tos" target="_blank">Nutzungsbedingungen aktiviert</a>',
),
'websub' => array(
'help' => 'About <a href="https://freshrss.github.io/FreshRSS/en/users/WebSub.html" target="_blank">WebSub</a>', // TODO
'help' => 'Über <a href="https://freshrss.github.io/FreshRSS/en/users/WebSub.html" target="_blank">WebSub</a>',
),
),
'update' => array(
Expand Down
30 changes: 15 additions & 15 deletions app/i18n/de/conf.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
'warn' => 'Dieser Account und alle damit bezogenen Daten werden gelöscht.',
),
'email' => 'E-Mail-Adresse',
'password_api' => 'Passwort-API<br /><small>(z.B. für mobile Anwendungen)</small>',
'password_api' => 'API-Passwort<br /><small>(z.B. für mobile Anwendungen)</small>',
'password_form' => 'Passwort<br /><small>(für die Anmeldemethode per Webformular)</small>',
'password_format' => 'mindestens 7 Zeichen',
'title' => 'Profil',
Expand All @@ -120,32 +120,32 @@
'feeds' => 'Nach Feed filtern',
'order' => 'Nach Datum sortieren',
'search' => 'Suchbegriff',
'shareOpml' => 'Enable sharing by OPML of corresponding categories and feeds', // TODO
'shareRss' => 'Enable sharing by HTML &amp; RSS', // TODO
'shareOpml' => 'Teilen via OPML mit zugehörigen Kategorien und Feeds aktivieren',
'shareRss' => 'Teilen via HTML &amp; RSS aktivieren',
'state' => 'Eigenschaft',
'tags' => 'Nach Labels filtern',
'type' => 'Filter-Typ',
),
'get_all' => 'Alle Artikel anzeigen',
'get_all_labels' => 'Display articles with any label', // TODO
'get_all_labels' => 'Alle Artikle mit beliebigem Label anzeigen',
'get_category' => 'Kategorie „%s“ anzeigen',
'get_favorite' => 'Lieblingsartikel anzeigen',
'get_favorite' => 'Favoriten-Artikel anzeigen',
'get_feed' => 'Feed „%s“ anzeigen',
'get_important' => 'Display articles from important feeds', // TODO
'get_label' => 'Display articles with “%s” label', // TODO
'help' => 'See the <a href="https://freshrss.github.io/FreshRSS/en/users/user_queries.html" target="_blank">documentation for user queries and resharing by HTML / RSS / OPML</a>.', // TODO
'get_important' => 'Alle Artikel von den "Wichtige Feeds" anzeigen',
'get_label' => 'Artikel mit dem Label “%s” anzeigen',
'help' => 'Siehe die <a href="https://freshrss.github.io/FreshRSS/en/users/user_queries.html" target="_blank">Dokumentation für Benutzerabfragen und Teilen via HTML / RSS / OPML</a>.',
'name' => 'Name', // IGNORE
'no_filter' => 'Kein Filter',
'number' => 'Abfrage Nr. %d',
'order_asc' => 'Älteste Artikel zuerst anzeigen',
'order_desc' => 'Neueste Artikel zuerst anzeigen',
'search' => 'Suche nach „%s“',
'share' => array(
'_' => 'Share this query by link', // TODO
'help' => 'Give this link if you want to share this query with anyone', // TODO
'html' => 'Shareable link to the HTML page', // TODO
'opml' => 'Shareable link to the OPML list of feeds', // TODO
'rss' => 'Shareable link to the RSS feed', // TODO
'_' => 'Diese Benutzerabfrage per Link teilen',
'help' => 'Diesen Link verteilen, um in mit Jedem zu teilen',
'html' => 'Verteilbarer Link zur HTML-Seite',
'opml' => 'Verteilbarer Link zur OPML Liste der Feeds',
'rss' => 'Verteilbarer Link zum RSS-Feed',
),
'state_0' => 'Alle Artikel anzeigen',
'state_1' => 'Gelesene Artikel anzeigen',
Expand Down Expand Up @@ -217,9 +217,9 @@
'read' => array(
'article_open_on_website' => 'wenn der Artikel auf der Original-Webseite geöffnet wird',
'article_viewed' => 'wenn der Artikel angesehen wird',
'focus' => 'when focused (except for important feeds)', // TODO
'focus' => 'wenn angewählt (außer für "Wichtige Feeds")',
'keep_max_n_unread' => 'Max. Anzahl von ungelesenen Artikeln',
'scroll' => 'beim Scrollen bzw. Überspringen (except for important feeds)', // DIRTY
'scroll' => 'beim Scrollen bzw. Überspringen (außer für "Wichtige Feeds")',
'upon_gone' => 'wenn der Artikel nicht mehr im Feed enthalten ist',
'upon_reception' => 'beim Empfang des Artikels',
'when' => 'Artikel als gelesen markieren…',
Expand Down
8 changes: 4 additions & 4 deletions app/i18n/de/feedback.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
'feeds_imported_with_errors' => 'Ihre Feeds sind importiert worden, aber es traten einige Fehler auf. Wenn Sie alle Dateien importiert haben, können Sie <i>Feeds aktualisieren</i> klicken.',
'file_cannot_be_uploaded' => 'Die Datei kann nicht hochgeladen werden!',
'no_zip_extension' => 'Die ZIP-Erweiterung ist auf Ihrem Server nicht vorhanden.',
'zip_error' => 'Ein Fehler trat während des ZIP-Imports auf.', // DIRTY
'zip_error' => 'Ein Fehler trat während des ZIP-Imports auf.',
),
'profile' => array(
'error' => 'Ihr Profil kann nicht geändert werden',
Expand Down Expand Up @@ -115,11 +115,11 @@
'purge_completed' => 'Bereinigung abgeschlossen (%d Artikel gelöscht)',
),
'tag' => array(
'created' => 'Label „%s“ wurde erstellt.',
'error' => 'Label could not be updated!', // TODO
'created' => 'Das Label „%s“ wurde erstellt.',
'error' => 'Das Label konnte nicht angepasst werden!',
'name_exists' => 'Label-Name existiert bereits.',
'renamed' => 'Das Label „%s“ wurde umbenannt in „%s“.',
'updated' => 'Label has been updated.', // TODO
'updated' => 'Das Label wurde angepasst.',
),
'update' => array(
'can_apply' => 'FreshRSS wird nun auf die <strong>Version %s</strong> aktualisiert.',
Expand Down
2 changes: 1 addition & 1 deletion app/i18n/de/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
'bookmark_query' => 'Aktuelle Abfrage speichern',
'favorites' => 'Favoriten (%s)',
'global_view' => 'Globale Ansicht',
'important' => 'Important feeds', // TODO
'important' => 'Wichtige Feeds',
'main_stream' => 'Haupt-Feeds',
'mark_all_read' => 'Alle als gelesen markieren',
'mark_cat_read' => 'Kategorie als gelesen markieren',
Expand Down
Loading

0 comments on commit 66976e9

Please sign in to comment.