protected virtual async Task <ApplicationLocalizationConfigurationDto> GetLocalizationConfigAsync()
        {
            Logger.LogDebug("Executing AbpApplicationConfigurationAppService.GetLocalizationConfigAsync()");

            var localizationConfig = new ApplicationLocalizationConfigurationDto();

            localizationConfig.Languages.AddRange(await _languageProvider.GetLanguagesAsync());

            foreach (var resource in _localizationOptions.Resources.Values)
            {
                var dictionary = new Dictionary <string, string>();

                var localizer = _serviceProvider.GetRequiredService(
                    typeof(IStringLocalizer <>).MakeGenericType(resource.ResourceType)
                    ) as IStringLocalizer;

                foreach (var localizedString in localizer.GetAllStrings())
                {
                    dictionary[localizedString.Name] = localizedString.Value;
                }

                localizationConfig.Values[resource.ResourceName] = dictionary;
            }

            localizationConfig.CurrentCulture = GetCurrentCultureInfo();

            Logger.LogDebug("Executed AbpApplicationConfigurationAppService.GetLocalizationConfigAsync()");

            return(localizationConfig);
        }
        private ApplicationLocalizationConfigurationDto GetLocalizationConfig()
        {
            //TODO: Optimize & cache

            var localizationConfig = new ApplicationLocalizationConfigurationDto();

            foreach (var resource in _localizationOptions.Resources.Values)
            {
                var dictionary = new Dictionary <string, string>();

                var localizer = _serviceProvider.GetRequiredService(typeof(IStringLocalizer <>).MakeGenericType(resource.ResourceType)) as IStringLocalizer;

                foreach (var localizedString in localizer.GetAllStrings())
                {
                    dictionary[localizedString.Name] = localizedString.Value;
                }

                var resourceShortName = resource.ResourceType
                                        .GetCustomAttributes(true)
                                        .OfType <ShortLocalizationResourceNameAttribute>()
                                        .FirstOrDefault()?.Name ?? resource.ResourceType.FullName;

                localizationConfig.Values[resourceShortName] = dictionary;
            }

            return(localizationConfig);
        }
        protected virtual ApplicationLocalizationConfigurationDto GetLocalizationConfig()
        {
            var localizationConfig = new ApplicationLocalizationConfigurationDto();

            foreach (var resource in _localizationOptions.Resources.Values)
            {
                var dictionary = new Dictionary <string, string>();

                var localizer = _serviceProvider.GetRequiredService(typeof(IStringLocalizer <>).MakeGenericType(resource.ResourceType)) as IStringLocalizer;

                foreach (var localizedString in localizer.GetAllStrings())
                {
                    dictionary[localizedString.Name] = localizedString.Value;
                }

                var resourceName = LocalizationResourceNameAttribute.GetName(resource.ResourceType);
                localizationConfig.Values[resourceName] = dictionary;
            }

            return(localizationConfig);
        }
        protected virtual async Task <ApplicationLocalizationConfigurationDto> GetLocalizationConfigAsync()
        {
            var localizationConfig = new ApplicationLocalizationConfigurationDto();

            localizationConfig.Languages.AddRange(await _languageProvider.GetLanguagesAsync());

            foreach (var resource in _localizationOptions.Resources.Values)
            {
                var dictionary = new Dictionary <string, string>();

                var localizer = _serviceProvider.GetRequiredService(
                    typeof(IStringLocalizer <>).MakeGenericType(resource.ResourceType)
                    ) as IStringLocalizer;

                foreach (var localizedString in localizer.GetAllStrings())
                {
                    dictionary[localizedString.Name] = localizedString.Value;
                }

                localizationConfig.Values[resource.ResourceName] = dictionary;
            }

            localizationConfig.CurrentCulture = GetCurrentCultureInfo();

            if (_localizationOptions.DefaultResourceType != null)
            {
                localizationConfig.DefaultResourceName = LocalizationResourceNameAttribute.GetName(
                    _localizationOptions.DefaultResourceType
                    );
            }

            localizationConfig.LanguagesMap     = _localizationOptions.LanguagesMap;
            localizationConfig.LanguageFilesMap = _localizationOptions.LanguageFilesMap;

            return(localizationConfig);
        }