feat: Structured Yields (#4489)

Co-authored-by: Kuchenpirat <24235032+Kuchenpirat@users.noreply.github.com>
This commit is contained in:
Michael Genson
2024-11-20 08:46:27 -06:00
committed by GitHub
parent c8cd68b4f0
commit 327da02fc8
39 changed files with 1018 additions and 551 deletions

View File

@@ -8,6 +8,14 @@
"recipe-defaults": {
"ingredient-note": "1 Cup Flour",
"step-text": "Recipe steps as well as other fields in the recipe page support markdown syntax.\n\n**Add a link**\n\n[My Link](https://demo.mealie.io)\n"
},
"servings-text": {
"makes": "Makes",
"serves": "Serves",
"serving": "Serving",
"servings": "Servings",
"yield": "Yield",
"yields": "Yields"
}
},
"mealplan": {

View File

@@ -29,3 +29,9 @@ def local_provider(accept_language: str | None = Header(None)) -> Translator:
factory = _load_factory()
accept_language = accept_language or "en-US"
return factory.get(accept_language)
@lru_cache
def get_all_translations(key: str) -> dict[str, str]:
factory = _load_factory()
return {locale: factory.get(locale).t(key) for locale in factory.supported_locales}