コード例 #1
0
ファイル: BasicService.cs プロジェクト: PeterIntel/GameStore
        public virtual TDomain First(Expression <Func <TDomain, bool> > filter, string cultureCode)
        {
            var item = _genericRepository.First(filter);

            LocalizationProvider.Localize(item, cultureCode);
            return(item);
        }
コード例 #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);
        }
コード例 #3
0
 public string Localize(IUserPreferences userPreferences, ILocalizationKey key)
 {
     return(_localizationProvider.Localize(userPreferences, key, new Dictionary <string, object>()));
 }