add translation support for portions, baking, cook times, and ingredient units

Add comprehensive translation support for previously untranslatable fields:
- Portions (serving sizes)
- Time fields (preparation, cooking, total_time)
- Baking properties (temperature, length, mode)
- Fermentation times (bulk, final)
- Ingredient units (EL→tbsp, TL→tsp, etc.)

Fix terminology replacement to work correctly:
- Pre-process German cooking terms BEFORE sending to DeepL
- Post-process to convert US English to British English AFTER DeepL
- Split applyIngredientTerminology into replaceGermanCookingTerms (pre) and applyBritishEnglish (post)

Database schema:
- Add translatable fields to translations.en object

Translation service:
- Include new fields and ingredient units in batch translation
- Add field-specific translation in translateFields()
- Update change detection to track new fields
- Pre-process all texts to replace German terms before DeepL
- Post-process all texts to apply British English after DeepL

UI components:
- Display all new fields in translation approval interface
- Add editable inputs for English translations
- Support nested field editing (baking.temperature, fermentation.bulk, etc.)

Fix changed fields detection:
- Only show changed fields when editing existing translations
- Don't show false warnings for first-time translations
This commit is contained in:
2025-12-27 13:57:42 +01:00
parent 0d01e595ea
commit 4e2a7ff624
4 changed files with 304 additions and 20 deletions

View File

@@ -51,6 +51,19 @@ const RecipeSchema = new mongoose.Schema(
note: {type: String},
category: {type: String},
tags: [String],
portions: {type: String},
preparation: {type: String},
cooking: {type: String},
total_time: {type: String},
baking: {
temperature: {type: String},
length: {type: String},
mode: {type: String},
},
fermentation: {
bulk: {type: String},
final: {type: String},
},
ingredients: [{
name: {type: String, default: ""},
list: [{