Browse Source

Skip the empty values in the `abp-translation.json` file.

pull/9630/head
maliming 5 years ago
parent
commit
2731747bc9
  1. 9
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/TranslateCommand.cs

9
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("Target culture: " + targetCulture);
Logger.LogInformation("Reference culture: " + referenceCulture); Logger.LogInformation("Reference culture: " + referenceCulture);
Logger.LogInformation("Output file: " + outputFile); Logger.LogInformation("Output file: " + outputFile);
if (allValues) if (allValues)
{ {
Logger.LogInformation("Include all keys"); Logger.LogInformation("Include all keys");
@ -195,8 +195,11 @@ namespace Volo.Abp.Cli.Commands
var targetText = targetLocalizationInfo.Texts.FirstOrDefault(x => x.Name == text.LocalizationKey); var targetText = targetLocalizationInfo.Texts.FirstOrDefault(x => x.Name == text.LocalizationKey);
if (targetText != null) if (targetText != null)
{ {
Logger.LogInformation($"Update translation: {targetText.Name} => " + text.Target); if (!text.Target.IsNullOrEmpty())
targetText.Value = text.Target; {
Logger.LogInformation($"Update translation: {targetText.Name} => " + text.Target);
targetText.Value = text.Target;
}
} }
else else
{ {

Loading…
Cancel
Save