From 2731747bc9fc78c244330e41fc0395d4b0b4061b Mon Sep 17 00:00:00 2001 From: maliming Date: Thu, 22 Jul 2021 14:24:52 +0800 Subject: [PATCH] Skip the empty values in the `abp-translation.json` file. --- .../Volo/Abp/Cli/Commands/TranslateCommand.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/TranslateCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/TranslateCommand.cs index c3eeddc443..a9f7a15a9a 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/TranslateCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/TranslateCommand.cs @@ -59,7 +59,7 @@ namespace Volo.Abp.Cli.Commands Logger.LogInformation("Target culture: " + targetCulture); Logger.LogInformation("Reference culture: " + referenceCulture); Logger.LogInformation("Output file: " + outputFile); - + if (allValues) { Logger.LogInformation("Include all keys"); @@ -195,8 +195,11 @@ namespace Volo.Abp.Cli.Commands var targetText = targetLocalizationInfo.Texts.FirstOrDefault(x => x.Name == text.LocalizationKey); if (targetText != null) { - Logger.LogInformation($"Update translation: {targetText.Name} => " + text.Target); - targetText.Value = text.Target; + if (!text.Target.IsNullOrEmpty()) + { + Logger.LogInformation($"Update translation: {targetText.Name} => " + text.Target); + targetText.Value = text.Target; + } } else {