Skip to content

Commit

Permalink
Translate All Doc
Browse files Browse the repository at this point in the history
Translate All Doc
  • Loading branch information
hyzx86 committed Apr 26, 2023
2 parents 3c1a5bf + a858557 commit d233452
Show file tree
Hide file tree
Showing 155 changed files with 8,338 additions and 7,878 deletions.
54 changes: 23 additions & 31 deletions src/docs/getting-started/README.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,41 @@
# Orchard Core的NuGet包使用 入门篇

In this article, we are going to see how easy it is to create a CMS Web application using the NuGet packages provided by Orchard Core.
在这篇文章中,我们将看到使用Orchard Core提供的NuGet包创建CMS Web应用程序有多么简单。

## Create an Orchard Core CMS application
## 创建Orchard Core CMS应用程序

使用Visual Studio,创建一个名为Cms.Web空的.NET Core网站应用。在配置新项目界面,不要勾选`将解决方案和项目放在同一目录中`选项,因为稍后创建模块和主题时,你可能希望它们在解决方案的同级目录中
在Visual Studio中,创建一个新的空白的.NET Core Web应用程序。例如:'Cms.Web'。不要勾选“将解决方案和项目放在同一个目录中”,因为后来当你创建模块和主题时,你会想让它们与解决方案中的Web应用程序一起生存

!!! 备注
如果你想使用“预发行”包,[在“程序包源”中配置OrchardCore预览地址](preview-package-source.md)
!!! 注意
如果你想使用`preview`包,[请在Package sources中配置OrchardCore Preview url](preview-package-source.md)

为项目添加包引用,在项目里的 `依赖项` 上右击然后选择 `管理NuGet程序包` , 勾选 `包括发行版` (如果需要的话) 。 如果你配置了上面的预览地址,点击右上角的 `程序包源` 并选择刚才配置的预览地址。在 `浏览` 选项卡中,搜索 `OrchardCore.Application.Cms.Targets` ,然后选中并 `安装` 这个包
要添加对包的引用,请右键单击项目并单击“管理NuGet包...”,如果需要,请勾选“包括预发布版本”。如果你添加了上面的预览源,请从右上方的“Package Source”选择此源。在“Browse”选项卡中,搜索OrchardCore.Application.Cms.Targets”并“安装”该包

### Getting Started with `Program.cs` Only Using .NET 6 Framework?
!!! tip
When starting a new project using `.NET 6` framework, you'll notice that the created project does not have a `Startup` class as it did in previous versions of the .NET framework.
### 仅使用.NET 6框架和`Program.cs`入门?
!!!提示
当使用`.NET 6`框架启动新项目时,你会注意到创建的项目没有像以前的.NET框架版本一样拥有`Startup`类。

Open `Program.cs` file. Remove the following line "if exists"
打开`Program.cs`文件,并删除如下代码:

```csharp
builder.Services.AddRazorPages();
builder.UseOrchardCore();
```

Add the following line

```csharp
builder.Services.AddOrchardCms()
```

Additionally, remove the following lines
此外,删除以下代码

```csharp
app.UseHttpsRedirection();
app.UseRouting();
app.UseAuthorization();
app.MapRazorPages();
```
Lastly, add the following line to the request pipeline

最后,在请求管道中添加以下代码

```csharp
app.UseOrchardCore();
builder.UseOrchardCore();
```

When you are done, the `Program.cs` file will something like this
在完成后,`Program.cs` 文件会像这样

```csharp
var builder = WebApplication.CreateBuilder(args);
Expand All @@ -58,19 +52,16 @@ if (!app.Environment.IsDevelopment())

app.UseStaticFiles();
app.UseOrchardCore();

app.Run();
```
## 使用 `Program.cs` 入门?

### Getting Started Using `Program.cs` file?

Open `Program.cs` file, then add the OrchardCore CMS services by adding this line:
打开 `Program.cs` 文件,然后添加 OrchardCore CMS 服务,可以通过加入这一行代码来实现:

```csharp
builder.Services.AddOrchardCms();
```

After building the `WebApplication`, replace this line:
构建 `WebApplication` 后,将这一行代码:

