From e67939357cbc85685a9fe6bbcac883cc50842ac3 Mon Sep 17 00:00:00 2001 From: Alper Ebicoglu Date: Sat, 29 Sep 2018 01:24:43 +0300 Subject: [PATCH] Closes #437. Added localization resources and registered. --- .../Volo.Docs.Domain/Volo.Docs.Domain.csproj | 10 ++++++++++ .../Volo/Docs/DocsDomainModule.cs | 19 +++++++++++++++++-- .../Volo/Docs/Localization/Domain/en.json | 9 +++++++++ .../Volo/Docs/Localization/Domain/tr.json | 9 +++++++++ .../Pages/Documents/Project/Index.cshtml | 10 ++++++---- 5 files changed, 51 insertions(+), 6 deletions(-) create mode 100644 modules/docs/src/Volo.Docs.Domain/Volo/Docs/Localization/Domain/en.json create mode 100644 modules/docs/src/Volo.Docs.Domain/Volo/Docs/Localization/Domain/tr.json diff --git a/modules/docs/src/Volo.Docs.Domain/Volo.Docs.Domain.csproj b/modules/docs/src/Volo.Docs.Domain/Volo.Docs.Domain.csproj index 649378cb6b..edeb3f7d1a 100644 --- a/modules/docs/src/Volo.Docs.Domain/Volo.Docs.Domain.csproj +++ b/modules/docs/src/Volo.Docs.Domain/Volo.Docs.Domain.csproj @@ -9,6 +9,16 @@ + + + + + + + + + + diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/DocsDomainModule.cs b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/DocsDomainModule.cs index c71feb98b7..f9c170cd54 100644 --- a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/DocsDomainModule.cs +++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/DocsDomainModule.cs @@ -1,5 +1,9 @@ -using Volo.Abp.Domain; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.Domain; +using Volo.Abp.Localization; using Volo.Abp.Modularity; +using Volo.Abp.VirtualFileSystem; +using Volo.Docs.Localization; namespace Volo.Docs { @@ -9,6 +13,17 @@ namespace Volo.Docs )] public class DocsDomainModule : AbpModule { - + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.Configure(options => + { + options.FileSets.AddEmbedded(); + }); + + context.Services.Configure(options => + { + options.Resources.Get().AddVirtualJson("/Volo/Docs/Localization/Domain"); + }); + } } } diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Localization/Domain/en.json b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Localization/Domain/en.json new file mode 100644 index 0000000000..04c33312fd --- /dev/null +++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Localization/Domain/en.json @@ -0,0 +1,9 @@ +{ + "culture": "en", + "texts": { + "Documents": "Documents", + "BackToWebsite": "Back to website", + "Version": "Version" + + } +} \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Localization/Domain/tr.json b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Localization/Domain/tr.json new file mode 100644 index 0000000000..7d0124e15c --- /dev/null +++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Localization/Domain/tr.json @@ -0,0 +1,9 @@ +{ + "culture": "tr", + "texts": { + "Documents": "Dökümanlar", + "BackToWebsite": "Ana sayafaya dön", + "Version": "Versiyon" + + } +} \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml index bd6dc81b2b..ce892a4c1e 100644 --- a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml +++ b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml @@ -1,8 +1,11 @@ @page +@using Microsoft.AspNetCore.Mvc.Localization @using Volo.Abp.AspNetCore.Mvc.UI.Theming @using Volo.Docs +@using Volo.Docs.Localization @using Volo.Docs.Pages.Documents.Project @inject IThemeManager ThemeManager +@inject IHtmlLocalizer L @model IndexModel @{ ViewBag.FluidLayout = true; @@ -48,7 +51,7 @@ @Model.ProjectName
- Documents + @L["Documents"]
} @@ -57,7 +60,7 @@ { - Back to Website + @L["BackToWebsite"] } @@ -74,7 +77,6 @@
- @@ -86,7 +88,7 @@
- +