diff --git a/packages/frontend/src/components/PageLayout/Search/useSearchAutocompleteDialogs.tsx b/packages/frontend/src/components/PageLayout/Search/useSearchAutocompleteDialogs.tsx
index bf68711e..050f516e 100644
--- a/packages/frontend/src/components/PageLayout/Search/useSearchAutocompleteDialogs.tsx
+++ b/packages/frontend/src/components/PageLayout/Search/useSearchAutocompleteDialogs.tsx
@@ -2,6 +2,7 @@ import type { AutocompleteProps } from '@altinn/altinn-components';
import type { AutocompleteItemProps } from '@altinn/altinn-components/dist/components/Autocomplete/AutocompleteItem';
import { useQuery } from '@tanstack/react-query';
import type { DialogStatus, GetSearchAutocompleteDialogsQuery, PartyFieldsFragment } from 'bff-types-generated';
+import { t } from 'i18next';
import { useMemo } from 'react';
import { Link } from 'react-router-dom';
import { useDebounce } from 'use-debounce';
@@ -72,14 +73,17 @@ const createAutocomplete = (
if (isLoading) {
return {
- items: [getScopeItem('Alt i innboks'), ...getSkeletonItems(skeletonSize)],
- groups: { searching: { title: `Søker etter «${searchValue}»...` } },
+ items: [
+ getScopeItem(`${t('word.everything')} ${t('search.autocomplete.inInbox')}`),
+ ...getSkeletonItems(skeletonSize),
+ ],
+ groups: { searching: { title: `${t('search.searchFor')} «${searchValue}»...` } },
} as AutocompleteProps;
}
if (!isSearchable) {
return {
- items: [getScopeItem('Alt i innboks')],
+ items: [getScopeItem(`${t('word.everything')} ${t('search.autocomplete.inInbox')}`)],
} as AutocompleteProps;
}
@@ -90,12 +94,12 @@ const createAutocomplete = (
items: [
getScopeItem(
- {searchValue} i innboks
+ {searchValue} {t('search.autocomplete.inInbox')}
,
- 'Ingen treff',
+ t('search.noHits'),
),
],
- groups: { noHits: { title: 'Ingen treff' } },
+ groups: { noHits: { title: t('search.noHits') } },
} as AutocompleteProps;
}
@@ -103,13 +107,13 @@ const createAutocomplete = (
items: [
getScopeItem(
- {searchValue} i innboks
+ {searchValue} {t('search.autocomplete.inInbox')}
,
- `${searchResults.length} treff`,
+ `${searchResults.length} ${t('word.hits')}`,
),
...searchHits,
],
- groups: { searchResults: { title: 'Anbefalte treff' } },
+ groups: { searchResults: { title: t('search.autocomplete.recommendedHits') } },
} as AutocompleteProps;
};
diff --git a/packages/frontend/src/i18n/resources/en.json b/packages/frontend/src/i18n/resources/en.json
index efbbba6c..2e48f9f2 100644
--- a/packages/frontend/src/i18n/resources/en.json
+++ b/packages/frontend/src/i18n/resources/en.json
@@ -127,8 +127,12 @@
"savedSearches.saved_success": "Search saved",
"savedSearches.title": "{count, plural, =0 {You have no saved searches} one {# saved search} other {# saved searches}}",
"savedSearches.update_success": "Search updated",
+ "search.noHits": "No hits",
+ "search.searchFor": "Search for",
"search.search.results": "Your search returned {count, plural, one {# hit} other {# hits}}",
"search.title.in_inbox": "in inbox",
+ "search.autocomplete.inInbox": "in inbox",
+ "search.autocomplete.recommendedHits": "Recommended hits",
"sidebar.archived": "Archive",
"sidebar.archived.label": "Press here to go to Archive",
"sidebar.deleted": "Trash",
@@ -182,5 +186,6 @@
"word.status": "Status",
"word.to": "to",
"word.transmissions": "Transmissions",
+ "word.hits": "hits",
"word.you": "you"
}
diff --git a/packages/frontend/src/i18n/resources/nb.json b/packages/frontend/src/i18n/resources/nb.json
index 71abd252..3245c2f7 100644
--- a/packages/frontend/src/i18n/resources/nb.json
+++ b/packages/frontend/src/i18n/resources/nb.json
@@ -127,8 +127,12 @@
"savedSearches.saved_success": "Søk lagret",
"savedSearches.title": "{count, plural, =0 {Du har ingen lagrede søk} one {# lagret søk} other {# lagrede søk}}",
"savedSearches.update_success": "Søk oppdatert",
+ "search.noHits": "Ingen treff",
+ "search.searchFor": "Søker etter",
"search.search.results": "Ditt søk ga {count, plural, one {# treff} other {# treff}}",
"search.title.in_inbox": "i innboks",
+ "search.autocomplete.inInbox": "i innboks",
+ "search.autocomplete.recommendedHits": "Anbefalte treff",
"sidebar.archived": "Arkiv",
"sidebar.archived.label": "Trykk her for å gå til Arkiv",
"sidebar.deleted": "Papirkurv",
@@ -182,5 +186,6 @@
"word.status": "Status",
"word.to": "til",
"word.transmissions": "Transmissions",
+ "word.hits": "treff",
"word.you": "deg"
}