fix: recipe version diff readability + i18n, tooltip on markdown export

- Version compare used positional (index-by-index) list alignment —
  inserting one ingredient in the middle shifted every subsequent line
  out of alignment, making the whole rest of the list look changed.
  Switch to diffArrays (LCS-based) so insertions/deletions are
  detected properly; adjacent removed+added chunks still get paired
  for word-level diffing so a single edited item doesn't render as a
  full delete+insert.
- Translated "Title"/"Description"/"Ingredients"/"Steps" diff section
  headers, "Version History" sheet title, compare/restore buttons,
  loading/empty states, and the version-detail ingredient/step count
  summary (with proper plural forms).
- formatDate() in version history was hardcoded to "en-US" regardless
  of the app's locale — now uses the session locale.
- ExportMarkdownButton had no hover tooltip (bare title attribute) —
  wrap it in the same Tooltip pattern every other icon button in the
  toolbar uses.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Arnaud
2026-07-09 04:19:33 +02:00
parent 10233b3ef9
commit 1614da38cd
5 changed files with 125 additions and 54 deletions
+13
View File
@@ -113,6 +113,19 @@
"urlImportFetchFailed": "Failed to import recipe",
"urlImportSaveFailed": "Failed to save imported recipe",
"urlImportSuccess": "Recipe imported! Review before publishing.",
"diffTitleLabel": "Title",
"diffDescriptionLabel": "Description",
"diffIngredientsLabel": "Ingredients",
"diffStepsLabel": "Steps",
"versionHistoryTitle": "Version History",
"versionsLoading": "Loading versions...",
"versionsEmpty": "No versions yet. Versions are saved automatically when you edit this recipe.",
"versionCompare": "Compare",
"versionCompareWith": "Compare v{version} with current",
"versionRestore": "Restore",
"versionRestored": "Recipe restored to version {version}",
"versionDetailLoading": "Loading...",
"versionDetailSummary": "{ingredients, plural, one {1 ingredient} other {{ingredients} ingredients}}, {steps, plural, one {1 step} other {{steps} steps}}",
"analyzingPhoto": "Analyzing photo…",
"pairMealTooltip": "Pair meal",
"historyTooltip": "History",
+13
View File
@@ -113,6 +113,19 @@
"urlImportFetchFailed": "Échec de l'importation de la recette",
"urlImportSaveFailed": "Échec de l'enregistrement de la recette importée",
"urlImportSuccess": "Recette importée ! Vérifiez-la avant de la publier.",
"diffTitleLabel": "Titre",
"diffDescriptionLabel": "Description",
"diffIngredientsLabel": "Ingrédients",
"diffStepsLabel": "Étapes",
"versionHistoryTitle": "Historique des versions",
"versionsLoading": "Chargement des versions...",
"versionsEmpty": "Aucune version pour l'instant. Les versions sont enregistrées automatiquement lorsque vous modifiez cette recette.",
"versionCompare": "Comparer",
"versionCompareWith": "Comparer v{version} avec la version actuelle",
"versionRestore": "Restaurer",
"versionRestored": "Recette restaurée à la version {version}",
"versionDetailLoading": "Chargement...",
"versionDetailSummary": "{ingredients, plural, one {1 ingrédient} other {{ingredients} ingrédients}}, {steps, plural, one {1 étape} other {{steps} étapes}}",
"analyzingPhoto": "Analyse de la photo…",
"pairMealTooltip": "Accorder un plat",
"historyTooltip": "Historique",