]> git.mxchange.org Git - friendica.git/commitdiff
Search: Replace "No results" notification with text, with translations
authorMarcus Funch <mfm@magenta.dk>
Wed, 18 Jun 2025 20:23:14 +0000 (22:23 +0200)
committerMarcus Funch <mfm@magenta.dk>
Sat, 21 Jun 2025 11:25:31 +0000 (13:25 +0200)
src/Module/Search/Index.php
view/lang/C/messages.po
view/theme/frio/js/theme.js

index 8d395ba8801ea7da536c9bb080a684deccc9f991..e6e9f39a31b7993c5f08f3141e2537c08ebe0d80 100644 (file)
@@ -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
                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]);
-                       DI::sysmsg()->addNotice(DI::l10n()->t('No results.'));
+                       $o .= Renderer::replaceMacros(Renderer::getMarkupTemplate('section_title.tpl'), [
+                               '$title' => DI::l10n()->t('No results.')
+                       ]);
                        return $o;
                }
 
@@ -186,7 +188,9 @@ class Index extends BaseSearch
 
                if (empty($items)) {
                        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;
                }
index 4aa51dc1cd18df50fdbb4f2ef812826c81a81be5..3988254f0ab37cc6d94366eb666ffb93113a1078 100644 (file)
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: 2025.02-dev\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"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -646,7 +646,7 @@ msgstr ""
 msgid "Map"
 msgstr ""
 
-#: src/App.php:451
+#: src/App.php:454
 msgid "Apologies but the website is unavailable at the moment."
 msgstr ""
 
@@ -2227,11 +2227,11 @@ msgstr ""
 msgid "prev"
 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"
 msgstr ""
 
-#: src/Content/Pager.php:267
+#: src/Content/Pager.php:251
 msgid "last"
 msgstr ""
 
@@ -6108,7 +6108,7 @@ msgstr ""
 msgid "Search your contacts"
 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
 msgid "Results for: %s"
 msgstr ""
@@ -6698,8 +6698,8 @@ msgid "Unable to unfollow this contact, please contact your administrator"
 msgstr ""
 
 #: src/Module/Conversation/Channel.php:125
-#: src/Module/Conversation/Community.php:114 src/Module/Search/Index.php:139
-#: src/Module/Search/Index.php:189
+#: src/Module/Conversation/Community.php:114 src/Module/Search/Index.php:140
+#: src/Module/Search/Index.php:192
 msgid "No results."
 msgstr ""
 
@@ -8901,7 +8901,7 @@ msgstr ""
 msgid "Only one search per minute is permitted for not logged in users."
 msgstr ""
 
-#: src/Module/Search/Index.php:200
+#: src/Module/Search/Index.php:204
 #, php-format
 msgid "Items tagged with: %s"
 msgstr ""
index ad59a3f633d202a6b15d19e899c95b7abba0ea26..d11f953127eac1eb4546b58bc9c13b7fa77b198b 100644 (file)
@@ -174,9 +174,8 @@ $(document).ready(function () {
 
                // temporary workaround to avoid 'undefined' being displayed (issue #9789)
                // https://github.com/friendica/friendica/issues/9789
-               // TODO: find a way to localize this string
                if (typeof searchText === "undefined") {
-                       searchText = "No results";
+                       searchText = "";
                }
                // insert the plain text in a <h4> heading and give it a class
                var newText = '<h4 class="search-heading">' + searchText + "</h4>";