From: Marcus Funch Date: Wed, 18 Jun 2025 20:23:14 +0000 (+0200) Subject: Search: Replace "No results" notification with text, with translations X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=f97abc11f049b3fb10a171215d9e2de3de724e0f;p=friendica.git Search: Replace "No results" notification with text, with translations --- diff --git a/src/Module/Search/Index.php b/src/Module/Search/Index.php index 8d395ba880..e6e9f39a31 100644 --- a/src/Module/Search/Index.php +++ b/src/Module/Search/Index.php @@ -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; } diff --git a/view/lang/C/messages.po b/view/lang/C/messages.po index 4aa51dc1cd..3988254f0a 100644 --- a/view/lang/C/messages.po +++ b/view/lang/C/messages.po @@ -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 \n" "Language-Team: LANGUAGE \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 "" diff --git a/view/theme/frio/js/theme.js b/view/theme/frio/js/theme.js index ad59a3f633..d11f953127 100644 --- a/view/theme/frio/js/theme.js +++ b/view/theme/frio/js/theme.js @@ -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

heading and give it a class var newText = '

' + searchText + "

";