```csharp
app.MapGet("/", () => "Hello World!");
Expand All @@ -79,12 +70,12 @@ app.MapGet("/", () => "Hello World!");
然后使用以下代码替换:

```csharp
app.UseOrchardCore();
app.UseOrchardCore().Run();
```

Finally, remove the default `Pages` and/or `Views` folder to allow OrchardCore to render the views from the active theme.
最后,删除默认的 `Pages` 和/或 `Views` 文件夹,允许OrchardCore从当前主题渲染视图。

## Setup your application
## 设置你的应用程序

运行项目 (Ctrl+F5)。浏览器显示了 安装界面。

Expand All @@ -101,3 +92,4 @@ Finally, remove the default `Pages` and/or `Views` folder to allow OrchardCore t
提交表单,你的网站在几秒后将会生成。

然后,你就可以使用 `/admin` 地址访问管理界面了。开始享受成果吧。

20 changes: 12 additions & 8 deletions src/docs/getting-started/preview-package-source.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
# 添加预览包源

在本文中,我们将添加一个指向预览包的新包源。
每次在 dev 分支上提交一些代码时都会构建预览包,和从master分支构建的Nuget包相比,
它们是最新版本,但不是最稳定的,并且可能包含重大更改。
在本文中,我们将添加一个指向预览软件包的新软件包源。预览软件包是每次在`dev`分支上提交代码时构建的,与在NuGet上构建的软件包不同,后者是从`master`分支构建的。它们是最最新的版本,但不是最稳定的,可能包含破坏性变更。

!!! 警告
我们不建议您在生产中使用 dev
我们不建议您在生产中使用 dev 软件包

## 将 Orchard Core 预览源添加到 Visual Studio
## 添加 Orchard Core 预览 Feed 到 Visual Studio

为了能够从Visual Studio使用__预览__源,打开NuGet包管理器下的Tools菜单-->包管理器设置。该源网址为<https://nuget.cloudsmith.io/orchardcore/preview/v3/index.json>

为了能够在 Visual Studio 裡使用预览源,请打开 Tools → NuGet Package Manager → Package Manager Settings,
並添加包源网址 <https://nuget.cloudsmith.io/orchardcore/preview/v3/index.json>

![image](assets/add-preview-package-source.png)

Expand All @@ -19,6 +17,7 @@

您也可以通过 `NuGet.config` 文件添加包源,将 该文件添加到你的解决方案中,并放置于sln 相同目录:

您还可以使用NuGet.config文件添加软件包源:
```xml
<?xml version="1.0" encoding="utf-8"?>
<configuration>
Expand All @@ -29,4 +28,9 @@
</packageSources>
<disabledPackageSources />
</configuration>
```
```
该文档为XML配置文件,配置了NuGet 包管理器的包源。其中,NuGet 是一个公共的包源,而OrchardCorePreview 是一种自定义的包源。'disabledPackageSources' 中的包源被设为禁用状态。



> 该文档由Chat-GPT 翻译
171 changes: 77 additions & 94 deletions src/docs/getting-started/starter-recipes.md
Original file line number Diff line number Diff line change
@@ -1,152 +1,135 @@
# Starter Recipes and Themes included with Orchard Core
# 包含在Orchard Core中的起始配方和主题

可以通过两个不同的 NuGet 元包去使用 Orchard Core
Orchard Core可以通过两个不同的NuGet元包供使用

- `OrchardCore.Application.Cms.Core.Targets`
- `OrchardCore.Application.Cms.Targets`

第一个包 `OrchardCore.Application.Cms.Core.Targets` 用于以下情况
第一个包 `OrchardCore.Application.Cms.Core.Targets` 适用于以下情况:

- 开发一个解耦的网站
- 开发无头网站
- 从头开始开发主题网站
- 开发解耦Web站点
- 开发Headless Web站点
- 从头开始开发主题Web站点

`Core.Targets` 包包含设置 Orchard Core 安装所需的最低要求。 它包含 `TheAdmin` 主题和两个安装配方,但没有前端主题。
`Core.Targets` 包包含了设置Orchard Core安装所需的最少量。它包含 `TheAdmin` 主题和两个基于配方的安装方案,但没有前端主题。

!!! 提示
您可以在安裝後啟用任何未包括在安裝配方裡的功能,
通过菜单 _Configuration -> Features_

第二个包 `OrchardCore.Application.Cms.Targets` 包含以上所有内容以及
!!! tip
在选择设置配方后,可以通过 _Configuration -> Features_ 菜单启用未启用的任何功能。第二个包`OrchardCore.Application.Cms.Targets`包含了以上所有内容,还包括:

- 适用于主题的配方
- 多个 CMS 起始主题
- 主题的设置配方(Setup recipes)
- 多个 CMS 初始主题(Multiple CMS Starter Themes)

