Add optional manual mode per translation and culture
This commit is contained in:
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
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user