コード例 #1
0
        public async Task <IActionResult> Index()
        {
            var planets = await _context.Planets.Include(i => i.Moons).ToListAsync();

            planets = _localizer.Localize <Planet>(planets).ToList();

            return(View(planets));
        }
コード例 #2
0
 public void OnGet()
 {
     Books = _dbContext.Books.ToList();
     Books = _objectLocalizer.Localize <Book>(Books).ToList();
     ViewData["Message"] = _htmlLocalizer["Html Yerelleştirme : <b>Merhaba</b><i> {0}</i>", "Ayaz Duru"];
 }
コード例 #3
0
 public static T Localize <T>(this T item, IObjectLocalizer localizer, LocalizationDepth depth = LocalizationDepth.Shallow) where T : class, ILocalizable
 {
     return(localizer.Localize(item, depth));
 }
コード例 #4
0
ファイル: Program.cs プロジェクト: mehalick/Xaki
 public void Shallow()
 {
     _localizer.Localize(_planets, "en", LocalizationDepth.Shallow).Consume(_consumer);
 }
コード例 #5
0
 public static IEnumerable <T> Localize <T>(this IEnumerable <T> items, IObjectLocalizer localizer, LocalizationDepth depth = LocalizationDepth.Shallow) where T : class, ILocalizable
 {
     return(localizer.Localize(items, depth));
 }