Search: Replace "No results" notification with text, with translations

pull/14980/head
Marcus Funch 2025-06-18 22:23:14 +02:00
rodzic 14e4fb8334
commit f97abc11f0
3 zmienionych plików z 15 dodań i 12 usunięć

Wyświetl plik

@ -136,7 +136,9 @@ class Index extends BaseSearch
// Tags don't look like an URL and the fulltext search does only work with natural words // Tags don't look like an URL and the fulltext search does only work with natural words
if (parse_url($search, PHP_URL_SCHEME) && parse_url($search, PHP_URL_HOST)) { if (parse_url($search, PHP_URL_SCHEME) && parse_url($search, PHP_URL_HOST)) {
$this->logger->info('Skipping tag and fulltext search since the search looks like a URL.', ['q' => $search]); $this->logger->info('Skipping tag and fulltext search since the search looks like a URL.', ['q' => $search]);
DI::sysmsg()->addNotice(DI::l10n()->t('No results.')); $o .= Renderer::replaceMacros(Renderer::getMarkupTemplate('section_title.tpl'), [
'$title' => DI::l10n()->t('No results.')
]);
return $o; return $o;
} }
@ -186,7 +188,9 @@ class Index extends BaseSearch
if (empty($items)) { if (empty($items)) {
if (empty($last_uriid)) { if (empty($last_uriid)) {
DI::sysmsg()->addNotice(DI::l10n()->t('No results.')); $o .= Renderer::replaceMacros(Renderer::getMarkupTemplate('section_title.tpl'), [
'$title' => DI::l10n()->t('No results.')
]);
} }
return $o; return $o;
} }

Wyświetl plik

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: 2025.02-dev\n" "Project-Id-Version: 2025.02-dev\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-06-14 15:06+0200\n" "POT-Creation-Date: 2025-06-21 13:03+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -646,7 +646,7 @@ msgstr ""
msgid "Map" msgid "Map"
msgstr "" msgstr ""
#: src/App.php:451 #: src/App.php:454
msgid "Apologies but the website is unavailable at the moment." msgid "Apologies but the website is unavailable at the moment."
msgstr "" msgstr ""
@ -2227,11 +2227,11 @@ msgstr ""
msgid "prev" msgid "prev"
msgstr "" msgstr ""
#: src/Content/Pager.php:262 src/Module/Calendar/Show.php:122 #: src/Content/Pager.php:246 src/Module/Calendar/Show.php:122
msgid "next" msgid "next"
msgstr "" msgstr ""
#: src/Content/Pager.php:267 #: src/Content/Pager.php:251
msgid "last" msgid "last"
msgstr "" msgstr ""
@ -6108,7 +6108,7 @@ msgstr ""
msgid "Search your contacts" msgid "Search your contacts"
msgstr "" msgstr ""
#: src/Module/Contact.php:441 src/Module/Search/Index.php:202 #: src/Module/Contact.php:441 src/Module/Search/Index.php:206
#, php-format #, php-format
msgid "Results for: %s" msgid "Results for: %s"
msgstr "" msgstr ""
@ -6698,8 +6698,8 @@ msgid "Unable to unfollow this contact, please contact your administrator"
msgstr "" msgstr ""
#: src/Module/Conversation/Channel.php:125 #: src/Module/Conversation/Channel.php:125
#: src/Module/Conversation/Community.php:114 src/Module/Search/Index.php:139 #: src/Module/Conversation/Community.php:114 src/Module/Search/Index.php:140
#: src/Module/Search/Index.php:189 #: src/Module/Search/Index.php:192
msgid "No results." msgid "No results."
msgstr "" msgstr ""
@ -8901,7 +8901,7 @@ msgstr ""
msgid "Only one search per minute is permitted for not logged in users." msgid "Only one search per minute is permitted for not logged in users."
msgstr "" msgstr ""
#: src/Module/Search/Index.php:200 #: src/Module/Search/Index.php:204
#, php-format #, php-format
msgid "Items tagged with: %s" msgid "Items tagged with: %s"
msgstr "" msgstr ""

Wyświetl plik

@ -174,9 +174,8 @@ $(document).ready(function () {
// temporary workaround to avoid 'undefined' being displayed (issue #9789) // temporary workaround to avoid 'undefined' being displayed (issue #9789)
// https://github.com/friendica/friendica/issues/9789 // https://github.com/friendica/friendica/issues/9789
// TODO: find a way to localize this string
if (typeof searchText === "undefined") { if (typeof searchText === "undefined") {
searchText = "No results"; searchText = "";
} }
// insert the plain text in a <h4> heading and give it a class // insert the plain text in a <h4> heading and give it a class
var newText = '<h4 class="search-heading">' + searchText + "</h4>"; var newText = '<h4 class="search-heading">' + searchText + "</h4>";