Search for keywords

This commit is contained in:
VincentMeilinger
2024-01-08 11:24:01 +01:00
parent f2dac7d2b8
commit 3bcf104a5d
36 changed files with 208 additions and 39 deletions

View File

@@ -1,109 +1,109 @@
{
"images" : [
{
"filename" : "cookbook-icon-20@2x.png",
"filename" : "Hintergrund-20@2x.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "20x20"
},
{
"filename" : "cookbook-icon-20@3x.png",
"filename" : "Hintergrund-20@3x.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "20x20"
},
{
"filename" : "cookbook-icon-29@2x.png",
"filename" : "Hintergrund-29@2x.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "29x29"
},
{
"filename" : "cookbook-icon-29@3x.png",
"filename" : "Hintergrund-29@3x.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "29x29"
},
{
"filename" : "cookbook-icon-40@2x.png",
"filename" : "Hintergrund-40@2x.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "40x40"
},
{
"filename" : "cookbook-icon-40@3x.png",
"filename" : "Hintergrund-40@3x.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "40x40"
},
{
"filename" : "cookbook-icon-60@2x.png",
"filename" : "Hintergrund-60@2x.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "60x60"
},
{
"filename" : "cookbook-icon-60@3x.png",
"filename" : "Hintergrund-60@3x.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "60x60"
},
{
"filename" : "cookbook-icon-20.png",
"filename" : "Hintergrund-20.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "20x20"
},
{
"filename" : "cookbook-icon-20@2x.png",
"filename" : "Hintergrund-20@2x.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "20x20"
},
{
"filename" : "cookbook-icon-29.png",
"filename" : "Hintergrund-29.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "29x29"
},
{
"filename" : "cookbook-icon-29@2x.png",
"filename" : "Hintergrund-29@2x.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "29x29"
},
{
"filename" : "cookbook-icon-40.png",
"filename" : "Hintergrund-40.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "40x40"
},
{
"filename" : "cookbook-icon-40@2x.png",
"filename" : "Hintergrund-40@2x.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "40x40"
},
{
"filename" : "cookbook-icon-76.png",
"filename" : "Hintergrund-76.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "76x76"
},
{
"filename" : "cookbook-icon-76@2x.png",
"filename" : "Hintergrund-76@2x.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "76x76"
},
{
"filename" : "cookbook-icon-83.5@2x.png",
"filename" : "Hintergrund-83.5@2x.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "83.5x83.5"
},
{
"filename" : "cookbook-icon-1024.png",
"filename" : "Hintergrund-1024.png",
"idiom" : "ios-marketing",
"scale" : "1x",
"size" : "1024x1024"

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

View File

@@ -0,0 +1,116 @@
{
"images" : [
{
"filename" : "cookbook-icon-20@2x.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "20x20"
},
{
"filename" : "cookbook-icon-20@3x.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "20x20"
},
{
"filename" : "cookbook-icon-29@2x.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "29x29"
},
{
"filename" : "cookbook-icon-29@3x.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "29x29"
},
{
"filename" : "cookbook-icon-40@2x.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "40x40"
},
{
"filename" : "cookbook-icon-40@3x.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "40x40"
},
{
"filename" : "cookbook-icon-60@2x.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "60x60"
},
{
"filename" : "cookbook-icon-60@3x.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "60x60"
},
{
"filename" : "cookbook-icon-20.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "20x20"
},
{
"filename" : "cookbook-icon-20@2x.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "20x20"
},
{
"filename" : "cookbook-icon-29.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "29x29"
},
{
"filename" : "cookbook-icon-29@2x.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "29x29"
},
{
"filename" : "cookbook-icon-40.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "40x40"
},
{
"filename" : "cookbook-icon-40@2x.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "40x40"
},
{
"filename" : "cookbook-icon-76.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "76x76"
},
{
"filename" : "cookbook-icon-76@2x.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "76x76"
},
{
"filename" : "cookbook-icon-83.5@2x.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "83.5x83.5"
},
{
"filename" : "cookbook-icon-1024.png",
"idiom" : "ios-marketing",
"scale" : "1x",
"size" : "1024x1024"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@@ -712,7 +712,26 @@
}
},
"Copy Link" : {
"localizations" : {
"de" : {
"stringUnit" : {
"state" : "translated",
"value" : "Link kopieren"
}
},
"es" : {
"stringUnit" : {
"state" : "translated",
"value" : "Copiar enlace"
}
},
"fr" : {
"stringUnit" : {
"state" : "translated",
"value" : "Copier le lien"
}
}
}
},
"Could not establish a connection to the server. The action will be retried upon reconnection." : {
"localizations" : {
@@ -957,7 +976,26 @@
}
},
"e.g.: example.com" : {
"localizations" : {
"de" : {
"stringUnit" : {
"state" : "translated",
"value" : "z.B. beispiel.com"
}
},
"es" : {
"stringUnit" : {
"state" : "translated",
"value" : "por ejemplo, example.com"
}
},
"fr" : {
"stringUnit" : {
"state" : "translated",
"value" : "par exemple example.com"
}
}
}
},
"Edit" : {
"localizations" : {
@@ -1157,31 +1195,27 @@
}
}
},
"If the login button does not open your browser, copy the following link and paste it in your browser manually:" : {
"extractionState" : "stale",
"If the login button does not open your browser, use the 'Copy Link' button and paste the link in your browser manually." : {
"localizations" : {
"de" : {
"stringUnit" : {
"state" : "translated",
"value" : "Wenn der Anmeldebutton Ihren Browser nicht öffnet, kopieren Sie den folgenden Link und fügen Sie ihn manuell in Ihren Browser ein:"
"value" : "Wenn der Anmeldebutton Ihren Browser nicht öffnet, verwenden Sie den 'Link kopieren' Button und fügen Sie den Link manuell in Ihren Browser ein."
}
},
"es" : {
"stringUnit" : {
"state" : "translated",
"value" : "Si el botón de inicio de sesión no abre su navegador, copie el siguiente enlace y péguelo manualmente en su navegador:"
"value" : "Si el botón de inicio de sesión no abre tu navegador, usa el botón 'Copiar enlace' y pega el enlace manualmente en tu navegador."
}
},
"fr" : {
"stringUnit" : {
"state" : "translated",
"value" : "Si le bouton de connexion n'ouvre pas votre navigateur, copiez le lien suivant et collez-le manuellement dans votre navigateur :"
"value" : "Si le bouton de connexion n'ouvre pas votre navigateur, utilisez le bouton 'Copier le lien' et collez le lien manuellement dans votre navigateur."
}
}
}
},
"If the login button does not open your browser, use the 'Copy Link' button and paste the link in your browser manually." : {
},
"If you are interested in contributing to this project or simply wish to review its source code, we encourage you to visit the GitHub repository for this application." : {
"localizations" : {
@@ -1586,27 +1620,23 @@
}
},
"Make sure to enter the server address in the form 'example.com', or \n'<server address>:<port>'\n when a non-standard port is used." : {
},
"Make sure to enter the server address in the form 'example.com'. Currently, only servers using the 'https' protocol are supported." : {
"extractionState" : "stale",
"localizations" : {
"de" : {
"stringUnit" : {
"state" : "translated",
"value" : "Stellen Sie sicher, dass Sie die Serveradresse in der Form 'beispiel.com' eingeben. Derzeit werden nur Server unterstützt, die das 'https'-Protokoll verwenden."
"value" : "Stellen Sie sicher, dass Sie die Serveradresse in der Form 'beispiel.com' eingeben, oder '<Serveradresse>:<Port>', wenn ein nicht standardmäßiger Port verwendet wird."
}
},
"es" : {
"stringUnit" : {
"state" : "translated",
"value" : "Asegúrese de ingresar la dirección del servidor en el formato 'example.com'. Actualmente, solo se admiten servidores que usan el protocolo 'https'."
"value" : "Asegúrate de introducir la dirección del servidor en la forma 'example.com', o '<dirección del servidor>:<puerto>' cuando se utiliza un puerto no estándar."
}
},
"fr" : {
"stringUnit" : {
"state" : "translated",
"value" : "Assurez-vous de saisir l'adresse du serveur sous la forme 'example.com'. Actuellement, seuls les serveurs utilisant le protocole 'https' sont pris en charge."
"value" : "Assurez-vous de saisir l'adresse du serveur sous la forme 'example.com', ou '<adresse du serveur>:<port>' lorsqu'un port non standard est utilisé."
}
}
}
@@ -2227,6 +2257,28 @@
}
}
},
"Search recipes/keywords" : {
"localizations" : {
"de" : {
"stringUnit" : {
"state" : "translated",
"value" : "Suche Rezepte/Schlagwörter"
}
},
"es" : {
"stringUnit" : {
"state" : "translated",
"value" : "Buscar recetas/palabras clave"
}
},
"fr" : {
"stringUnit" : {
"state" : "translated",
"value" : "Rechercher recettes/mots-clés"
}
}
}
},
"Select a default cookbook" : {
"localizations" : {
"de" : {

View File

@@ -42,7 +42,7 @@ struct CategoryDetailView: View {
}
}
}
.searchable(text: $searchText, prompt: "Search recipes")
.searchable(text: $searchText, prompt: "Search recipes/keywords")
.task {
await viewModel.getCategory(
named: categoryName,
@@ -61,7 +61,8 @@ struct CategoryDetailView: View {
guard let recipes = viewModel.recipes[categoryName] else { return [] }
guard searchText != "" else { return recipes }
return recipes.filter { recipe in
recipe.name.lowercased().contains(searchText.lowercased())
recipe.name.lowercased().contains(searchText.lowercased()) || // check name for occurence of search term
(recipe.keywords != nil && recipe.keywords!.lowercased().contains(searchText.lowercased())) // check keywords for search term
}
}
}