Fixed localization.

pull/997/head
Alper Ebicoglu 7 years ago
parent 038d6f7756
commit 16d76dc182

@ -41,7 +41,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Docs.Admin.Web", "src\
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VoloDocs.EntityFrameworkCore", "app\VoloDocs.EntityFrameworkCore\VoloDocs.EntityFrameworkCore.csproj", "{1B459653-8DAC-41CD-A08E-28D6E74265D3}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VoloDocs.Web", "app\VoloDocs\VoloDocs.Web.csproj", "{057EA924-4524-4452-840C-5E3D509F2ED3}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VoloDocs.Web", "app\VoloDocs.Web\VoloDocs.Web.csproj", "{057EA924-4524-4452-840C-5E3D509F2ED3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VoloDocs.Migrator", "app\VoloDocs.Migrator\VoloDocs.Migrator.csproj", "{8A5E5001-C017-44A8-ADDA-DC66C102556E}"
EndProject

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

@ -0,0 +1,9 @@
{
"culture": "tr",
"texts": {
"WelcomeVoloDocs": "VoloDocs Hoşgeldiniz!",
"NoProjectWarning": "Henüz bir proje yok!",
"CreateYourFirstProject": "İlk projenizi oluşturmak için tıklayın",
"NoProject": "Proje yok!"
}
}

File diff suppressed because one or more lines are too long

@ -1,11 +1,11 @@
@page
@model Volo.Docs.Pages.ErrorModel
@model VoloDocs.Web.Pages.ErrorModel
@{
<div class="text-center">
<pre>
@Model.ErrorMessage
</pre>
<a href="/" class="btn btn-outline-primary">Home Page</a>
</div>
}

@ -8,7 +8,7 @@ using Microsoft.Extensions.Logging;
using Volo.Abp.AspNetCore.Mvc.UI.RazorPages;
using Volo.Abp.Domain.Entities;
namespace Volo.Docs.Pages
namespace VoloDocs.Web.Pages
{
public class ErrorModel : AbpPageModel
{
@ -16,40 +16,48 @@ namespace Volo.Docs.Pages
public async Task<ActionResult> OnGetAsync(string statusCode)
{
if (!int.TryParse(statusCode, out var errorStatusCode))
try
{
errorStatusCode = (int)HttpStatusCode.BadRequest;
}
if (!int.TryParse(statusCode, out var errorStatusCode))
{
errorStatusCode = (int)HttpStatusCode.BadRequest;
}
var statusFeature = HttpContext.Features.Get<IStatusCodeReExecuteFeature>();
if (statusFeature != null)
{
Logger.LogWarning("Handled {0} error for URL: {1}", statusCode, statusFeature.OriginalPath);
}
var statusFeature = HttpContext.Features.Get<IStatusCodeReExecuteFeature>();
if (statusFeature != null)
{
Logger.LogWarning("Handled {0} error for URL: {1}", statusCode, statusFeature.OriginalPath);
}
var exceptionHandlerPathFeature = HttpContext.Features.Get<IExceptionHandlerPathFeature>();
if (exceptionHandlerPathFeature != null)
{
var exception = exceptionHandlerPathFeature.Error;
var path = exceptionHandlerPathFeature.Path;
var exceptionHandlerPathFeature = HttpContext.Features.Get<IExceptionHandlerPathFeature>();
if (exceptionHandlerPathFeature != null)
{
var exception = exceptionHandlerPathFeature.Error;
var path = exceptionHandlerPathFeature.Path;
if (exception is EntityNotFoundException)
{
ErrorMessage = exception.Message;
return Page();
}
}
if (exception is EntityNotFoundException)
var isValidStatusCode = Enum.IsDefined(typeof(HttpStatusCode), errorStatusCode);
if (!isValidStatusCode)
{
ErrorMessage = exception.Message;
return Page();
errorStatusCode = (int)HttpStatusCode.BadRequest;
}
}
var isValidStatusCode = Enum.IsDefined(typeof(HttpStatusCode), errorStatusCode);
if (!isValidStatusCode)
ErrorMessage = _errorMessages.ContainsKey(errorStatusCode)
? _errorMessages[errorStatusCode]
: "Looks like something went wrong!";
}
catch (Exception e)
{
errorStatusCode = (int)HttpStatusCode.BadRequest;
Logger.LogError("Error on error page: " + e);
}
ErrorMessage = _errorMessages.ContainsKey(errorStatusCode)
? _errorMessages[errorStatusCode]
: "Looks like something went wrong!";
return Page();
}

@ -5,7 +5,7 @@
@using Volo.Docs.Localization
@using Volo.Docs.Pages.Documents
@model Volo.Docs.Pages.IndexModel
@model VoloDocs.Web.Pages.IndexModel
@inject IHtmlLocalizer<DocsResource> L
@section styles {

@ -3,9 +3,10 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Volo.Abp.Users;
using Volo.Docs;
using Volo.Docs.Projects;
namespace Volo.Docs.Pages
namespace VoloDocs.Web.Pages
{
public class IndexModel : PageModel
{

@ -2,14 +2,10 @@
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<UserSecretsId>b5e1445f-a53c-4d4b-9539-061359f52fcf</UserSecretsId>
<RootNamespace>Volo.Docs</RootNamespace>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
</PropertyGroup>
<ItemGroup>
<Compile Remove="Logs\**" />
<None Remove="Logs\**" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Localization\Resources\VoloDocs\Web\en.json" />

@ -112,7 +112,7 @@ namespace Volo.Docs
Configure<VirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<VoloDocsWebModule>();
options.FileSets.AddEmbedded<VoloDocsWebModule>("VoloDocs.Web");
});
Configure<AbpLocalizationOptions>(options =>

@ -0,0 +1 @@
dotnet clean && dotnet build && dotnet publish -c Release -o "C:\Publishes\VoloDocs.Web"

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save