From 5db1ff62a3d7ba2ab3b3895841c67f49f100fefc Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Tue, 28 May 2019 09:56:38 +0300 Subject: [PATCH 001/166] Potential bugfix in RemoveProjectFromSolutionStep --- .../Building/Steps/RemoveProjectFromSolutionStep.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/RemoveProjectFromSolutionStep.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/RemoveProjectFromSolutionStep.cs index fe5057709d..325999cfc1 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/RemoveProjectFromSolutionStep.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/RemoveProjectFromSolutionStep.cs @@ -10,6 +10,8 @@ namespace Volo.Abp.Cli.ProjectBuilding.Building.Steps private readonly string _solutionFilePath; private readonly string _projectFolderPath; + private string ProjectNameWithQuotes => $"\"{_projectName}\""; + public RemoveProjectFromSolutionStep( string projectName, string solutionFilePath = null, @@ -59,7 +61,7 @@ namespace Volo.Abp.Cli.ProjectBuilding.Building.Steps { foreach (var solutionFileLine in solutionFileLines) { - if (solutionFileLine.Contains(_projectName)) + if (solutionFileLine.Contains(ProjectNameWithQuotes)) { var curlyBracketStartIndex = solutionFileLine.LastIndexOf("{", StringComparison.OrdinalIgnoreCase); var curlyBracketEndIndex = solutionFileLine.LastIndexOf("}", StringComparison.OrdinalIgnoreCase); From 3c7adc8493edcf29fe31895fc30a5d61a7e70a36 Mon Sep 17 00:00:00 2001 From: Halil ibrahim Kalkan Date: Tue, 28 May 2019 12:59:53 +0300 Subject: [PATCH 002/166] Inherit AbpMvcJsonContractResolver from CamelCasePropertyNamesContractResolver. --- .../Volo/Abp/AspNetCore/Mvc/Json/AbpMvcJsonContractResolver.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Json/AbpMvcJsonContractResolver.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Json/AbpMvcJsonContractResolver.cs index 55174481a0..a0cec5e117 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Json/AbpMvcJsonContractResolver.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Json/AbpMvcJsonContractResolver.cs @@ -9,9 +9,10 @@ using Volo.Abp.Timing; namespace Volo.Abp.AspNetCore.Mvc.Json { - public class AbpMvcJsonContractResolver : DefaultContractResolver + public class AbpMvcJsonContractResolver : CamelCasePropertyNamesContractResolver { private readonly Lazy _dateTimeConverter; + public AbpMvcJsonContractResolver(IServiceCollection services) { _dateTimeConverter = services.GetServiceLazy(); From 2c9f6509a319dc714b4f79fddfabff89e6e770b9 Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Tue, 28 May 2019 13:01:49 +0300 Subject: [PATCH 003/166] Update ProjectBuilder.cs --- .../Volo/Abp/Cli/ProjectBuilding/ProjectBuilder.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/ProjectBuilder.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/ProjectBuilder.cs index 0b66ea375d..64aa02ee6e 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/ProjectBuilder.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/ProjectBuilder.cs @@ -1,7 +1,6 @@ using System; using System.Threading.Tasks; using Volo.Abp.Cli.ProjectBuilding.Building; -using Volo.Abp.Cli.Utils; using Volo.Abp.DependencyInjection; namespace Volo.Abp.Cli.ProjectBuilding From d94dc72f7a8200d751079b1746ca5d2ae4641e67 Mon Sep 17 00:00:00 2001 From: Xeevis Date: Tue, 28 May 2019 23:12:36 +0200 Subject: [PATCH 004/166] Remove unused possibly duplicate localization key --- .../Localization/Resources/AbpAccount/Web/en.json | 1 - .../Localization/Resources/AbpAccount/Web/pt-BR.json | 1 - .../Localization/Resources/AbpAccount/Web/tr.json | 1 - .../Localization/Resources/AbpAccount/Web/zh-Hans.json | 1 - 4 files changed, 4 deletions(-) diff --git a/modules/account/src/Volo.Abp.Account.Web/Localization/Resources/AbpAccount/Web/en.json b/modules/account/src/Volo.Abp.Account.Web/Localization/Resources/AbpAccount/Web/en.json index 1055309b22..892e60f89e 100644 --- a/modules/account/src/Volo.Abp.Account.Web/Localization/Resources/AbpAccount/Web/en.json +++ b/modules/account/src/Volo.Abp.Account.Web/Localization/Resources/AbpAccount/Web/en.json @@ -14,7 +14,6 @@ "Login": "Login", "Cancel": "Cancel", "Register": "Register", - "UseAnotherServiceToLogIn.": "Use another service to log in.", "InvalidLoginRequest": "Invalid login request", "ThereAreNoLoginSchemesConfiguredForThisClient": "There are no login schemes configured for this client.", "LogInUsingYourProviderAccount": "Log in using your {0} account" diff --git a/modules/account/src/Volo.Abp.Account.Web/Localization/Resources/AbpAccount/Web/pt-BR.json b/modules/account/src/Volo.Abp.Account.Web/Localization/Resources/AbpAccount/Web/pt-BR.json index fec54c0476..0513d99afd 100644 --- a/modules/account/src/Volo.Abp.Account.Web/Localization/Resources/AbpAccount/Web/pt-BR.json +++ b/modules/account/src/Volo.Abp.Account.Web/Localization/Resources/AbpAccount/Web/pt-BR.json @@ -14,7 +14,6 @@ "Login": "Entrar", "Cancel": "Cancelar", "Register": "Registrar-se", - "UseAnotherServiceToLogIn.": "Use outro serviço para entrar.", "InvalidLoginRequest": "Requisição de acesso inválida!", "ThereAreNoLoginSchemesConfiguredForThisClient": "Não existe um esquema de acesso para este usuário", "LogInUsingYourProviderAccount": "Acessse utilizando sua conta {0}" diff --git a/modules/account/src/Volo.Abp.Account.Web/Localization/Resources/AbpAccount/Web/tr.json b/modules/account/src/Volo.Abp.Account.Web/Localization/Resources/AbpAccount/Web/tr.json index dfc1c9486a..3b78c3a55d 100644 --- a/modules/account/src/Volo.Abp.Account.Web/Localization/Resources/AbpAccount/Web/tr.json +++ b/modules/account/src/Volo.Abp.Account.Web/Localization/Resources/AbpAccount/Web/tr.json @@ -14,7 +14,6 @@ "Login": "Giriş yap", "Cancel": "İptal", "Register": "Kayıt ol", - "UseAnotherServiceToLogIn.": "Başka bir servisle giriş yap.", "InvalidLoginRequest": "Başarısız giriş isteği", "ThereAreNoLoginSchemesConfiguredForThisClient": "Bu client için konfigüre edilmiş giriş şeması bulunamadı.", "LogInUsingYourProviderAccount": "{0} hesabınızla giriş yapın." diff --git a/modules/account/src/Volo.Abp.Account.Web/Localization/Resources/AbpAccount/Web/zh-Hans.json b/modules/account/src/Volo.Abp.Account.Web/Localization/Resources/AbpAccount/Web/zh-Hans.json index 01e0b6b57d..6aee740de6 100644 --- a/modules/account/src/Volo.Abp.Account.Web/Localization/Resources/AbpAccount/Web/zh-Hans.json +++ b/modules/account/src/Volo.Abp.Account.Web/Localization/Resources/AbpAccount/Web/zh-Hans.json @@ -14,7 +14,6 @@ "Login": "登录", "Cancel": "取消", "Register": "注册", - "UseAnotherServiceToLogIn.": "使用其他服务登录.", "InvalidLoginRequest": "登录请求无效", "ThereAreNoLoginSchemesConfiguredForThisClient": "没有为此客户端配置登录方案.", "LogInUsingYourProviderAccount": "使用你的{0}帐户登录" From 748b0567e2957f84ea5608d64d758801180eb81c Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Wed, 29 May 2019 10:02:17 +0300 Subject: [PATCH 005/166] abp update command for CLI resolves https://github.com/abpframework/abp/issues/1112 --- .../Volo/Abp/Cli/AbpCliCoreModule.cs | 1 + .../Volo/Abp/Cli/Commands/UpdateCommand.cs | 93 +++++++++++++++++++ .../VoloPackagesVersionUpdater.cs | 76 +++++++++++++++ 3 files changed, 170 insertions(+) create mode 100644 framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/UpdateCommand.cs create mode 100644 framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/VoloPackagesVersionUpdater.cs diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/AbpCliCoreModule.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/AbpCliCoreModule.cs index c1894b2e6b..eb22185b73 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/AbpCliCoreModule.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/AbpCliCoreModule.cs @@ -22,6 +22,7 @@ namespace Volo.Abp.Cli { options.Commands["help"] = typeof(HelpCommand); options.Commands["new"] = typeof(NewCommand); + options.Commands["update"] = typeof(UpdateCommand); options.Commands["add-package"] = typeof(AddPackageCommand); options.Commands["add-module"] = typeof(AddModuleCommand); options.Commands["login"] = typeof(LoginCommand); diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/UpdateCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/UpdateCommand.cs new file mode 100644 index 0000000000..b046c908e3 --- /dev/null +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/UpdateCommand.cs @@ -0,0 +1,93 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Net.Http; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Logging.Abstractions; +using Newtonsoft.Json; +using Volo.Abp.Cli.Args; +using Volo.Abp.Cli.ProjectBuilding.Github; +using Volo.Abp.Cli.ProjectModification; +using Volo.Abp.DependencyInjection; + +namespace Volo.Abp.Cli.Commands +{ + public class UpdateCommand : IConsoleCommand, ITransientDependency + { + public ILogger Logger { get; set; } + + private readonly VoloPackagesVersionUpdater _packagesVersionUpdater; + + public UpdateCommand(VoloPackagesVersionUpdater packagesVersionUpdater) + { + _packagesVersionUpdater = packagesVersionUpdater; + + Logger = NullLogger.Instance; + } + + public async Task ExecuteAsync(CommandLineArgs commandLineArgs) + { + var includePreviews = commandLineArgs.Options.GetOrNull(Options.IncludePreviews.Short, Options.IncludePreviews.Long) != null; + + var solution = Directory.GetFiles(Directory.GetCurrentDirectory(), "*.sln").FirstOrDefault(); + + if (solution != null) + { + var version = await GetLatestAbpVersion(includePreviews); + var solutionName = Path.GetFileName(solution).RemovePostFix(".sln"); + + _packagesVersionUpdater.UpdateSolution(solution, version); + + Logger.LogInformation($"Volo packages are updated to {version} in {solutionName} solution."); + return; + } + + var project = Directory.GetFiles(Directory.GetCurrentDirectory(), "*.csproj").FirstOrDefault(); + + if (project != null) + { + var version = await GetLatestAbpVersion(includePreviews); + var projectName = Path.GetFileName(project).RemovePostFix(".csproj"); + + _packagesVersionUpdater.UpdateProject(project, version); + + Logger.LogInformation($"Volo packages are updated to {version} in {projectName} project."); + return; + } + + Logger.LogError("No solution or project found in this directory."); + } + + protected virtual async Task GetLatestAbpVersion(bool includePreviews) + { + var url = "https://api.github.com/repos/abpframework/abp/releases"; + + using (var client = new HttpClient()) + { + client.Timeout = TimeSpan.FromMinutes(30); + client.DefaultRequestHeaders.UserAgent.ParseAdd("MyAgent/1.0"); + var result = await client.GetStringAsync(url); + + var releases = JsonConvert.DeserializeObject>(result); + + if (!includePreviews) + { + releases.RemoveAll(v => v.IsPrerelease); + } + + return releases.First().Name.RemovePreFix("v"); + } + } + + public static class Options + { + public static class IncludePreviews + { + public const string Short = "p"; + public const string Long = "include-previews"; + } + } + } +} diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/VoloPackagesVersionUpdater.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/VoloPackagesVersionUpdater.cs new file mode 100644 index 0000000000..e97a901879 --- /dev/null +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/VoloPackagesVersionUpdater.cs @@ -0,0 +1,76 @@ +using System; +using System.IO; +using System.Text; +using Volo.Abp.DependencyInjection; + +namespace Volo.Abp.Cli.ProjectModification +{ + public class VoloPackagesVersionUpdater : ITransientDependency + { + public void UpdateSolution(string solutionPath, string newVersion) + { + var projectPaths = ProjectFinder.GetProjectFiles(solutionPath); + + foreach (var filePath in projectPaths) + { + UpdateInternal(filePath, newVersion); + } + } + + public void UpdateProject(string projectPath, string newVersion) + { + UpdateInternal(projectPath, newVersion); + } + + protected virtual void UpdateInternal(string projectPath, string newVersion) + { + var fileContent = File.ReadAllText(projectPath); + + var content = new StringBuilder(); + var index = 0; + + while (index >= 0) + { + fileContent = fileContent.Substring(index); + content.Append(ReplaceAPackage(fileContent, newVersion, out index)); + } + + File.WriteAllText(projectPath, content.ToString()); + } + + private string ReplaceAPackage(string content, string version, out int index) + { + var packageReferenceStartText = "nclude=\"Volo."; + var returningText = new StringBuilder(); + + var indexOfPackageReference = content.IndexOf(packageReferenceStartText, StringComparison.Ordinal); + + if (indexOfPackageReference < 0) + { + index = -1; + return content; + } + + returningText.Append(content.Substring(0, indexOfPackageReference + packageReferenceStartText.Length)); + content = content.Substring(indexOfPackageReference + packageReferenceStartText.Length); + + var indexAfterQuote = content.IndexOf("\"", StringComparison.Ordinal) + 1; + + returningText.Append(content.Substring(0, indexAfterQuote)); + content = content.Substring(indexAfterQuote); + + var indexAfterSecondQuote = content.IndexOf("\"", StringComparison.Ordinal) + 1; + + returningText.Append(content.Substring(0, indexAfterSecondQuote)); + content = content.Substring(indexAfterSecondQuote); + + var indexOfThirdQuote = content.IndexOf("\"", StringComparison.Ordinal); + + returningText.Append(version); + + index = indexOfPackageReference + packageReferenceStartText.Length + indexAfterQuote + indexAfterSecondQuote + indexOfThirdQuote; + + return returningText.ToString(); + } + } +} From 42f24d1391c3b1d06be0e010ae7c3b68d575041e Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Wed, 29 May 2019 10:08:47 +0300 Subject: [PATCH 006/166] BookStore: Upgraded abp version using CLi https://github.com/abpframework/abp/issues/1112 --- .../Acme.BookStore.Application.csproj | 10 +++++----- .../Acme.BookStore.Domain.csproj | 16 ++++++++-------- ...ore.EntityFrameworkCore.DbMigrations.csproj | 3 ++- .../Acme.BookStore.EntityFrameworkCore.csproj | 18 +++++++++--------- .../Acme.BookStore.Web.csproj | 14 +++++++------- 5 files changed, 31 insertions(+), 30 deletions(-) diff --git a/samples/BookStore/src/Acme.BookStore.Application/Acme.BookStore.Application.csproj b/samples/BookStore/src/Acme.BookStore.Application/Acme.BookStore.Application.csproj index 9926530966..d7983e8b87 100644 --- a/samples/BookStore/src/Acme.BookStore.Application/Acme.BookStore.Application.csproj +++ b/samples/BookStore/src/Acme.BookStore.Application/Acme.BookStore.Application.csproj @@ -1,4 +1,4 @@ - + @@ -9,10 +9,10 @@ - - - - + + + + diff --git a/samples/BookStore/src/Acme.BookStore.Domain/Acme.BookStore.Domain.csproj b/samples/BookStore/src/Acme.BookStore.Domain/Acme.BookStore.Domain.csproj index c358910b01..4c0984d3b9 100644 --- a/samples/BookStore/src/Acme.BookStore.Domain/Acme.BookStore.Domain.csproj +++ b/samples/BookStore/src/Acme.BookStore.Domain/Acme.BookStore.Domain.csproj @@ -1,4 +1,4 @@ - + @@ -8,13 +8,13 @@ - - - - - - - + + + + + + + diff --git a/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Acme.BookStore.EntityFrameworkCore.DbMigrations.csproj b/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Acme.BookStore.EntityFrameworkCore.DbMigrations.csproj index da6638173c..d4c691c4e8 100644 --- a/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Acme.BookStore.EntityFrameworkCore.DbMigrations.csproj +++ b/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Acme.BookStore.EntityFrameworkCore.DbMigrations.csproj @@ -1,4 +1,4 @@ - + @@ -9,6 +9,7 @@ + diff --git a/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Acme.BookStore.EntityFrameworkCore.csproj b/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Acme.BookStore.EntityFrameworkCore.csproj index c42ea44516..e65e2d5d89 100644 --- a/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Acme.BookStore.EntityFrameworkCore.csproj +++ b/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Acme.BookStore.EntityFrameworkCore.csproj @@ -1,4 +1,4 @@ - + @@ -9,14 +9,14 @@ - - - - - - - - + + + + + + + + diff --git a/samples/BookStore/src/Acme.BookStore.Web/Acme.BookStore.Web.csproj b/samples/BookStore/src/Acme.BookStore.Web/Acme.BookStore.Web.csproj index 46616b452a..7509a9c9bb 100644 --- a/samples/BookStore/src/Acme.BookStore.Web/Acme.BookStore.Web.csproj +++ b/samples/BookStore/src/Acme.BookStore.Web/Acme.BookStore.Web.csproj @@ -1,4 +1,4 @@ - + @@ -36,12 +36,12 @@ - - - - - - + + + + + + From 33aebc9ebcc97c446435c60f0974a5912120cf5a Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Wed, 29 May 2019 11:48:46 +0300 Subject: [PATCH 007/166] update command refactor https://github.com/abpframework/abp/issues/1112 --- .../Volo/Abp/Cli/Commands/UpdateCommand.cs | 35 +++---------------- .../VoloPackagesVersionUpdater.cs | 25 +++++++++---- 2 files changed, 22 insertions(+), 38 deletions(-) diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/UpdateCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/UpdateCommand.cs index b046c908e3..2a3259b4c9 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/UpdateCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/UpdateCommand.cs @@ -1,14 +1,10 @@ using System; -using System.Collections.Generic; using System.IO; using System.Linq; -using System.Net.Http; using System.Threading.Tasks; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; -using Newtonsoft.Json; using Volo.Abp.Cli.Args; -using Volo.Abp.Cli.ProjectBuilding.Github; using Volo.Abp.Cli.ProjectModification; using Volo.Abp.DependencyInjection; @@ -35,12 +31,11 @@ namespace Volo.Abp.Cli.Commands if (solution != null) { - var version = await GetLatestAbpVersion(includePreviews); var solutionName = Path.GetFileName(solution).RemovePostFix(".sln"); - _packagesVersionUpdater.UpdateSolution(solution, version); + _packagesVersionUpdater.UpdateSolution(solution, includePreviews); - Logger.LogInformation($"Volo packages are updated to {version} in {solutionName} solution."); + Logger.LogInformation($"Volo packages are updated in {solutionName} solution."); return; } @@ -48,39 +43,17 @@ namespace Volo.Abp.Cli.Commands if (project != null) { - var version = await GetLatestAbpVersion(includePreviews); var projectName = Path.GetFileName(project).RemovePostFix(".csproj"); - _packagesVersionUpdater.UpdateProject(project, version); + _packagesVersionUpdater.UpdateProject(project, includePreviews); - Logger.LogInformation($"Volo packages are updated to {version} in {projectName} project."); + Logger.LogInformation($"Volo packages are updated in {projectName} project."); return; } Logger.LogError("No solution or project found in this directory."); } - protected virtual async Task GetLatestAbpVersion(bool includePreviews) - { - var url = "https://api.github.com/repos/abpframework/abp/releases"; - - using (var client = new HttpClient()) - { - client.Timeout = TimeSpan.FromMinutes(30); - client.DefaultRequestHeaders.UserAgent.ParseAdd("MyAgent/1.0"); - var result = await client.GetStringAsync(url); - - var releases = JsonConvert.DeserializeObject>(result); - - if (!includePreviews) - { - releases.RemoveAll(v => v.IsPrerelease); - } - - return releases.First().Name.RemovePreFix("v"); - } - } - public static class Options { public static class IncludePreviews diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/VoloPackagesVersionUpdater.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/VoloPackagesVersionUpdater.cs index e97a901879..8e0be8f1a1 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/VoloPackagesVersionUpdater.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/VoloPackagesVersionUpdater.cs @@ -1,28 +1,36 @@ using System; using System.IO; using System.Text; +using Volo.Abp.Cli.NuGet; using Volo.Abp.DependencyInjection; namespace Volo.Abp.Cli.ProjectModification { public class VoloPackagesVersionUpdater : ITransientDependency { - public void UpdateSolution(string solutionPath, string newVersion) + private readonly NuGetService _nuGetService; + + public VoloPackagesVersionUpdater(NuGetService nuGetService) + { + _nuGetService = nuGetService; + } + + public void UpdateSolution(string solutionPath, bool includePreviews) { var projectPaths = ProjectFinder.GetProjectFiles(solutionPath); foreach (var filePath in projectPaths) { - UpdateInternal(filePath, newVersion); + UpdateInternal(filePath, includePreviews); } } - public void UpdateProject(string projectPath, string newVersion) + public void UpdateProject(string projectPath, bool includePreviews) { - UpdateInternal(projectPath, newVersion); + UpdateInternal(projectPath, includePreviews); } - protected virtual void UpdateInternal(string projectPath, string newVersion) + protected virtual void UpdateInternal(string projectPath, bool includePreviews) { var fileContent = File.ReadAllText(projectPath); @@ -32,13 +40,13 @@ namespace Volo.Abp.Cli.ProjectModification while (index >= 0) { fileContent = fileContent.Substring(index); - content.Append(ReplaceAPackage(fileContent, newVersion, out index)); + content.Append(ReplaceAPackage(fileContent, includePreviews, out index)); } File.WriteAllText(projectPath, content.ToString()); } - private string ReplaceAPackage(string content, string version, out int index) + private string ReplaceAPackage(string content, bool includePreviews, out int index) { var packageReferenceStartText = "nclude=\"Volo."; var returningText = new StringBuilder(); @@ -56,6 +64,8 @@ namespace Volo.Abp.Cli.ProjectModification var indexAfterQuote = content.IndexOf("\"", StringComparison.Ordinal) + 1; + var packageId = "Volo." + content.Substring(indexAfterQuote - 1); + returningText.Append(content.Substring(0, indexAfterQuote)); content = content.Substring(indexAfterQuote); @@ -66,6 +76,7 @@ namespace Volo.Abp.Cli.ProjectModification var indexOfThirdQuote = content.IndexOf("\"", StringComparison.Ordinal); + var version = _nuGetService.GetLatestVersionOrNullAsync(packageId, includePreviews); returningText.Append(version); index = indexOfPackageReference + packageReferenceStartText.Length + indexAfterQuote + indexAfterSecondQuote + indexOfThirdQuote; From e4ea2a0f0a1e2798056bd937317cd059592c852e Mon Sep 17 00:00:00 2001 From: Marcelo Mohr Maciel Date: Wed, 29 May 2019 06:26:08 -0300 Subject: [PATCH 008/166] Updating PT-BR translation Updating PT-BR translation --- .../Volo.Abp.UI.Navigation/Volo.Abp.UI.Navigation.csproj | 4 ++++ .../Abp/Ui/Navigation/Localization/Resource/pt-BR.json | 6 ++++++ .../Volo/Abp/Emailing/Localization/pt-BR.json | 6 ++++++ .../Localization/TestResources/Base/CountryNames/en.json | 2 +- .../Localization/Resources/VoloDocs/Web/pt-BR.json | 9 +++++++++ modules/docs/app/VoloDocs.Web/VoloDocs.Web.csproj | 4 ++++ .../Localization/Resources/Docs/Web/pt-BR.json | 3 ++- .../Volo/Docs/Localization/Domain/pt-BR.json | 4 ++-- .../Localization/Resources/FeatureManagement/pt-BR.json | 2 +- .../Resources/AbpPermissionManagement/pt-BR.json | 4 +++- .../Localization/ApplicationContracts/pt-BR.json | 1 + .../MyProjectNameWebUnifiedModule.cs | 2 +- .../MyProjectName/ApplicationContracts/pt-BR.json | 6 ++++++ ...ompanyName.MyProjectName.Application.Contracts.csproj | 4 ++++ .../Localization/MyProjectName/DomainShared/pt-BR.json | 6 ++++++ .../MyCompanyName.MyProjectName.Domain.Shared.csproj | 4 ++++ .../Localization/MyProjectName/Web/pt-BR.json | 6 ++++++ 17 files changed, 66 insertions(+), 7 deletions(-) create mode 100644 framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Localization/Resource/pt-BR.json create mode 100644 framework/test/Volo.Abp.Emailing.Tests/Volo/Abp/Emailing/Localization/pt-BR.json create mode 100644 modules/docs/app/VoloDocs.Web/Localization/Resources/VoloDocs/Web/pt-BR.json create mode 100644 templates/mvc-module/src/MyCompanyName.MyProjectName.Application.Contracts/Localization/MyProjectName/ApplicationContracts/pt-BR.json create mode 100644 templates/mvc-module/src/MyCompanyName.MyProjectName.Domain.Shared/Localization/MyProjectName/DomainShared/pt-BR.json create mode 100644 templates/mvc-module/src/MyCompanyName.MyProjectName.Web/Localization/MyProjectName/Web/pt-BR.json diff --git a/framework/src/Volo.Abp.UI.Navigation/Volo.Abp.UI.Navigation.csproj b/framework/src/Volo.Abp.UI.Navigation/Volo.Abp.UI.Navigation.csproj index c218698017..c8265cf189 100644 --- a/framework/src/Volo.Abp.UI.Navigation/Volo.Abp.UI.Navigation.csproj +++ b/framework/src/Volo.Abp.UI.Navigation/Volo.Abp.UI.Navigation.csproj @@ -18,6 +18,10 @@ + + + + diff --git a/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Localization/Resource/pt-BR.json b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Localization/Resource/pt-BR.json new file mode 100644 index 0000000000..d8eacbc96d --- /dev/null +++ b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Localization/Resource/pt-BR.json @@ -0,0 +1,6 @@ +{ + "culture": "pt-BR", + "texts": { + "Menu:Administration": "Administração" + } +} \ No newline at end of file diff --git a/framework/test/Volo.Abp.Emailing.Tests/Volo/Abp/Emailing/Localization/pt-BR.json b/framework/test/Volo.Abp.Emailing.Tests/Volo/Abp/Emailing/Localization/pt-BR.json new file mode 100644 index 0000000000..0e33dee138 --- /dev/null +++ b/framework/test/Volo.Abp.Emailing.Tests/Volo/Abp/Emailing/Localization/pt-BR.json @@ -0,0 +1,6 @@ +{ + "culture": "pt-BR", + "texts": { + "hello": "Olá" + } +} \ No newline at end of file diff --git a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/CountryNames/en.json b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/CountryNames/en.json index ead8fc2af8..9bc0f26698 100644 --- a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/CountryNames/en.json +++ b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/CountryNames/en.json @@ -2,6 +2,6 @@ "culture": "en", "texts": { "USA": "United States of America", - "Brazil": "Brasil" + "Brazil": "Brazil" } } \ No newline at end of file diff --git a/modules/docs/app/VoloDocs.Web/Localization/Resources/VoloDocs/Web/pt-BR.json b/modules/docs/app/VoloDocs.Web/Localization/Resources/VoloDocs/Web/pt-BR.json new file mode 100644 index 0000000000..cdd8a651ce --- /dev/null +++ b/modules/docs/app/VoloDocs.Web/Localization/Resources/VoloDocs/Web/pt-BR.json @@ -0,0 +1,9 @@ +{ + "culture": "pt-BR", + "texts": { + "WelcomeVoloDocs": "Bem vindo ao VoloDocs!", + "NoProjectWarning": "Ainda não existe um projeto definido!", + "CreateYourFirstProject": "Clique aqui para iniciar seu primeiro projeto", + "NoProject": "Sem projeto!" + } +} \ No newline at end of file diff --git a/modules/docs/app/VoloDocs.Web/VoloDocs.Web.csproj b/modules/docs/app/VoloDocs.Web/VoloDocs.Web.csproj index 83d7ffd457..82fd5b8cc2 100644 --- a/modules/docs/app/VoloDocs.Web/VoloDocs.Web.csproj +++ b/modules/docs/app/VoloDocs.Web/VoloDocs.Web.csproj @@ -12,6 +12,10 @@ + + + + diff --git a/modules/docs/src/Volo.Docs.Admin.Web/Localization/Resources/Docs/Web/pt-BR.json b/modules/docs/src/Volo.Docs.Admin.Web/Localization/Resources/Docs/Web/pt-BR.json index b1a723d8b4..f77d799651 100644 --- a/modules/docs/src/Volo.Docs.Admin.Web/Localization/Resources/Docs/Web/pt-BR.json +++ b/modules/docs/src/Volo.Docs.Admin.Web/Localization/Resources/Docs/Web/pt-BR.json @@ -21,6 +21,7 @@ "DisplayName:MainWebsiteUrl": "URL do site principal", "DisplayName:LatestVersionBranchName": "Nome do branch da última versão", "DisplayName:GitHubRootUrl": "URL raíz do GitHub", - "DisplayName:GitHubAccessToken": "Token de acesso do GitHub" + "DisplayName:GitHubAccessToken": "Token de acesso do GitHub", + "DisplayName:GitHubUserAgent": "Usuário agente do GitHub" } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Localization/Domain/pt-BR.json b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Localization/Domain/pt-BR.json index 05a642010c..38fa49de3d 100644 --- a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Localization/Domain/pt-BR.json +++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Localization/Domain/pt-BR.json @@ -4,7 +4,7 @@ "Documents": "Documentos", "BackToWebsite": "Voltar para o site", "Contributors": "Contribuidores", - "ShareOn": "Compartilhar em:", + "ShareOn": "Compartilhar em", "Version": "Versão", "Edit": "Editar", "Delete": "Excluir", @@ -12,7 +12,7 @@ "GoToTop": "Ir pra o topo", "Projects": "Projeto(s)", "NoProjectWarning": "Ainda não há projetos!", - "DocumentNotFound": "Oops, o documento solicitado foi encontrado", + "DocumentNotFound": "Oops, o documento solicitado não foi encontrado", "NavigationDocumentNotFound": "Esta versão não possui um documento de navegação!" } } \ No newline at end of file diff --git a/modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Localization/Resources/FeatureManagement/pt-BR.json b/modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Localization/Resources/FeatureManagement/pt-BR.json index 6d746df04c..caaacd6fd4 100644 --- a/modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Localization/Resources/FeatureManagement/pt-BR.json +++ b/modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Localization/Resources/FeatureManagement/pt-BR.json @@ -1,6 +1,6 @@ { "culture": "pt-BR", "texts": { - + "Features": "Funcionalidades" } } \ No newline at end of file diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Localization/Resources/AbpPermissionManagement/pt-BR.json b/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Localization/Resources/AbpPermissionManagement/pt-BR.json index 93adef2871..ac1a771466 100644 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Localization/Resources/AbpPermissionManagement/pt-BR.json +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Localization/Resources/AbpPermissionManagement/pt-BR.json @@ -3,6 +3,8 @@ "texts": { "Permissions": "Permissões", "OnlyProviderPermissons": "Apenas este provedor", - "All": "Todos" + "All": "Todos", + "SelectAllInAllTabs": "Conceder todas as permissões", + "SelectAllInThisTab": "Selecionar todos" } } \ No newline at end of file diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Application.Contracts/Volo/Abp/TenantManagement/Localization/ApplicationContracts/pt-BR.json b/modules/tenant-management/src/Volo.Abp.TenantManagement.Application.Contracts/Volo/Abp/TenantManagement/Localization/ApplicationContracts/pt-BR.json index bf461ab29e..6631be849a 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Application.Contracts/Volo/Abp/TenantManagement/Localization/ApplicationContracts/pt-BR.json +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Application.Contracts/Volo/Abp/TenantManagement/Localization/ApplicationContracts/pt-BR.json @@ -5,6 +5,7 @@ "Permission:Create": "Criar", "Permission:Edit": "Editar", "Permission:Delete": "Excluir", + "Permission:ManageConnectionStrings": "Gerenciar conexões (connection strings)", "Permission:ManageFeatures": "Gerenciar Funcionalidades" } } \ No newline at end of file diff --git a/templates/mvc-module/host/MyCompanyName.MyProjectName.Web.Unified/MyProjectNameWebUnifiedModule.cs b/templates/mvc-module/host/MyCompanyName.MyProjectName.Web.Unified/MyProjectNameWebUnifiedModule.cs index afe103d632..16782ca821 100644 --- a/templates/mvc-module/host/MyCompanyName.MyProjectName.Web.Unified/MyProjectNameWebUnifiedModule.cs +++ b/templates/mvc-module/host/MyCompanyName.MyProjectName.Web.Unified/MyProjectNameWebUnifiedModule.cs @@ -87,7 +87,7 @@ namespace MyCompanyName.MyProjectName Configure(options => { options.Languages.Add(new LanguageInfo("en", "en", "English")); - options.Languages.Add(new LanguageInfo("pt-BR", "pt-BR", "Portuguese (Brazilian)")); + options.Languages.Add(new LanguageInfo("pt-BR", "pt-BR", "Português (Brasil)")); options.Languages.Add(new LanguageInfo("tr", "tr", "Türkçe")); options.Languages.Add(new LanguageInfo("zh-Hans", "zh-Hans", "Chinese")); }); diff --git a/templates/mvc-module/src/MyCompanyName.MyProjectName.Application.Contracts/Localization/MyProjectName/ApplicationContracts/pt-BR.json b/templates/mvc-module/src/MyCompanyName.MyProjectName.Application.Contracts/Localization/MyProjectName/ApplicationContracts/pt-BR.json new file mode 100644 index 0000000000..958055dcd5 --- /dev/null +++ b/templates/mvc-module/src/MyCompanyName.MyProjectName.Application.Contracts/Localization/MyProjectName/ApplicationContracts/pt-BR.json @@ -0,0 +1,6 @@ +{ + "culture": "pt-BR", + "texts": { + "Permission:MyProjectName": "MyProjectName" + } +} \ No newline at end of file diff --git a/templates/mvc-module/src/MyCompanyName.MyProjectName.Application.Contracts/MyCompanyName.MyProjectName.Application.Contracts.csproj b/templates/mvc-module/src/MyCompanyName.MyProjectName.Application.Contracts/MyCompanyName.MyProjectName.Application.Contracts.csproj index 6b7caa489c..995cd46be4 100644 --- a/templates/mvc-module/src/MyCompanyName.MyProjectName.Application.Contracts/MyCompanyName.MyProjectName.Application.Contracts.csproj +++ b/templates/mvc-module/src/MyCompanyName.MyProjectName.Application.Contracts/MyCompanyName.MyProjectName.Application.Contracts.csproj @@ -20,4 +20,8 @@ + + + + diff --git a/templates/mvc-module/src/MyCompanyName.MyProjectName.Domain.Shared/Localization/MyProjectName/DomainShared/pt-BR.json b/templates/mvc-module/src/MyCompanyName.MyProjectName.Domain.Shared/Localization/MyProjectName/DomainShared/pt-BR.json new file mode 100644 index 0000000000..6d746df04c --- /dev/null +++ b/templates/mvc-module/src/MyCompanyName.MyProjectName.Domain.Shared/Localization/MyProjectName/DomainShared/pt-BR.json @@ -0,0 +1,6 @@ +{ + "culture": "pt-BR", + "texts": { + + } +} \ No newline at end of file diff --git a/templates/mvc-module/src/MyCompanyName.MyProjectName.Domain.Shared/MyCompanyName.MyProjectName.Domain.Shared.csproj b/templates/mvc-module/src/MyCompanyName.MyProjectName.Domain.Shared/MyCompanyName.MyProjectName.Domain.Shared.csproj index e5698774eb..b923aa0d8b 100644 --- a/templates/mvc-module/src/MyCompanyName.MyProjectName.Domain.Shared/MyCompanyName.MyProjectName.Domain.Shared.csproj +++ b/templates/mvc-module/src/MyCompanyName.MyProjectName.Domain.Shared/MyCompanyName.MyProjectName.Domain.Shared.csproj @@ -16,4 +16,8 @@ + + + + diff --git a/templates/mvc-module/src/MyCompanyName.MyProjectName.Web/Localization/MyProjectName/Web/pt-BR.json b/templates/mvc-module/src/MyCompanyName.MyProjectName.Web/Localization/MyProjectName/Web/pt-BR.json new file mode 100644 index 0000000000..6d746df04c --- /dev/null +++ b/templates/mvc-module/src/MyCompanyName.MyProjectName.Web/Localization/MyProjectName/Web/pt-BR.json @@ -0,0 +1,6 @@ +{ + "culture": "pt-BR", + "texts": { + + } +} \ No newline at end of file From d0d1b9ae759ef7a462b8da072368b80d3258b2ce Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Wed, 29 May 2019 13:08:03 +0300 Subject: [PATCH 009/166] fix csproj files https://github.com/abpframework/abp/pull/1172 --- .../src/Volo.Abp.UI.Navigation/Volo.Abp.UI.Navigation.csproj | 4 ---- modules/docs/app/VoloDocs.Web/VoloDocs.Web.csproj | 4 ---- .../MyCompanyName.MyProjectName.Application.Contracts.csproj | 4 ---- .../MyCompanyName.MyProjectName.Domain.Shared.csproj | 4 ---- 4 files changed, 16 deletions(-) diff --git a/framework/src/Volo.Abp.UI.Navigation/Volo.Abp.UI.Navigation.csproj b/framework/src/Volo.Abp.UI.Navigation/Volo.Abp.UI.Navigation.csproj index c8265cf189..c218698017 100644 --- a/framework/src/Volo.Abp.UI.Navigation/Volo.Abp.UI.Navigation.csproj +++ b/framework/src/Volo.Abp.UI.Navigation/Volo.Abp.UI.Navigation.csproj @@ -18,10 +18,6 @@ - - - - diff --git a/modules/docs/app/VoloDocs.Web/VoloDocs.Web.csproj b/modules/docs/app/VoloDocs.Web/VoloDocs.Web.csproj index 82fd5b8cc2..83d7ffd457 100644 --- a/modules/docs/app/VoloDocs.Web/VoloDocs.Web.csproj +++ b/modules/docs/app/VoloDocs.Web/VoloDocs.Web.csproj @@ -12,10 +12,6 @@ - - - - diff --git a/templates/mvc-module/src/MyCompanyName.MyProjectName.Application.Contracts/MyCompanyName.MyProjectName.Application.Contracts.csproj b/templates/mvc-module/src/MyCompanyName.MyProjectName.Application.Contracts/MyCompanyName.MyProjectName.Application.Contracts.csproj index 995cd46be4..6b7caa489c 100644 --- a/templates/mvc-module/src/MyCompanyName.MyProjectName.Application.Contracts/MyCompanyName.MyProjectName.Application.Contracts.csproj +++ b/templates/mvc-module/src/MyCompanyName.MyProjectName.Application.Contracts/MyCompanyName.MyProjectName.Application.Contracts.csproj @@ -20,8 +20,4 @@ - - - - diff --git a/templates/mvc-module/src/MyCompanyName.MyProjectName.Domain.Shared/MyCompanyName.MyProjectName.Domain.Shared.csproj b/templates/mvc-module/src/MyCompanyName.MyProjectName.Domain.Shared/MyCompanyName.MyProjectName.Domain.Shared.csproj index b923aa0d8b..e5698774eb 100644 --- a/templates/mvc-module/src/MyCompanyName.MyProjectName.Domain.Shared/MyCompanyName.MyProjectName.Domain.Shared.csproj +++ b/templates/mvc-module/src/MyCompanyName.MyProjectName.Domain.Shared/MyCompanyName.MyProjectName.Domain.Shared.csproj @@ -16,8 +16,4 @@ - - - - From c3224d87f1125ed2dc43d2d5b7ada1c601c19734 Mon Sep 17 00:00:00 2001 From: Halil ibrahim Kalkan Date: Wed, 29 May 2019 13:21:07 +0300 Subject: [PATCH 010/166] Remove unnecessary none includes. --- .../MyCompanyName.MyProjectName.IdentityServer.csproj | 5 ----- 1 file changed, 5 deletions(-) diff --git a/templates/mvc/src/MyCompanyName.MyProjectName.IdentityServer/MyCompanyName.MyProjectName.IdentityServer.csproj b/templates/mvc/src/MyCompanyName.MyProjectName.IdentityServer/MyCompanyName.MyProjectName.IdentityServer.csproj index 26947c4d19..bf8e4e46c0 100644 --- a/templates/mvc/src/MyCompanyName.MyProjectName.IdentityServer/MyCompanyName.MyProjectName.IdentityServer.csproj +++ b/templates/mvc/src/MyCompanyName.MyProjectName.IdentityServer/MyCompanyName.MyProjectName.IdentityServer.csproj @@ -14,11 +14,6 @@ - - - - - From 41479cb9a7439f0ddbfbb374fa2a507aea085ee2 Mon Sep 17 00:00:00 2001 From: Halil ibrahim Kalkan Date: Wed, 29 May 2019 13:21:16 +0300 Subject: [PATCH 011/166] Fix AbpMvcJsonContractResolver --- .../Abp/AspNetCore/Mvc/Json/AbpMvcJsonContractResolver.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Json/AbpMvcJsonContractResolver.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Json/AbpMvcJsonContractResolver.cs index a0cec5e117..695212f563 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Json/AbpMvcJsonContractResolver.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Json/AbpMvcJsonContractResolver.cs @@ -9,13 +9,15 @@ using Volo.Abp.Timing; namespace Volo.Abp.AspNetCore.Mvc.Json { - public class AbpMvcJsonContractResolver : CamelCasePropertyNamesContractResolver + public class AbpMvcJsonContractResolver : DefaultContractResolver { private readonly Lazy _dateTimeConverter; public AbpMvcJsonContractResolver(IServiceCollection services) { _dateTimeConverter = services.GetServiceLazy(); + + NamingStrategy = new CamelCaseNamingStrategy(); } protected override JsonProperty CreateProperty(MemberInfo member, MemberSerialization memberSerialization) From b55d87eb3b19873f04205349b566ae30fdb8c14b Mon Sep 17 00:00:00 2001 From: Halil ibrahim Kalkan Date: Wed, 29 May 2019 14:04:18 +0300 Subject: [PATCH 012/166] Add FeaturesController --- .../FeatureManagement/IFeatureAppService.cs | 5 +--- .../FeatureManagement/FeaturesController.cs | 28 +++++++++++++++++++ 2 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 modules/feature-management/src/Volo.Abp.FeatureManagement.HttpApi/Volo/Abp/FeatureManagement/FeaturesController.cs diff --git a/modules/feature-management/src/Volo.Abp.FeatureManagement.Application.Contracts/Volo/Abp/FeatureManagement/IFeatureAppService.cs b/modules/feature-management/src/Volo.Abp.FeatureManagement.Application.Contracts/Volo/Abp/FeatureManagement/IFeatureAppService.cs index a30b2397fa..2c337f1b2a 100644 --- a/modules/feature-management/src/Volo.Abp.FeatureManagement.Application.Contracts/Volo/Abp/FeatureManagement/IFeatureAppService.cs +++ b/modules/feature-management/src/Volo.Abp.FeatureManagement.Application.Contracts/Volo/Abp/FeatureManagement/IFeatureAppService.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Threading.Tasks; +using System.Threading.Tasks; using JetBrains.Annotations; using Volo.Abp.Application.Services; diff --git a/modules/feature-management/src/Volo.Abp.FeatureManagement.HttpApi/Volo/Abp/FeatureManagement/FeaturesController.cs b/modules/feature-management/src/Volo.Abp.FeatureManagement.HttpApi/Volo/Abp/FeatureManagement/FeaturesController.cs new file mode 100644 index 0000000000..ea0bfd16ee --- /dev/null +++ b/modules/feature-management/src/Volo.Abp.FeatureManagement.HttpApi/Volo/Abp/FeatureManagement/FeaturesController.cs @@ -0,0 +1,28 @@ +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; +using Volo.Abp.AspNetCore.Mvc; + +namespace Volo.Abp.FeatureManagement +{ + [RemoteService] + [Area("abp")] + public class FeaturesController : AbpController, IFeatureAppService + { + private readonly IFeatureAppService _featureAppService; + + public FeaturesController(IFeatureAppService featureAppService) + { + _featureAppService = featureAppService; + } + + public Task GetAsync(string providerName, string providerKey) + { + return _featureAppService.GetAsync(providerName, providerKey); + } + + public Task UpdateAsync(string providerName, string providerKey, UpdateFeaturesDto input) + { + return _featureAppService.UpdateAsync(providerName, providerKey, input); + } + } +} \ No newline at end of file From c6d95ecad5de959bc5809094f6e48cb4ddc0415a Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Wed, 29 May 2019 16:04:13 +0300 Subject: [PATCH 013/166] Create languageConfig.json --- docs/languageConfig.json | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 docs/languageConfig.json diff --git a/docs/languageConfig.json b/docs/languageConfig.json new file mode 100644 index 0000000000..41d51d55bc --- /dev/null +++ b/docs/languageConfig.json @@ -0,0 +1,14 @@ +{ +"Languages":[ + { + "DisplayName" : "English", + "Code" : "en", + "IsDefault": true + }, + { + "DisplayName" : "Chinese", + "Code" : "zh-Hans", + "IsDefault": false + } +] +} \ No newline at end of file From 40604a40d65e72a06540494080f90bc30cbbd692 Mon Sep 17 00:00:00 2001 From: Xeevis Date: Wed, 29 May 2019 15:50:33 +0200 Subject: [PATCH 014/166] Initial Czech localization support --- .../Mvc/UI/MultiTenancy/Localization/cs.json | 11 ++++ .../Resources/AbpValidation/cs.json | 20 ++++++++ .../Navigation/Localization/Resource/cs.json | 6 +++ .../Localization/Resources/AbpUi/cs.json | 51 +++++++++++++++++++ .../Mvc/Localization/Resource/cs.json | 7 +++ .../Volo/Abp/Emailing/Localization/cs.json | 6 +++ .../TestResources/Base/CountryNames/cs.json | 7 +++ .../TestResources/Base/Validation/cs.json | 7 +++ .../Localization/TestResources/Source/cs.json | 11 ++++ .../TestResources/SourceExt/cs.json | 6 +++ .../Resources/AbpAccount/Web/cs.json | 21 ++++++++ .../BloggingTestAppModule.cs | 9 +++- .../Blogging/ApplicationContracts/cs.json | 14 +++++ .../Volo.Blogging.Web/BloggingWebModule.cs | 1 + .../Resources/Blogging/Web/cs.json | 47 +++++++++++++++++ .../Resources/VoloDocs/Web/cs.json | 9 ++++ .../app/VoloDocs.Web/VoloDocsWebModule.cs | 2 +- .../Docs/ApplicationContracts/cs.json | 10 ++++ .../Localization/Resources/Docs/Web/cs.json | 27 ++++++++++ .../Volo/Docs/Localization/Domain/cs.json | 18 +++++++ .../Localization/ApplicationContracts/cs.json | 6 +++ .../Localization/Domain/cs.json | 6 +++ .../Resources/FeatureManagement/cs.json | 6 +++ .../Localization/ApplicationContracts/cs.json | 14 +++++ .../Abp/Identity/Localization/Domain/cs.json | 33 ++++++++++++ .../Resources/AbpIdentity/cs.json | 39 ++++++++++++++ .../Resources/AbpPermissionManagement/cs.json | 10 ++++ .../Resources/AbpSettingManagement/cs.json | 6 +++ .../Localization/ApplicationContracts/cs.json | 11 ++++ .../Resources/AbpTenantManagement/Web/cs.json | 14 +++++ .../Localization/BookStore/cs.json | 20 ++++++++ .../Acme.BookStore.Web/BookStoreWebModule.cs | 1 + .../Localization/DashboardDemo/cs.json | 10 ++++ .../DashboardDemoWebModule.cs | 1 + .../Localization/ApplicationContracts/cs.json | 10 ++++ .../Localization/Domain/cs.json | 6 +++ .../Resources/ProductManagement/cs.json | 16 ++++++ .../MyProjectNameHttpApiHostModule.cs | 1 + .../MyProjectNameIdentityServerModule.cs | 1 + .../MyProjectNameWebUnifiedModule.cs | 1 + .../ApplicationContracts/cs.json | 6 +++ .../MyProjectName/DomainShared/cs.json | 6 +++ .../Localization/MyProjectName/Web/cs.json | 6 +++ .../Localization/MyProjectName/cs.json | 8 +++ .../MyProjectNameHttpApiHostModule.cs | 1 + .../MyProjectNameIdentityServerModule.cs | 1 + .../MyProjectNameWebModule.cs | 1 + 47 files changed, 529 insertions(+), 2 deletions(-) create mode 100644 framework/src/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy/Volo/Abp/AspNetCore/Mvc/UI/MultiTenancy/Localization/cs.json create mode 100644 framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpValidation/cs.json create mode 100644 framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Localization/Resource/cs.json create mode 100644 framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/cs.json create mode 100644 framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Localization/Resource/cs.json create mode 100644 framework/test/Volo.Abp.Emailing.Tests/Volo/Abp/Emailing/Localization/cs.json create mode 100644 framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/CountryNames/cs.json create mode 100644 framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/Validation/cs.json create mode 100644 framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Source/cs.json create mode 100644 framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/SourceExt/cs.json create mode 100644 modules/account/src/Volo.Abp.Account.Web/Localization/Resources/AbpAccount/Web/cs.json create mode 100644 modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Localization/Resources/Blogging/ApplicationContracts/cs.json create mode 100644 modules/blogging/src/Volo.Blogging.Web/Localization/Resources/Blogging/Web/cs.json create mode 100644 modules/docs/app/VoloDocs.Web/Localization/Resources/VoloDocs/Web/cs.json create mode 100644 modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/cs.json create mode 100644 modules/docs/src/Volo.Docs.Admin.Web/Localization/Resources/Docs/Web/cs.json create mode 100644 modules/docs/src/Volo.Docs.Domain/Volo/Docs/Localization/Domain/cs.json create mode 100644 modules/feature-management/src/Volo.Abp.FeatureManagement.Application.Contracts/Volo/Abp/FeatureManagement/Localization/ApplicationContracts/cs.json create mode 100644 modules/feature-management/src/Volo.Abp.FeatureManagement.Domain/Volo/Abp/FeatureManagement/Localization/Domain/cs.json create mode 100644 modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Localization/Resources/FeatureManagement/cs.json create mode 100644 modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/Localization/ApplicationContracts/cs.json create mode 100644 modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/Localization/Domain/cs.json create mode 100644 modules/identity/src/Volo.Abp.Identity.Web/Localization/Resources/AbpIdentity/cs.json create mode 100644 modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Localization/Resources/AbpPermissionManagement/cs.json create mode 100644 modules/setting-management/src/Volo.Abp.SettingManagement.Web/Localization/Resources/AbpSettingManagement/cs.json create mode 100644 modules/tenant-management/src/Volo.Abp.TenantManagement.Application.Contracts/Volo/Abp/TenantManagement/Localization/ApplicationContracts/cs.json create mode 100644 modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Localization/Resources/AbpTenantManagement/Web/cs.json create mode 100644 samples/BookStore/src/Acme.BookStore.Domain/Localization/BookStore/cs.json create mode 100644 samples/DashboardDemo/src/DashboardDemo.Domain/Localization/DashboardDemo/cs.json create mode 100644 samples/MicroserviceDemo/modules/product/src/ProductManagement.Application.Contracts/ProductManagement/Localization/ApplicationContracts/cs.json create mode 100644 samples/MicroserviceDemo/modules/product/src/ProductManagement.Domain/ProductManagement/Localization/Domain/cs.json create mode 100644 samples/MicroserviceDemo/modules/product/src/ProductManagement.Web/Localization/Resources/ProductManagement/cs.json create mode 100644 templates/mvc-module/src/MyCompanyName.MyProjectName.Application.Contracts/Localization/MyProjectName/ApplicationContracts/cs.json create mode 100644 templates/mvc-module/src/MyCompanyName.MyProjectName.Domain.Shared/Localization/MyProjectName/DomainShared/cs.json create mode 100644 templates/mvc-module/src/MyCompanyName.MyProjectName.Web/Localization/MyProjectName/Web/cs.json create mode 100644 templates/mvc/src/MyCompanyName.MyProjectName.Domain.Shared/Localization/MyProjectName/cs.json diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy/Volo/Abp/AspNetCore/Mvc/UI/MultiTenancy/Localization/cs.json b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy/Volo/Abp/AspNetCore/Mvc/UI/MultiTenancy/Localization/cs.json new file mode 100644 index 0000000000..480c223775 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy/Volo/Abp/AspNetCore/Mvc/UI/MultiTenancy/Localization/cs.json @@ -0,0 +1,11 @@ +{ + "culture": "cs", + "texts": { + "GivenTenantIsNotAvailable": "Given tenant is not available: {0}", + "Tenant": "Tenant", + "Switch": "switch", + "Name": "Name", + "SwitchTenantHint": "Leave the name field blank to switch to the host side.", + "NotSelected": "Not selected" + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpValidation/cs.json b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpValidation/cs.json new file mode 100644 index 0000000000..d4894c950a --- /dev/null +++ b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpValidation/cs.json @@ -0,0 +1,20 @@ +{ + "culture": "cs", + "texts": { + "'{0}' and '{1}' do not match.": "'{0}' and '{1}' do not match.", + "The {0} field is not a valid credit card number.": "The {0} field is not a valid credit card number.", + "{0} is not valid.": "{0} is not valid.", + "The {0} field is not a valid e-mail address.": "The {0} field is not a valid e-mail address.", + "The {0} field only accepts files with the following extensions: {1}": "The {0} field only accepts files with the following extensions: {1}", + "The field {0} must be a string or array type with a maximum length of '{1}'.": "The field {0} must be a string or array type with a maximum length of '{1}'.", + "The field {0} must be a string or array type with a minimum length of '{1}'.": "The field {0} must be a string or array type with a minimum length of '{1}'.", + "The {0} field is not a valid phone number.": "The {0} field is not a valid phone number.", + "The field {0} must be between {1} and {2}.": "The field {0} must be between {1} and {2}.", + "The field {0} must match the regular expression '{1}'.": "The field {0} must match the regular expression '{1}'.", + "The {0} field is required.": "The {0} field is required.", + "The field {0} must be a string with a maximum length of {1}.": "The field {0} must be a string with a maximum length of {1}.", + "The field {0} must be a string with a minimum length of {2} and a maximum length of {1}.": "The field {0} must be a string with a minimum length of {2} and a maximum length of {1}.", + "The {0} field is not a valid fully-qualified http, https, or ftp URL.": "The {0} field is not a valid fully-qualified http, https, or ftp URL.", + "The field {0} is invalid.": "The field {0} is invalid." + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Localization/Resource/cs.json b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Localization/Resource/cs.json new file mode 100644 index 0000000000..1f11b0da7b --- /dev/null +++ b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Localization/Resource/cs.json @@ -0,0 +1,6 @@ +{ + "culture": "cs", + "texts": { + "Menu:Administration": "Administration" + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/cs.json b/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/cs.json new file mode 100644 index 0000000000..4e0e6f3750 --- /dev/null +++ b/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/cs.json @@ -0,0 +1,51 @@ +{ + "culture": "cs", + "texts": { + "InternalServerErrorMessage": "An internal error occurred during your request!", + "ValidationErrorMessage": "Your request is not valid!", + "ValidationNarrativeErrorMessageTitle": "The following errors were detected during validation.", + "DefaultErrorMessage": "An error has been occurred!", + "DefaultErrorMessageDetail": "Error detail not sent by server.", + "DefaultErrorMessage401": "You are not authenticated!", + "DefaultErrorMessage401Detail": "You should sign in to perform this operation.", + "DefaultErrorMessage403": "You are not authorized!", + "DefaultErrorMessage403Detail": "You are not allowed to perform this operation!", + "DefaultErrorMessage404": "Resource not found!", + "DefaultErrorMessage404Detail": "The resource requested could not found on the server!", + "EntityNotFoundErrorMessage": "There is no entity {0} with id = {1}!", + "Error": "Error", + "AreYouSure": "Are you sure?", + "Cancel": "Cancel", + "Yes": "Yes", + "No": "No", + "Close": "Close", + "Save": "Save", + "SavingWithThreeDot": "Saving...", + "Actions": "Actions", + "Delete": "Delete", + "Edit": "Edit", + "Refresh": "Refresh", + "ProcessingWithThreeDot": "Processing...", + "LoadingWithThreeDot": "Loading...", + "Welcome": "Welcome", + "Login": "Login", + "Register": "Register", + "Logout": "Log out", + "Submit": "Submit", + "Back": "Back", + "PagerSearch": "Search", + "PagerNext": "Next", + "PagerPrevious": "Previous", + "PagerFirst": "First", + "PagerLast": "Last", + "PagerInfo": "Showing _START_ to _END_ of _TOTAL_ entries", + "PagerInfoEmpty": "Showing 0 to 0 of 0 entries", + "PagerInfoFiltered": "(filtered from _MAX_ total entries)", + "NoDataAvailableInDatatable": "No data available in table", + "PagerShowMenuEntries": "Show _MENU_ entries", + "DatatableActionDropdownDefaultText": "Actions", + "ChangePassword": "Change password", + "PersonalInfo": "My profile", + "AreYouSureYouWantToCancelEditingWarningMessage": "You have unsaved changes." + } +} \ No newline at end of file diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Localization/Resource/cs.json b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Localization/Resource/cs.json new file mode 100644 index 0000000000..b83d4baa34 --- /dev/null +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Localization/Resource/cs.json @@ -0,0 +1,7 @@ +{ + "culture": "cs", + "texts": { + "BirthDate": "Birth date", + "Value1": "Value One" + } +} \ No newline at end of file diff --git a/framework/test/Volo.Abp.Emailing.Tests/Volo/Abp/Emailing/Localization/cs.json b/framework/test/Volo.Abp.Emailing.Tests/Volo/Abp/Emailing/Localization/cs.json new file mode 100644 index 0000000000..b03a2b3fb1 --- /dev/null +++ b/framework/test/Volo.Abp.Emailing.Tests/Volo/Abp/Emailing/Localization/cs.json @@ -0,0 +1,6 @@ +{ + "culture": "cs", + "texts": { + "hello": "hello" + } +} \ No newline at end of file diff --git a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/CountryNames/cs.json b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/CountryNames/cs.json new file mode 100644 index 0000000000..a065183f92 --- /dev/null +++ b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/CountryNames/cs.json @@ -0,0 +1,7 @@ +{ + "culture": "cs", + "texts": { + "USA": "United States of America", + "Brazil": "Brazil" + } +} \ No newline at end of file diff --git a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/Validation/cs.json b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/Validation/cs.json new file mode 100644 index 0000000000..174f957923 --- /dev/null +++ b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/Validation/cs.json @@ -0,0 +1,7 @@ +{ + "culture": "cs", + "texts": { + "ThisFieldIsRequired": "This field is required", + "MaxLenghtErrorMessage": "This field can be maximum of '{0}' chars" + } +} \ No newline at end of file diff --git a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Source/cs.json b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Source/cs.json new file mode 100644 index 0000000000..44f745a285 --- /dev/null +++ b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Source/cs.json @@ -0,0 +1,11 @@ +{ + "culture": "cs", + "texts": { + "Hello {0}.": "Hello {0}.", + "Car": "Car", + "CarPlural": "Cars", + "MaxLenghtErrorMessage": "This field's length can be maximum of '{0}' chars", + "Universe": "Universe", + "FortyTwo": "Forty Two" + } +} \ No newline at end of file diff --git a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/SourceExt/cs.json b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/SourceExt/cs.json new file mode 100644 index 0000000000..40c51d6732 --- /dev/null +++ b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/SourceExt/cs.json @@ -0,0 +1,6 @@ +{ + "culture": "cs", + "texts": { + "SeeYou": "See you" + } +} \ No newline at end of file diff --git a/modules/account/src/Volo.Abp.Account.Web/Localization/Resources/AbpAccount/Web/cs.json b/modules/account/src/Volo.Abp.Account.Web/Localization/Resources/AbpAccount/Web/cs.json new file mode 100644 index 0000000000..e943f6c180 --- /dev/null +++ b/modules/account/src/Volo.Abp.Account.Web/Localization/Resources/AbpAccount/Web/cs.json @@ -0,0 +1,21 @@ +{ + "culture": "cs", + "texts": { + "UserName": "User name", + "EmailAddress": "Email address", + "UserNameOrEmailAddress": "User name or email address", + "Password": "Password", + "RememberMe": "Remember me", + "UseAnotherServiceToLogin": "Use another service to log in", + "UserLockedOutMessage": "The user account has been locked out due to invalid login attempts. Please wait a while and try again.", + "InvalidUserNameOrPassword": "Invalid username or password!", + "LoginIsNotAllowed": "You are not allowed to login! You need to confirm your email/phone number.", + "SelfRegistrationDisabledMessage": "Self user registration is disabled for this application. Contact to the application administrator to register a new user.", + "Login": "Login", + "Cancel": "Cancel", + "Register": "Register", + "InvalidLoginRequest": "Invalid login request", + "ThereAreNoLoginSchemesConfiguredForThisClient": "There are no login schemes configured for this client.", + "LogInUsingYourProviderAccount": "Log in using your {0} account" + } +} \ No newline at end of file diff --git a/modules/blogging/app/Volo.BloggingTestApp/BloggingTestAppModule.cs b/modules/blogging/app/Volo.BloggingTestApp/BloggingTestAppModule.cs index 84ed5d1910..1bbc4a93a3 100644 --- a/modules/blogging/app/Volo.BloggingTestApp/BloggingTestAppModule.cs +++ b/modules/blogging/app/Volo.BloggingTestApp/BloggingTestAppModule.cs @@ -98,7 +98,14 @@ namespace Volo.BloggingTestApp options.CustomSchemaIds(type => type.FullName); }); - var cultures = new List { new CultureInfo("en"), new CultureInfo("tr"),new CultureInfo("zh-Hans") }; + var cultures = new List + { + new CultureInfo("cs"), + new CultureInfo("en"), + new CultureInfo("tr"), + new CultureInfo("zh-Hans") + }; + Configure(options => { options.DefaultRequestCulture = new RequestCulture("en"); diff --git a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Localization/Resources/Blogging/ApplicationContracts/cs.json b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Localization/Resources/Blogging/ApplicationContracts/cs.json new file mode 100644 index 0000000000..0a73a11da6 --- /dev/null +++ b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Localization/Resources/Blogging/ApplicationContracts/cs.json @@ -0,0 +1,14 @@ +{ + "culture": "cs", + "texts": { + "Permission:Blogging": "Blog", + "Permission:Blogs": "Blogs", + "Permission:Posts": "Posts", + "Permission:Tags": "Tags", + "Permission:Comments": "Comments", + "Permission:Management": "Management", + "Permission:Edit": "Edit", + "Permission:Create": "Create", + "Permission:Delete": "Delete" + } +} \ No newline at end of file diff --git a/modules/blogging/src/Volo.Blogging.Web/BloggingWebModule.cs b/modules/blogging/src/Volo.Blogging.Web/BloggingWebModule.cs index 20678ddc37..550bf059f5 100644 --- a/modules/blogging/src/Volo.Blogging.Web/BloggingWebModule.cs +++ b/modules/blogging/src/Volo.Blogging.Web/BloggingWebModule.cs @@ -45,6 +45,7 @@ namespace Volo.Blogging Configure(options => { + options.Languages.Add(new LanguageInfo("cs", "cs", "Čeština")); options.Languages.Add(new LanguageInfo("en", "en", "English")); options.Languages.Add(new LanguageInfo("tr", "tr", "Türkçe")); options.Languages.Add(new LanguageInfo("zh-Hans", "zh-Hans", "简体中文")); diff --git a/modules/blogging/src/Volo.Blogging.Web/Localization/Resources/Blogging/Web/cs.json b/modules/blogging/src/Volo.Blogging.Web/Localization/Resources/Blogging/Web/cs.json new file mode 100644 index 0000000000..b942faea05 --- /dev/null +++ b/modules/blogging/src/Volo.Blogging.Web/Localization/Resources/Blogging/Web/cs.json @@ -0,0 +1,47 @@ +{ + "culture": "cs", + "texts": { + "Menu:Blogs": "Blogs", + "Menu:BlogManagement": "Blog Management", + "Title": "Title", + "Delete": "Delete", + "Reply": "Reply", + "ReplyTo": "Reply To {0}", + "ContinueReading": "Continue Reading", + "DaysAgo": "{0} days ago", + "YearsAgo": "{0} years ago", + "MonthsAgo": "{0} months ago", + "WeeksAgo": "{0} weeks ago", + "MinutesAgo": "{0} minutes ago", + "SecondsAgo": "{0} seconds ago", + "HoursAgo": "{0} hours ago", + "Now": "now", + "Content": "Content", + "SeeAll": "See All", + "PopularTags": "Popular Tags", + "WiewsWithCount": "{0} views", + "LastPosts": "Last Posts", + "LeaveComment": "Leave Comment", + "TagsInThisArticle": "Tags in this article", + "Posts": "Posts", + "Edit": "Edit", + "BLOG": "BLOG", + "CommentDeletionWarningMessage": "Comment will be deleted.", + "PostDeletionWarningMessage": "Post will be deleted.", + "BlogDeletionWarningMessage": "Blog will be deleted.", + "AreYouSure": "Are you sure?", + "CommentWithCount": "{0} comments", + "Comment": "Comment", + "ShareOnTwitter": "Share On Twitter", + "CoverImage": "Cover Image", + "CreateANewPost": "Create A New Post", + "CreateANewBlog": "Create A New Blog", + "WhatIsNew": "What is new?", + "Name": "Name", + "ShortName": "Short Name", + "CreationTime": "Creation Time", + "Description": "Description", + "Blogs": "Blogs", + "Tags": "Tags" + } +} \ No newline at end of file diff --git a/modules/docs/app/VoloDocs.Web/Localization/Resources/VoloDocs/Web/cs.json b/modules/docs/app/VoloDocs.Web/Localization/Resources/VoloDocs/Web/cs.json new file mode 100644 index 0000000000..75ac74a0f5 --- /dev/null +++ b/modules/docs/app/VoloDocs.Web/Localization/Resources/VoloDocs/Web/cs.json @@ -0,0 +1,9 @@ +{ + "culture": "cs", + "texts": { + "WelcomeVoloDocs": "Welcome to the VoloDocs!", + "NoProjectWarning": "There`s no defined project yet!", + "CreateYourFirstProject": "Click here to start your first project", + "NoProject": "No project!" + } +} \ No newline at end of file diff --git a/modules/docs/app/VoloDocs.Web/VoloDocsWebModule.cs b/modules/docs/app/VoloDocs.Web/VoloDocsWebModule.cs index cc018ddcc1..5aafb75f66 100644 --- a/modules/docs/app/VoloDocs.Web/VoloDocsWebModule.cs +++ b/modules/docs/app/VoloDocs.Web/VoloDocsWebModule.cs @@ -107,7 +107,7 @@ namespace VoloDocs.Web Configure(options => { - + options.Languages.Add(new LanguageInfo("cs", "cs", "Čeština")); options.Languages.Add(new LanguageInfo("en", "en", "English")); options.Languages.Add(new LanguageInfo("tr", "tr", "Türkçe")); options.Languages.Add(new LanguageInfo("zh-Hans", "zh-Hans", "简体中文")); diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/cs.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/cs.json new file mode 100644 index 0000000000..4f74fe9220 --- /dev/null +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/cs.json @@ -0,0 +1,10 @@ +{ + "culture": "cs", + "texts": { + "Permission:DocumentManagement": "Document Management", + "Permission:Projects": "Projects", + "Permission:Edit": "Edit", + "Permission:Delete": "Delete", + "Permission:Create": "Create" + } +} \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Web/Localization/Resources/Docs/Web/cs.json b/modules/docs/src/Volo.Docs.Admin.Web/Localization/Resources/Docs/Web/cs.json new file mode 100644 index 0000000000..d520ab4ff7 --- /dev/null +++ b/modules/docs/src/Volo.Docs.Admin.Web/Localization/Resources/Docs/Web/cs.json @@ -0,0 +1,27 @@ +{ + "culture": "cs", + "texts": { + "Menu:DocumentManagement": "Documents", + "Menu:ProjectManagement": "Projects", + "CreateANewProject": "Create new project", + "Edit": "Edit", + "Create": "Create", + "Projects": "Projects", + "Name": "Name", + "ShortName": "ShortName", + "DocumentStoreType": "DocumentStoreType", + "Format": "Format", + "ShortNameInfoText": "Will be used for unique URL.", + "DisplayName:Name": "Name", + "DisplayName:ShortName": "Short name", + "DisplayName:Format": "Format", + "DisplayName:DefaultDocumentName": "Default document name", + "DisplayName:NavigationDocumentName": "Navigation document name", + "DisplayName:MinimumVersion": "Minimum version", + "DisplayName:MainWebsiteUrl": "Main web site URL", + "DisplayName:LatestVersionBranchName": "Latest version branch name", + "DisplayName:GitHubRootUrl": "GitHub root URL", + "DisplayName:GitHubAccessToken": "GitHub access token", + "DisplayName:GitHubUserAgent": "GitHub user agent" + } +} \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Localization/Domain/cs.json b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Localization/Domain/cs.json new file mode 100644 index 0000000000..3c853d0b8a --- /dev/null +++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Localization/Domain/cs.json @@ -0,0 +1,18 @@ +{ + "culture": "cs", + "texts": { + "Documents": "Documents", + "BackToWebsite": "Back to website", + "Contributors": "Contributors", + "ShareOn": "Share on", + "Version": "Version", + "Edit": "Edit", + "Delete": "Delete", + "InThisDocument": "In this document", + "GoToTop": "Go to top", + "Projects": "Project(s)", + "NoProjectWarning": "There are no projects yet!", + "DocumentNotFound": "Oops, the requested document was not found!", + "NavigationDocumentNotFound": "This version does not have a navigation document!" + } +} \ No newline at end of file diff --git a/modules/feature-management/src/Volo.Abp.FeatureManagement.Application.Contracts/Volo/Abp/FeatureManagement/Localization/ApplicationContracts/cs.json b/modules/feature-management/src/Volo.Abp.FeatureManagement.Application.Contracts/Volo/Abp/FeatureManagement/Localization/ApplicationContracts/cs.json new file mode 100644 index 0000000000..6a060a54c1 --- /dev/null +++ b/modules/feature-management/src/Volo.Abp.FeatureManagement.Application.Contracts/Volo/Abp/FeatureManagement/Localization/ApplicationContracts/cs.json @@ -0,0 +1,6 @@ +{ + "culture": "cs", + "texts": { + + } +} \ No newline at end of file diff --git a/modules/feature-management/src/Volo.Abp.FeatureManagement.Domain/Volo/Abp/FeatureManagement/Localization/Domain/cs.json b/modules/feature-management/src/Volo.Abp.FeatureManagement.Domain/Volo/Abp/FeatureManagement/Localization/Domain/cs.json new file mode 100644 index 0000000000..6a060a54c1 --- /dev/null +++ b/modules/feature-management/src/Volo.Abp.FeatureManagement.Domain/Volo/Abp/FeatureManagement/Localization/Domain/cs.json @@ -0,0 +1,6 @@ +{ + "culture": "cs", + "texts": { + + } +} \ No newline at end of file diff --git a/modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Localization/Resources/FeatureManagement/cs.json b/modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Localization/Resources/FeatureManagement/cs.json new file mode 100644 index 0000000000..bb0b195455 --- /dev/null +++ b/modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Localization/Resources/FeatureManagement/cs.json @@ -0,0 +1,6 @@ +{ + "culture": "cs", + "texts": { + "Features": "Features" + } +} \ No newline at end of file diff --git a/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/Localization/ApplicationContracts/cs.json b/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/Localization/ApplicationContracts/cs.json new file mode 100644 index 0000000000..f7833b9f43 --- /dev/null +++ b/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/Localization/ApplicationContracts/cs.json @@ -0,0 +1,14 @@ +{ + "culture": "cs", + "texts": { + "Volo.Abp.Identity:010001": "You can not delete your own account!", + "Permission:IdentityManagement": "Identity management", + "Permission:RoleManagement": "Role management", + "Permission:Create": "Create", + "Permission:Edit": "Edit", + "Permission:Delete": "Delete", + "Permission:ChangePermissions": "Change permissions", + "Permission:UserManagement": "User management", + "Permission:UserLookup": "User lookup" + } +} \ No newline at end of file diff --git a/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/Localization/Domain/cs.json b/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/Localization/Domain/cs.json new file mode 100644 index 0000000000..4ac5a3104c --- /dev/null +++ b/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/Localization/Domain/cs.json @@ -0,0 +1,33 @@ +{ + "culture": "cs", + "texts": { + "Identity.DefaultError": "An unknown failure has occurred.", + "Identity.ConcurrencyFailure": "Optimistic concurrency failure, object has been modified.", + "Identity.DuplicateEmail": "Email '{0}' is already taken.", + "Identity.DuplicateRoleName": "Role name '{0}' is already taken.", + "Identity.DuplicateUserName": "User name '{0}' is already taken.", + "Identity.InvalidEmail": "Email '{0}' is invalid.", + "Identity.InvalidPasswordHasherCompatibilityMode": "The provided PasswordHasherCompatibilityMode is invalid.", + "Identity.InvalidPasswordHasherIterationCount": "The iteration count must be a positive integer.", + "Identity.InvalidRoleName": "Role name '{0}' is invalid.", + "Identity.InvalidToken": "Invalid token.", + "Identity.InvalidUserName": "User name '{0}' is invalid, can only contain letters or digits.", + "Identity.LoginAlreadyAssociated": "A user with this login already exists.", + "Identity.PasswordMismatch": "Incorrect password.", + "Identity.PasswordRequiresDigit": "Passwords must have at least one digit ('0'-'9').", + "Identity.PasswordRequiresLower": "Passwords must have at least one lowercase ('a'-'z').", + "Identity.PasswordRequiresNonAlphanumeric": "Passwords must have at least one non alphanumeric character.", + "Identity.PasswordRequiresUpper": "Passwords must have at least one uppercase ('A'-'Z').", + "Identity.PasswordTooShort": "Passwords must be at least {0} characters.", + "Identity.RoleNotFound": "Role {0} does not exist.", + "Identity.UserAlreadyHasPassword": "User already has a password set.", + "Identity.UserAlreadyInRole": "User already in role '{0}'.", + "Identity.UserLockedOut": "User is locked out.", + "Identity.UserLockoutNotEnabled": "Lockout is not enabled for this user.", + "Identity.UserNameNotFound": "User {0} does not exist.", + "Identity.UserNotInRole": "User is not in role '{0}'.", + "Identity.PasswordConfirmationFailed": "Password does not match the confirm password.", + "Identity.StaticRoleRenamingErrorMessage": "Static roles can not be renamed.", + "Identity.StaticRoleDeletionErrorMessage": "Static roles can not be deleted." + } +} \ No newline at end of file diff --git a/modules/identity/src/Volo.Abp.Identity.Web/Localization/Resources/AbpIdentity/cs.json b/modules/identity/src/Volo.Abp.Identity.Web/Localization/Resources/AbpIdentity/cs.json new file mode 100644 index 0000000000..e0a1afa742 --- /dev/null +++ b/modules/identity/src/Volo.Abp.Identity.Web/Localization/Resources/AbpIdentity/cs.json @@ -0,0 +1,39 @@ +{ + "culture": "cs", + "texts": { + "Menu:IdentityManagement": "Identity management", + "Users": "Users", + "NewUser": "New user", + "UserName": "User name", + "EmailAddress": "Email address", + "PhoneNumber": "Phone number", + "UserInformations": "User informations", + "DisplayName:IsDefault": "Default", + "DisplayName:IsStatic": "Static", + "DisplayName:IsPublic": "Public", + "Roles": "Roles", + "Password": "Password", + "PersonalInfo": "My profile", + "PersonalSettings": "Personal settings", + "UserDeletionConfirmationMessage": "User '{0}' will be deleted. Do you confirm that?", + "RoleDeletionConfirmationMessage": "Role '{0}' will be deleted. Do you confirm that?", + "DisplayName:RoleName": "Role name", + "DisplayName:UserName": "User name", + "DisplayName:Name": "Name", + "DisplayName:Surname": "Surname", + "DisplayName:Password": "Password", + "DisplayName:Email": "Email address", + "DisplayName:PhoneNumber": "Phone number", + "DisplayName:TwoFactorEnabled": "Two factor verification", + "DisplayName:LockoutEnabled": "Locking account after failed login attempts", + "NewRole": "New role", + "RoleName": "Role name", + "CreationTime": "Creation time", + "Permissions": "Permissions", + "DisplayName:CurrentPassword": "Current password", + "DisplayName:NewPassword": "New password", + "DisplayName:NewPasswordConfirm": "Confirm new password", + "PasswordChangedMessage": "Your password has been changed successfully.", + "PersonalSettingsSavedMessage": "Your personal settings has been saved successfully." + } +} \ No newline at end of file diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Localization/Resources/AbpPermissionManagement/cs.json b/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Localization/Resources/AbpPermissionManagement/cs.json new file mode 100644 index 0000000000..31c3a05605 --- /dev/null +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Localization/Resources/AbpPermissionManagement/cs.json @@ -0,0 +1,10 @@ +{ + "culture": "cs", + "texts": { + "Permissions": "Permissions", + "OnlyProviderPermissons": "Only this provider", + "All": "All", + "SelectAllInAllTabs": "Grant all permissions", + "SelectAllInThisTab": "Select all" + } +} \ No newline at end of file diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Localization/Resources/AbpSettingManagement/cs.json b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Localization/Resources/AbpSettingManagement/cs.json new file mode 100644 index 0000000000..2e1cc57421 --- /dev/null +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Localization/Resources/AbpSettingManagement/cs.json @@ -0,0 +1,6 @@ +{ + "culture": "cs", + "texts": { + "Settings": "Settings" + } +} \ No newline at end of file diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Application.Contracts/Volo/Abp/TenantManagement/Localization/ApplicationContracts/cs.json b/modules/tenant-management/src/Volo.Abp.TenantManagement.Application.Contracts/Volo/Abp/TenantManagement/Localization/ApplicationContracts/cs.json new file mode 100644 index 0000000000..b3b67e9175 --- /dev/null +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Application.Contracts/Volo/Abp/TenantManagement/Localization/ApplicationContracts/cs.json @@ -0,0 +1,11 @@ +{ + "culture": "cs", + "texts": { + "Permission:TenantManagement": "Tenant management", + "Permission:Create": "Create", + "Permission:Edit": "Edit", + "Permission:Delete": "Delete", + "Permission:ManageConnectionStrings": "Manage connection strings", + "Permission:ManageFeatures": "Manage features" + } +} \ No newline at end of file diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Localization/Resources/AbpTenantManagement/Web/cs.json b/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Localization/Resources/AbpTenantManagement/Web/cs.json new file mode 100644 index 0000000000..412655016d --- /dev/null +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Localization/Resources/AbpTenantManagement/Web/cs.json @@ -0,0 +1,14 @@ +{ + "culture": "cs", + "texts": { + "Menu:TenantManagement": "Tenant management", + "Tenants": "Tenants", + "NewTenant": "New tenant", + "TenantName": "Tenant name", + "DisplayName:TenantName": "Tenant name", + "TenantDeletionConfirmationMessage": "Tenant '{0}' will be deleted. Do you confirm that?", + "ConnectionStrings": "Connection Strings", + "DisplayName:DefaultConnectionString": "Default Connection String", + "DisplayName:UseSharedDatabase": "Use the Shared Database" + } +} \ No newline at end of file diff --git a/samples/BookStore/src/Acme.BookStore.Domain/Localization/BookStore/cs.json b/samples/BookStore/src/Acme.BookStore.Domain/Localization/BookStore/cs.json new file mode 100644 index 0000000000..c594aaad29 --- /dev/null +++ b/samples/BookStore/src/Acme.BookStore.Domain/Localization/BookStore/cs.json @@ -0,0 +1,20 @@ +{ + "culture": "cs", + "texts": { + "Menu:Home": "Home", + "Welcome": "Welcome", + "LongWelcomeMessage": "Welcome to the application. This is a startup project based on the ABP framework. For more information, visit abp.io.", + "Menu:BookStore": "Book Store", + "Menu:Books": "Books", + "Name": "Name", + "Type": "Type", + "PublishDate": "Publish Date", + "Price": "Price", + "CreationTime": "Creation Time", + "NewBook": "New book", + "Books": "Books", + "Update": "Update", + "BookDeletionConfirmationMessage": "Are you sure to delete this book: {0}", + "SuccessfullyDeleted": "Successfully deleted." + } +} \ No newline at end of file diff --git a/samples/BookStore/src/Acme.BookStore.Web/BookStoreWebModule.cs b/samples/BookStore/src/Acme.BookStore.Web/BookStoreWebModule.cs index 9f42c3d330..235f287261 100644 --- a/samples/BookStore/src/Acme.BookStore.Web/BookStoreWebModule.cs +++ b/samples/BookStore/src/Acme.BookStore.Web/BookStoreWebModule.cs @@ -114,6 +114,7 @@ namespace Acme.BookStore typeof(AbpUiResource) ); + options.Languages.Add(new LanguageInfo("cs", "cs", "Čeština")); options.Languages.Add(new LanguageInfo("en", "en", "English")); options.Languages.Add(new LanguageInfo("pt-BR", "pt-BR", "Português")); options.Languages.Add(new LanguageInfo("tr", "tr", "Türkçe")); diff --git a/samples/DashboardDemo/src/DashboardDemo.Domain/Localization/DashboardDemo/cs.json b/samples/DashboardDemo/src/DashboardDemo.Domain/Localization/DashboardDemo/cs.json new file mode 100644 index 0000000000..c60a597e3c --- /dev/null +++ b/samples/DashboardDemo/src/DashboardDemo.Domain/Localization/DashboardDemo/cs.json @@ -0,0 +1,10 @@ +{ + "culture": "cs", + "texts": { + "Menu:Home": "Home", + "Welcome": "Welcome", + "RolesInApplication": "Roles in application", + "UserCount": "User count", + "LongWelcomeMessage": "Welcome to the application. This is a startup project based on the ABP framework. For more information, visit abp.io." + } +} \ No newline at end of file diff --git a/samples/DashboardDemo/src/DashboardDemo.Web/DashboardDemoWebModule.cs b/samples/DashboardDemo/src/DashboardDemo.Web/DashboardDemoWebModule.cs index e15e1245fd..c8d7bcc18b 100644 --- a/samples/DashboardDemo/src/DashboardDemo.Web/DashboardDemoWebModule.cs +++ b/samples/DashboardDemo/src/DashboardDemo.Web/DashboardDemoWebModule.cs @@ -159,6 +159,7 @@ namespace DashboardDemo typeof(AbpUiResource) ); + options.Languages.Add(new LanguageInfo("cs", "cs", "Čeština")); options.Languages.Add(new LanguageInfo("en", "en", "English")); options.Languages.Add(new LanguageInfo("pt-BR", "pt-BR", "Português")); options.Languages.Add(new LanguageInfo("tr", "tr", "Türkçe")); diff --git a/samples/MicroserviceDemo/modules/product/src/ProductManagement.Application.Contracts/ProductManagement/Localization/ApplicationContracts/cs.json b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Application.Contracts/ProductManagement/Localization/ApplicationContracts/cs.json new file mode 100644 index 0000000000..3855ae00ea --- /dev/null +++ b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Application.Contracts/ProductManagement/Localization/ApplicationContracts/cs.json @@ -0,0 +1,10 @@ +{ + "culture": "cs", + "texts": { + "Permission:ProductManagement": "Product Management", + "Permission:Products": "Products", + "Permission:Edit": "Edit", + "Permission:Delete": "Delete", + "Permission:Create": "Create" + } +} \ No newline at end of file diff --git a/samples/MicroserviceDemo/modules/product/src/ProductManagement.Domain/ProductManagement/Localization/Domain/cs.json b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Domain/ProductManagement/Localization/Domain/cs.json new file mode 100644 index 0000000000..6a060a54c1 --- /dev/null +++ b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Domain/ProductManagement/Localization/Domain/cs.json @@ -0,0 +1,6 @@ +{ + "culture": "cs", + "texts": { + + } +} \ No newline at end of file diff --git a/samples/MicroserviceDemo/modules/product/src/ProductManagement.Web/Localization/Resources/ProductManagement/cs.json b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Web/Localization/Resources/ProductManagement/cs.json new file mode 100644 index 0000000000..cabdbeb74e --- /dev/null +++ b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Web/Localization/Resources/ProductManagement/cs.json @@ -0,0 +1,16 @@ +{ + "culture": "cs", + "texts": { + "Menu:ProductManagement": "Product Management", + "Menu:Products": "Products", + "ProductManagement": "Product Management", + "CreateANewProduct": "Create A New Product", + "Products": "Products", + "StockCount": "Stock Count", + "Code": "Code", + "Name": "Name", + "Price": "Price", + "ImageName": "Image Name", + "ProductDeletionWarningMessage": "Are you sure you want to delete this product?" + } +} \ No newline at end of file diff --git a/templates/mvc-module/host/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs b/templates/mvc-module/host/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs index 97d3f7b847..2a330c49a8 100644 --- a/templates/mvc-module/host/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs +++ b/templates/mvc-module/host/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs @@ -71,6 +71,7 @@ namespace MyCompanyName.MyProjectName Configure(options => { + options.Languages.Add(new LanguageInfo("cs", "cs", "Čeština")); options.Languages.Add(new LanguageInfo("en", "en", "English")); options.Languages.Add(new LanguageInfo("pt-BR", "pt-BR", "Português")); options.Languages.Add(new LanguageInfo("tr", "tr", "Türkçe")); diff --git a/templates/mvc-module/host/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs b/templates/mvc-module/host/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs index 9730db7df2..065f35e613 100644 --- a/templates/mvc-module/host/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs +++ b/templates/mvc-module/host/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs @@ -79,6 +79,7 @@ namespace MyCompanyName.MyProjectName Configure(options => { + options.Languages.Add(new LanguageInfo("cs", "cs", "Čeština")); options.Languages.Add(new LanguageInfo("en", "en", "English")); options.Languages.Add(new LanguageInfo("pt-BR", "pt-BR", "Português")); options.Languages.Add(new LanguageInfo("tr", "tr", "Türkçe")); diff --git a/templates/mvc-module/host/MyCompanyName.MyProjectName.Web.Unified/MyProjectNameWebUnifiedModule.cs b/templates/mvc-module/host/MyCompanyName.MyProjectName.Web.Unified/MyProjectNameWebUnifiedModule.cs index 16782ca821..78234ce6b4 100644 --- a/templates/mvc-module/host/MyCompanyName.MyProjectName.Web.Unified/MyProjectNameWebUnifiedModule.cs +++ b/templates/mvc-module/host/MyCompanyName.MyProjectName.Web.Unified/MyProjectNameWebUnifiedModule.cs @@ -86,6 +86,7 @@ namespace MyCompanyName.MyProjectName Configure(options => { + options.Languages.Add(new LanguageInfo("cs", "cs", "Čeština")); options.Languages.Add(new LanguageInfo("en", "en", "English")); options.Languages.Add(new LanguageInfo("pt-BR", "pt-BR", "Português (Brasil)")); options.Languages.Add(new LanguageInfo("tr", "tr", "Türkçe")); diff --git a/templates/mvc-module/src/MyCompanyName.MyProjectName.Application.Contracts/Localization/MyProjectName/ApplicationContracts/cs.json b/templates/mvc-module/src/MyCompanyName.MyProjectName.Application.Contracts/Localization/MyProjectName/ApplicationContracts/cs.json new file mode 100644 index 0000000000..a0373003c8 --- /dev/null +++ b/templates/mvc-module/src/MyCompanyName.MyProjectName.Application.Contracts/Localization/MyProjectName/ApplicationContracts/cs.json @@ -0,0 +1,6 @@ +{ + "culture": "cs", + "texts": { + "Permission:MyProjectName": "MyProjectName" + } +} \ No newline at end of file diff --git a/templates/mvc-module/src/MyCompanyName.MyProjectName.Domain.Shared/Localization/MyProjectName/DomainShared/cs.json b/templates/mvc-module/src/MyCompanyName.MyProjectName.Domain.Shared/Localization/MyProjectName/DomainShared/cs.json new file mode 100644 index 0000000000..6a060a54c1 --- /dev/null +++ b/templates/mvc-module/src/MyCompanyName.MyProjectName.Domain.Shared/Localization/MyProjectName/DomainShared/cs.json @@ -0,0 +1,6 @@ +{ + "culture": "cs", + "texts": { + + } +} \ No newline at end of file diff --git a/templates/mvc-module/src/MyCompanyName.MyProjectName.Web/Localization/MyProjectName/Web/cs.json b/templates/mvc-module/src/MyCompanyName.MyProjectName.Web/Localization/MyProjectName/Web/cs.json new file mode 100644 index 0000000000..6a060a54c1 --- /dev/null +++ b/templates/mvc-module/src/MyCompanyName.MyProjectName.Web/Localization/MyProjectName/Web/cs.json @@ -0,0 +1,6 @@ +{ + "culture": "cs", + "texts": { + + } +} \ No newline at end of file diff --git a/templates/mvc/src/MyCompanyName.MyProjectName.Domain.Shared/Localization/MyProjectName/cs.json b/templates/mvc/src/MyCompanyName.MyProjectName.Domain.Shared/Localization/MyProjectName/cs.json new file mode 100644 index 0000000000..7a802e140c --- /dev/null +++ b/templates/mvc/src/MyCompanyName.MyProjectName.Domain.Shared/Localization/MyProjectName/cs.json @@ -0,0 +1,8 @@ +{ + "culture": "cs", + "texts": { + "Menu:Home": "Home", + "Welcome": "Welcome", + "LongWelcomeMessage": "Welcome to the application. This is a startup project based on the ABP framework. For more information, visit abp.io." + } +} \ No newline at end of file diff --git a/templates/mvc/src/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs b/templates/mvc/src/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs index ca5a3e6773..7cd698a711 100644 --- a/templates/mvc/src/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs +++ b/templates/mvc/src/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs @@ -89,6 +89,7 @@ namespace MyCompanyName.MyProjectName { Configure(options => { + options.Languages.Add(new LanguageInfo("cs", "cs", "Čeština")); options.Languages.Add(new LanguageInfo("en", "en", "English")); options.Languages.Add(new LanguageInfo("pt-BR", "pt-BR", "Português")); options.Languages.Add(new LanguageInfo("tr", "tr", "Türkçe")); diff --git a/templates/mvc/src/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs b/templates/mvc/src/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs index 588e62dba9..8b294109fc 100644 --- a/templates/mvc/src/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs +++ b/templates/mvc/src/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs @@ -46,6 +46,7 @@ namespace MyCompanyName.MyProjectName typeof(AbpUiResource) ); + options.Languages.Add(new LanguageInfo("cs", "cs", "Čeština")); options.Languages.Add(new LanguageInfo("en", "en", "English")); options.Languages.Add(new LanguageInfo("pt-BR", "pt-BR", "Português")); options.Languages.Add(new LanguageInfo("tr", "tr", "Türkçe")); diff --git a/templates/mvc/src/MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs b/templates/mvc/src/MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs index 1c33edf183..bc9d41a476 100644 --- a/templates/mvc/src/MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs +++ b/templates/mvc/src/MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs @@ -142,6 +142,7 @@ namespace MyCompanyName.MyProjectName typeof(AbpUiResource) ); + options.Languages.Add(new LanguageInfo("cs", "cs", "Čeština")); options.Languages.Add(new LanguageInfo("en", "en", "English")); options.Languages.Add(new LanguageInfo("pt-BR", "pt-BR", "Português")); options.Languages.Add(new LanguageInfo("tr", "tr", "Türkçe")); From 83679fb8ba7f13dff5837bab2919ea7d2893bf45 Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Wed, 29 May 2019 16:58:26 +0300 Subject: [PATCH 015/166] implemented multi language on docs module basicly --- .../app/VoloDocs.Web/Pages/Index.cshtml.cs | 10 ---- .../Docs/Documents/GetDefaultDocumentInput.cs | 3 + .../Volo/Docs/Documents/GetDocumentInput.cs | 3 + .../Documents/GetDocumentResourceInput.cs | 3 + .../Documents/GetNavigationDocumentInput.cs | 3 + .../Volo/Docs/Projects/ProjectDto.cs | 2 + .../Docs/DocsApplicationAutoMapperProfile.cs | 2 +- .../Volo/Docs/Documents/DocumentAppService.cs | 55 ++++++++++++++++--- .../Volo/Docs/Projects/ProjectAppService.cs | 4 +- .../Volo/Docs/Projects/ProjectConsts.cs | 1 + .../Volo/Docs/Documents/IDocumentStore.cs | 5 +- .../Volo/Docs/Documents/LanguageConfig.cs | 11 ++++ .../Docs/Documents/LanguageConfigElement.cs | 11 ++++ .../Documents/FileSystemDocumentStore.cs | 15 ++++- .../GitHub/Documents/GithubDocumentStore.cs | 30 +++++++++- .../docs/src/Volo.Docs.Web/DocsWebModule.cs | 4 +- .../Pages/Documents/Index.cshtml.cs | 10 ---- .../Pages/Documents/Project/Index.cshtml | 6 ++ .../Pages/Documents/Project/Index.cshtml.cs | 46 ++++++++++++++-- .../Pages/Documents/Project/index.js | 13 +++++ .../Volo/Docs/GithubDocumentStore_Tests.cs | 2 +- 21 files changed, 193 insertions(+), 46 deletions(-) create mode 100644 modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/LanguageConfig.cs create mode 100644 modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/LanguageConfigElement.cs diff --git a/modules/docs/app/VoloDocs.Web/Pages/Index.cshtml.cs b/modules/docs/app/VoloDocs.Web/Pages/Index.cshtml.cs index 8b6ffd2cdf..018e5fac4c 100644 --- a/modules/docs/app/VoloDocs.Web/Pages/Index.cshtml.cs +++ b/modules/docs/app/VoloDocs.Web/Pages/Index.cshtml.cs @@ -22,16 +22,6 @@ namespace VoloDocs.Web.Pages { Projects = (await _projectAppService.GetListAsync()).Items; - if (Projects.Count == 1) - { - return RedirectToPage("./Documents/Project/Index", new - { - projectName = Projects[0].ShortName, - version = DocsAppConsts.Latest, - documentName = Projects[0].DefaultDocumentName - }); - } - return Page(); } } diff --git a/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/GetDefaultDocumentInput.cs b/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/GetDefaultDocumentInput.cs index 770f43b13e..4cfab98225 100644 --- a/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/GetDefaultDocumentInput.cs +++ b/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/GetDefaultDocumentInput.cs @@ -10,5 +10,8 @@ namespace Volo.Docs.Documents [StringLength(ProjectConsts.MaxVersionNameLength)] public string Version { get; set; } + + [StringLength(ProjectConsts.MaxLanguageCodeLength)] + public string LanguageCode { get; set; } } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/GetDocumentInput.cs b/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/GetDocumentInput.cs index 2c887fb829..825c1a7942 100644 --- a/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/GetDocumentInput.cs +++ b/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/GetDocumentInput.cs @@ -14,5 +14,8 @@ namespace Volo.Docs.Documents [StringLength(ProjectConsts.MaxVersionNameLength)] public string Version { get; set; } + + [StringLength(ProjectConsts.MaxLanguageCodeLength)] + public string LanguageCode { get; set; } } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/GetDocumentResourceInput.cs b/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/GetDocumentResourceInput.cs index e34dfa5512..eb0d853e06 100644 --- a/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/GetDocumentResourceInput.cs +++ b/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/GetDocumentResourceInput.cs @@ -14,5 +14,8 @@ namespace Volo.Docs.Documents [StringLength(ProjectConsts.MaxVersionNameLength)] public string Version { get; set; } + + [StringLength(ProjectConsts.MaxLanguageCodeLength)] + public string LanguageCode { get; set; } } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/GetNavigationDocumentInput.cs b/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/GetNavigationDocumentInput.cs index c9ea504272..473014eb25 100644 --- a/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/GetNavigationDocumentInput.cs +++ b/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/GetNavigationDocumentInput.cs @@ -10,5 +10,8 @@ namespace Volo.Docs.Documents [StringLength(ProjectConsts.MaxVersionNameLength)] public string Version { get; set; } + + [StringLength(ProjectConsts.MaxLanguageCodeLength)] + public string LanguageCode { get; set; } } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Projects/ProjectDto.cs b/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Projects/ProjectDto.cs index 91f5c63a22..a9ec815a6c 100644 --- a/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Projects/ProjectDto.cs +++ b/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Projects/ProjectDto.cs @@ -26,5 +26,7 @@ namespace Volo.Docs.Projects public string DocumentStoreType { get; set; } public Dictionary ExtraProperties { get; set; } + + public Dictionary Languages { get; set; } } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Application/Volo/Docs/DocsApplicationAutoMapperProfile.cs b/modules/docs/src/Volo.Docs.Application/Volo/Docs/DocsApplicationAutoMapperProfile.cs index d29828ad05..320dbe49c3 100644 --- a/modules/docs/src/Volo.Docs.Application/Volo/Docs/DocsApplicationAutoMapperProfile.cs +++ b/modules/docs/src/Volo.Docs.Application/Volo/Docs/DocsApplicationAutoMapperProfile.cs @@ -9,7 +9,7 @@ namespace Volo.Docs { public DocsApplicationAutoMapperProfile() { - CreateMap(); + CreateMap().Ignore(x=>x.Languages); CreateMap(); CreateMap() .Ignore(x => x.Project).Ignore(x => x.Contributors); diff --git a/modules/docs/src/Volo.Docs.Application/Volo/Docs/Documents/DocumentAppService.cs b/modules/docs/src/Volo.Docs.Application/Volo/Docs/Documents/DocumentAppService.cs index 3a4474e877..4b214547f5 100644 --- a/modules/docs/src/Volo.Docs.Application/Volo/Docs/Documents/DocumentAppService.cs +++ b/modules/docs/src/Volo.Docs.Application/Volo/Docs/Documents/DocumentAppService.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; +using System.Linq; using System.Threading.Tasks; using Microsoft.Extensions.Caching.Distributed; using Microsoft.Extensions.Logging; @@ -15,17 +16,20 @@ namespace Volo.Docs.Documents private readonly IProjectRepository _projectRepository; private readonly IDocumentStoreFactory _documentStoreFactory; protected IDistributedCache DocumentCache { get; } + protected IDistributedCache LanguaCache { get; } protected IDistributedCache ResourceCache { get; } public DocumentAppService( IProjectRepository projectRepository, IDocumentStoreFactory documentStoreFactory, IDistributedCache documentCache, + IDistributedCache languaCache, IDistributedCache resourceCache) { _projectRepository = projectRepository; _documentStoreFactory = documentStoreFactory; DocumentCache = documentCache; + LanguaCache = languaCache; ResourceCache = resourceCache; } @@ -33,9 +37,10 @@ namespace Volo.Docs.Documents { var project = await _projectRepository.GetAsync(input.ProjectId); - return await GetDocumentWithDetailsDto( + return await GetDocument( project, input.Name, + input.LanguageCode, input.Version ); } @@ -44,9 +49,10 @@ namespace Volo.Docs.Documents { var project = await _projectRepository.GetAsync(input.ProjectId); - return await GetDocumentWithDetailsDto( + return await GetDocument( project, project.DefaultDocumentName, + input.LanguageCode, input.Version ); } @@ -55,9 +61,10 @@ namespace Volo.Docs.Documents { var project = await _projectRepository.GetAsync(input.ProjectId); - return await GetDocumentWithDetailsDto( + return await GetDocument( project, project.NavigationDocumentName, + input.LanguageCode, input.Version ); } @@ -92,20 +99,23 @@ namespace Volo.Docs.Documents ); } - protected virtual async Task GetDocumentWithDetailsDto( + protected virtual async Task GetDocument( Project project, string documentName, + string languageCode, string version) { - var cacheKey = $"Document@{project.ShortName}#{documentName}#{version}"; + var cacheKey = $"Document@{project.ShortName}#{languageCode}#{documentName}#{version}"; async Task GetDocumentAsync() { Logger.LogInformation($"Not found in the cache. Requesting {documentName} from the store..."); var store = _documentStoreFactory.Create(project.DocumentStoreType); - var document = await store.GetDocumentAsync(project, documentName, version); + var languages = await GetLanguageListAsync(store, project, version); + var language = GetLanguageByCode(languages, languageCode); + var document = await store.GetDocumentAsync(project, documentName, language.Code, version); Logger.LogInformation($"Document retrieved: {documentName}"); - return CreateDocumentWithDetailsDto(project, document); + return CreateDocumentWithDetailsDto(project, document, languages); } if (Debugger.IsAttached) @@ -125,11 +135,40 @@ namespace Volo.Docs.Documents ); } - protected virtual DocumentWithDetailsDto CreateDocumentWithDetailsDto(Project project, Document document) + protected virtual LanguageConfigElement GetLanguageByCode(LanguageConfig languageCodes, string languageCode) + { + var language = languageCodes.Languages.FirstOrDefault(l => l.Code == languageCode); + + return language ?? languageCodes.Languages.Single(l => l.IsDefault); + } + + protected virtual async Task GetLanguageListAsync(IDocumentStore store, Project project, string version) + { + async Task GetLanguagesAsync() + { + return await store.GetLanguageListAsync(project, version); + } + + return await LanguaCache.GetOrAddAsync( + project.ShortName, + GetLanguagesAsync, + () => new DistributedCacheEntryOptions + { + AbsoluteExpirationRelativeToNow = TimeSpan.FromHours(24) + } + ); + } + + protected virtual DocumentWithDetailsDto CreateDocumentWithDetailsDto(Project project, Document document, LanguageConfig languages) { var documentDto = ObjectMapper.Map(document); documentDto.Project = ObjectMapper.Map(project); documentDto.Contributors = ObjectMapper.Map, List>(document.Contributors); + documentDto.Project.Languages = new Dictionary(); + foreach (var language in languages.Languages) + { + documentDto.Project.Languages.Add(language.Code,language.DisplayName); + } return documentDto; } } diff --git a/modules/docs/src/Volo.Docs.Application/Volo/Docs/Projects/ProjectAppService.cs b/modules/docs/src/Volo.Docs.Application/Volo/Docs/Projects/ProjectAppService.cs index 02ffac9ee9..63fc5557ce 100644 --- a/modules/docs/src/Volo.Docs.Application/Volo/Docs/Projects/ProjectAppService.cs +++ b/modules/docs/src/Volo.Docs.Application/Volo/Docs/Projects/ProjectAppService.cs @@ -16,17 +16,15 @@ namespace Volo.Docs.Projects private readonly IProjectRepository _projectRepository; private readonly IDistributedCache> _versionCache; private readonly IDocumentStoreFactory _documentStoreFactory; - private readonly IGuidGenerator _guidGenerator; public ProjectAppService( IProjectRepository projectRepository, IDistributedCache> versionCache, - IDocumentStoreFactory documentStoreFactory, IGuidGenerator guidGenerator) + IDocumentStoreFactory documentStoreFactory) { _projectRepository = projectRepository; _versionCache = versionCache; _documentStoreFactory = documentStoreFactory; - _guidGenerator = guidGenerator; } public async Task> GetListAsync() diff --git a/modules/docs/src/Volo.Docs.Domain.Shared/Volo/Docs/Projects/ProjectConsts.cs b/modules/docs/src/Volo.Docs.Domain.Shared/Volo/Docs/Projects/ProjectConsts.cs index 57f3c17112..ea5506151f 100644 --- a/modules/docs/src/Volo.Docs.Domain.Shared/Volo/Docs/Projects/ProjectConsts.cs +++ b/modules/docs/src/Volo.Docs.Domain.Shared/Volo/Docs/Projects/ProjectConsts.cs @@ -8,5 +8,6 @@ public const int MaxNavigationDocumentNameLength = 128; public const int MaxLatestVersionBranchNameLength = 128; public const int MaxVersionNameLength = 128; + public const int MaxLanguageCodeLength = 10; } } diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/IDocumentStore.cs b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/IDocumentStore.cs index 1b001303b5..6f6d90de49 100644 --- a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/IDocumentStore.cs +++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/IDocumentStore.cs @@ -1,16 +1,19 @@ using System.Collections.Generic; using System.Threading.Tasks; using Volo.Abp.Domain.Services; +using Volo.Docs.GitHub.Documents; using Volo.Docs.Projects; namespace Volo.Docs.Documents { public interface IDocumentStore : IDomainService { - Task GetDocumentAsync(Project project, string documentName, string version); + Task GetDocumentAsync(Project project, string documentName, string languageCode, string version); Task> GetVersionsAsync(Project project); Task GetResource(Project project, string resourceName, string version); + + Task GetLanguageListAsync(Project project, string version); } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/LanguageConfig.cs b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/LanguageConfig.cs new file mode 100644 index 0000000000..b53497a948 --- /dev/null +++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/LanguageConfig.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Volo.Docs.Documents +{ + public class LanguageConfig + { + public List Languages { get; set; } + } +} diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/LanguageConfigElement.cs b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/LanguageConfigElement.cs new file mode 100644 index 0000000000..25525394ca --- /dev/null +++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/LanguageConfigElement.cs @@ -0,0 +1,11 @@ +namespace Volo.Docs.Documents +{ + public class LanguageConfigElement + { + public string DisplayName { get; set; } + + public string Code { get; set; } + + public bool IsDefault { get; set; } + } +} diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/FileSystem/Documents/FileSystemDocumentStore.cs b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/FileSystem/Documents/FileSystemDocumentStore.cs index 87a74d1702..e221dba23e 100644 --- a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/FileSystem/Documents/FileSystemDocumentStore.cs +++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/FileSystem/Documents/FileSystemDocumentStore.cs @@ -1,7 +1,9 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.IO; using System.Security; using System.Threading.Tasks; +using Newtonsoft.Json; using Volo.Abp.Domain.Services; using Volo.Abp.IO; using Volo.Docs.Documents; @@ -14,10 +16,10 @@ namespace Volo.Docs.FileSystem.Documents { public const string Type = "FileSystem"; - public async Task GetDocumentAsync(Project project, string documentName, string version) + public async Task GetDocumentAsync(Project project, string documentName, string languageCode, string version) { var projectFolder = project.GetFileSystemPath(); - var path = Path.Combine(projectFolder, documentName); + var path = Path.Combine(projectFolder, languageCode, documentName); CheckDirectorySecurity(projectFolder, path); @@ -46,6 +48,13 @@ namespace Volo.Docs.FileSystem.Documents return Task.FromResult(new List()); } + public async Task GetLanguageListAsync(Project project, string version) + { + var configAsJson = project.GetFileSystemPath() + "languageConfig.json"; + + return JsonConvert.DeserializeObject(configAsJson); + } + public async Task GetResource(Project project, string resourceName, string version) { var projectFolder = project.GetFileSystemPath(); diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/GitHub/Documents/GithubDocumentStore.cs b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/GitHub/Documents/GithubDocumentStore.cs index 2d65a17c68..5ca5f310bf 100644 --- a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/GitHub/Documents/GithubDocumentStore.cs +++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/GitHub/Documents/GithubDocumentStore.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.Extensions.Logging; +using Newtonsoft.Json; using Volo.Abp.Domain.Services; using Volo.Docs.Documents; using Volo.Docs.GitHub.Projects; @@ -27,14 +28,14 @@ namespace Volo.Docs.GitHub.Documents _githubRepositoryManager = githubRepositoryManager; } - public virtual async Task GetDocumentAsync(Project project, string documentName, string version) + public virtual async Task GetDocumentAsync(Project project, string documentName, string languageCode, string version) { var token = project.GetGitHubAccessTokenOrNull(); var rootUrl = project.GetGitHubUrl(version); - var rawRootUrl = CalculateRawRootUrl(rootUrl); + var userAgent = project.GetGithubUserAgentOrNull(); + var rawRootUrl = CalculateRawRootUrlWithLanguageCode(rootUrl, languageCode); var rawDocumentUrl = rawRootUrl + documentName; var commitHistoryUrl = project.GetGitHubUrlForCommitHistory() + documentName; - var userAgent = project.GetGithubUserAgentOrNull(); var isNavigationDocument = documentName == project.NavigationDocumentName; var editLink = rootUrl.ReplaceFirst("/tree/", "/blob/") + documentName; var localDirectory = ""; @@ -102,6 +103,19 @@ namespace Volo.Docs.GitHub.Documents return new DocumentResource(content); } + public async Task GetLanguageListAsync(Project project, string version) + { + var token = project.GetGitHubAccessTokenOrNull(); + var rootUrl = project.GetGitHubUrl(version); + var userAgent = project.GetGithubUserAgentOrNull(); + + var url = CalculateRawRootUrl(rootUrl) + "languageConfig.json"; + + var configAsJson = await DownloadWebContentAsStringAsync(url, token, userAgent); + + return JsonConvert.DeserializeObject(configAsJson); + } + private async Task> GetReleasesAsync(Project project) { var url = project.GetGitHubUrl(); @@ -202,6 +216,16 @@ namespace Volo.Docs.GitHub.Documents return contributors; } + private static string CalculateRawRootUrlWithLanguageCode(string rootUrl, string languageCode) + { + return (rootUrl + .Replace("github.com", "raw.githubusercontent.com") + .ReplaceFirst("/tree/", "/") + .EnsureEndsWith('/') + + languageCode + ).EnsureEndsWith('/'); + } + private static string CalculateRawRootUrl(string rootUrl) { return rootUrl diff --git a/modules/docs/src/Volo.Docs.Web/DocsWebModule.cs b/modules/docs/src/Volo.Docs.Web/DocsWebModule.cs index 89301265ea..e92a8d21a6 100644 --- a/modules/docs/src/Volo.Docs.Web/DocsWebModule.cs +++ b/modules/docs/src/Volo.Docs.Web/DocsWebModule.cs @@ -39,8 +39,8 @@ namespace Volo.Docs { //TODO: Make configurable! options.Conventions.AddPageRoute("/Documents/Project/Index", "documents/{projectName}"); - - options.Conventions.AddPageRoute("/Documents/Project/Index", "documents/{projectName}/{version}/{*documentName}"); + options.Conventions.AddPageRoute("/Documents/Project/Index", "documents/{languageCode}/{projectName}"); + options.Conventions.AddPageRoute("/Documents/Project/Index", "documents/{languageCode}/{projectName}/{version}/{*documentName}"); }); Configure(options => diff --git a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Index.cshtml.cs b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Index.cshtml.cs index 552aa0c21d..32675ded2c 100644 --- a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Index.cshtml.cs +++ b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Index.cshtml.cs @@ -21,16 +21,6 @@ namespace Volo.Docs.Pages.Documents { var listResult = await _projectAppService.GetListAsync(); - if (listResult.Items.Count == 1) - { - return RedirectToPage("./Project/Index", new - { - projectName = listResult.Items[0].ShortName, - version = DocsAppConsts.Latest, - documentName = listResult.Items[0].DefaultDocumentName - }); - } - Projects = listResult.Items; return Page(); 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 9b98ebe4b4..3e6a8dda35 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 @@ -158,6 +158,11 @@ + @if (Model.LanguageSelectListItems.Count > 1) + { + + } + @if (!string.IsNullOrEmpty(Model.Document.EditLink)) { @L["Edit"] @@ -222,3 +227,4 @@ + \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs index 378903d121..744ad1d7b9 100644 --- a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs +++ b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs @@ -5,6 +5,7 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Rendering; using Volo.Abp.AspNetCore.Mvc.UI.RazorPages; +using Volo.Abp.Localization; using Volo.Docs.Documents; using Volo.Docs.HtmlConverting; using Volo.Docs.Models; @@ -23,8 +24,13 @@ namespace Volo.Docs.Pages.Documents.Project [BindProperty(SupportsGet = true)] public string DocumentName { get; set; } + [BindProperty(SupportsGet = true)] + public string LanguageCode { get; set; } + public ProjectDto Project { get; set; } + public List LanguageSelectListItems { get; set; } + public string DocumentNameWithExtension { get; private set; } public DocumentWithDetailsDto Document { get; private set; } @@ -58,6 +64,8 @@ namespace Volo.Docs.Pages.Documents.Project await SetVersionAsync(); await SetDocumentAsync(); await SetNavigationAsync(); + SetLanguageSelectListItems(); + AddLanguageCodePrefixToLinks(); } private async Task SetProjectAsync() @@ -72,7 +80,7 @@ namespace Volo.Docs.Pages.Documents.Project ProjectSelectItems = projects.Items.Select(p => new SelectListItem { Text = p.Name, - Value = p.Id != Project.Id ? "/documents/" + p.ShortName + "/" + DocsAppConsts.Latest : null, + Value = p.Id != Project.Id ? "/documents/" + LanguageCode + "/" + p.ShortName + "/" + DocsAppConsts.Latest : null, Selected = p.Id == Project.Id }).ToList(); } @@ -133,6 +141,7 @@ namespace Volo.Docs.Pages.Documents.Project new GetNavigationDocumentInput { ProjectId = Project.Id, + LanguageCode = LanguageCode, Version = Version } ); @@ -154,7 +163,7 @@ namespace Volo.Docs.Pages.Documents.Project version = DocsAppConsts.Latest; } - var link = "/documents/" + ProjectName + "/" + version; + var link = "/documents/" + LanguageCode + "/" + ProjectName + "/" + version; if (documentName != null) { @@ -193,6 +202,7 @@ namespace Volo.Docs.Pages.Documents.Project new GetDefaultDocumentInput { ProjectId = Project.Id, + LanguageCode = LanguageCode, Version = Version } ); @@ -204,6 +214,7 @@ namespace Volo.Docs.Pages.Documents.Project { ProjectId = Project.Id, Name = DocumentNameWithExtension, + LanguageCode = LanguageCode, Version = Version } ); @@ -211,13 +222,35 @@ namespace Volo.Docs.Pages.Documents.Project } catch (DocumentNotFoundException) { - //TODO: Handle it! - throw; + Document = await _documentAppService.GetDefaultAsync( + new GetDefaultDocumentInput + { + ProjectId = Project.Id, + LanguageCode = LanguageCode, + Version = Version + } + ); } ConvertDocumentContentToHtml(); } + private void SetLanguageSelectListItems() + { + LanguageSelectListItems = new List(); + + foreach (var language in Document.Project.Languages) + { + LanguageSelectListItems.Add( + new SelectListItem( + language.Value, + "/documents/" + language.Key + "/" + Project.ShortName + "/" + Version + "/" + DocumentName, + language.Key == LanguageCode + ) + ); + } + } + private void ConvertDocumentContentToHtml() { var converter = _documentToHtmlConverterFactory.Create(Document.Format ?? Project.Format); @@ -238,5 +271,10 @@ namespace Volo.Docs.Pages.Documents.Project Document.Content = content; } + + private void AddLanguageCodePrefixToLinks() + { + Document.Content = Document.Content.Replace("href=\"/documents", "href=\"/documents/" + LanguageCode); + } } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/index.js b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/index.js index 32ce1933a7..5eeb579f43 100644 --- a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/index.js +++ b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/index.js @@ -2,10 +2,21 @@ $(function () { + var addLanguageCodePrefixToLinks = function () { + var anchors = $('#sidebar-scroll a'); + + for (var i = 0; i < anchors.length; i++) { + var anchor = $(anchors[i]); + var newhref = anchor.attr('href').replace("/documents", "/documents/" + $('#LanguageCode').val()); + anchor.attr('href', newhref); + } + }; + var initNavigationFilter = function (navigationContainerId) { var $navigation = $("#" + navigationContainerId); + var getShownDocumentLinks = function () { return $navigation.find(".mCSB_container > li a:visible").not(".tree-toggle"); }; @@ -108,6 +119,8 @@ initSocialShareLinks(); + addLanguageCodePrefixToLinks(); + }); })(jQuery); diff --git a/modules/docs/test/Volo.Docs.Domain.Tests/Volo/Docs/GithubDocumentStore_Tests.cs b/modules/docs/test/Volo.Docs.Domain.Tests/Volo/Docs/GithubDocumentStore_Tests.cs index 1f8bfeca77..5e60d5f96f 100644 --- a/modules/docs/test/Volo.Docs.Domain.Tests/Volo/Docs/GithubDocumentStore_Tests.cs +++ b/modules/docs/test/Volo.Docs.Domain.Tests/Volo/Docs/GithubDocumentStore_Tests.cs @@ -28,7 +28,7 @@ namespace Volo.Docs var project = await _projectRepository.FindAsync(_testData.PorjectId); project.ShouldNotBeNull(); - var document = await store.GetDocumentAsync(project, "index2", "0.123.0"); + var document = await store.GetDocumentAsync(project, "index2", "en", "0.123.0"); document.ShouldNotBeNull(); document.Title.ShouldBe("index2"); From 345f5d25110a071da55be10c58d18d7ce6a48715 Mon Sep 17 00:00:00 2001 From: Xeevis Date: Wed, 29 May 2019 16:28:05 +0200 Subject: [PATCH 016/166] Czech translations --- .../Mvc/UI/MultiTenancy/Localization/cs.json | 10 +- .../Resources/AbpValidation/cs.json | 30 +++--- .../Navigation/Localization/Resource/cs.json | 2 +- .../Localization/Resources/AbpUi/cs.json | 92 +++++++++---------- .../Mvc/Localization/Resource/cs.json | 4 +- .../TestResources/Base/CountryNames/cs.json | 4 +- .../TestResources/Base/Validation/cs.json | 4 +- .../Localization/TestResources/Source/cs.json | 12 +-- .../TestResources/SourceExt/cs.json | 2 +- .../Resources/AbpAccount/Web/cs.json | 32 +++---- .../Blogging/ApplicationContracts/cs.json | 16 ++-- .../Resources/Blogging/Web/cs.json | 82 ++++++++--------- .../Resources/VoloDocs/Web/cs.json | 8 +- .../Docs/ApplicationContracts/cs.json | 10 +- .../Localization/Resources/Docs/Web/cs.json | 42 ++++----- .../Volo/Docs/Localization/Domain/cs.json | 26 +++--- .../Resources/FeatureManagement/cs.json | 2 +- .../Localization/ApplicationContracts/cs.json | 18 ++-- .../Abp/Identity/Localization/Domain/cs.json | 56 +++++------ .../Resources/AbpIdentity/cs.json | 68 +++++++------- .../Resources/AbpPermissionManagement/cs.json | 10 +- .../Resources/AbpSettingManagement/cs.json | 2 +- .../Localization/ApplicationContracts/cs.json | 12 +-- .../Resources/AbpTenantManagement/Web/cs.json | 18 ++-- .../Localization/BookStore/cs.json | 30 +++--- .../Localization/DashboardDemo/cs.json | 10 +- .../Localization/ApplicationContracts/cs.json | 10 +- .../Resources/ProductManagement/cs.json | 22 ++--- .../Localization/MyProjectName/cs.json | 6 +- 29 files changed, 320 insertions(+), 320 deletions(-) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy/Volo/Abp/AspNetCore/Mvc/UI/MultiTenancy/Localization/cs.json b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy/Volo/Abp/AspNetCore/Mvc/UI/MultiTenancy/Localization/cs.json index 480c223775..7151dc73f3 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy/Volo/Abp/AspNetCore/Mvc/UI/MultiTenancy/Localization/cs.json +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy/Volo/Abp/AspNetCore/Mvc/UI/MultiTenancy/Localization/cs.json @@ -1,11 +1,11 @@ { "culture": "cs", "texts": { - "GivenTenantIsNotAvailable": "Given tenant is not available: {0}", + "GivenTenantIsNotAvailable": "Zvolený tenant není dostupný: {0}", "Tenant": "Tenant", - "Switch": "switch", - "Name": "Name", - "SwitchTenantHint": "Leave the name field blank to switch to the host side.", - "NotSelected": "Not selected" + "Switch": "změnit", + "Name": "Název", + "SwitchTenantHint": "Nechte pole prázdné ke změně na hostitele.", + "NotSelected": "Nevybrán" } } \ No newline at end of file diff --git a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpValidation/cs.json b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpValidation/cs.json index d4894c950a..d38574303a 100644 --- a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpValidation/cs.json +++ b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpValidation/cs.json @@ -1,20 +1,20 @@ { "culture": "cs", "texts": { - "'{0}' and '{1}' do not match.": "'{0}' and '{1}' do not match.", - "The {0} field is not a valid credit card number.": "The {0} field is not a valid credit card number.", - "{0} is not valid.": "{0} is not valid.", - "The {0} field is not a valid e-mail address.": "The {0} field is not a valid e-mail address.", - "The {0} field only accepts files with the following extensions: {1}": "The {0} field only accepts files with the following extensions: {1}", - "The field {0} must be a string or array type with a maximum length of '{1}'.": "The field {0} must be a string or array type with a maximum length of '{1}'.", - "The field {0} must be a string or array type with a minimum length of '{1}'.": "The field {0} must be a string or array type with a minimum length of '{1}'.", - "The {0} field is not a valid phone number.": "The {0} field is not a valid phone number.", - "The field {0} must be between {1} and {2}.": "The field {0} must be between {1} and {2}.", - "The field {0} must match the regular expression '{1}'.": "The field {0} must match the regular expression '{1}'.", - "The {0} field is required.": "The {0} field is required.", - "The field {0} must be a string with a maximum length of {1}.": "The field {0} must be a string with a maximum length of {1}.", - "The field {0} must be a string with a minimum length of {2} and a maximum length of {1}.": "The field {0} must be a string with a minimum length of {2} and a maximum length of {1}.", - "The {0} field is not a valid fully-qualified http, https, or ftp URL.": "The {0} field is not a valid fully-qualified http, https, or ftp URL.", - "The field {0} is invalid.": "The field {0} is invalid." + "'{0}' and '{1}' do not match.": "'{0}' a '{1}' se neshodují", + "The {0} field is not a valid credit card number.": "V poli {0} není platné číslo kreditní karty.", + "{0} is not valid.": "{0} není platný.", + "The {0} field is not a valid e-mail address.": "V poli {0} není platný email.", + "The {0} field only accepts files with the following extensions: {1}": "Pole {0} přijímá soubory pouze s následujícími koncovkami: {1}", + "The field {0} must be a string or array type with a maximum length of '{1}'.": "Vy poli {0} musí být řežezec nebo řada o maximální délce '{1}'.", + "The field {0} must be a string or array type with a minimum length of '{1}'.": "V poli {0} musí být řežezec nebo řada o minimální délce '{1}'.", + "The {0} field is not a valid phone number.": "V poli {0} není platné telefonní číslo.", + "The field {0} must be between {1} and {2}.": "Pole {0} musí být mezi {1} a {2}.", + "The field {0} must match the regular expression '{1}'.": "Pole {0} musí odpovídat regulérnímu výrazu '{1}'.", + "The {0} field is required.": "Pole {0} je povinné.", + "The field {0} must be a string with a maximum length of {1}.": "Pole {0} musí být řetězec o maximální délce {1}.", + "The field {0} must be a string with a minimum length of {2} and a maximum length of {1}.": "Pole {0} musí být řetězec o minimální délce {2} a maximální délce {1} znaků.", + "The {0} field is not a valid fully-qualified http, https, or ftp URL.": "Pole {0} není platná plně kvalifikovaná adresa http, https, nebo ftp URL.", + "The field {0} is invalid.": "Pole {0} je neplatné." } } \ No newline at end of file diff --git a/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Localization/Resource/cs.json b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Localization/Resource/cs.json index 1f11b0da7b..b2c46465c0 100644 --- a/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Localization/Resource/cs.json +++ b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Localization/Resource/cs.json @@ -1,6 +1,6 @@ { "culture": "cs", "texts": { - "Menu:Administration": "Administration" + "Menu:Administration": "Administrace" } } \ No newline at end of file diff --git a/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/cs.json b/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/cs.json index 4e0e6f3750..b67fc568b3 100644 --- a/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/cs.json +++ b/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/cs.json @@ -1,51 +1,51 @@ { "culture": "cs", "texts": { - "InternalServerErrorMessage": "An internal error occurred during your request!", - "ValidationErrorMessage": "Your request is not valid!", - "ValidationNarrativeErrorMessageTitle": "The following errors were detected during validation.", - "DefaultErrorMessage": "An error has been occurred!", - "DefaultErrorMessageDetail": "Error detail not sent by server.", - "DefaultErrorMessage401": "You are not authenticated!", - "DefaultErrorMessage401Detail": "You should sign in to perform this operation.", - "DefaultErrorMessage403": "You are not authorized!", - "DefaultErrorMessage403Detail": "You are not allowed to perform this operation!", - "DefaultErrorMessage404": "Resource not found!", - "DefaultErrorMessage404Detail": "The resource requested could not found on the server!", - "EntityNotFoundErrorMessage": "There is no entity {0} with id = {1}!", - "Error": "Error", - "AreYouSure": "Are you sure?", - "Cancel": "Cancel", - "Yes": "Yes", - "No": "No", - "Close": "Close", - "Save": "Save", - "SavingWithThreeDot": "Saving...", - "Actions": "Actions", - "Delete": "Delete", - "Edit": "Edit", - "Refresh": "Refresh", - "ProcessingWithThreeDot": "Processing...", - "LoadingWithThreeDot": "Loading...", - "Welcome": "Welcome", - "Login": "Login", - "Register": "Register", - "Logout": "Log out", - "Submit": "Submit", - "Back": "Back", - "PagerSearch": "Search", - "PagerNext": "Next", - "PagerPrevious": "Previous", - "PagerFirst": "First", - "PagerLast": "Last", - "PagerInfo": "Showing _START_ to _END_ of _TOTAL_ entries", - "PagerInfoEmpty": "Showing 0 to 0 of 0 entries", - "PagerInfoFiltered": "(filtered from _MAX_ total entries)", - "NoDataAvailableInDatatable": "No data available in table", - "PagerShowMenuEntries": "Show _MENU_ entries", - "DatatableActionDropdownDefaultText": "Actions", - "ChangePassword": "Change password", - "PersonalInfo": "My profile", - "AreYouSureYouWantToCancelEditingWarningMessage": "You have unsaved changes." + "InternalServerErrorMessage": "Během požadavku se vyskytla vnitřní chyba!", + "ValidationErrorMessage": "Neplatný požadavek!", + "ValidationNarrativeErrorMessageTitle": "Během ověřování byly zjištěny následující chyby.", + "DefaultErrorMessage": "Vyskytla se chyba!", + "DefaultErrorMessageDetail": "Server neposkytl detaily k chybě.", + "DefaultErrorMessage401": "Nejste přihlášeni!", + "DefaultErrorMessage401Detail": "K vykonání této operace se musíte nejprve přihlásit.", + "DefaultErrorMessage403": "Nemáte oprávnění!", + "DefaultErrorMessage403Detail": "Není vám dovoleno vykonat tuto operaci!", + "DefaultErrorMessage404": "Prostředek nenalezen!", + "DefaultErrorMessage404Detail": "Vyžádaný prostředek nebyl na serveru nalezen!", + "EntityNotFoundErrorMessage": "Neexistující entita {0} s id = {1}!", + "Error": "Chyba", + "AreYouSure": "Jste si jisti?", + "Cancel": "Zrušit", + "Yes": "Ano", + "No": "Ne", + "Close": "Zavřít", + "Save": "Uložit", + "SavingWithThreeDot": "Ukládám...", + "Actions": "Akce", + "Delete": "Smazat", + "Edit": "Upravit", + "Refresh": "Obnovit", + "ProcessingWithThreeDot": "Zpracovávám...", + "LoadingWithThreeDot": "Nahrávám...", + "Welcome": "Vítejte", + "Login": "Přihlášení", + "Register": "Registrovat", + "Logout": "Odhlásit", + "Submit": "Odeslat", + "Back": "Zpět", + "PagerSearch": "Vyhledat", + "PagerNext": "Další", + "PagerPrevious": "Předchozí", + "PagerFirst": "První", + "PagerLast": "Poslední", + "PagerInfo": "Zobrazeno od _START_ do _END_ z celkem _TOTAL_ záznamů", + "PagerInfoEmpty": "Zobrazeno od 0 do 0 z celkem 0 záznamů", + "PagerInfoFiltered": "(filtrováno ze všech _MAX_ záznamů)", + "NoDataAvailableInDatatable": "V tabulce nejsou žádná data", + "PagerShowMenuEntries": "Zobrazit _MENU_ záznamů", + "DatatableActionDropdownDefaultText": "Akce", + "ChangePassword": "Změnit heslo", + "PersonalInfo": "Můj profil", + "AreYouSureYouWantToCancelEditingWarningMessage": "Máte neuložené změny." } } \ No newline at end of file diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Localization/Resource/cs.json b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Localization/Resource/cs.json index b83d4baa34..65c0603c50 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Localization/Resource/cs.json +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Localization/Resource/cs.json @@ -1,7 +1,7 @@ { "culture": "cs", "texts": { - "BirthDate": "Birth date", - "Value1": "Value One" + "BirthDate": "Narozeniny", + "Value1": "Hodnota jedna" } } \ No newline at end of file diff --git a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/CountryNames/cs.json b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/CountryNames/cs.json index a065183f92..6f249267c0 100644 --- a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/CountryNames/cs.json +++ b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/CountryNames/cs.json @@ -1,7 +1,7 @@ { "culture": "cs", "texts": { - "USA": "United States of America", - "Brazil": "Brazil" + "USA": "Spojené státy americké", + "Brazil": "Brazílie" } } \ No newline at end of file diff --git a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/Validation/cs.json b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/Validation/cs.json index 174f957923..9fd414c139 100644 --- a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/Validation/cs.json +++ b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/Validation/cs.json @@ -1,7 +1,7 @@ { "culture": "cs", "texts": { - "ThisFieldIsRequired": "This field is required", - "MaxLenghtErrorMessage": "This field can be maximum of '{0}' chars" + "ThisFieldIsRequired": "Toto pole je povinné", + "MaxLenghtErrorMessage": "Toto pole může mít nanejvýš '{0}' znaků" } } \ No newline at end of file diff --git a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Source/cs.json b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Source/cs.json index 44f745a285..88593c2ba8 100644 --- a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Source/cs.json +++ b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Source/cs.json @@ -1,11 +1,11 @@ { "culture": "cs", "texts": { - "Hello {0}.": "Hello {0}.", - "Car": "Car", - "CarPlural": "Cars", - "MaxLenghtErrorMessage": "This field's length can be maximum of '{0}' chars", - "Universe": "Universe", - "FortyTwo": "Forty Two" + "Hello {0}.": "Ahoj {0}.", + "Car": "Auto", + "CarPlural": "Auta", + "MaxLenghtErrorMessage": "Toto pole může mít nanejvýš '{0}' znaků", + "Universe": "Vesmír", + "FortyTwo": "Čtyřicet dva" } } \ No newline at end of file diff --git a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/SourceExt/cs.json b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/SourceExt/cs.json index 40c51d6732..8054f6de70 100644 --- a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/SourceExt/cs.json +++ b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/SourceExt/cs.json @@ -1,6 +1,6 @@ { "culture": "cs", "texts": { - "SeeYou": "See you" + "SeeYou": "Měj se" } } \ No newline at end of file diff --git a/modules/account/src/Volo.Abp.Account.Web/Localization/Resources/AbpAccount/Web/cs.json b/modules/account/src/Volo.Abp.Account.Web/Localization/Resources/AbpAccount/Web/cs.json index e943f6c180..f0ec8ad410 100644 --- a/modules/account/src/Volo.Abp.Account.Web/Localization/Resources/AbpAccount/Web/cs.json +++ b/modules/account/src/Volo.Abp.Account.Web/Localization/Resources/AbpAccount/Web/cs.json @@ -1,21 +1,21 @@ { "culture": "cs", "texts": { - "UserName": "User name", - "EmailAddress": "Email address", - "UserNameOrEmailAddress": "User name or email address", - "Password": "Password", - "RememberMe": "Remember me", - "UseAnotherServiceToLogin": "Use another service to log in", - "UserLockedOutMessage": "The user account has been locked out due to invalid login attempts. Please wait a while and try again.", - "InvalidUserNameOrPassword": "Invalid username or password!", - "LoginIsNotAllowed": "You are not allowed to login! You need to confirm your email/phone number.", - "SelfRegistrationDisabledMessage": "Self user registration is disabled for this application. Contact to the application administrator to register a new user.", - "Login": "Login", - "Cancel": "Cancel", - "Register": "Register", - "InvalidLoginRequest": "Invalid login request", - "ThereAreNoLoginSchemesConfiguredForThisClient": "There are no login schemes configured for this client.", - "LogInUsingYourProviderAccount": "Log in using your {0} account" + "UserName": "Uživatelské jméno", + "EmailAddress": "Email", + "UserNameOrEmailAddress": "Uživatelské jméno nebo email", + "Password": "Heslo", + "RememberMe": "Zapamatovat si mě", + "UseAnotherServiceToLogin": "Použít jinou službu k přihlášení", + "UserLockedOutMessage": "Tento účet byl uzamčen z důvodu neúspěšných přihlášení. Přihlaste se prosím později.", + "InvalidUserNameOrPassword": "Neplatné uživatelské jméno nebo heslo!", + "LoginIsNotAllowed": "Není vám dovoleno se přihlásit! Musíte první potvrdit email/telefonní číslo.", + "SelfRegistrationDisabledMessage": "Vlastní registrace uživatele není povolena. K vytvoření účtu kontaktujte správce.", + "Login": "Přihlásit", + "Cancel": "Zrušit", + "Register": "Registrovat", + "InvalidLoginRequest": "Neplatný požadavek k přihlášení", + "ThereAreNoLoginSchemesConfiguredForThisClient": "Pro tohoto klienta nejsou nakonfigurovány žádné přihlašovací schémata.", + "LogInUsingYourProviderAccount": "Přihlásit pomocí vašeho účtu {0}" } } \ No newline at end of file diff --git a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Localization/Resources/Blogging/ApplicationContracts/cs.json b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Localization/Resources/Blogging/ApplicationContracts/cs.json index 0a73a11da6..9b781b029e 100644 --- a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Localization/Resources/Blogging/ApplicationContracts/cs.json +++ b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Localization/Resources/Blogging/ApplicationContracts/cs.json @@ -2,13 +2,13 @@ "culture": "cs", "texts": { "Permission:Blogging": "Blog", - "Permission:Blogs": "Blogs", - "Permission:Posts": "Posts", - "Permission:Tags": "Tags", - "Permission:Comments": "Comments", - "Permission:Management": "Management", - "Permission:Edit": "Edit", - "Permission:Create": "Create", - "Permission:Delete": "Delete" + "Permission:Blogs": "Blogy", + "Permission:Posts": "Příspěvky", + "Permission:Tags": "Tagy", + "Permission:Comments": "Komentáře", + "Permission:Management": "Správa", + "Permission:Edit": "Upravit", + "Permission:Create": "Vytvořit", + "Permission:Delete": "Smazat" } } \ No newline at end of file diff --git a/modules/blogging/src/Volo.Blogging.Web/Localization/Resources/Blogging/Web/cs.json b/modules/blogging/src/Volo.Blogging.Web/Localization/Resources/Blogging/Web/cs.json index b942faea05..5e49b65288 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Localization/Resources/Blogging/Web/cs.json +++ b/modules/blogging/src/Volo.Blogging.Web/Localization/Resources/Blogging/Web/cs.json @@ -1,47 +1,47 @@ { "culture": "cs", "texts": { - "Menu:Blogs": "Blogs", - "Menu:BlogManagement": "Blog Management", - "Title": "Title", - "Delete": "Delete", - "Reply": "Reply", - "ReplyTo": "Reply To {0}", - "ContinueReading": "Continue Reading", - "DaysAgo": "{0} days ago", - "YearsAgo": "{0} years ago", - "MonthsAgo": "{0} months ago", - "WeeksAgo": "{0} weeks ago", - "MinutesAgo": "{0} minutes ago", - "SecondsAgo": "{0} seconds ago", - "HoursAgo": "{0} hours ago", - "Now": "now", - "Content": "Content", - "SeeAll": "See All", - "PopularTags": "Popular Tags", - "WiewsWithCount": "{0} views", - "LastPosts": "Last Posts", - "LeaveComment": "Leave Comment", - "TagsInThisArticle": "Tags in this article", - "Posts": "Posts", - "Edit": "Edit", + "Menu:Blogs": "Blogy", + "Menu:BlogManagement": "Správa blogu", + "Title": "Nadpis", + "Delete": "Smazat", + "Reply": "Odpovědět", + "ReplyTo": "Odpověď pro {0}", + "ContinueReading": "Číst dále", + "DaysAgo": "před {0} dny", + "YearsAgo": "před {0} roky", + "MonthsAgo": "před {0} měsíci", + "WeeksAgo": "před {0} týdny", + "MinutesAgo": "před {0} minutami", + "SecondsAgo": "před {0} sekundami", + "HoursAgo": "před {0} hodinami", + "Now": "nyní", + "Content": "Obsah", + "SeeAll": "Zobrazit vše", + "PopularTags": "Populární tagy", + "WiewsWithCount": "{0} zobrazení", + "LastPosts": "Poslední příspěvky", + "LeaveComment": "Přidat komentář", + "TagsInThisArticle": "Tagy v článku", + "Posts": "Příspěvky", + "Edit": "Upravit", "BLOG": "BLOG", - "CommentDeletionWarningMessage": "Comment will be deleted.", - "PostDeletionWarningMessage": "Post will be deleted.", - "BlogDeletionWarningMessage": "Blog will be deleted.", - "AreYouSure": "Are you sure?", - "CommentWithCount": "{0} comments", - "Comment": "Comment", - "ShareOnTwitter": "Share On Twitter", - "CoverImage": "Cover Image", - "CreateANewPost": "Create A New Post", - "CreateANewBlog": "Create A New Blog", - "WhatIsNew": "What is new?", - "Name": "Name", - "ShortName": "Short Name", - "CreationTime": "Creation Time", - "Description": "Description", - "Blogs": "Blogs", - "Tags": "Tags" + "CommentDeletionWarningMessage": "Komentáře budou smazány.", + "PostDeletionWarningMessage": "Příspěvek bude smazán.", + "BlogDeletionWarningMessage": "Blog bude smazán.", + "AreYouSure": "Jste si jistí?", + "CommentWithCount": "{0} komentářů", + "Comment": "Komentář", + "ShareOnTwitter": "Sdílet na Twitteru", + "CoverImage": "Obrázek obálky", + "CreateANewPost": "Vytvořit nový příspěvek", + "CreateANewBlog": "Vytvořit nový blog", + "WhatIsNew": "Co je nového?", + "Name": "Název", + "ShortName": "Krátký název", + "CreationTime": "Vytvořeno", + "Description": "Popis", + "Blogs": "Blogy", + "Tags": "Tagy" } } \ No newline at end of file diff --git a/modules/docs/app/VoloDocs.Web/Localization/Resources/VoloDocs/Web/cs.json b/modules/docs/app/VoloDocs.Web/Localization/Resources/VoloDocs/Web/cs.json index 75ac74a0f5..2ad18ee148 100644 --- a/modules/docs/app/VoloDocs.Web/Localization/Resources/VoloDocs/Web/cs.json +++ b/modules/docs/app/VoloDocs.Web/Localization/Resources/VoloDocs/Web/cs.json @@ -1,9 +1,9 @@ { "culture": "cs", "texts": { - "WelcomeVoloDocs": "Welcome to the VoloDocs!", - "NoProjectWarning": "There`s no defined project yet!", - "CreateYourFirstProject": "Click here to start your first project", - "NoProject": "No project!" + "WelcomeVoloDocs": "Vítejte ve VoloDocs!", + "NoProjectWarning": "Zatím zde není žádný projekt!", + "CreateYourFirstProject": "Klikněte zde k vytvoření vašeho prvního projektu", + "NoProject": "Žádný projekt!" } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/cs.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/cs.json index 4f74fe9220..18c3c429d4 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/cs.json +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/cs.json @@ -1,10 +1,10 @@ { "culture": "cs", "texts": { - "Permission:DocumentManagement": "Document Management", - "Permission:Projects": "Projects", - "Permission:Edit": "Edit", - "Permission:Delete": "Delete", - "Permission:Create": "Create" + "Permission:DocumentManagement": "Správa dokumentů", + "Permission:Projects": "Projekty", + "Permission:Edit": "Upravit", + "Permission:Delete": "Smazat", + "Permission:Create": "Vytvořit" } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Web/Localization/Resources/Docs/Web/cs.json b/modules/docs/src/Volo.Docs.Admin.Web/Localization/Resources/Docs/Web/cs.json index d520ab4ff7..471fea1b38 100644 --- a/modules/docs/src/Volo.Docs.Admin.Web/Localization/Resources/Docs/Web/cs.json +++ b/modules/docs/src/Volo.Docs.Admin.Web/Localization/Resources/Docs/Web/cs.json @@ -1,27 +1,27 @@ { "culture": "cs", "texts": { - "Menu:DocumentManagement": "Documents", - "Menu:ProjectManagement": "Projects", - "CreateANewProject": "Create new project", - "Edit": "Edit", - "Create": "Create", - "Projects": "Projects", - "Name": "Name", - "ShortName": "ShortName", - "DocumentStoreType": "DocumentStoreType", - "Format": "Format", - "ShortNameInfoText": "Will be used for unique URL.", - "DisplayName:Name": "Name", - "DisplayName:ShortName": "Short name", - "DisplayName:Format": "Format", - "DisplayName:DefaultDocumentName": "Default document name", - "DisplayName:NavigationDocumentName": "Navigation document name", - "DisplayName:MinimumVersion": "Minimum version", - "DisplayName:MainWebsiteUrl": "Main web site URL", - "DisplayName:LatestVersionBranchName": "Latest version branch name", - "DisplayName:GitHubRootUrl": "GitHub root URL", - "DisplayName:GitHubAccessToken": "GitHub access token", + "Menu:DocumentManagement": "Dokumenty", + "Menu:ProjectManagement": "Projekty", + "CreateANewProject": "Vytvořit nový projekt", + "Edit": "Upravit", + "Create": "Vytvořit", + "Projects": "Projekty", + "Name": "Název", + "ShortName": "Krátký název", + "DocumentStoreType": "Typ uložiště dokumentu", + "Format": "Formát", + "ShortNameInfoText": "Bude použíto k unikátnímu URL.", + "DisplayName:Name": "Název", + "DisplayName:ShortName": "Krátký název", + "DisplayName:Format": "Formát", + "DisplayName:DefaultDocumentName": "Název výchozího dokumentu", + "DisplayName:NavigationDocumentName": "Název navigačního dokumentu", + "DisplayName:MinimumVersion": "Nejnižší verze", + "DisplayName:MainWebsiteUrl": "URL hlavních webových stránek", + "DisplayName:LatestVersionBranchName": "Název poslední verze odvětví", + "DisplayName:GitHubRootUrl": "GitHub kořenové URL", + "DisplayName:GitHubAccessToken": "GitHub přístupový token", "DisplayName:GitHubUserAgent": "GitHub user agent" } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Localization/Domain/cs.json b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Localization/Domain/cs.json index 3c853d0b8a..ec882e6538 100644 --- a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Localization/Domain/cs.json +++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Localization/Domain/cs.json @@ -1,18 +1,18 @@ { "culture": "cs", "texts": { - "Documents": "Documents", - "BackToWebsite": "Back to website", - "Contributors": "Contributors", - "ShareOn": "Share on", - "Version": "Version", - "Edit": "Edit", - "Delete": "Delete", - "InThisDocument": "In this document", - "GoToTop": "Go to top", - "Projects": "Project(s)", - "NoProjectWarning": "There are no projects yet!", - "DocumentNotFound": "Oops, the requested document was not found!", - "NavigationDocumentNotFound": "This version does not have a navigation document!" + "Documents": "Dokumenty", + "BackToWebsite": "Zpět na stránky", + "Contributors": "Přispěvatelé", + "ShareOn": "Sdílet na", + "Version": "Verze", + "Edit": "Upravit", + "Delete": "Smazat", + "InThisDocument": "V tomto dokumentu", + "GoToTop": "Přejít nahoru", + "Projects": "Projekt(y)", + "NoProjectWarning": "Zatím zde není žádný projekt!", + "DocumentNotFound": "Ups, vyžádaný dokument neexistuje!", + "NavigationDocumentNotFound": "Tato verze nemá navigační dokument!" } } \ No newline at end of file diff --git a/modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Localization/Resources/FeatureManagement/cs.json b/modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Localization/Resources/FeatureManagement/cs.json index bb0b195455..8cbecf08ab 100644 --- a/modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Localization/Resources/FeatureManagement/cs.json +++ b/modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Localization/Resources/FeatureManagement/cs.json @@ -1,6 +1,6 @@ { "culture": "cs", "texts": { - "Features": "Features" + "Features": "Funkce" } } \ No newline at end of file diff --git a/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/Localization/ApplicationContracts/cs.json b/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/Localization/ApplicationContracts/cs.json index f7833b9f43..8580872991 100644 --- a/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/Localization/ApplicationContracts/cs.json +++ b/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/Localization/ApplicationContracts/cs.json @@ -1,14 +1,14 @@ { "culture": "cs", "texts": { - "Volo.Abp.Identity:010001": "You can not delete your own account!", - "Permission:IdentityManagement": "Identity management", - "Permission:RoleManagement": "Role management", - "Permission:Create": "Create", - "Permission:Edit": "Edit", - "Permission:Delete": "Delete", - "Permission:ChangePermissions": "Change permissions", - "Permission:UserManagement": "User management", - "Permission:UserLookup": "User lookup" + "Volo.Abp.Identity:010001": "Nemůžete smazat svůj vlastní účet!", + "Permission:IdentityManagement": "Správa identit", + "Permission:RoleManagement": "Správa rolí", + "Permission:Create": "Vytvořit", + "Permission:Edit": "Upravit", + "Permission:Delete": "Smazat", + "Permission:ChangePermissions": "Změnit oprávnění", + "Permission:UserManagement": "Správa uživatelů", + "Permission:UserLookup": "Vyhledání uživatele" } } \ No newline at end of file diff --git a/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/Localization/Domain/cs.json b/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/Localization/Domain/cs.json index 4ac5a3104c..f6fdea467d 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/Localization/Domain/cs.json +++ b/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/Localization/Domain/cs.json @@ -1,33 +1,33 @@ { "culture": "cs", "texts": { - "Identity.DefaultError": "An unknown failure has occurred.", - "Identity.ConcurrencyFailure": "Optimistic concurrency failure, object has been modified.", - "Identity.DuplicateEmail": "Email '{0}' is already taken.", - "Identity.DuplicateRoleName": "Role name '{0}' is already taken.", - "Identity.DuplicateUserName": "User name '{0}' is already taken.", - "Identity.InvalidEmail": "Email '{0}' is invalid.", - "Identity.InvalidPasswordHasherCompatibilityMode": "The provided PasswordHasherCompatibilityMode is invalid.", - "Identity.InvalidPasswordHasherIterationCount": "The iteration count must be a positive integer.", - "Identity.InvalidRoleName": "Role name '{0}' is invalid.", - "Identity.InvalidToken": "Invalid token.", - "Identity.InvalidUserName": "User name '{0}' is invalid, can only contain letters or digits.", - "Identity.LoginAlreadyAssociated": "A user with this login already exists.", - "Identity.PasswordMismatch": "Incorrect password.", - "Identity.PasswordRequiresDigit": "Passwords must have at least one digit ('0'-'9').", - "Identity.PasswordRequiresLower": "Passwords must have at least one lowercase ('a'-'z').", - "Identity.PasswordRequiresNonAlphanumeric": "Passwords must have at least one non alphanumeric character.", - "Identity.PasswordRequiresUpper": "Passwords must have at least one uppercase ('A'-'Z').", - "Identity.PasswordTooShort": "Passwords must be at least {0} characters.", - "Identity.RoleNotFound": "Role {0} does not exist.", - "Identity.UserAlreadyHasPassword": "User already has a password set.", - "Identity.UserAlreadyInRole": "User already in role '{0}'.", - "Identity.UserLockedOut": "User is locked out.", - "Identity.UserLockoutNotEnabled": "Lockout is not enabled for this user.", - "Identity.UserNameNotFound": "User {0} does not exist.", - "Identity.UserNotInRole": "User is not in role '{0}'.", - "Identity.PasswordConfirmationFailed": "Password does not match the confirm password.", - "Identity.StaticRoleRenamingErrorMessage": "Static roles can not be renamed.", - "Identity.StaticRoleDeletionErrorMessage": "Static roles can not be deleted." + "Identity.DefaultError": "Došlo k neznámé chybě.", + "Identity.ConcurrencyFailure": "Selhání optimistické souběžnosti, objekt byl změněn.", + "Identity.DuplicateEmail": "Email '{0}' již existuje.", + "Identity.DuplicateRoleName": "Role '{0}' již existuje.", + "Identity.DuplicateUserName": "Uživatelské jméno '{0}' již existuje.", + "Identity.InvalidEmail": "Email '{0}' je neplatný.", + "Identity.InvalidPasswordHasherCompatibilityMode": "Dodaný PasswordHasherCompatibilityMode je neplatný.", + "Identity.InvalidPasswordHasherIterationCount": "Počet iterací musí být kladné celé číslo.", + "Identity.InvalidRoleName": "Role '{0}' je neplatná.", + "Identity.InvalidToken": "Neplatný token.", + "Identity.InvalidUserName": "Uživatelské jméno '{0}' je neplatné, může obsahovat pouze písmena a číslice.", + "Identity.LoginAlreadyAssociated": "Uživatel s tímto přihlášením již existuje.", + "Identity.PasswordMismatch": "Chybné heslo.", + "Identity.PasswordRequiresDigit": "Hesla musí obsahovat alespoň jednu číslici ('0'-'9').", + "Identity.PasswordRequiresLower": "Hesla musí obsahovat alespoň jedno malé písmeno ('a'-'z').", + "Identity.PasswordRequiresNonAlphanumeric": "Hesla musí obsahovat alespoň jeden nealfanumerický znak.", + "Identity.PasswordRequiresUpper": "Hesla musí obsahovat alespoň jedno velké písmeno ('A'-'Z').", + "Identity.PasswordTooShort": "Hesla musí být dlouhá alespoň {0} znaků.", + "Identity.RoleNotFound": "Role {0} neexistuje.", + "Identity.UserAlreadyHasPassword": "Uživatel již má nastavené heslo.", + "Identity.UserAlreadyInRole": "Uživatel již je v roli '{0}'.", + "Identity.UserLockedOut": "Uživatel je uzamčen.", + "Identity.UserLockoutNotEnabled": "Uzamčení není umožněno pro tohoto uživatele.", + "Identity.UserNameNotFound": "Uživatel {0} neexistuje.", + "Identity.UserNotInRole": "Uživatel není v roli '{0}'.", + "Identity.PasswordConfirmationFailed": "Heslo nesouhlasí s potvrzovacím heslem.", + "Identity.StaticRoleRenamingErrorMessage": "Statické role nemohou být přejmenovány.", + "Identity.StaticRoleDeletionErrorMessage": "Statické role nemohou být smazány." } } \ No newline at end of file diff --git a/modules/identity/src/Volo.Abp.Identity.Web/Localization/Resources/AbpIdentity/cs.json b/modules/identity/src/Volo.Abp.Identity.Web/Localization/Resources/AbpIdentity/cs.json index e0a1afa742..30217206f4 100644 --- a/modules/identity/src/Volo.Abp.Identity.Web/Localization/Resources/AbpIdentity/cs.json +++ b/modules/identity/src/Volo.Abp.Identity.Web/Localization/Resources/AbpIdentity/cs.json @@ -1,39 +1,39 @@ { "culture": "cs", "texts": { - "Menu:IdentityManagement": "Identity management", - "Users": "Users", - "NewUser": "New user", - "UserName": "User name", - "EmailAddress": "Email address", - "PhoneNumber": "Phone number", - "UserInformations": "User informations", - "DisplayName:IsDefault": "Default", - "DisplayName:IsStatic": "Static", - "DisplayName:IsPublic": "Public", - "Roles": "Roles", - "Password": "Password", - "PersonalInfo": "My profile", - "PersonalSettings": "Personal settings", - "UserDeletionConfirmationMessage": "User '{0}' will be deleted. Do you confirm that?", - "RoleDeletionConfirmationMessage": "Role '{0}' will be deleted. Do you confirm that?", - "DisplayName:RoleName": "Role name", - "DisplayName:UserName": "User name", - "DisplayName:Name": "Name", - "DisplayName:Surname": "Surname", - "DisplayName:Password": "Password", - "DisplayName:Email": "Email address", - "DisplayName:PhoneNumber": "Phone number", - "DisplayName:TwoFactorEnabled": "Two factor verification", - "DisplayName:LockoutEnabled": "Locking account after failed login attempts", - "NewRole": "New role", - "RoleName": "Role name", - "CreationTime": "Creation time", - "Permissions": "Permissions", - "DisplayName:CurrentPassword": "Current password", - "DisplayName:NewPassword": "New password", - "DisplayName:NewPasswordConfirm": "Confirm new password", - "PasswordChangedMessage": "Your password has been changed successfully.", - "PersonalSettingsSavedMessage": "Your personal settings has been saved successfully." + "Menu:IdentityManagement": "Správa identit", + "Users": "Uživatelé", + "NewUser": "Nový uživatel", + "UserName": "Uživatelské jméno", + "EmailAddress": "Email", + "PhoneNumber": "Telefonní číslo", + "UserInformations": "Uživatelské informace", + "DisplayName:IsDefault": "Výchozí", + "DisplayName:IsStatic": "Statické", + "DisplayName:IsPublic": "Veřejné", + "Roles": "Role", + "Password": "Heslo", + "PersonalInfo": "Můj profil", + "PersonalSettings": "Osobní nastavení", + "UserDeletionConfirmationMessage": "Uživatel '{0}' bude smazán. Jste si jistí?", + "RoleDeletionConfirmationMessage": "Role '{0}' bude smazána. Jste si jistí?", + "DisplayName:RoleName": "Název role", + "DisplayName:UserName": "Uživatelské jméno", + "DisplayName:Name": "Jméno", + "DisplayName:Surname": "Příjmení", + "DisplayName:Password": "Heslo", + "DisplayName:Email": "Email", + "DisplayName:PhoneNumber": "Telefonní číslo", + "DisplayName:TwoFactorEnabled": "Dvoufázové ověřování", + "DisplayName:LockoutEnabled": "Zamčení účtu po neúspěšných pokusech", + "NewRole": "Nová role", + "RoleName": "Název role", + "CreationTime": "Vytvořeno", + "Permissions": "Oprávnění", + "DisplayName:CurrentPassword": "Stávající heslo", + "DisplayName:NewPassword": "Nové heslo", + "DisplayName:NewPasswordConfirm": "Potvrzení nového hesla", + "PasswordChangedMessage": "Vaše heslo bylo úspěšně změněno.", + "PersonalSettingsSavedMessage": "Vaše osobní nastavení bylo úspěšně uloženo." } } \ No newline at end of file diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Localization/Resources/AbpPermissionManagement/cs.json b/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Localization/Resources/AbpPermissionManagement/cs.json index 31c3a05605..4c500d06eb 100644 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Localization/Resources/AbpPermissionManagement/cs.json +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Localization/Resources/AbpPermissionManagement/cs.json @@ -1,10 +1,10 @@ { "culture": "cs", "texts": { - "Permissions": "Permissions", - "OnlyProviderPermissons": "Only this provider", - "All": "All", - "SelectAllInAllTabs": "Grant all permissions", - "SelectAllInThisTab": "Select all" + "Permissions": "Oprávnění", + "OnlyProviderPermissons": "Pouze tento poskytovatel", + "All": "Všechna", + "SelectAllInAllTabs": "Dát veškerá oprávnění", + "SelectAllInThisTab": "Vybrat vše" } } \ No newline at end of file diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Localization/Resources/AbpSettingManagement/cs.json b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Localization/Resources/AbpSettingManagement/cs.json index 2e1cc57421..a0357eda0c 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Localization/Resources/AbpSettingManagement/cs.json +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Localization/Resources/AbpSettingManagement/cs.json @@ -1,6 +1,6 @@ { "culture": "cs", "texts": { - "Settings": "Settings" + "Settings": "Nastavení" } } \ No newline at end of file diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Application.Contracts/Volo/Abp/TenantManagement/Localization/ApplicationContracts/cs.json b/modules/tenant-management/src/Volo.Abp.TenantManagement.Application.Contracts/Volo/Abp/TenantManagement/Localization/ApplicationContracts/cs.json index b3b67e9175..415294c34a 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Application.Contracts/Volo/Abp/TenantManagement/Localization/ApplicationContracts/cs.json +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Application.Contracts/Volo/Abp/TenantManagement/Localization/ApplicationContracts/cs.json @@ -1,11 +1,11 @@ { "culture": "cs", "texts": { - "Permission:TenantManagement": "Tenant management", - "Permission:Create": "Create", - "Permission:Edit": "Edit", - "Permission:Delete": "Delete", - "Permission:ManageConnectionStrings": "Manage connection strings", - "Permission:ManageFeatures": "Manage features" + "Permission:TenantManagement": "Správa tenantů", + "Permission:Create": "Vytvořit", + "Permission:Edit": "Upravit", + "Permission:Delete": "Smazat", + "Permission:ManageConnectionStrings": "Spravovat connection stringy", + "Permission:ManageFeatures": "Spravovat funkce" } } \ No newline at end of file diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Localization/Resources/AbpTenantManagement/Web/cs.json b/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Localization/Resources/AbpTenantManagement/Web/cs.json index 412655016d..df819c5798 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Localization/Resources/AbpTenantManagement/Web/cs.json +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Localization/Resources/AbpTenantManagement/Web/cs.json @@ -1,14 +1,14 @@ { "culture": "cs", "texts": { - "Menu:TenantManagement": "Tenant management", - "Tenants": "Tenants", - "NewTenant": "New tenant", - "TenantName": "Tenant name", - "DisplayName:TenantName": "Tenant name", - "TenantDeletionConfirmationMessage": "Tenant '{0}' will be deleted. Do you confirm that?", - "ConnectionStrings": "Connection Strings", - "DisplayName:DefaultConnectionString": "Default Connection String", - "DisplayName:UseSharedDatabase": "Use the Shared Database" + "Menu:TenantManagement": "Správa tenantů", + "Tenants": "Tenanty", + "NewTenant": "Nový tenant", + "TenantName": "Název tenantu", + "DisplayName:TenantName": "Název tenantu", + "TenantDeletionConfirmationMessage": "Tenant '{0}' bude smazán. Jste si jistí?", + "ConnectionStrings": "Connection stringy", + "DisplayName:DefaultConnectionString": "Výchozí connection string", + "DisplayName:UseSharedDatabase": "Použít sdílenou databázi" } } \ No newline at end of file diff --git a/samples/BookStore/src/Acme.BookStore.Domain/Localization/BookStore/cs.json b/samples/BookStore/src/Acme.BookStore.Domain/Localization/BookStore/cs.json index c594aaad29..86d19a6aa7 100644 --- a/samples/BookStore/src/Acme.BookStore.Domain/Localization/BookStore/cs.json +++ b/samples/BookStore/src/Acme.BookStore.Domain/Localization/BookStore/cs.json @@ -1,20 +1,20 @@ { "culture": "cs", "texts": { - "Menu:Home": "Home", - "Welcome": "Welcome", - "LongWelcomeMessage": "Welcome to the application. This is a startup project based on the ABP framework. For more information, visit abp.io.", - "Menu:BookStore": "Book Store", - "Menu:Books": "Books", - "Name": "Name", - "Type": "Type", - "PublishDate": "Publish Date", - "Price": "Price", - "CreationTime": "Creation Time", - "NewBook": "New book", - "Books": "Books", - "Update": "Update", - "BookDeletionConfirmationMessage": "Are you sure to delete this book: {0}", - "SuccessfullyDeleted": "Successfully deleted." + "Menu:Home": "Úvod", + "Welcome": "Vítejte", + "LongWelcomeMessage": "Vítejte v aplikaci. Toto je startovací projekt založený na ABP frameworku. Pro více informací, navštivte abp.io.", + "Menu:BookStore": "Knihkupectví", + "Menu:Books": "Knihy", + "Name": "Název", + "Type": "Typ", + "PublishDate": "Publikováno", + "Price": "Cena", + "CreationTime": "Vytvořeno", + "NewBook": "Nová kniha", + "Books": "Knihy", + "Update": "Aktualizovat", + "BookDeletionConfirmationMessage": "Opravdu chcete smazat tuto knihu: {0}", + "SuccessfullyDeleted": "Úspěšně smazáno." } } \ No newline at end of file diff --git a/samples/DashboardDemo/src/DashboardDemo.Domain/Localization/DashboardDemo/cs.json b/samples/DashboardDemo/src/DashboardDemo.Domain/Localization/DashboardDemo/cs.json index c60a597e3c..01438ba1e8 100644 --- a/samples/DashboardDemo/src/DashboardDemo.Domain/Localization/DashboardDemo/cs.json +++ b/samples/DashboardDemo/src/DashboardDemo.Domain/Localization/DashboardDemo/cs.json @@ -1,10 +1,10 @@ { "culture": "cs", "texts": { - "Menu:Home": "Home", - "Welcome": "Welcome", - "RolesInApplication": "Roles in application", - "UserCount": "User count", - "LongWelcomeMessage": "Welcome to the application. This is a startup project based on the ABP framework. For more information, visit abp.io." + "Menu:Home": "Úvod", + "Welcome": "Vítejte", + "RolesInApplication": "Role v aplikaci", + "UserCount": "Počet uživatelů", + "LongWelcomeMessage": "Vítejte v aplikaci. Toto je startovací projekt založený na ABP frameworku. Pro více informací, navštivte abp.io." } } \ No newline at end of file diff --git a/samples/MicroserviceDemo/modules/product/src/ProductManagement.Application.Contracts/ProductManagement/Localization/ApplicationContracts/cs.json b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Application.Contracts/ProductManagement/Localization/ApplicationContracts/cs.json index 3855ae00ea..fb05fd06ac 100644 --- a/samples/MicroserviceDemo/modules/product/src/ProductManagement.Application.Contracts/ProductManagement/Localization/ApplicationContracts/cs.json +++ b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Application.Contracts/ProductManagement/Localization/ApplicationContracts/cs.json @@ -1,10 +1,10 @@ { "culture": "cs", "texts": { - "Permission:ProductManagement": "Product Management", - "Permission:Products": "Products", - "Permission:Edit": "Edit", - "Permission:Delete": "Delete", - "Permission:Create": "Create" + "Permission:ProductManagement": "Správa produktů", + "Permission:Products": "Produkty", + "Permission:Edit": "Upravit", + "Permission:Delete": "Smazat", + "Permission:Create": "Vytvořit" } } \ No newline at end of file diff --git a/samples/MicroserviceDemo/modules/product/src/ProductManagement.Web/Localization/Resources/ProductManagement/cs.json b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Web/Localization/Resources/ProductManagement/cs.json index cabdbeb74e..489699d9a6 100644 --- a/samples/MicroserviceDemo/modules/product/src/ProductManagement.Web/Localization/Resources/ProductManagement/cs.json +++ b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Web/Localization/Resources/ProductManagement/cs.json @@ -1,16 +1,16 @@ { "culture": "cs", "texts": { - "Menu:ProductManagement": "Product Management", - "Menu:Products": "Products", - "ProductManagement": "Product Management", - "CreateANewProduct": "Create A New Product", - "Products": "Products", - "StockCount": "Stock Count", - "Code": "Code", - "Name": "Name", - "Price": "Price", - "ImageName": "Image Name", - "ProductDeletionWarningMessage": "Are you sure you want to delete this product?" + "Menu:ProductManagement": "Správa produktů", + "Menu:Products": "Produkty", + "ProductManagement": "Správa produktů", + "CreateANewProduct": "Vytvořit nový produkt", + "Products": "Produkty", + "StockCount": "Skladem", + "Code": "Kód", + "Name": "Název", + "Price": "Cena", + "ImageName": "Název obrázku", + "ProductDeletionWarningMessage": "Opravdu chcete smazat tento produkt?" } } \ No newline at end of file diff --git a/templates/mvc/src/MyCompanyName.MyProjectName.Domain.Shared/Localization/MyProjectName/cs.json b/templates/mvc/src/MyCompanyName.MyProjectName.Domain.Shared/Localization/MyProjectName/cs.json index 7a802e140c..619521939c 100644 --- a/templates/mvc/src/MyCompanyName.MyProjectName.Domain.Shared/Localization/MyProjectName/cs.json +++ b/templates/mvc/src/MyCompanyName.MyProjectName.Domain.Shared/Localization/MyProjectName/cs.json @@ -1,8 +1,8 @@ { "culture": "cs", "texts": { - "Menu:Home": "Home", - "Welcome": "Welcome", - "LongWelcomeMessage": "Welcome to the application. This is a startup project based on the ABP framework. For more information, visit abp.io." + "Menu:Home": "Úvod", + "Welcome": "Vítejte", + "LongWelcomeMessage": "Vítejte v aplikaci. Toto je startovací projekt založený na ABP frameworku. Pro více informací, navštivte abp.io." } } \ No newline at end of file From 19453a0dfa5626fe8f5f1d1a4f73f456694928ac Mon Sep 17 00:00:00 2001 From: Halil ibrahim Kalkan Date: Wed, 29 May 2019 18:41:04 +0300 Subject: [PATCH 017/166] Add other file types. --- .../VirtualFileSystem/AspNetCoreContentOptions.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/VirtualFileSystem/AspNetCoreContentOptions.cs b/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/VirtualFileSystem/AspNetCoreContentOptions.cs index 73d189f1d3..c4265c7ced 100644 --- a/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/VirtualFileSystem/AspNetCoreContentOptions.cs +++ b/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/VirtualFileSystem/AspNetCoreContentOptions.cs @@ -22,7 +22,11 @@ namespace Volo.Abp.AspNetCore.VirtualFileSystem ".css", ".png", ".jpg", - ".jpeg" + ".jpeg", + ".woff", + ".woff2", + ".tff", + ".otf" }; } } From 2f1162ec4345095a93de27fe7d6cb040c767bf33 Mon Sep 17 00:00:00 2001 From: Halil ibrahim Kalkan Date: Wed, 29 May 2019 19:10:51 +0300 Subject: [PATCH 018/166] Add publish related properties to MVC template projects. --- .../MyCompanyName.MyProjectName.IdentityServer.csproj | 6 ++++++ .../MyCompanyName.MyProjectName.Web.Host.csproj | 6 ++++++ .../MyCompanyName.MyProjectName.Web.csproj | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/templates/mvc/src/MyCompanyName.MyProjectName.IdentityServer/MyCompanyName.MyProjectName.IdentityServer.csproj b/templates/mvc/src/MyCompanyName.MyProjectName.IdentityServer/MyCompanyName.MyProjectName.IdentityServer.csproj index bf8e4e46c0..cd21488394 100644 --- a/templates/mvc/src/MyCompanyName.MyProjectName.IdentityServer/MyCompanyName.MyProjectName.IdentityServer.csproj +++ b/templates/mvc/src/MyCompanyName.MyProjectName.IdentityServer/MyCompanyName.MyProjectName.IdentityServer.csproj @@ -5,6 +5,12 @@ netcoreapp2.2 MyCompanyName.MyProjectName + $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; + true + true + true + true + false diff --git a/templates/mvc/src/MyCompanyName.MyProjectName.Web.Host/MyCompanyName.MyProjectName.Web.Host.csproj b/templates/mvc/src/MyCompanyName.MyProjectName.Web.Host/MyCompanyName.MyProjectName.Web.Host.csproj index b1fef7b208..509751db3c 100644 --- a/templates/mvc/src/MyCompanyName.MyProjectName.Web.Host/MyCompanyName.MyProjectName.Web.Host.csproj +++ b/templates/mvc/src/MyCompanyName.MyProjectName.Web.Host/MyCompanyName.MyProjectName.Web.Host.csproj @@ -5,6 +5,12 @@ netcoreapp2.2 MyCompanyName.MyProjectName + $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; + true + true + true + true + false diff --git a/templates/mvc/src/MyCompanyName.MyProjectName.Web/MyCompanyName.MyProjectName.Web.csproj b/templates/mvc/src/MyCompanyName.MyProjectName.Web/MyCompanyName.MyProjectName.Web.csproj index f0dfcbb41b..77e1810290 100644 --- a/templates/mvc/src/MyCompanyName.MyProjectName.Web/MyCompanyName.MyProjectName.Web.csproj +++ b/templates/mvc/src/MyCompanyName.MyProjectName.Web/MyCompanyName.MyProjectName.Web.csproj @@ -5,6 +5,12 @@ netcoreapp2.2 MyCompanyName.MyProjectName + $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; + true + true + true + true + false From c8f0c58d00e02e33e542039f81b05221372bb60e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=B6=9B?= Date: Thu, 30 May 2019 10:17:34 +0800 Subject: [PATCH 019/166] AbpFeatureManagementResource to AbpTenantManagementWebModule The resouce key "Features" is used by index.js: https://github.com/abpframework/abp/blob/2f1162ec4345095a93de27fe7d6cb040c767bf33/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/Index.js#L45 --- .../AbpTenantManagementWebModule.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/AbpTenantManagementWebModule.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/AbpTenantManagementWebModule.cs index 855fa24bb3..1549664c27 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/AbpTenantManagementWebModule.cs +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/AbpTenantManagementWebModule.cs @@ -5,6 +5,7 @@ using Volo.Abp.AspNetCore.Mvc.Localization; using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap; using Volo.Abp.AutoMapper; using Volo.Abp.FeatureManagement; +using Volo.Abp.FeatureManagement.Localization; using Volo.Abp.Localization; using Volo.Abp.Localization.Resources.AbpValidation; using Volo.Abp.Modularity; @@ -47,6 +48,7 @@ namespace Volo.Abp.TenantManagement.Web .Get() .AddBaseTypes( typeof(AbpValidationResource), + typeof(AbpFeatureManagementResource), typeof(AbpUiResource) ).AddVirtualJson("/Localization/Resources/AbpTenantManagement/Web"); }); From 77fef984b88373a6cb650d3cf8ac36ef17cac76f Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Thu, 30 May 2019 08:33:20 +0300 Subject: [PATCH 020/166] multi language on docs refactor --- .../Docs/Documents/ContentWithDetailsDto.cs | 2 ++ .../Docs/DocsApplicationAutoMapperProfile.cs | 2 +- .../Volo/Docs/Documents/DocumentAppService.cs | 9 ++++--- .../Volo/Docs/Documents/LanguageConfig.cs | 6 ++--- ...nguageConfigElement.cs => LanguageInfo.cs} | 2 +- .../Documents/TagHelpers/TreeTagHelper.cs | 9 ++++--- .../Pages/Documents/Project/Index.cshtml | 25 +++++++++++-------- .../Pages/Documents/Project/Index.cshtml.cs | 5 ++++ .../Pages/Documents/Project/index.js | 13 ---------- 9 files changed, 37 insertions(+), 36 deletions(-) rename modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/{LanguageConfigElement.cs => LanguageInfo.cs} (82%) diff --git a/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/ContentWithDetailsDto.cs b/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/ContentWithDetailsDto.cs index 44b2ef6861..43fab40c0c 100644 --- a/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/ContentWithDetailsDto.cs +++ b/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/ContentWithDetailsDto.cs @@ -25,6 +25,8 @@ namespace Volo.Docs.Documents public string FileName { get; set; } + public string CurrentLanguageCode { get; set; } + public ProjectDto Project { get; set; } public List Contributors { get; set; } diff --git a/modules/docs/src/Volo.Docs.Application/Volo/Docs/DocsApplicationAutoMapperProfile.cs b/modules/docs/src/Volo.Docs.Application/Volo/Docs/DocsApplicationAutoMapperProfile.cs index 320dbe49c3..2f029f3a39 100644 --- a/modules/docs/src/Volo.Docs.Application/Volo/Docs/DocsApplicationAutoMapperProfile.cs +++ b/modules/docs/src/Volo.Docs.Application/Volo/Docs/DocsApplicationAutoMapperProfile.cs @@ -12,7 +12,7 @@ namespace Volo.Docs CreateMap().Ignore(x=>x.Languages); CreateMap(); CreateMap() - .Ignore(x => x.Project).Ignore(x => x.Contributors); + .Ignore(x => x.Project).Ignore(x => x.Contributors).Ignore(x => x.CurrentLanguageCode); CreateMap(); CreateMap(); } diff --git a/modules/docs/src/Volo.Docs.Application/Volo/Docs/Documents/DocumentAppService.cs b/modules/docs/src/Volo.Docs.Application/Volo/Docs/Documents/DocumentAppService.cs index 4b214547f5..6bfe9b40ee 100644 --- a/modules/docs/src/Volo.Docs.Application/Volo/Docs/Documents/DocumentAppService.cs +++ b/modules/docs/src/Volo.Docs.Application/Volo/Docs/Documents/DocumentAppService.cs @@ -115,7 +115,7 @@ namespace Volo.Docs.Documents var language = GetLanguageByCode(languages, languageCode); var document = await store.GetDocumentAsync(project, documentName, language.Code, version); Logger.LogInformation($"Document retrieved: {documentName}"); - return CreateDocumentWithDetailsDto(project, document, languages); + return CreateDocumentWithDetailsDto(project, document, languages, language.Code); } if (Debugger.IsAttached) @@ -135,7 +135,7 @@ namespace Volo.Docs.Documents ); } - protected virtual LanguageConfigElement GetLanguageByCode(LanguageConfig languageCodes, string languageCode) + protected virtual LanguageInfo GetLanguageByCode(LanguageConfig languageCodes, string languageCode) { var language = languageCodes.Languages.FirstOrDefault(l => l.Code == languageCode); @@ -159,16 +159,19 @@ namespace Volo.Docs.Documents ); } - protected virtual DocumentWithDetailsDto CreateDocumentWithDetailsDto(Project project, Document document, LanguageConfig languages) + protected virtual DocumentWithDetailsDto CreateDocumentWithDetailsDto(Project project, Document document, LanguageConfig languages, string languageCode) { var documentDto = ObjectMapper.Map(document); documentDto.Project = ObjectMapper.Map(project); documentDto.Contributors = ObjectMapper.Map, List>(document.Contributors); + documentDto.Project.Languages = new Dictionary(); foreach (var language in languages.Languages) { documentDto.Project.Languages.Add(language.Code,language.DisplayName); } + + documentDto.CurrentLanguageCode = languageCode; return documentDto; } } diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/LanguageConfig.cs b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/LanguageConfig.cs index b53497a948..d98444386f 100644 --- a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/LanguageConfig.cs +++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/LanguageConfig.cs @@ -1,11 +1,9 @@ -using System; -using System.Collections.Generic; -using System.Text; +using System.Collections.Generic; namespace Volo.Docs.Documents { public class LanguageConfig { - public List Languages { get; set; } + public List Languages { get; set; } } } diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/LanguageConfigElement.cs b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/LanguageInfo.cs similarity index 82% rename from modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/LanguageConfigElement.cs rename to modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/LanguageInfo.cs index 25525394ca..f384dcaa76 100644 --- a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/LanguageConfigElement.cs +++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/LanguageInfo.cs @@ -1,6 +1,6 @@ namespace Volo.Docs.Documents { - public class LanguageConfigElement + public class LanguageInfo { public string DisplayName { get; set; } diff --git a/modules/docs/src/Volo.Docs.Web/Areas/Documents/TagHelpers/TreeTagHelper.cs b/modules/docs/src/Volo.Docs.Web/Areas/Documents/TagHelpers/TreeTagHelper.cs index 38e95a6e93..2e8ec8bde0 100644 --- a/modules/docs/src/Volo.Docs.Web/Areas/Documents/TagHelpers/TreeTagHelper.cs +++ b/modules/docs/src/Volo.Docs.Web/Areas/Documents/TagHelpers/TreeTagHelper.cs @@ -35,6 +35,9 @@ namespace Volo.Docs.Areas.Documents.TagHelpers [HtmlAttributeName("project-format")] public string ProjectFormat { get; set; } + [HtmlAttributeName("language")] + public string LanguageCode { get; set; } + public override void Process(TagHelperContext context, TagHelperOutput output) { var content = new StringBuilder(); @@ -107,7 +110,7 @@ namespace Volo.Docs.Areas.Documents.TagHelpers } else { - listInnerItem = string.Format(ListItemAnchor, NormalizePath(node.Path, node.HasChildItems), textCss, node.Text.IsNullOrEmpty() ? "?" : node.Text); + listInnerItem = string.Format(ListItemAnchor, NormalizePath(node.Path), textCss, node.Text.IsNullOrEmpty() ? "?" : node.Text); } return string.Format(LiItemTemplateWithLink, @@ -117,7 +120,7 @@ namespace Volo.Docs.Areas.Documents.TagHelpers content); } - private string NormalizePath(string path, bool hasChildItems) + private string NormalizePath(string path) { if (UrlHelper.IsExternalLink(path)) { @@ -131,7 +134,7 @@ namespace Volo.Docs.Areas.Documents.TagHelpers return "javascript:;"; } - return "/documents/" + ProjectName + "/" + Version + "/" + pathWithoutFileExtension; + return "/documents/" + LanguageCode + "/" + ProjectName + "/" + Version + "/" + pathWithoutFileExtension; } private string RemoveFileExtensionFromPath(string path) 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 3e6a8dda35..9dd8b484d7 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 @@ -107,7 +107,7 @@ } -
+
@@ -116,7 +116,7 @@
-
+
@if (Model.Navigation == null || Model.Navigation.Content.IsNullOrEmpty()) @@ -132,6 +132,7 @@ project-name="@Model.ProjectName" project-format="@Model.Project.Format" selected-document-name="@Model.DocumentNameWithExtension" + language="@Model.LanguageCode" id="sidebar-scroll" class="nav nav-list"> } @@ -158,15 +159,17 @@
- @if (Model.LanguageSelectListItems.Count > 1) - { - - } +
+ @if (Model.LanguageSelectListItems.Count > 1) + { + + } - @if (!string.IsNullOrEmpty(Model.Document.EditLink)) - { - @L["Edit"] - } + @if (!string.IsNullOrEmpty(Model.Document.EditLink)) + { + @L["Edit"] + } +
@@ -227,4 +230,4 @@
- \ No newline at end of file + \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs index 744ad1d7b9..a50340294b 100644 --- a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs +++ b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs @@ -153,6 +153,8 @@ namespace Volo.Docs.Pages.Documents.Project return; } + LanguageCode = Document.CurrentLanguageCode; + Navigation.ConvertItems(); } @@ -219,6 +221,7 @@ namespace Volo.Docs.Pages.Documents.Project } ); } + } catch (DocumentNotFoundException) { @@ -232,6 +235,8 @@ namespace Volo.Docs.Pages.Documents.Project ); } + LanguageCode = Document.CurrentLanguageCode; + ConvertDocumentContentToHtml(); } diff --git a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/index.js b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/index.js index 5eeb579f43..8eb2083749 100644 --- a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/index.js +++ b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/index.js @@ -1,17 +1,6 @@ (function ($) { $(function () { - - var addLanguageCodePrefixToLinks = function () { - var anchors = $('#sidebar-scroll a'); - - for (var i = 0; i < anchors.length; i++) { - var anchor = $(anchors[i]); - var newhref = anchor.attr('href').replace("/documents", "/documents/" + $('#LanguageCode').val()); - anchor.attr('href', newhref); - } - }; - var initNavigationFilter = function (navigationContainerId) { var $navigation = $("#" + navigationContainerId); @@ -119,8 +108,6 @@ initSocialShareLinks(); - addLanguageCodePrefixToLinks(); - }); })(jQuery); From 256e6ebce6f102b43c90872eb2e5dcf5b14e0678 Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Thu, 30 May 2019 08:39:58 +0300 Subject: [PATCH 021/166] LanguageCode parameter added for DocumentAppService.GetResourceAsync --- .../Volo/Docs/Documents/DocumentAppService.cs | 4 ++-- .../Volo.Docs.Domain/Volo/Docs/Documents/IDocumentStore.cs | 2 +- .../Volo/Docs/FileSystem/Documents/FileSystemDocumentStore.cs | 2 +- .../Volo/Docs/GitHub/Documents/GithubDocumentStore.cs | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/docs/src/Volo.Docs.Application/Volo/Docs/Documents/DocumentAppService.cs b/modules/docs/src/Volo.Docs.Application/Volo/Docs/Documents/DocumentAppService.cs index 6bfe9b40ee..c7680baf1b 100644 --- a/modules/docs/src/Volo.Docs.Application/Volo/Docs/Documents/DocumentAppService.cs +++ b/modules/docs/src/Volo.Docs.Application/Volo/Docs/Documents/DocumentAppService.cs @@ -72,12 +72,12 @@ namespace Volo.Docs.Documents public async Task GetResourceAsync(GetDocumentResourceInput input) { var project = await _projectRepository.GetAsync(input.ProjectId); - var cacheKey = $"Resource@{project.ShortName}#{input.Name}#{input.Version}"; + var cacheKey = $"Resource@{project.ShortName}#{input.LanguageCode}#{input.Name}#{input.Version}"; async Task GetResourceAsync() { var store = _documentStoreFactory.Create(project.DocumentStoreType); - var documentResource = await store.GetResource(project, input.Name, input.Version); + var documentResource = await store.GetResource(project, input.Name, input.LanguageCode, input.Version); return ObjectMapper.Map(documentResource); } diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/IDocumentStore.cs b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/IDocumentStore.cs index 6f6d90de49..3cbf2c40f2 100644 --- a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/IDocumentStore.cs +++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/IDocumentStore.cs @@ -12,7 +12,7 @@ namespace Volo.Docs.Documents Task> GetVersionsAsync(Project project); - Task GetResource(Project project, string resourceName, string version); + Task GetResource(Project project, string resourceName, string languageCode, string version); Task GetLanguageListAsync(Project project, string version); } diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/FileSystem/Documents/FileSystemDocumentStore.cs b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/FileSystem/Documents/FileSystemDocumentStore.cs index e221dba23e..e74a7c1d83 100644 --- a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/FileSystem/Documents/FileSystemDocumentStore.cs +++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/FileSystem/Documents/FileSystemDocumentStore.cs @@ -55,7 +55,7 @@ namespace Volo.Docs.FileSystem.Documents return JsonConvert.DeserializeObject(configAsJson); } - public async Task GetResource(Project project, string resourceName, string version) + public async Task GetResource(Project project, string resourceName, string languageCode, string version) { var projectFolder = project.GetFileSystemPath(); var path = Path.Combine(projectFolder, resourceName); diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/GitHub/Documents/GithubDocumentStore.cs b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/GitHub/Documents/GithubDocumentStore.cs index 5ca5f310bf..91c03379ab 100644 --- a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/GitHub/Documents/GithubDocumentStore.cs +++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/GitHub/Documents/GithubDocumentStore.cs @@ -91,9 +91,9 @@ namespace Volo.Docs.GitHub.Documents return versions; } - public async Task GetResource(Project project, string resourceName, string version) + public async Task GetResource(Project project, string resourceName, string languageCode, string version) { - var rawRootUrl = CalculateRawRootUrl(project.GetGitHubUrl(version)); + var rawRootUrl = CalculateRawRootUrlWithLanguageCode(project.GetGitHubUrl(version), languageCode); var content = await DownloadWebContentAsByteArrayAsync( rawRootUrl + resourceName, project.GetGitHubAccessTokenOrNull(), From 2153d4f16b362a17d0ec9cb42ced8d1c50a87e01 Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Thu, 30 May 2019 08:43:30 +0300 Subject: [PATCH 022/166] Update FileSystemDocumentStore.cs --- .../Volo/Docs/FileSystem/Documents/FileSystemDocumentStore.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/FileSystem/Documents/FileSystemDocumentStore.cs b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/FileSystem/Documents/FileSystemDocumentStore.cs index e74a7c1d83..ff06abdd27 100644 --- a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/FileSystem/Documents/FileSystemDocumentStore.cs +++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/FileSystem/Documents/FileSystemDocumentStore.cs @@ -58,7 +58,7 @@ namespace Volo.Docs.FileSystem.Documents public async Task GetResource(Project project, string resourceName, string languageCode, string version) { var projectFolder = project.GetFileSystemPath(); - var path = Path.Combine(projectFolder, resourceName); + var path = Path.Combine(projectFolder, languageCode, resourceName); if (!DirectoryHelper.IsSubDirectoryOf(projectFolder, path)) { From 3f5d12dd7041dd26d3808b73c234448fc43d5b8c Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Thu, 30 May 2019 08:43:33 +0300 Subject: [PATCH 023/166] Update GithubDocumentStore_Tests.cs --- .../Volo/Docs/GithubDocumentStore_Tests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/docs/test/Volo.Docs.Domain.Tests/Volo/Docs/GithubDocumentStore_Tests.cs b/modules/docs/test/Volo.Docs.Domain.Tests/Volo/Docs/GithubDocumentStore_Tests.cs index 5e60d5f96f..76d1f9f68f 100644 --- a/modules/docs/test/Volo.Docs.Domain.Tests/Volo/Docs/GithubDocumentStore_Tests.cs +++ b/modules/docs/test/Volo.Docs.Domain.Tests/Volo/Docs/GithubDocumentStore_Tests.cs @@ -60,7 +60,7 @@ namespace Volo.Docs var project = await _projectRepository.FindAsync(_testData.PorjectId); project.ShouldNotBeNull(); - var documentResource = await store.GetResource(project, "index.md", "0.123.0"); + var documentResource = await store.GetResource(project, "index.md", "en", "0.123.0"); documentResource.ShouldNotBeNull(); documentResource.Content.ShouldBe(new byte[] From 6f5eb0f63065b7712d1132b0baca5b0224689f30 Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Thu, 30 May 2019 09:09:17 +0300 Subject: [PATCH 024/166] docs configure redirects --- modules/docs/app/VoloDocs.Web/Pages/Index.cshtml.cs | 13 ++++++++++++- .../Volo/Docs/Projects/IProjectAppService.cs | 2 ++ .../Volo/Docs/Projects/ProjectAppService.cs | 9 +++++++++ .../Volo/Docs/Projects/DocsProjectController.cs | 7 +++++++ .../Volo.Docs.Web/Pages/Documents/Index.cshtml.cs | 13 ++++++++++++- .../Pages/Documents/Project/Index.cshtml | 1 - 6 files changed, 42 insertions(+), 3 deletions(-) diff --git a/modules/docs/app/VoloDocs.Web/Pages/Index.cshtml.cs b/modules/docs/app/VoloDocs.Web/Pages/Index.cshtml.cs index 018e5fac4c..25d42e3ac2 100644 --- a/modules/docs/app/VoloDocs.Web/Pages/Index.cshtml.cs +++ b/modules/docs/app/VoloDocs.Web/Pages/Index.cshtml.cs @@ -18,10 +18,21 @@ namespace VoloDocs.Web.Pages _projectAppService = projectAppService; } - public async Task OnGet() + public async Task OnGetAsync() { Projects = (await _projectAppService.GetListAsync()).Items; + if (Projects.Count == 1) + { + return RedirectToPage("./Documents/Project/Index", new + { + projectName = Projects[0].ShortName, + version = DocsAppConsts.Latest, + languageCode = await _projectAppService.GetDefaultLanguageCode(Projects[0].ShortName), + documentName = Projects[0].DefaultDocumentName + }); + } + return Page(); } } diff --git a/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Projects/IProjectAppService.cs b/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Projects/IProjectAppService.cs index 5bfc221e4d..d7fdb6759d 100644 --- a/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Projects/IProjectAppService.cs +++ b/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Projects/IProjectAppService.cs @@ -9,6 +9,8 @@ namespace Volo.Docs.Projects Task> GetListAsync(); Task GetAsync(string shortName); + + Task GetDefaultLanguageCode(string shortName); Task> GetVersionsAsync(string shortName); } diff --git a/modules/docs/src/Volo.Docs.Application/Volo/Docs/Projects/ProjectAppService.cs b/modules/docs/src/Volo.Docs.Application/Volo/Docs/Projects/ProjectAppService.cs index 63fc5557ce..19c4e66b7b 100644 --- a/modules/docs/src/Volo.Docs.Application/Volo/Docs/Projects/ProjectAppService.cs +++ b/modules/docs/src/Volo.Docs.Application/Volo/Docs/Projects/ProjectAppService.cs @@ -43,6 +43,15 @@ namespace Volo.Docs.Projects return ObjectMapper.Map(project); } + public async Task GetDefaultLanguageCode(string shortName) + { + var project = await _projectRepository.GetByShortNameAsync(shortName); + var store = _documentStoreFactory.Create(project.DocumentStoreType); + var languageList = await store.GetLanguageListAsync(project, project.LatestVersionBranchName); + + return languageList.Languages.Single(l=>l.IsDefault).Code; + } + public async Task> GetVersionsAsync(string shortName) { var project = await _projectRepository.GetByShortNameAsync(shortName); diff --git a/modules/docs/src/Volo.Docs.HttpApi/Volo/Docs/Projects/DocsProjectController.cs b/modules/docs/src/Volo.Docs.HttpApi/Volo/Docs/Projects/DocsProjectController.cs index e22df620f9..9b9df7b481 100644 --- a/modules/docs/src/Volo.Docs.HttpApi/Volo/Docs/Projects/DocsProjectController.cs +++ b/modules/docs/src/Volo.Docs.HttpApi/Volo/Docs/Projects/DocsProjectController.cs @@ -34,6 +34,13 @@ namespace Volo.Docs.Projects return ProjectAppService.GetAsync(shortName); } + [HttpGet] + [Route("{shortName}/defaultLanguage")] + public Task GetDefaultLanguageCode(string shortName) + { + return ProjectAppService.GetDefaultLanguageCode(shortName); + } + [HttpGet] [Route("{shortName}/versions")] public virtual Task> GetVersionsAsync(string shortName) diff --git a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Index.cshtml.cs b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Index.cshtml.cs index 32675ded2c..436b0fe8e3 100644 --- a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Index.cshtml.cs +++ b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Index.cshtml.cs @@ -17,10 +17,21 @@ namespace Volo.Docs.Pages.Documents _projectAppService = projectAppService; } - public async Task OnGet() + public async Task OnGetAsync() { var listResult = await _projectAppService.GetListAsync(); + if (listResult.Items.Count == 1) + { + return RedirectToPage("./Project/Index", new + { + projectName = listResult.Items[0].ShortName, + version = DocsAppConsts.Latest, + languageCode = await _projectAppService.GetDefaultLanguageCode(listResult.Items[0].ShortName), + documentName = listResult.Items[0].DefaultDocumentName + }); + } + Projects = listResult.Items; return Page(); 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 9dd8b484d7..e6991812b9 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 @@ -230,4 +230,3 @@ - \ No newline at end of file From d7f375ed84e10bc47e8ed30a7ffb7a7f295a2041 Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Thu, 30 May 2019 09:13:58 +0300 Subject: [PATCH 025/166] typo fix --- .../Volo/Docs/Documents/DocumentAppService.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/docs/src/Volo.Docs.Application/Volo/Docs/Documents/DocumentAppService.cs b/modules/docs/src/Volo.Docs.Application/Volo/Docs/Documents/DocumentAppService.cs index c7680baf1b..95a869f296 100644 --- a/modules/docs/src/Volo.Docs.Application/Volo/Docs/Documents/DocumentAppService.cs +++ b/modules/docs/src/Volo.Docs.Application/Volo/Docs/Documents/DocumentAppService.cs @@ -16,20 +16,20 @@ namespace Volo.Docs.Documents private readonly IProjectRepository _projectRepository; private readonly IDocumentStoreFactory _documentStoreFactory; protected IDistributedCache DocumentCache { get; } - protected IDistributedCache LanguaCache { get; } + protected IDistributedCache LanguageCache { get; } protected IDistributedCache ResourceCache { get; } public DocumentAppService( IProjectRepository projectRepository, IDocumentStoreFactory documentStoreFactory, IDistributedCache documentCache, - IDistributedCache languaCache, + IDistributedCache languageCache, IDistributedCache resourceCache) { _projectRepository = projectRepository; _documentStoreFactory = documentStoreFactory; DocumentCache = documentCache; - LanguaCache = languaCache; + LanguageCache = languageCache; ResourceCache = resourceCache; } @@ -149,7 +149,7 @@ namespace Volo.Docs.Documents return await store.GetLanguageListAsync(project, version); } - return await LanguaCache.GetOrAddAsync( + return await LanguageCache.GetOrAddAsync( project.ShortName, GetLanguagesAsync, () => new DistributedCacheEntryOptions From 9305b933b7ee0751b335dc13eb0615562b832de9 Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Thu, 30 May 2019 09:20:54 +0300 Subject: [PATCH 026/166] refactor --- .../Volo/Docs/Documents/DocumentAppService.cs | 4 ++-- .../Volo.Docs.Domain/Volo/Docs/Documents/LanguageConfig.cs | 2 +- .../Documents/{LanguageInfo.cs => LanguageConfigElement.cs} | 2 +- .../Volo/Docs/FileSystem/Documents/FileSystemDocumentStore.cs | 3 ++- 4 files changed, 6 insertions(+), 5 deletions(-) rename modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/{LanguageInfo.cs => LanguageConfigElement.cs} (82%) diff --git a/modules/docs/src/Volo.Docs.Application/Volo/Docs/Documents/DocumentAppService.cs b/modules/docs/src/Volo.Docs.Application/Volo/Docs/Documents/DocumentAppService.cs index 95a869f296..013bcefe84 100644 --- a/modules/docs/src/Volo.Docs.Application/Volo/Docs/Documents/DocumentAppService.cs +++ b/modules/docs/src/Volo.Docs.Application/Volo/Docs/Documents/DocumentAppService.cs @@ -135,7 +135,7 @@ namespace Volo.Docs.Documents ); } - protected virtual LanguageInfo GetLanguageByCode(LanguageConfig languageCodes, string languageCode) + protected virtual LanguageConfigElement GetLanguageByCode(LanguageConfig languageCodes, string languageCode) { var language = languageCodes.Languages.FirstOrDefault(l => l.Code == languageCode); @@ -168,7 +168,7 @@ namespace Volo.Docs.Documents documentDto.Project.Languages = new Dictionary(); foreach (var language in languages.Languages) { - documentDto.Project.Languages.Add(language.Code,language.DisplayName); + documentDto.Project.Languages.Add(language.Code, language.DisplayName); } documentDto.CurrentLanguageCode = languageCode; diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/LanguageConfig.cs b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/LanguageConfig.cs index d98444386f..038ec00cee 100644 --- a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/LanguageConfig.cs +++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/LanguageConfig.cs @@ -4,6 +4,6 @@ namespace Volo.Docs.Documents { public class LanguageConfig { - public List Languages { get; set; } + public List Languages { get; set; } } } diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/LanguageInfo.cs b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/LanguageConfigElement.cs similarity index 82% rename from modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/LanguageInfo.cs rename to modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/LanguageConfigElement.cs index f384dcaa76..25525394ca 100644 --- a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/LanguageInfo.cs +++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/LanguageConfigElement.cs @@ -1,6 +1,6 @@ namespace Volo.Docs.Documents { - public class LanguageInfo + public class LanguageConfigElement { public string DisplayName { get; set; } diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/FileSystem/Documents/FileSystemDocumentStore.cs b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/FileSystem/Documents/FileSystemDocumentStore.cs index ff06abdd27..74e2e8469e 100644 --- a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/FileSystem/Documents/FileSystemDocumentStore.cs +++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/FileSystem/Documents/FileSystemDocumentStore.cs @@ -50,7 +50,8 @@ namespace Volo.Docs.FileSystem.Documents public async Task GetLanguageListAsync(Project project, string version) { - var configAsJson = project.GetFileSystemPath() + "languageConfig.json"; + var path = Path.Combine(project.GetFileSystemPath(), "languageConfig.json"); + var configAsJson = await FileHelper.ReadAllTextAsync(path); return JsonConvert.DeserializeObject(configAsJson); } From d99efbce862275718cf18ee922a7893ed6d060ed Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Thu, 30 May 2019 09:23:51 +0300 Subject: [PATCH 027/166] MaxLanguageCodeLength moved to LanguageConsts --- .../Volo/Docs/Documents/GetDefaultDocumentInput.cs | 3 ++- .../Volo/Docs/Documents/GetDocumentInput.cs | 3 ++- .../Volo/Docs/Documents/GetDocumentResourceInput.cs | 3 ++- .../Volo/Docs/Documents/GetNavigationDocumentInput.cs | 3 ++- .../Volo/Docs/Language/LanguageConsts.cs | 8 ++++++++ .../Volo/Docs/Projects/ProjectConsts.cs | 1 - 6 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 modules/docs/src/Volo.Docs.Domain.Shared/Volo/Docs/Language/LanguageConsts.cs diff --git a/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/GetDefaultDocumentInput.cs b/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/GetDefaultDocumentInput.cs index 4cfab98225..c606c3be5d 100644 --- a/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/GetDefaultDocumentInput.cs +++ b/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/GetDefaultDocumentInput.cs @@ -1,5 +1,6 @@ using System; using System.ComponentModel.DataAnnotations; +using Volo.Docs.Language; using Volo.Docs.Projects; namespace Volo.Docs.Documents @@ -11,7 +12,7 @@ namespace Volo.Docs.Documents [StringLength(ProjectConsts.MaxVersionNameLength)] public string Version { get; set; } - [StringLength(ProjectConsts.MaxLanguageCodeLength)] + [StringLength(LanguageConsts.MaxLanguageCodeLength)] public string LanguageCode { get; set; } } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/GetDocumentInput.cs b/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/GetDocumentInput.cs index 825c1a7942..e28237c352 100644 --- a/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/GetDocumentInput.cs +++ b/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/GetDocumentInput.cs @@ -1,5 +1,6 @@ using System; using System.ComponentModel.DataAnnotations; +using Volo.Docs.Language; using Volo.Docs.Projects; namespace Volo.Docs.Documents @@ -15,7 +16,7 @@ namespace Volo.Docs.Documents [StringLength(ProjectConsts.MaxVersionNameLength)] public string Version { get; set; } - [StringLength(ProjectConsts.MaxLanguageCodeLength)] + [StringLength(LanguageConsts.MaxLanguageCodeLength)] public string LanguageCode { get; set; } } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/GetDocumentResourceInput.cs b/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/GetDocumentResourceInput.cs index eb0d853e06..1fff5a1e12 100644 --- a/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/GetDocumentResourceInput.cs +++ b/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/GetDocumentResourceInput.cs @@ -1,5 +1,6 @@ using System; using System.ComponentModel.DataAnnotations; +using Volo.Docs.Language; using Volo.Docs.Projects; namespace Volo.Docs.Documents @@ -15,7 +16,7 @@ namespace Volo.Docs.Documents [StringLength(ProjectConsts.MaxVersionNameLength)] public string Version { get; set; } - [StringLength(ProjectConsts.MaxLanguageCodeLength)] + [StringLength(LanguageConsts.MaxLanguageCodeLength)] public string LanguageCode { get; set; } } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/GetNavigationDocumentInput.cs b/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/GetNavigationDocumentInput.cs index 473014eb25..c2a614ce58 100644 --- a/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/GetNavigationDocumentInput.cs +++ b/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/GetNavigationDocumentInput.cs @@ -1,5 +1,6 @@ using System; using System.ComponentModel.DataAnnotations; +using Volo.Docs.Language; using Volo.Docs.Projects; namespace Volo.Docs.Documents @@ -11,7 +12,7 @@ namespace Volo.Docs.Documents [StringLength(ProjectConsts.MaxVersionNameLength)] public string Version { get; set; } - [StringLength(ProjectConsts.MaxLanguageCodeLength)] + [StringLength(LanguageConsts.MaxLanguageCodeLength)] public string LanguageCode { get; set; } } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Domain.Shared/Volo/Docs/Language/LanguageConsts.cs b/modules/docs/src/Volo.Docs.Domain.Shared/Volo/Docs/Language/LanguageConsts.cs new file mode 100644 index 0000000000..867cc2dd4e --- /dev/null +++ b/modules/docs/src/Volo.Docs.Domain.Shared/Volo/Docs/Language/LanguageConsts.cs @@ -0,0 +1,8 @@ + +namespace Volo.Docs.Language +{ + public static class LanguageConsts + { + public const int MaxLanguageCodeLength = 10; + } +} diff --git a/modules/docs/src/Volo.Docs.Domain.Shared/Volo/Docs/Projects/ProjectConsts.cs b/modules/docs/src/Volo.Docs.Domain.Shared/Volo/Docs/Projects/ProjectConsts.cs index ea5506151f..57f3c17112 100644 --- a/modules/docs/src/Volo.Docs.Domain.Shared/Volo/Docs/Projects/ProjectConsts.cs +++ b/modules/docs/src/Volo.Docs.Domain.Shared/Volo/Docs/Projects/ProjectConsts.cs @@ -8,6 +8,5 @@ public const int MaxNavigationDocumentNameLength = 128; public const int MaxLatestVersionBranchNameLength = 128; public const int MaxVersionNameLength = 128; - public const int MaxLanguageCodeLength = 10; } } From 843ccb3db23ab91f44bd58a56b3cf20ea1ac1b5f Mon Sep 17 00:00:00 2001 From: Halil ibrahim Kalkan Date: Thu, 30 May 2019 14:00:46 +0300 Subject: [PATCH 028/166] Use new IDS4 API for IdentityModelAuthenticationService. --- .../Volo.Abp.IdentityModel.csproj | 2 +- .../IdentityModel/AbpIdentityModelModule.cs | 4 ++ .../IdentityClientConfiguration.cs | 17 ++++- .../IdentityModelAuthenticationService.cs | 72 +++++++++++++------ .../AbpIdentityServerDomainModule.cs | 1 - 5 files changed, 71 insertions(+), 25 deletions(-) diff --git a/framework/src/Volo.Abp.IdentityModel/Volo.Abp.IdentityModel.csproj b/framework/src/Volo.Abp.IdentityModel/Volo.Abp.IdentityModel.csproj index fcfff3fcb5..e608961fff 100644 --- a/framework/src/Volo.Abp.IdentityModel/Volo.Abp.IdentityModel.csproj +++ b/framework/src/Volo.Abp.IdentityModel/Volo.Abp.IdentityModel.csproj @@ -15,7 +15,7 @@ - +
\ No newline at end of file diff --git a/framework/src/Volo.Abp.IdentityModel/Volo/Abp/IdentityModel/AbpIdentityModelModule.cs b/framework/src/Volo.Abp.IdentityModel/Volo/Abp/IdentityModel/AbpIdentityModelModule.cs index cadeb794a7..b8578ca95d 100644 --- a/framework/src/Volo.Abp.IdentityModel/Volo/Abp/IdentityModel/AbpIdentityModelModule.cs +++ b/framework/src/Volo.Abp.IdentityModel/Volo/Abp/IdentityModel/AbpIdentityModelModule.cs @@ -1,8 +1,12 @@ using Microsoft.Extensions.DependencyInjection; using Volo.Abp.Modularity; +using Volo.Abp.Threading; namespace Volo.Abp.IdentityModel { + [DependsOn( + typeof(AbpThreadingModule) + )] public class AbpIdentityModelModule : AbpModule { public override void ConfigureServices(ServiceConfigurationContext context) diff --git a/framework/src/Volo.Abp.IdentityModel/Volo/Abp/IdentityModel/IdentityClientConfiguration.cs b/framework/src/Volo.Abp.IdentityModel/Volo/Abp/IdentityModel/IdentityClientConfiguration.cs index 35ca881f7f..e2e6e45e49 100644 --- a/framework/src/Volo.Abp.IdentityModel/Volo/Abp/IdentityModel/IdentityClientConfiguration.cs +++ b/framework/src/Volo.Abp.IdentityModel/Volo/Abp/IdentityModel/IdentityClientConfiguration.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using IdentityModel; namespace Volo.Abp.IdentityModel @@ -71,6 +72,16 @@ namespace Volo.Abp.IdentityModel set => this[nameof(Scope)] = value; } + /// + /// RequireHttps. + /// Default: true. + /// + public bool RequireHttps + { + get => this.GetOrDefault(nameof(RequireHttps))?.To() ?? true; + set => this[nameof(RequireHttps)] = value.ToString().ToLowerInvariant(); + } + public IdentityClientConfiguration() { @@ -83,7 +94,8 @@ namespace Volo.Abp.IdentityModel string clientSecret, string grantType = OidcConstants.GrantTypes.ClientCredentials, string userName = null, - string userPassword = null) + string userPassword = null, + bool requireHttps = true) { this[nameof(Authority)] = authority; this[nameof(Scope)] = scope; @@ -92,6 +104,7 @@ namespace Volo.Abp.IdentityModel this[nameof(GrantType)] = grantType; this[nameof(UserName)] = userName; this[nameof(UserPassword)] = userPassword; + this[nameof(RequireHttps)] = requireHttps.ToString().ToLowerInvariant(); } } } \ No newline at end of file diff --git a/framework/src/Volo.Abp.IdentityModel/Volo/Abp/IdentityModel/IdentityModelAuthenticationService.cs b/framework/src/Volo.Abp.IdentityModel/Volo/Abp/IdentityModel/IdentityModelAuthenticationService.cs index 4f316ec357..032bd15457 100644 --- a/framework/src/Volo.Abp.IdentityModel/Volo/Abp/IdentityModel/IdentityModelAuthenticationService.cs +++ b/framework/src/Volo.Abp.IdentityModel/Volo/Abp/IdentityModel/IdentityModelAuthenticationService.cs @@ -10,6 +10,7 @@ using System.Net.Http; using System.Net.Http.Headers; using System.Threading.Tasks; using Volo.Abp.DependencyInjection; +using Volo.Abp.Threading; namespace Volo.Abp.IdentityModel { @@ -18,10 +19,13 @@ namespace Volo.Abp.IdentityModel { public ILogger Logger { get; set; } protected IdentityClientOptions ClientOptions { get; } + protected ICancellationTokenProvider CancellationTokenProvider { get; } public IdentityModelAuthenticationService( - IOptions options) + IOptions options, + ICancellationTokenProvider cancellationTokenProvider) { + CancellationTokenProvider = cancellationTokenProvider; ClientOptions = options.Value; Logger = NullLogger.Instance; } @@ -87,31 +91,57 @@ namespace Volo.Abp.IdentityModel ClientOptions.IdentityClients.Default; } - protected virtual async Task GetDiscoveryResponse(IdentityClientConfiguration configuration) + protected virtual async Task GetDiscoveryResponse( + IdentityClientConfiguration configuration) { - return await DiscoveryClient.GetAsync(configuration.Authority); + using (var httpClient = new HttpClient()) + { + return await httpClient.GetDiscoveryDocumentAsync(new DiscoveryDocumentRequest + { + Address = configuration.Authority, + Policy = + { + RequireHttps = configuration.RequireHttps + } + }); + } } - protected virtual async Task GetTokenResponse(DiscoveryResponse discoveryResponse, IdentityClientConfiguration configuration) + protected virtual async Task GetTokenResponse( + DiscoveryResponse discoveryResponse, + IdentityClientConfiguration configuration) { - //TODO: Pass cancellation token - - var tokenClient = new TokenClient(discoveryResponse.TokenEndpoint, configuration.ClientId, configuration.ClientSecret); - - switch (configuration.GrantType) + using (var httpClient = new HttpClient()) { - case OidcConstants.GrantTypes.ClientCredentials: - return await tokenClient.RequestClientCredentialsAsync( - configuration.Scope - ); - case OidcConstants.GrantTypes.Password: - return await tokenClient.RequestResourceOwnerPasswordAsync( - configuration.UserName, - configuration.UserPassword, - configuration.Scope - ); - default: - throw new AbpException("Grant type was not implemented: " + configuration.GrantType); + switch (configuration.GrantType) + { + case OidcConstants.GrantTypes.ClientCredentials: + return await httpClient.RequestClientCredentialsTokenAsync( + new ClientCredentialsTokenRequest + { + Address = discoveryResponse.TokenEndpoint, + Scope = configuration.Scope, + ClientId = configuration.ClientId, + ClientSecret = configuration.ClientSecret + }, + CancellationTokenProvider.Token + ); + case OidcConstants.GrantTypes.Password: + return await httpClient.RequestPasswordTokenAsync( + new PasswordTokenRequest + { + Address = discoveryResponse.TokenEndpoint, + Scope = configuration.Scope, + ClientId = configuration.ClientId, + ClientSecret = configuration.ClientSecret, + UserName = configuration.UserName, + Password = configuration.UserPassword + }, + CancellationTokenProvider.Token + ); + default: + throw new AbpException("Grant type was not implemented: " + configuration.GrantType); + } } } } diff --git a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AbpIdentityServerDomainModule.cs b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AbpIdentityServerDomainModule.cs index dc06ce130d..7ddc619cfa 100644 --- a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AbpIdentityServerDomainModule.cs +++ b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AbpIdentityServerDomainModule.cs @@ -3,7 +3,6 @@ using IdentityServer4.Stores; using Microsoft.Extensions.DependencyInjection; using Volo.Abp.AutoMapper; using Volo.Abp.Caching; -using Volo.Abp.Domain; using Volo.Abp.Identity; using Volo.Abp.IdentityServer.Clients; using Volo.Abp.Modularity; From 0bf2341d8cfa3129510176ce4bb818819bc25cd2 Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Thu, 30 May 2019 14:49:10 +0300 Subject: [PATCH 029/166] serializeFormToObject improvements --- .../jquery/jquery-extensions.js | 18 ++++++++++++++---- .../SettingManagementMainMenuContributor.cs | 2 -- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/jquery/jquery-extensions.js b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/jquery/jquery-extensions.js index 3b177ea3d5..2bae0cf8fc 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/jquery/jquery-extensions.js +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/jquery/jquery-extensions.js @@ -63,14 +63,14 @@ }); }; - var toCamelCase = function(str) { + var toCamelCase = function (str) { var regexs = [ /(^[A-Z])/, // first char of string /((\.)[A-Z])/ // first char after a dot (.) ]; regexs.forEach( - function(regex) { + function (regex) { var infLoopAvoider = 0; while (regex.test(str)) { @@ -115,7 +115,17 @@ } data.map(function (x) { - obj[x.name] = x.value; + //TODO: improve mapping. it only supports one level deep object. + var names = x.name.split("."); + if (names.length === 1 && !obj[names[0]]) { + obj[names[0]] = x.value; + } + else if (names.length === 2) { + if (!obj[names[0]]) { + obj[names[0]] = {}; + } + obj[names[0]][names[1]] = x.value; + } }); return obj; @@ -152,7 +162,7 @@ } }); - $(this).on('abp-ajax-success',function () { + $(this).on('abp-ajax-success', function () { formSaved = true; }); }; diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Navigation/SettingManagementMainMenuContributor.cs b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Navigation/SettingManagementMainMenuContributor.cs index 4bbb0f0bfd..9d622e6a7a 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Navigation/SettingManagementMainMenuContributor.cs +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Navigation/SettingManagementMainMenuContributor.cs @@ -19,7 +19,6 @@ namespace Volo.Abp.SettingManagement.Web.Navigation return; } - var settingManagementPageOptions = context.ServiceProvider.GetRequiredService>().Value; var settingPageCreationContext = new SettingPageCreationContext(context.ServiceProvider); if ( @@ -42,7 +41,6 @@ namespace Volo.Abp.SettingManagement.Web.Navigation icon: "fa fa-cog" ) ); - } private async Task CheckAnyOfPagePermissionsGranted( From a8d22b969df9d2b7052d80695c6914a025fc6f8d Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Thu, 30 May 2019 15:03:10 +0300 Subject: [PATCH 030/166] Update jquery-extensions.js --- .../jquery/jquery-extensions.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/jquery/jquery-extensions.js b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/jquery/jquery-extensions.js index 2bae0cf8fc..b3fa839d10 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/jquery/jquery-extensions.js +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/jquery/jquery-extensions.js @@ -124,7 +124,9 @@ if (!obj[names[0]]) { obj[names[0]] = {}; } - obj[names[0]][names[1]] = x.value; + if (!obj[names[0]][names[1]]) { + obj[names[0]][names[1]] = x.value; + } } }); From 1ee3e3c3bce379d54534505cd87372758d1f770b Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Thu, 30 May 2019 16:28:38 +0300 Subject: [PATCH 031/166] rename GetDocument to GetDocumentWithDetailsDtoAsync --- .../Volo/Docs/Documents/DocumentAppService.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/docs/src/Volo.Docs.Application/Volo/Docs/Documents/DocumentAppService.cs b/modules/docs/src/Volo.Docs.Application/Volo/Docs/Documents/DocumentAppService.cs index 013bcefe84..03fe9778f9 100644 --- a/modules/docs/src/Volo.Docs.Application/Volo/Docs/Documents/DocumentAppService.cs +++ b/modules/docs/src/Volo.Docs.Application/Volo/Docs/Documents/DocumentAppService.cs @@ -37,7 +37,7 @@ namespace Volo.Docs.Documents { var project = await _projectRepository.GetAsync(input.ProjectId); - return await GetDocument( + return await GetDocumentWithDetailsDtoAsync( project, input.Name, input.LanguageCode, @@ -49,7 +49,7 @@ namespace Volo.Docs.Documents { var project = await _projectRepository.GetAsync(input.ProjectId); - return await GetDocument( + return await GetDocumentWithDetailsDtoAsync( project, project.DefaultDocumentName, input.LanguageCode, @@ -61,7 +61,7 @@ namespace Volo.Docs.Documents { var project = await _projectRepository.GetAsync(input.ProjectId); - return await GetDocument( + return await GetDocumentWithDetailsDtoAsync( project, project.NavigationDocumentName, input.LanguageCode, @@ -99,7 +99,7 @@ namespace Volo.Docs.Documents ); } - protected virtual async Task GetDocument( + protected virtual async Task GetDocumentWithDetailsDtoAsync( Project project, string documentName, string languageCode, From 5c12fb07680660d3a9e90634f9fff85091e22660 Mon Sep 17 00:00:00 2001 From: Halil ibrahim Kalkan Date: Thu, 30 May 2019 22:56:59 +0300 Subject: [PATCH 032/166] Created CLI documentation. --- docs/en/CLI.md | 114 ++++++++++++++++++ docs/en/Startup-Templates/Index.md | 6 + docs/en/Startup-Templates/Mvc-Module.md | 6 + docs/en/Startup-Templates/Mvc.md | 6 + .../Volo/Abp/Cli/Commands/AddModuleCommand.cs | 2 +- .../Volo/Abp/Cli/Commands/HelpCommand.cs | 2 + .../Volo/Abp/Cli/Commands/NewCommand.cs | 11 +- 7 files changed, 144 insertions(+), 3 deletions(-) create mode 100644 docs/en/CLI.md create mode 100644 docs/en/Startup-Templates/Index.md create mode 100644 docs/en/Startup-Templates/Mvc-Module.md create mode 100644 docs/en/Startup-Templates/Mvc.md diff --git a/docs/en/CLI.md b/docs/en/CLI.md new file mode 100644 index 0000000000..19b532796e --- /dev/null +++ b/docs/en/CLI.md @@ -0,0 +1,114 @@ +# ABP CLI + +ABP CLI (Command Line Interface) is a command line tool to perform some common operations for ABP based solutions. + +## new + +Generates a new solution based on the ABP [startup templates](Startup-Templates/Index.md). + +Basic usage: + +````bash +abp new +```` + +Example: + +````bash +abp new Acme.BookStore +```` + +* Acme.BookStore is the solution name here. +* Common convention is to name a solution is like *YourCompany.YourProject*. However, you can use different naming like *YourProject* (single level namespacing) or *YourCompany.YourProduct.YourModule* (three levels namespacing). + +### Options + +* `--template` or `-t`: Specifies the template name. Default template name is `mvc`. Available templates: + * `mvc` (default): ASP.NET Core [MVC application template](Startup-Templates/Mvc.md). Additional options: + * `--database-provider` or `-d`: Specifies the database provider. Default provider is `ef`. Available providers: + * `ef`: Entity Framework Core. + * `mongodb`: MongoDB. + * `--tiered`: Creates a tiered options where Web and Http API layers can be physically separated. + * `mvc-module`: ASP.NET Core [MVC module template](Startup-Templates/Mvc-Module.md). Additional options: + * `--no-ui`: Specifies to not include the UI. This makes possible to create service-only modules (a.k.a. microservices - without UI). +* `--output-folder` or `-o`: Specifies the output folder. Default value is the current directory. + +## add-package + +Adds a new ABP package to a project by, + +* Adding related nuget package as a dependency to the project. +* Adding `[DependsOn(...)]` attribute to the module class in the project (see the [module development document](Module-Development-Basics.md)). + +> Notice that the added module may require additional configuration which is generally indicated in the documentation of the related package. + +Basic usage: + +````bash +abp add-package +```` + +Example: + +```` +abp add-package Volo.Abp.MongoDB +```` + +* This example adds the Volo.Abp.MongoDB package to the project. + +### Options + +* `--project` or `-p`: Specifies the project (.csproj) file path. If not specified, CLI tries to find a .csproj file in the current directory. + +## add-module + +Adds a multi-package module to a solution by finding all packages of the module, finding related projects in the solution and adding each package to the corresponding project in the solution. + +> A business module generally consists of several packages (because of layering, different database providr options or other reasons). Using `add-module` command dramatically simplifies adding a module to a solution. However, each module may require some additional configurations which is generally indicated in the documentation of the related module. + +Basic usage: + +````bash +abp add-module +```` + +Example: + +```bash +abp add-module Volo.Blogging +``` + +* This example add the Volo.Blogging module to the solution. + +### Options + +* `--solution` or `-s`: Specifies the solution (.sln) file path. If not specified, CLI tries to find a .sln file in the current directory. +* `--skip-db-migrations`: For EF Core database provider, it automatically adds a new code first migration (`Add-Migration`) and updates the database (`Update-Database`) if necessary. Specify this option to skip this operation. + +## update + +Updating all ABP related packages can be tedious since there are many packages of the framework and modules. This command automatically updates all ABP related packages in a solution or project to the latest versions. + +Usage: + +````bash +abp update +```` + +* If you run in a directory with a .sln file, it updates all ABP related packages of the all projects of the solution to the latest versions. +* If you run in a directory with a .csproj file, it updates all ABP related packages of the project to the latest versions. + +### Options + +* `--include-previews` or `-p`: Includes preview, beta and rc packages while checking the latest versions. + +## help + +Writes basic usage information of the CLI. + +Usage: + +````bash +abp help +```` + diff --git a/docs/en/Startup-Templates/Index.md b/docs/en/Startup-Templates/Index.md new file mode 100644 index 0000000000..9eb280d205 --- /dev/null +++ b/docs/en/Startup-Templates/Index.md @@ -0,0 +1,6 @@ +# Startup Templates + +TODO + + + diff --git a/docs/en/Startup-Templates/Mvc-Module.md b/docs/en/Startup-Templates/Mvc-Module.md new file mode 100644 index 0000000000..b641d78bac --- /dev/null +++ b/docs/en/Startup-Templates/Mvc-Module.md @@ -0,0 +1,6 @@ +# MVC Module Startup Template + +TODO + + + diff --git a/docs/en/Startup-Templates/Mvc.md b/docs/en/Startup-Templates/Mvc.md new file mode 100644 index 0000000000..0deba09da4 --- /dev/null +++ b/docs/en/Startup-Templates/Mvc.md @@ -0,0 +1,6 @@ +# MVC Application Startup Template + +TODO + + + diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/AddModuleCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/AddModuleCommand.cs index 7925b82aa6..985ca49f17 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/AddModuleCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/AddModuleCommand.cs @@ -98,7 +98,7 @@ namespace Volo.Abp.Cli.Commands sb.AppendLine("Examples:"); sb.AppendLine(" abp add-module Volo.Blogging Adds the module to the current soluton."); sb.AppendLine(" abp add-module Volo.Blogging -s Acme.BookStore Adds the module to the given soluton."); - sb.AppendLine(" abp add-module Volo.Blogging -s Acme.BookStore --skip-db-migrations false Adds the module to the given soluton but doesn't add-migration."); + sb.AppendLine(" abp add-module Volo.Blogging -s Acme.BookStore --skip-db-migrations false Adds the module to the given soluton but doesn't create a database migration."); sb.AppendLine(""); return sb.ToString(); diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/HelpCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/HelpCommand.cs index 671bf3cbab..85e421588f 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/HelpCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/HelpCommand.cs @@ -23,6 +23,8 @@ namespace Volo.Abp.Cli.Commands Logger.LogInformation(" abp [options]"); Logger.LogInformation(""); + //TODO: Write available commands (not hard-coded, but from the CliOptions.Commands) + return Task.CompletedTask; } } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs index 19865bdacf..5979348004 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs @@ -35,14 +35,21 @@ namespace Volo.Abp.Cli.Commands Logger.LogWarning(""); Logger.LogWarning("Options:"); Logger.LogWarning("-t|--template "); - Logger.LogWarning("-d|--database-provider "); Logger.LogWarning("-o|--output-folder "); + Logger.LogWarning("-d|--database-provider (if supported by the template)"); + Logger.LogWarning("--tiered (if supported by the template)"); + Logger.LogWarning("--no-ui (if supported by the template)"); Logger.LogWarning(""); - Logger.LogWarning("Examples:"); + Logger.LogWarning("Some examples:"); Logger.LogWarning(" abp new Acme.BookStore"); + Logger.LogWarning(" abp new Acme.BookStore --tiered"); Logger.LogWarning(" abp new Acme.BookStore -t mvc-module"); + Logger.LogWarning(" abp new Acme.BookStore -t mvc-module no-ui"); + Logger.LogWarning(" abp new Acme.BookStore -d mongodb"); Logger.LogWarning(" abp new Acme.BookStore -t mvc -d mongodb"); Logger.LogWarning(" abp new Acme.BookStore -t mvc -d mongodb -o d:\\project"); + Logger.LogWarning(""); + Logger.LogWarning("See the documentation for more info."); return; } From c947b65a7f78413cbe60e45e59908dd38255e1c3 Mon Sep 17 00:00:00 2001 From: Halil ibrahim Kalkan Date: Thu, 30 May 2019 23:00:43 +0300 Subject: [PATCH 033/166] Add CLI to nav document. --- docs/en/docs-nav.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/en/docs-nav.json b/docs/en/docs-nav.json index 396b92afd3..eaee22e59a 100644 --- a/docs/en/docs-nav.json +++ b/docs/en/docs-nav.json @@ -41,6 +41,10 @@ } ] }, + { + "text": "CLI", + "path": "CLI.md" + }, { "text": "Fundamentals", "items": [ From b1449746dd9f15fec1e8b2b3f4949a5f90cf6b11 Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Fri, 31 May 2019 09:14:58 +0300 Subject: [PATCH 034/166] languageConfig renamed to docs-langs --- docs/{languageConfig.json => docs-langs.json} | 0 .../Volo/Docs/FileSystem/Documents/FileSystemDocumentStore.cs | 2 +- .../Volo/Docs/GitHub/Documents/GithubDocumentStore.cs | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename docs/{languageConfig.json => docs-langs.json} (100%) diff --git a/docs/languageConfig.json b/docs/docs-langs.json similarity index 100% rename from docs/languageConfig.json rename to docs/docs-langs.json diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/FileSystem/Documents/FileSystemDocumentStore.cs b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/FileSystem/Documents/FileSystemDocumentStore.cs index 74e2e8469e..8d85046d29 100644 --- a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/FileSystem/Documents/FileSystemDocumentStore.cs +++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/FileSystem/Documents/FileSystemDocumentStore.cs @@ -50,7 +50,7 @@ namespace Volo.Docs.FileSystem.Documents public async Task GetLanguageListAsync(Project project, string version) { - var path = Path.Combine(project.GetFileSystemPath(), "languageConfig.json"); + var path = Path.Combine(project.GetFileSystemPath(), "docs-langs.json"); var configAsJson = await FileHelper.ReadAllTextAsync(path); return JsonConvert.DeserializeObject(configAsJson); diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/GitHub/Documents/GithubDocumentStore.cs b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/GitHub/Documents/GithubDocumentStore.cs index 91c03379ab..d0bdccac54 100644 --- a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/GitHub/Documents/GithubDocumentStore.cs +++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/GitHub/Documents/GithubDocumentStore.cs @@ -109,7 +109,7 @@ namespace Volo.Docs.GitHub.Documents var rootUrl = project.GetGitHubUrl(version); var userAgent = project.GetGithubUserAgentOrNull(); - var url = CalculateRawRootUrl(rootUrl) + "languageConfig.json"; + var url = CalculateRawRootUrl(rootUrl) + "docs-langs.json"; var configAsJson = await DownloadWebContentAsStringAsync(url, token, userAgent); From df841406354f4be5a10e97be0d7aa31717965eea Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Fri, 31 May 2019 09:15:21 +0300 Subject: [PATCH 035/166] file name fix --- .../{ContentWithDetailsDto.cs => DocumentWithDetailsDto.cs} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/{ContentWithDetailsDto.cs => DocumentWithDetailsDto.cs} (100%) diff --git a/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/ContentWithDetailsDto.cs b/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/DocumentWithDetailsDto.cs similarity index 100% rename from modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/ContentWithDetailsDto.cs rename to modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/DocumentWithDetailsDto.cs From 83e5970ede1b8c29bee584ce70f90dd931feb09f Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Fri, 31 May 2019 09:20:15 +0300 Subject: [PATCH 036/166] Update docs-langs.json --- docs/docs-langs.json | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/docs-langs.json b/docs/docs-langs.json index 41d51d55bc..30cd8d3813 100644 --- a/docs/docs-langs.json +++ b/docs/docs-langs.json @@ -1,14 +1,14 @@ { -"Languages":[ - { - "DisplayName" : "English", - "Code" : "en", - "IsDefault": true - }, - { - "DisplayName" : "Chinese", - "Code" : "zh-Hans", - "IsDefault": false - } -] + "Languages":[ + { + "DisplayName" : "English", + "Code" : "en", + "IsDefault": true + }, + { + "DisplayName" : "Chinese", + "Code" : "zh-Hans", + "IsDefault": false + } + ] } \ No newline at end of file From ba4136a39a19ec2f2e07b90e0dc7cef8a3a9c39a Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Fri, 31 May 2019 09:22:51 +0300 Subject: [PATCH 037/166] Take first language if no default one is defined --- .../Volo/Docs/Documents/DocumentAppService.cs | 4 +++- .../Volo/Docs/Projects/ProjectAppService.cs | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/docs/src/Volo.Docs.Application/Volo/Docs/Documents/DocumentAppService.cs b/modules/docs/src/Volo.Docs.Application/Volo/Docs/Documents/DocumentAppService.cs index 03fe9778f9..20ecf4d03f 100644 --- a/modules/docs/src/Volo.Docs.Application/Volo/Docs/Documents/DocumentAppService.cs +++ b/modules/docs/src/Volo.Docs.Application/Volo/Docs/Documents/DocumentAppService.cs @@ -139,7 +139,9 @@ namespace Volo.Docs.Documents { var language = languageCodes.Languages.FirstOrDefault(l => l.Code == languageCode); - return language ?? languageCodes.Languages.Single(l => l.IsDefault); + return language ?? + languageCodes.Languages.FirstOrDefault(l => l.IsDefault) ?? + languageCodes.Languages.First(); } protected virtual async Task GetLanguageListAsync(IDocumentStore store, Project project, string version) diff --git a/modules/docs/src/Volo.Docs.Application/Volo/Docs/Projects/ProjectAppService.cs b/modules/docs/src/Volo.Docs.Application/Volo/Docs/Projects/ProjectAppService.cs index 19c4e66b7b..89de8ea363 100644 --- a/modules/docs/src/Volo.Docs.Application/Volo/Docs/Projects/ProjectAppService.cs +++ b/modules/docs/src/Volo.Docs.Application/Volo/Docs/Projects/ProjectAppService.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.Extensions.Caching.Distributed; +using Volo.Abp; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; using Volo.Abp.Caching; @@ -49,7 +50,7 @@ namespace Volo.Docs.Projects var store = _documentStoreFactory.Create(project.DocumentStoreType); var languageList = await store.GetLanguageListAsync(project, project.LatestVersionBranchName); - return languageList.Languages.Single(l=>l.IsDefault).Code; + return (languageList.Languages.FirstOrDefault(l => l.IsDefault) ?? languageList.Languages.First()).Code; } public async Task> GetVersionsAsync(string shortName) From 688cd23f7e5ce6c7e16236ebcccdbebd505ea723 Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Fri, 31 May 2019 11:00:38 +0300 Subject: [PATCH 038/166] docs language refactor --- .../app/VoloDocs.Web/Pages/Index.cshtml.cs | 2 +- .../Docs/Documents/DocumentWithDetailsDto.cs | 2 - .../Volo/Docs/Projects/IProjectAppService.cs | 7 +- .../Volo/Docs/Projects/ProjectDto.cs | 2 - .../Docs/DocsApplicationAutoMapperProfile.cs | 4 +- .../Volo/Docs/Documents/DocumentAppService.cs | 42 +--------- .../Volo/Docs/Projects/ProjectAppService.cs | 47 ++++++++--- .../Volo/Docs/Language}/LanguageConfig.cs | 0 .../Docs/Language}/LanguageConfigElement.cs | 0 .../Docs/Projects/DocsProjectController.cs | 12 ++- .../Pages/Documents/Index.cshtml.cs | 2 +- .../Pages/Documents/Project/Index.cshtml | 7 +- .../Pages/Documents/Project/Index.cshtml.cs | 82 +++++++++++++++---- 13 files changed, 128 insertions(+), 81 deletions(-) rename modules/docs/src/{Volo.Docs.Domain/Volo/Docs/Documents => Volo.Docs.Domain.Shared/Volo/Docs/Language}/LanguageConfig.cs (100%) rename modules/docs/src/{Volo.Docs.Domain/Volo/Docs/Documents => Volo.Docs.Domain.Shared/Volo/Docs/Language}/LanguageConfigElement.cs (100%) diff --git a/modules/docs/app/VoloDocs.Web/Pages/Index.cshtml.cs b/modules/docs/app/VoloDocs.Web/Pages/Index.cshtml.cs index 25d42e3ac2..c60f2d682b 100644 --- a/modules/docs/app/VoloDocs.Web/Pages/Index.cshtml.cs +++ b/modules/docs/app/VoloDocs.Web/Pages/Index.cshtml.cs @@ -28,7 +28,7 @@ namespace VoloDocs.Web.Pages { projectName = Projects[0].ShortName, version = DocsAppConsts.Latest, - languageCode = await _projectAppService.GetDefaultLanguageCode(Projects[0].ShortName), + languageCode = "", documentName = Projects[0].DefaultDocumentName }); } diff --git a/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/DocumentWithDetailsDto.cs b/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/DocumentWithDetailsDto.cs index 43fab40c0c..44b2ef6861 100644 --- a/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/DocumentWithDetailsDto.cs +++ b/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/DocumentWithDetailsDto.cs @@ -25,8 +25,6 @@ namespace Volo.Docs.Documents public string FileName { get; set; } - public string CurrentLanguageCode { get; set; } - public ProjectDto Project { get; set; } public List Contributors { get; set; } diff --git a/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Projects/IProjectAppService.cs b/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Projects/IProjectAppService.cs index d7fdb6759d..44f4cbf3b8 100644 --- a/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Projects/IProjectAppService.cs +++ b/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Projects/IProjectAppService.cs @@ -1,6 +1,7 @@ using System.Threading.Tasks; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; +using Volo.Docs.Documents; namespace Volo.Docs.Projects { @@ -9,9 +10,11 @@ namespace Volo.Docs.Projects Task> GetListAsync(); Task GetAsync(string shortName); - - Task GetDefaultLanguageCode(string shortName); Task> GetVersionsAsync(string shortName); + + Task GetDefaultLanguageCode(string shortName, string version); + + Task GetLanguageListAsync(string shortName, string version); } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Projects/ProjectDto.cs b/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Projects/ProjectDto.cs index a9ec815a6c..91f5c63a22 100644 --- a/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Projects/ProjectDto.cs +++ b/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Projects/ProjectDto.cs @@ -26,7 +26,5 @@ namespace Volo.Docs.Projects public string DocumentStoreType { get; set; } public Dictionary ExtraProperties { get; set; } - - public Dictionary Languages { get; set; } } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Application/Volo/Docs/DocsApplicationAutoMapperProfile.cs b/modules/docs/src/Volo.Docs.Application/Volo/Docs/DocsApplicationAutoMapperProfile.cs index 2f029f3a39..d29828ad05 100644 --- a/modules/docs/src/Volo.Docs.Application/Volo/Docs/DocsApplicationAutoMapperProfile.cs +++ b/modules/docs/src/Volo.Docs.Application/Volo/Docs/DocsApplicationAutoMapperProfile.cs @@ -9,10 +9,10 @@ namespace Volo.Docs { public DocsApplicationAutoMapperProfile() { - CreateMap().Ignore(x=>x.Languages); + CreateMap(); CreateMap(); CreateMap() - .Ignore(x => x.Project).Ignore(x => x.Contributors).Ignore(x => x.CurrentLanguageCode); + .Ignore(x => x.Project).Ignore(x => x.Contributors); CreateMap(); CreateMap(); } diff --git a/modules/docs/src/Volo.Docs.Application/Volo/Docs/Documents/DocumentAppService.cs b/modules/docs/src/Volo.Docs.Application/Volo/Docs/Documents/DocumentAppService.cs index 20ecf4d03f..d6e615c22e 100644 --- a/modules/docs/src/Volo.Docs.Application/Volo/Docs/Documents/DocumentAppService.cs +++ b/modules/docs/src/Volo.Docs.Application/Volo/Docs/Documents/DocumentAppService.cs @@ -111,11 +111,9 @@ namespace Volo.Docs.Documents { Logger.LogInformation($"Not found in the cache. Requesting {documentName} from the store..."); var store = _documentStoreFactory.Create(project.DocumentStoreType); - var languages = await GetLanguageListAsync(store, project, version); - var language = GetLanguageByCode(languages, languageCode); - var document = await store.GetDocumentAsync(project, documentName, language.Code, version); + var document = await store.GetDocumentAsync(project, documentName, languageCode, version); Logger.LogInformation($"Document retrieved: {documentName}"); - return CreateDocumentWithDetailsDto(project, document, languages, language.Code); + return CreateDocumentWithDetailsDto(project, document); } if (Debugger.IsAttached) @@ -135,45 +133,11 @@ namespace Volo.Docs.Documents ); } - protected virtual LanguageConfigElement GetLanguageByCode(LanguageConfig languageCodes, string languageCode) - { - var language = languageCodes.Languages.FirstOrDefault(l => l.Code == languageCode); - - return language ?? - languageCodes.Languages.FirstOrDefault(l => l.IsDefault) ?? - languageCodes.Languages.First(); - } - - protected virtual async Task GetLanguageListAsync(IDocumentStore store, Project project, string version) - { - async Task GetLanguagesAsync() - { - return await store.GetLanguageListAsync(project, version); - } - - return await LanguageCache.GetOrAddAsync( - project.ShortName, - GetLanguagesAsync, - () => new DistributedCacheEntryOptions - { - AbsoluteExpirationRelativeToNow = TimeSpan.FromHours(24) - } - ); - } - - protected virtual DocumentWithDetailsDto CreateDocumentWithDetailsDto(Project project, Document document, LanguageConfig languages, string languageCode) + protected virtual DocumentWithDetailsDto CreateDocumentWithDetailsDto(Project project, Document document) { var documentDto = ObjectMapper.Map(document); documentDto.Project = ObjectMapper.Map(project); documentDto.Contributors = ObjectMapper.Map, List>(document.Contributors); - - documentDto.Project.Languages = new Dictionary(); - foreach (var language in languages.Languages) - { - documentDto.Project.Languages.Add(language.Code, language.DisplayName); - } - - documentDto.CurrentLanguageCode = languageCode; return documentDto; } } diff --git a/modules/docs/src/Volo.Docs.Application/Volo/Docs/Projects/ProjectAppService.cs b/modules/docs/src/Volo.Docs.Application/Volo/Docs/Projects/ProjectAppService.cs index 89de8ea363..99a6c70123 100644 --- a/modules/docs/src/Volo.Docs.Application/Volo/Docs/Projects/ProjectAppService.cs +++ b/modules/docs/src/Volo.Docs.Application/Volo/Docs/Projects/ProjectAppService.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.Extensions.Caching.Distributed; -using Volo.Abp; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; using Volo.Abp.Caching; @@ -17,15 +16,18 @@ namespace Volo.Docs.Projects private readonly IProjectRepository _projectRepository; private readonly IDistributedCache> _versionCache; private readonly IDocumentStoreFactory _documentStoreFactory; + protected IDistributedCache LanguageCache { get; } public ProjectAppService( IProjectRepository projectRepository, IDistributedCache> versionCache, - IDocumentStoreFactory documentStoreFactory) + IDocumentStoreFactory documentStoreFactory, + IDistributedCache languageCache) { _projectRepository = projectRepository; _versionCache = versionCache; _documentStoreFactory = documentStoreFactory; + LanguageCache = languageCache; } public async Task> GetListAsync() @@ -44,15 +46,6 @@ namespace Volo.Docs.Projects return ObjectMapper.Map(project); } - public async Task GetDefaultLanguageCode(string shortName) - { - var project = await _projectRepository.GetByShortNameAsync(shortName); - var store = _documentStoreFactory.Create(project.DocumentStoreType); - var languageList = await store.GetLanguageListAsync(project, project.LatestVersionBranchName); - - return (languageList.Languages.FirstOrDefault(l => l.IsDefault) ?? languageList.Languages.First()).Code; - } - public async Task> GetVersionsAsync(string shortName) { var project = await _projectRepository.GetByShortNameAsync(shortName); @@ -99,5 +92,37 @@ namespace Volo.Docs.Projects return versions; } + + public async Task GetLanguageListAsync(string shortName, string version) + { + return await GetLanguageListInternalAsync(shortName, version); + } + + public async Task GetDefaultLanguageCode(string shortName, string version) + { + var languageList = await GetLanguageListInternalAsync(shortName, version); + + return (languageList.Languages.FirstOrDefault(l => l.IsDefault) ?? languageList.Languages.First()).Code; + } + + private async Task GetLanguageListInternalAsync(string shortName, string version) + { + var project = await _projectRepository.GetByShortNameAsync(shortName); + var store = _documentStoreFactory.Create(project.DocumentStoreType); + + async Task GetLanguagesAsync() + { + return await store.GetLanguageListAsync(project, version); + } + + return await LanguageCache.GetOrAddAsync( + project.ShortName, + GetLanguagesAsync, + () => new DistributedCacheEntryOptions + { + AbsoluteExpirationRelativeToNow = TimeSpan.FromHours(24) + } + ); + } } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/LanguageConfig.cs b/modules/docs/src/Volo.Docs.Domain.Shared/Volo/Docs/Language/LanguageConfig.cs similarity index 100% rename from modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/LanguageConfig.cs rename to modules/docs/src/Volo.Docs.Domain.Shared/Volo/Docs/Language/LanguageConfig.cs diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/LanguageConfigElement.cs b/modules/docs/src/Volo.Docs.Domain.Shared/Volo/Docs/Language/LanguageConfigElement.cs similarity index 100% rename from modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/LanguageConfigElement.cs rename to modules/docs/src/Volo.Docs.Domain.Shared/Volo/Docs/Language/LanguageConfigElement.cs diff --git a/modules/docs/src/Volo.Docs.HttpApi/Volo/Docs/Projects/DocsProjectController.cs b/modules/docs/src/Volo.Docs.HttpApi/Volo/Docs/Projects/DocsProjectController.cs index 9b9df7b481..1484025094 100644 --- a/modules/docs/src/Volo.Docs.HttpApi/Volo/Docs/Projects/DocsProjectController.cs +++ b/modules/docs/src/Volo.Docs.HttpApi/Volo/Docs/Projects/DocsProjectController.cs @@ -4,6 +4,7 @@ using Microsoft.AspNetCore.Mvc; using Volo.Abp; using Volo.Abp.Application.Dtos; using Volo.Abp.AspNetCore.Mvc; +using Volo.Docs.Documents; namespace Volo.Docs.Projects { @@ -36,9 +37,9 @@ namespace Volo.Docs.Projects [HttpGet] [Route("{shortName}/defaultLanguage")] - public Task GetDefaultLanguageCode(string shortName) + public Task GetDefaultLanguageCode(string shortName,string version) { - return ProjectAppService.GetDefaultLanguageCode(shortName); + return ProjectAppService.GetDefaultLanguageCode(shortName, version); } [HttpGet] @@ -47,5 +48,12 @@ namespace Volo.Docs.Projects { return ProjectAppService.GetVersionsAsync(shortName); } + + [HttpGet] + [Route("{shortName}/{versiion}/languageList")] + public Task GetLanguageListAsync(string shortName, string version) + { + return ProjectAppService.GetLanguageListAsync(shortName, version); + } } } diff --git a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Index.cshtml.cs b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Index.cshtml.cs index 436b0fe8e3..2852c233b5 100644 --- a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Index.cshtml.cs +++ b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Index.cshtml.cs @@ -27,7 +27,7 @@ namespace Volo.Docs.Pages.Documents { projectName = listResult.Items[0].ShortName, version = DocsAppConsts.Latest, - languageCode = await _projectAppService.GetDefaultLanguageCode(listResult.Items[0].ShortName), + languageCode = "", documentName = listResult.Items[0].DefaultDocumentName }); } 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 e6991812b9..a7fc072011 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 @@ -144,7 +144,6 @@ @if (Model.Document != null) {
-