From ed079d2efb1bd71535dd0e00870fb34cfb694262 Mon Sep 17 00:00:00 2001 From: Abdullah Atta Date: Fri, 30 May 2025 19:25:00 +0500 Subject: [PATCH] core: use intl for showing search results count --- packages/core/src/api/lookup.ts | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/packages/core/src/api/lookup.ts b/packages/core/src/api/lookup.ts index 161950268..2a6a37917 100644 --- a/packages/core/src/api/lookup.ts +++ b/packages/core/src/api/lookup.ts @@ -41,6 +41,7 @@ import { fuzzy } from "../utils/fuzzy.js"; import { extractMatchingBlocks } from "../utils/html-parser.js"; import { findOrAdd } from "../utils/array.js"; import { Parser } from "htmlparser2"; +import { strings } from "@notesnook/intl"; type SearchResults = { sorted: (sortOptions?: SortOptions) => Promise>; @@ -277,7 +278,21 @@ export default class Lookup { ids: results.map((c) => c.id), items: results }; - } + }, + () => + new Map([ + [ + 0, + { + index: 0, + group: { + id: "0", + title: strings.results(matches.ids.length), + type: "header" + } + } + ] + ]) ); }