예제 #1
0
        private Dictionary <string, string> GetDisplayNameLookup(int languageId)
        {
            var allKeys = _displayNameResourceKeys.Select(x => x.Value);

            // Load all known string resources in one go.
            var resourceQuery   = _localizationService.All(languageId);
            var resourcesLookup = resourceQuery.Where(x => allKeys.Contains(x.ResourceName))
                                  .ToList()
                                  .ToDictionarySafe(x => x.ResourceName, x => x.ResourceValue);

            return(resourcesLookup);
        }
예제 #2
0
 public IDictionary <string, string> ToJson()
 {
     return(localizationService.All().ToDictionary(k => k.Key[0].ToString(CultureInfo.CurrentCulture).ToLowerInvariant() + k.Key.Substring(1), k => k.Value));
 }