Beispiel #1
0
        public virtual TDomain First(Expression <Func <TDomain, bool> > filter, string cultureCode)
        {
            var item = _genericRepository.First(filter);

            LocalizationProvider.Localize(item, cultureCode);
            return(item);
        }
Beispiel #2
0
        public Game Localize(Game game, string cultureCode)
        {
            if (game.Locals != null && game.Locals.Any())
            {
                var local = game.Locals.FirstOrDefault(x => x.Culture.Code == cultureCode) ?? game.Locals.First();
                game.Description = local.Description;

                foreach (var genre in game.Genres)
                {
                    _genreLocalizationProvider.Localize(genre, cultureCode);
                }

                foreach (var platformType in game.PlatformTypes)
                {
                    _platformTypeLocalizationProvider.Localize(platformType, cultureCode);
                }
            }

            return(game);
        }
 public string Localize(IUserPreferences userPreferences, ILocalizationKey key)
 {
     return(_localizationProvider.Localize(userPreferences, key, new Dictionary <string, object>()));
 }