Orchard Core 中的配方通过启用功能帮助您设置站点,
和/或为您的网站创建内容类型和内容。
Orchard Core 中的配方(Recipes)可以帮助您通过启用功能和/或为您的站点创建内容类型和内容来设置站点。

Orchard Core 主题可以包含 Razor 或 Liquid 视图,默认情况下使用 Orchard Core Display Management 技術去渲染內容
Orchard Core 主题可以包含 Razor 或 Liquid 视图,并且默认情况下使用 Orchard Core 显示管理技术来呈现内容

## OrchardCore.Application.Cms.Core.Targets

### Blank Recipe

The Blank recipe enables content management features, but does not set a current theme.
You can use this recipe when starting Orchard Core in Decoupled Mode,
or when building your own theme.
### 空白配方(Blank Recipe)

Alternatively you can start with another recipe,
and change the active theme after setup.
空白配方启用内容管理功能,但不设置当前主题。您可以在启动 Orchard Core 的分离模式下使用此配方,或在构建自己的主题时使用它。或者,您可以选择其他的配置文件,然后在设置后更改活动主题。

#### Blank Recipe Contents
#### 空白配置文件内容

- Content management features
- Activates `TheAdmin` theme
- 内容管理功能
- 激活`TheAdmin`主题

### Headless Recipe
### Headless配置文件

The Headless recipe is intended to get you started when using Orchard Core
as an API, and Content Management System, with Administrator access to the host.
Headless配置文件旨在帮助您使用Orchard Core作为API和内容管理系统,并具有对主机的管理员访问权限。

#### Headless Recipe Contents
#### Headless配置文件内容

- Content management features
- Secure GraphQL API support
- OpenID authentication features
- Activates `TheAdmin` theme and set Admin as the home route

!!! tip
You will want to review the default security configuration to be certain
it suits your requirements.
- 内容管理功能
- 安全的GraphQL API支持
- OpenID身份验证功能
- 激活`TheAdmin`主题,并将管理员设置为主页路由!!! tip
您将需要检查默认的安全配置以确保它符合您的要求。

## Headless Recipe Video

<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/dbABI1wECPg" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

## OrchardCore.Application.Cms.Targets

### TheBlogTheme and Blog Recipe
### TheBlogTheme和Blog Recipe

The Blog recipe sets up a range of content types, and widgets, the initial content,
and sets the current theme to the TheBlogTheme.
Blog recipe设置了一系列内容类型、小部件、初始内容,并将当前主题设置为TheBlogTheme。

