diff --git a/src/Machine/src/Serval.Machine.Shared/Serval.Machine.Shared.csproj b/src/Machine/src/Serval.Machine.Shared/Serval.Machine.Shared.csproj
index 6b0d78b1..4ea74e68 100644
--- a/src/Machine/src/Serval.Machine.Shared/Serval.Machine.Shared.csproj
+++ b/src/Machine/src/Serval.Machine.Shared/Serval.Machine.Shared.csproj
@@ -36,9 +36,9 @@
-
-
-
+
+
+
@@ -57,4 +57,4 @@
-
+
\ No newline at end of file
diff --git a/src/Machine/src/Serval.Machine.Shared/Services/PreprocessBuildJob.cs b/src/Machine/src/Serval.Machine.Shared/Services/PreprocessBuildJob.cs
index 850d1b68..4e5f94b1 100644
--- a/src/Machine/src/Serval.Machine.Shared/Services/PreprocessBuildJob.cs
+++ b/src/Machine/src/Serval.Machine.Shared/Services/PreprocessBuildJob.cs
@@ -50,13 +50,19 @@ protected override async Task DoWorkAsync(
CancellationToken cancellationToken
)
{
+ TranslationEngine? engine = await Engines.GetAsync(e => e.EngineId == engineId, cancellationToken);
+ if (engine is null)
+ throw new OperationCanceledException($"Engine {engineId} does not exist. Build canceled.");
+
+ bool sourceTagInBaseModel = ResolveLanguageCodeForBaseModel(engine.SourceLanguage, out string srcLang);
+ bool targetTagInBaseModel = ResolveLanguageCodeForBaseModel(engine.TargetLanguage, out string trgLang);
+
(int trainCount, int pretranslateCount) = await WriteDataFilesAsync(
buildId,
data,
buildOptions,
cancellationToken
);
-
// Log summary of build data
JsonObject buildPreprocessSummary =
new()
@@ -65,16 +71,10 @@ CancellationToken cancellationToken
{ "EngineId", engineId },
{ "BuildId", buildId },
{ "NumTrainRows", trainCount },
- { "NumPretranslateRows", pretranslateCount }
+ { "NumPretranslateRows", pretranslateCount },
+ { "SourceLanguageResolved", srcLang },
+ { "TargetLanguageResolved", trgLang }
};
- TranslationEngine? engine = await Engines.GetAsync(e => e.EngineId == engineId, cancellationToken);
- if (engine is null)
- throw new OperationCanceledException($"Engine {engineId} does not exist. Build canceled.");
-
- bool sourceTagInBaseModel = ResolveLanguageCodeForBaseModel(engine.SourceLanguage, out string srcLang);
- buildPreprocessSummary.Add("SourceLanguageResolved", srcLang);
- bool targetTagInBaseModel = ResolveLanguageCodeForBaseModel(engine.TargetLanguage, out string trgLang);
- buildPreprocessSummary.Add("TargetLanguageResolved", trgLang);
Logger.LogInformation("{summary}", buildPreprocessSummary.ToJsonString());
if (trainCount == 0 && (!sourceTagInBaseModel || !targetTagInBaseModel))
diff --git a/src/Machine/test/Serval.Machine.Shared.Tests/Services/PreprocessBuildJobTests.cs b/src/Machine/test/Serval.Machine.Shared.Tests/Services/PreprocessBuildJobTests.cs
index 08b6d414..65ed5fef 100644
--- a/src/Machine/test/Serval.Machine.Shared.Tests/Services/PreprocessBuildJobTests.cs
+++ b/src/Machine/test/Serval.Machine.Shared.Tests/Services/PreprocessBuildJobTests.cs
@@ -104,7 +104,7 @@ public async Task RunAsync_EnableKeyTerms()
Assert.That(src1Count, Is.EqualTo(0));
Assert.That(src2Count, Is.EqualTo(0));
Assert.That(trgCount, Is.EqualTo(0));
- Assert.That(termCount, Is.EqualTo(1));
+ Assert.That(termCount, Is.EqualTo(5726));
});
}
diff --git a/src/Serval/src/Serval.Shared/Serval.Shared.csproj b/src/Serval/src/Serval.Shared/Serval.Shared.csproj
index 6689ffbf..87217c39 100644
--- a/src/Serval/src/Serval.Shared/Serval.Shared.csproj
+++ b/src/Serval/src/Serval.Shared/Serval.Shared.csproj
@@ -19,7 +19,7 @@
-
+
diff --git a/src/Serval/test/Serval.Translation.Tests/Services/EngineServiceTests.cs b/src/Serval/test/Serval.Translation.Tests/Services/EngineServiceTests.cs
index e6df88c6..49e114cb 100644
--- a/src/Serval/test/Serval.Translation.Tests/Services/EngineServiceTests.cs
+++ b/src/Serval/test/Serval.Translation.Tests/Services/EngineServiceTests.cs
@@ -619,7 +619,8 @@ public TestEnvironment()
fileNameSuffix: ".USFM",
biblicalTermsListType: "BiblicalTerms",
biblicalTermsProjectName: "",
- biblicalTermsFileName: "BiblicalTerms.xml"
+ biblicalTermsFileName: "BiblicalTerms.xml",
+ languageCode: "en"
)
);
diff --git a/src/Serval/test/Serval.Translation.Tests/Services/PretranslationServiceTests.cs b/src/Serval/test/Serval.Translation.Tests/Services/PretranslationServiceTests.cs
index b2f08824..cbdcb6ff 100644
--- a/src/Serval/test/Serval.Translation.Tests/Services/PretranslationServiceTests.cs
+++ b/src/Serval/test/Serval.Translation.Tests/Services/PretranslationServiceTests.cs
@@ -402,7 +402,8 @@ private static ParatextProjectSettings CreateProjectSettings(string name)
fileNameSuffix: $"{name}.SFM",
biblicalTermsListType: "Major",
biblicalTermsProjectName: "",
- biblicalTermsFileName: "BiblicalTerms.xml"
+ biblicalTermsFileName: "BiblicalTerms.xml",
+ languageCode: "en"
);
}
}