Used IHtmlLocalizer in the view.

pull/179/head
Halil İbrahim Kalkan 7 years ago
parent 21914f50cc
commit fefae25f7f

@ -56,7 +56,7 @@ namespace AbpDesk.Web.Mvc
//services.Configure<RemoteServiceOptions>(configuration); //Needed when we use Volo.Abp.Identity.HttpApi.Client
services.AddMvc();
services.AddMvc().AddViewLocalization(); //TODO: Move to AbpAspNetCoreMvcModule!
services.AddAssemblyOf<AbpDeskWebMvcModule>();

@ -1,6 +1,6 @@
@using Microsoft.Extensions.Localization
@using Microsoft.AspNetCore.Mvc.Localization
@using Volo.Abp.Identity.Web.Areas.Identity.Localization.Resource
@inject IStringLocalizer<IdentityResource> Localizer
@inject IHtmlLocalizer<IdentityResource> L
@section styles {
<!-- TODO: Use minified on production, normal in development -->
<link rel="stylesheet" type="text/css" href="~/modules/identity/libs/datatables/datatables.css" />
@ -15,12 +15,12 @@
<div class="row">
<div class="col-md-6">
<h2>@Localizer["Users"]</h2>
<h2>@L["Users"]</h2>
</div>
<div class="col-md-6 text-right">
<!-- Button trigger modal -->
<button type="button" class="btn btn-primary create-user" data-toggle="modal">
@Localizer["CreateUser"]
@L["CreateUser"]
</button>
</div>
</div>
@ -28,10 +28,10 @@
<table id="IdentityUsersTable" class="table table-striped table-bordered table-hover nowrap">
<thead>
<tr>
<th>@Localizer["Actions"]</th>
<th>@Localizer["UserName"]</th>
<th>@Localizer["EmailAddress"]</th>
<th>@Localizer["PhoneNumber"]</th>
<th>@L["Actions"]</th>
<th>@L["UserName"]</th>
<th>@L["EmailAddress"]</th>
<th>@L["PhoneNumber"]</th>
</tr>
</thead>
</table>

@ -164,19 +164,20 @@ $.fn.serializeFormToObject = function () {
var currentLanguage = 'English'; //TODO: Get from current culture!
$.extend(true, $.fn.dataTable.defaults, {
language: {
url: '/modules/identity/libs/datatables/localizations/' + currentLanguage + '.json'
},
lengthMenu: [5, 10, 25, 50, 100, 250, 500],
pageLength: 10,
paging: true,
serverSide: true,
processing: true,
responsive: true,
pagingType: "bootstrap_full_number",
dom: 'rt<"bottom"ilp><"clear">',
order: []
});
//TODO: This does not work!
//$.extend(true, $.fn.dataTable.defaults, {
// language: {
// url: '/modules/identity/libs/datatables/localizations/' + currentLanguage + '.json'
// },
// lengthMenu: [5, 10, 25, 50, 100, 250, 500],
// pageLength: 10,
// paging: true,
// serverSide: true,
// processing: true,
// responsive: true,
// pagingType: "bootstrap_full_number",
// dom: 'rt<"bottom"ilp><"clear">',
// order: []
//});
})(jQuery);
Loading…
Cancel
Save