Skip to content

Commit

Permalink
🌐 fix(i18n): start adding translations for timeline events (#4497)
Browse files Browse the repository at this point in the history
- Fixed hardcoded Recipe Created message in timeline events
- Added initial recipe-created translations:
  - de-DE: Rezept erstellt
  - en-US: Recipe created

Part of #4497
  • Loading branch information
domezi committed Nov 15, 2024
1 parent 172698a commit 02d0c82
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions mealie/lang/messages/de-DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
},
"recipe": {
"unique-name-error": "Rezeptnamen müssen einzigartig sein",
"recipe-created": "Rezept erstellt",
"recipe-defaults": {
"ingredient-note": "250 g Mehl",
"step-text": "Zubereitungs-Schritte und andere Felder der Rezeptseite unterstützen Markdown Syntax.\n\n**Füge einen Link hinzu**\n\n[Mein Link](https://demo.mealie.io)\n"
Expand Down
1 change: 1 addition & 0 deletions mealie/lang/messages/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
},
"recipe": {
"unique-name-error": "Recipe names must be unique",
"recipe-created": "Recipe created",
"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"
Expand Down
2 changes: 1 addition & 1 deletion mealie/services/recipe/recipe_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def create_one(self, create_data: Recipe | CreateRecipe) -> Recipe:
timeline_event_data = RecipeTimelineEventCreate(
user_id=new_recipe.user_id,
recipe_id=new_recipe.id,
subject="Recipe Created",
subject=self.t("recipe.recipe-created"),
event_type=TimelineEventType.system,
timestamp=new_recipe.created_at or datetime.now(timezone.utc),
)
Expand Down

0 comments on commit 02d0c82

Please sign in to comment.