From 6cb17bd083f38280c2abe557aa2e32f87f0a96d6 Mon Sep 17 00:00:00 2001 From: Halil ibrahim Kalkan Date: Fri, 3 Aug 2018 15:24:40 +0300 Subject: [PATCH] AbpDictionaryBasedStringLocalizer handle exceptions --- .../AbpDictionaryBasedStringLocalizer.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpDictionaryBasedStringLocalizer.cs b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpDictionaryBasedStringLocalizer.cs index de3582983d..c9428626a8 100644 --- a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpDictionaryBasedStringLocalizer.cs +++ b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpDictionaryBasedStringLocalizer.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Collections.Immutable; using System.Globalization; using System.Linq; +using System.Resources; using Microsoft.Extensions.Localization; namespace Volo.Abp.Localization @@ -116,9 +117,18 @@ namespace Volo.Abp.Localization foreach (var baseLocalizer in BaseLocalizers.Select(l => l.WithCulture(CultureInfo.GetCultureInfo(cultureName)))) { - foreach (var localizedString in baseLocalizer.GetAllStrings(includeParentCultures)) + //TODO: Try/catch is a workaround here! + try { - allStrings[localizedString.Name] = localizedString; + var baseLocalizedString = baseLocalizer.GetAllStrings(includeParentCultures); + foreach (var localizedString in baseLocalizedString) + { + allStrings[localizedString.Name] = localizedString; + } + } + catch (MissingManifestResourceException) + { + } }