IEnumerable <LocalizedString> GetAllStrings(CultureInfo culture) { var dictionary = _localizationManager.GetDictionary(culture); foreach (var(key, value) in dictionary.Translations) { yield return(new LocalizedString(key, value.FirstOrDefault())); } }
public PortableObjectStringLocalizer(CultureInfo culture, string context, ILocalizationManager localizationManager, ILogger logger) { Context = context; _localizationManager = localizationManager; _logger = logger; _dictionary = localizationManager.GetDictionary(culture); if (culture.Parent != null) { _parentCultureDictionary = localizationManager.GetDictionary(culture.Parent); } }
public DefaultModularLocalizer(CultureInfo culture, ILocalizationManager localizationManager, ITenantShellManager tenantShellManager, Type localizer) { _localizationManager = localizationManager; _tenantShellManager = tenantShellManager; _localizer = localizer; var feature = _tenantShellManager.GetCurrentTenantShellContext().Blueprint.Dependencies[localizer]; _localizationDictionary = _localizationManager.GetDictionary(feature.FeatureInfo.Id, culture); }
public IEnumerable <LocalizedString> GetAllStrings(bool includeParentCultures) { var culture = CultureInfo.CurrentUICulture; while (culture != null) { var dictionary = _localizationManager.GetDictionary(culture); foreach (var entry in dictionary.Translations.Select(t => new LocalizedString(t.Key, t.Value.FirstOrDefault()))) { yield return(entry); } if (culture == culture.Parent) { break; } culture = culture.Parent; } }