Browse Source

Add branding provider and improve localization

pull/1063/head
杨涛 7 years ago
parent
commit
35fc002c0a
  1. 18
      modules/blogging/app/Volo.BloggingTestApp/Branding/BloggingTestAppBrandingProvider.cs
  2. 4
      modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Index.cshtml

18
modules/blogging/app/Volo.BloggingTestApp/Branding/BloggingTestAppBrandingProvider.cs

@ -0,0 +1,18 @@
using Microsoft.AspNetCore.Mvc.Localization;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Components;
using Volo.Abp.DependencyInjection;
using Volo.Blogging.Localization;
namespace Volo.BloggingTestApp.Branding
{
[Dependency(ReplaceServices = true)]
public class BloggingTestAppBrandingProvider : DefaultBrandingProvider
{
public IHtmlLocalizer<BloggingResource> L { get; set; }
public BloggingTestAppBrandingProvider(IHtmlLocalizer<BloggingResource> localizer)
{
L = localizer;
}
public override string AppName => L["Blogs"].Value;
}
}

4
modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Index.cshtml

@ -1,12 +1,12 @@
@page @page
@using Volo.Blogging.Pages.Blog @using Volo.Blogging.Pages.Blog
@*inherits BloggingPage*@ @inherits BloggingPage
@model IndexModel @model IndexModel
@{ @{
ViewBag.PageTitle = "Blog"; ViewBag.PageTitle = "Blog";
} }
<h2> <h2>
Blogs @L["Blogs"]
</h2> </h2>
<ul> <ul>

Loading…
Cancel
Save