Bugfixes
- Added handling for DeepL exceptions - Added debug logging for im- and exporting - When executing the post script for the unique id migration, ensure that new id are generated, only when no id exists - Fixed section export by loading references to parents
This commit is contained in:
5 files changed
+98
-25
No files matched your search
@@ -54,17 +54,24 @@ public static class DeepL
|
||||
{
|
||||
var sourceCultureIndex = await AppSettings.GetDeepLSourceCultureIndex();
|
||||
var sourceCulture = await AppSettings.GetCultureCode(sourceCultureIndex);
|
||||
|
||||
|
||||
// In case of the source culture, we cannot specify the region, so we need to remove it:
|
||||
sourceCulture = sourceCulture.Split('-')[0];
|
||||
|
||||
|
||||
using var deepl = new Translator(deepLAPIKey);
|
||||
var translation = await deepl.TranslateTextAsync(text, sourceCulture, targetCulture);
|
||||
|
||||
|
||||
return translation.Text;
|
||||
}
|
||||
catch (AuthorizationException)
|
||||
catch (AuthorizationException e)
|
||||
{
|
||||
Console.WriteLine($"DeepL authorization failed: {e.Message}");
|
||||
DEEPL_NOT_AVAILABLE = true;
|
||||
return string.Empty;
|
||||
}
|
||||
catch (DeepLException e)
|
||||
{
|
||||
Console.WriteLine($"DeepL issue: {e.Message}");
|
||||
DEEPL_NOT_AVAILABLE = true;
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
|
||||
public static class Version
|
||||
{
|
||||
public static string Text => $"v0.8.1 (2023-01-24), .NET {Environment.Version}";
|
||||
public static string Text => $"v0.8.2 (2023-02-11), .NET {Environment.Version}";
|
||||
}
|
||||
Reference in new issue
Block a user