Add optional manual mode per translation and culture

This commit is contained in:
tsommer committed 2022-09-21 22:52:17 +02:00
1 parent 10434c553a
commit 8a4bf6f180
8 files changed
+326 -8

No files matched your search

@@ -17,6 +17,7 @@ public static class TranslationProcessor
if(!await db.Translations.AnyAsync(n => n.TextElement == textElement && n.Culture == cultureInfo.Code))
missedTranslations.Add(new Translation
{
TranslateManual = false,
Culture = cultureInfo.Code,
Text = string.Empty,
});
@@ -32,11 +33,12 @@ public static class TranslationProcessor
return await db.Translations.Where(n => n.TextElement == textElement).ToListAsync();
}
public static async Task<ProcessorResult<Translation>> SaveChangedTranslation(int translationId, string text)
public static async Task<ProcessorResult<Translation>> SaveChangedTranslation(int translationId, string text, bool manualFLag)
{
await using var db = ProcessorMeta.ServiceProvider.GetRequiredService<DataContext>();
var dbTranslation = await db.Translations.FirstAsync(n => n.Id == translationId);
dbTranslation.Text = text;
dbTranslation.TranslateManual = manualFLag;
try
{