From 35fc002c0aaba9ece0b74838cf73e6f8a60e41cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=B6=9B?= Date: Fri, 26 Apr 2019 18:05:57 +0800 Subject: [PATCH] Add branding provider and improve localization --- .../BloggingTestAppBrandingProvider.cs | 18 ++++++++++++++++++ .../Volo.Blogging.Web/Pages/Blog/Index.cshtml | 4 ++-- 2 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 modules/blogging/app/Volo.BloggingTestApp/Branding/BloggingTestAppBrandingProvider.cs diff --git a/modules/blogging/app/Volo.BloggingTestApp/Branding/BloggingTestAppBrandingProvider.cs b/modules/blogging/app/Volo.BloggingTestApp/Branding/BloggingTestAppBrandingProvider.cs new file mode 100644 index 0000000000..e5a8046ff7 --- /dev/null +++ b/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 L { get; set; } + public BloggingTestAppBrandingProvider(IHtmlLocalizer localizer) + { + L = localizer; + } + public override string AppName => L["Blogs"].Value; + } +} diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Index.cshtml b/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Index.cshtml index fadaaab269..97f06b6dc0 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Index.cshtml +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Index.cshtml @@ -1,12 +1,12 @@ @page @using Volo.Blogging.Pages.Blog -@*inherits BloggingPage*@ +@inherits BloggingPage @model IndexModel @{ ViewBag.PageTitle = "Blog"; }

- Blogs + @L["Blogs"]