TheBlogTheme is based on the [Start Bootstrap Clean Blog Theme](https://startbootstrap.com/themes/clean-blog/)
TheBlogTheme基于[Start Bootstrap Clean Blog Theme](https://startbootstrap.com/themes/clean-blog/)

#### Blog Recipe Contents

- Content management features
- Blog related Content Types, and Widgets
- A blog, and a first blog post, based on the `ListPart`
- Liquid templates, in the TheBlogTheme source code
#### Blog Recipe的内容- 内容管理功能
- 与博客相关的内容类型和小部件
- 基于`ListPart`的博客和第一篇博客文章
- `TheBlogTheme`源代码中的Liquid模板
- Bootstrap

### Blog - Lucene Query Recipe
### 博客-Lucene查询配方

The Lucene Query recipe is an optional recipe in the TheBlogTheme.
This recipe runs the Blog Lucene Search recipe and as an example,
the recipe replaces the RecentBlogPosts SQL query with a Lucene query.
Lucene查询配方是`TheBlogTheme`中的一个可选配方。此配方运行博客Lucene搜索配方,并作为示例,将近期博客文章的SQL查询替换为Lucene查询。

#### Blog Lucene Query Recipe Contents
#### 博客Lucene查询配方内容

- Runs the Blog Lucene Search recipe
- Replace RecentBlogPosts SQL query with Lucene
- 运行博客Lucene搜索配方
- 用Lucene替换近期博客文章的SQL查询

### Blog - Lucene Search Recipe
### 博客-Lucene搜索配方Lucene Search食谱是TheBlogTheme中的可选食谱。该食谱启用了Lucene功能,并创建了搜索设置、Lucene索引和权限。

The Lucene Search recipe is an optional recipe in the TheBlogTheme.
This recipe enables the Lucene feature and creates Search setting, Lucene indices and permissions.
#### Blog Lucene Search食谱内容

#### Blog Lucene Search Recipe Contents
- 启用Lucene功能
- 设置Lucene索引
- 创建搜索设置
- 搜索索引权限

- Enables Lucene feature
- Setup Lucene indices
- Create the search settings
- Search index permission
### TheAgencyTheme和Agency食谱

### TheAgencyTheme and Agency Recipe
Agency食谱设置了一系列内容类型和小部件、初始内容,并将当前主题设置为TheAgencyTheme。

The Agency recipe sets up a range of content types, and widgets, the initial content,
and sets the current theme to TheAgencyTheme.
TheAgencyTheme基于[Start Bootstrap Agency Theme](https://startbootstrap.com/themes/agency/)

TheAgencyTheme is based on the [Start Bootstrap Agency Theme](https://startbootstrap.com/themes/agency/)
#### Agency食谱内容### 内容管理特性
该功能可用于管理网站的所有内容,包括页面、博客、图片、视频等。可以轻松地添加、编辑和删除内容,以确保网站的动态更新。

#### Agency Recipe Contents
### 与机构相关的内容类型和小部件
为了方便网站使用者,该功能设置了与机构相关的内容类型和小部件,包括机构信息、团队成员、客户案例和服务内容等,以更好地展示机构特色。

- Content management features
- Agency related Content types, and widgets
- A LandingPage, based on the `BagPart`
- Liquid templates, in TheAgencyTheme source code, and Templates feature
- Bootstrap
### 基于 `BagPart` 的登陆页面
该功能使用 `BagPart` 创建了一个登录页面,用户可以使用此页面登录网站,以便访问特定的网站内容。

### ComingSoon Recipe and TheComingSoonTheme
### TheAgencyTheme源代码中的Liquid模板和模板特性
`Liquid` 是一种模板语言,可以用来创建动态数据的静态页面。在该功能中,通过修改 `TheAgencyTheme` 的源代码,添加了 `Liquid` 模板和模板特性。

This recipe sets up a range of Content Types, and Widgets, and the initial content of TheComingSoonTheme.
It also includes Email, Recaptcha, Forms, Workflows and User Registration Forms.
### Bootstrap
这是一个流行的前端框架,包括HTML、CSS和JavaScript的库,用于快速开发响应式、移动设备优化的网站。在该功能中使用了 `Bootstrap` 来进行网站的前端开发。

TheComingSoon theme is based on the [Start Bootstrap Coming Soon Theme](https://startbootstrap.com/themes/coming-soon/)
### ComingSoon Recipe 和 TheComingSoonTheme

#### ComingSoon Recipe Contents
该功能包含了许多内容类型和小部件,并提供了 `TheComingSoonTheme` 的初始内容。它还包括电子邮件、验证码、表单、工作流和用户注册表单等功能。

- Content management features
- A Coming Soon landing page, using the the `FlowPart`, and form `Widgets`
- Liquid layout template, in TheComingSoon Source Code
- Liquid content templates stored in the database with the Templates features
- Bootstrap
`TheComingSoonTheme` 基于 [Start Bootstrap Coming Soon Theme](https://startbootstrap.com/themes/coming-soon/) 开发。

#### ComingSoon Recipe 内容

- 内容管理功能
- 一个 "即将上线" 的页面,使用 `FlowPart` 和表单 `Widgets`
- 存储在数据库中的 `Liquid` 内容模板
- `TheComingSoon` 源代码中的 `Liquid` 布局模板- Bootstrap

### SaaS Recipe with TheTheme
### 使用TheTheme的SaaS配方

The Saas recipe includes a Software as a Service multi tenancy configuration.
SaaS配方包括软件即服务多租户配置。

It configures the site to use TheTheme, and you are then able to create Tenants
using any of the other recipes.
它配置网站使用TheTheme,然后您可以使用任何其他配方创建租户。

#### Saas Recipe Contents
#### SaaS配方内容

- Multi-tenancy feature
- Razor home page and Layout with bootstrap and jQuery
- 多租户功能
- 使用Bootstrap和jQuery的Razor主页和布局

## Creating your own recipe
## 创建自己的配方

You can create your own recipes for deployment of your Orchard Core websites.
您可以为部署Orchard Core网站创建自己的配方。

See the [Recipes](../reference/modules/Recipes/README.md) document for more information.
请参阅[配方](../reference/modules/Recipes/README.md)文档获取更多信息。
$END_OF_FILE$

0 comments on commit d233452

Please sign in to comment.