Skip to content

Commit

Permalink
Add more not localizable settings
Browse files Browse the repository at this point in the history
  • Loading branch information
artem-dudarev committed Oct 5, 2023
1 parent 733cebc commit d9d103c
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Threading.Tasks;
using VirtoCommerce.CoreModule.Core;
using VirtoCommerce.CoreModule.Core.Settings;
using VirtoCommerce.Platform.Core;
using VirtoCommerce.Platform.Core.Common;
using VirtoCommerce.Platform.Core.Settings;

Expand All @@ -14,6 +15,13 @@ public class LocalizableSettingService : ILocalizableSettingService
private static readonly StringComparer _ignoreCase = StringComparer.OrdinalIgnoreCase;
private static readonly string _languagesSettingName = ModuleConstants.Settings.General.Languages.Name;

private static readonly string[] _notLocalizableSettingNames =
{
ModuleConstants.Settings.General.Languages.Name,
PlatformConstants.Settings.Security.FileExtensionsBlackList.Name,
PlatformConstants.Settings.Security.FileExtensionsWhiteList.Name,
};

private readonly ISettingsManager _settingsManager;
private readonly ILocalizedItemSearchService _localizedItemSearchService;
private readonly ILocalizedItemService _localizedItemService;
Expand Down Expand Up @@ -244,7 +252,7 @@ private async Task<ObjectSettingEntry> GetDictionarySetting(string name)

private static bool IsLocalizable(SettingDescriptor setting)
{
return IsShortTextDictionary(setting) && !setting.Name.EqualsInvariant(_languagesSettingName);
return IsShortTextDictionary(setting) && !_notLocalizableSettingNames.Contains(setting.Name, _ignoreCase);
}

private static bool IsShortTextDictionary(SettingDescriptor setting)
Expand Down

0 comments on commit d9d103c

Please sign in to comment.