Пример #1
0
        /// <summary>
        /// Gets all string resources including those for parent cultures.
        /// </summary>
        /// <param name="htmlLocalizer">The <see cref="IHtmlLocalizer"/>.</param>
        /// <returns>The string resources.</returns>
        public static IEnumerable <LocalizedString> GetAllStrings(this IHtmlLocalizer htmlLocalizer)
        {
            if (htmlLocalizer == null)
            {
                throw new ArgumentNullException(nameof(htmlLocalizer));
            }

            return(htmlLocalizer.GetAllStrings(includeParentCultures: true));
        }
 /// <inheritdoc />
 public IEnumerable <LocalizedString> GetAllStrings(bool includeParentCultures)
 {
     return(_htmlLocalizer.GetAllStrings(includeParentCultures));
 }
Пример #3
0
 /// <inheritdoc />
 public virtual IEnumerable <LocalizedString> GetAllStrings(bool includeParentCultures) =>
 _localizer.GetAllStrings(includeParentCultures);
Пример #4
0
 /// <inheritdoc />
 public IEnumerable <LocalizedString> GetAllStrings(bool includeAncestorCultures) =>
 _localizer.GetAllStrings(includeAncestorCultures);
Пример #5
0
 public static string GetAllStringsFromLocalizerToJson(IHtmlLocalizer htmlLocalizer)
 {
     return(htmlLocalizer.GetAllStrings()
            .ToDictionary(kv => kv.Name, kv => kv.Value)
            .ToCamelCasedJson());
 }