mirror of
https://github.com/tauri-apps/tauri-docs.git
synced 2026-01-31 00:35:16 +01:00
i18(zh-cn): Keep the sidebar consistent with the English version of the document and add Chinese translation. (#2198)
This commit is contained in:
@@ -127,31 +127,52 @@ export default defineConfig({
|
||||
sidebar: [
|
||||
{
|
||||
label: 'Guides',
|
||||
translations: {
|
||||
'zh-CN': '指引',
|
||||
},
|
||||
collapsed: true,
|
||||
items: [
|
||||
{
|
||||
label: 'Quick Start',
|
||||
translations: {
|
||||
'zh-CN': '快速开始',
|
||||
},
|
||||
collapsed: true,
|
||||
items: [
|
||||
{
|
||||
label: 'What is Tauri?',
|
||||
translations: {
|
||||
'zh-CN': '什么是 Tauri?',
|
||||
},
|
||||
link: '/start/',
|
||||
},
|
||||
{
|
||||
label: 'Prerequisites',
|
||||
translations: {
|
||||
'zh-CN': '前置条件',
|
||||
},
|
||||
link: '/start/prerequisites/',
|
||||
},
|
||||
{
|
||||
label: 'Create a Project',
|
||||
translations: {
|
||||
'zh-CN': '创建项目',
|
||||
},
|
||||
link: '/start/create-project/',
|
||||
},
|
||||
{
|
||||
label: 'Frontend Configuration',
|
||||
translations: {
|
||||
'zh-CN': '前端配置',
|
||||
},
|
||||
collapsed: true,
|
||||
autogenerate: { directory: 'start/frontend' },
|
||||
},
|
||||
{
|
||||
label: 'Upgrade & Migrate',
|
||||
translations: {
|
||||
'zh-CN': '升级和迁移',
|
||||
},
|
||||
collapsed: true,
|
||||
autogenerate: { directory: 'start/migrate' },
|
||||
},
|
||||
@@ -159,36 +180,57 @@ export default defineConfig({
|
||||
},
|
||||
{
|
||||
label: 'Core Concepts',
|
||||
translations: {
|
||||
'zh-CN': '核心概念',
|
||||
},
|
||||
collapsed: true,
|
||||
autogenerate: { directory: 'concept' },
|
||||
},
|
||||
{
|
||||
label: 'Security',
|
||||
translations: {
|
||||
'zh-CN': '安全',
|
||||
},
|
||||
collapsed: true,
|
||||
autogenerate: { directory: 'security' },
|
||||
},
|
||||
{
|
||||
label: 'Develop',
|
||||
translations: {
|
||||
'zh-CN': '开发',
|
||||
},
|
||||
collapsed: true,
|
||||
autogenerate: { directory: 'develop' },
|
||||
},
|
||||
{
|
||||
label: 'Distribute',
|
||||
translations: {
|
||||
'zh-CN': '分发',
|
||||
},
|
||||
collapsed: true,
|
||||
autogenerate: { directory: 'distribute' },
|
||||
},
|
||||
{
|
||||
label: 'Learn',
|
||||
translations: {
|
||||
'zh-CN': '学习',
|
||||
},
|
||||
collapsed: true,
|
||||
autogenerate: { directory: 'learn' },
|
||||
},
|
||||
{
|
||||
label: 'Plugins',
|
||||
translations: {
|
||||
'zh-CN': '插件',
|
||||
},
|
||||
collapsed: true,
|
||||
autogenerate: { directory: 'plugin' },
|
||||
},
|
||||
{
|
||||
label: 'About',
|
||||
translations: {
|
||||
'zh-CN': '关于',
|
||||
},
|
||||
collapsed: true,
|
||||
autogenerate: { directory: 'about' },
|
||||
},
|
||||
@@ -196,30 +238,51 @@ export default defineConfig({
|
||||
},
|
||||
{
|
||||
label: 'References',
|
||||
translations: {
|
||||
'zh-CN': '参考',
|
||||
},
|
||||
collapsed: true,
|
||||
items: [
|
||||
{
|
||||
label: 'Access Control List',
|
||||
translations: {
|
||||
'zh-CN': '访问控制列表',
|
||||
},
|
||||
link: '/reference/acl/',
|
||||
},
|
||||
{
|
||||
label: 'Command Line Interface (CLI)',
|
||||
translations: {
|
||||
'zh-CN': '命令行接口(CLI)',
|
||||
},
|
||||
link: '/reference/cli/',
|
||||
},
|
||||
{
|
||||
label: 'Configuration',
|
||||
translations: {
|
||||
'zh-CN': '配置',
|
||||
},
|
||||
link: '/reference/config/',
|
||||
},
|
||||
{
|
||||
label: 'Environment Variables',
|
||||
translations: {
|
||||
'zh-CN': '环境变量',
|
||||
},
|
||||
link: '/reference/environment-variables/',
|
||||
},
|
||||
{
|
||||
label: 'Webview Versions',
|
||||
translations: {
|
||||
'zh-CN': 'Webview 版本',
|
||||
},
|
||||
link: '/reference/webview-versions/',
|
||||
},
|
||||
{
|
||||
label: 'Releases',
|
||||
translations: {
|
||||
'zh-CN': '发行版',
|
||||
},
|
||||
collapsed: true,
|
||||
autogenerate: { directory: 'release' },
|
||||
},
|
||||
@@ -236,6 +299,9 @@ export default defineConfig({
|
||||
},
|
||||
{
|
||||
label: 'Blog',
|
||||
translations: {
|
||||
'zh-CN': '博客',
|
||||
},
|
||||
collapsed: true,
|
||||
items: [
|
||||
{
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
---
|
||||
title: 开发周期
|
||||
---
|
||||
|
||||
import CommandTabs from '@components/CommandTabs.astro';
|
||||
|
||||
### 1. 启动开发服务器
|
||||
|
||||
现在您已经设置好了一切,您应该启动由 UI 框架或捆绑器提供的应用程序开发服务器(当然,假设您使用的是)。
|
||||
|
||||
:::note
|
||||
|
||||
每个框架都有自己的开发工具。 涵盖所有内容或保持最新状态超出了本文档的范围。
|
||||
|
||||
:::
|
||||
|
||||
### 2. 启动 Tauri 开发窗口
|
||||
|
||||
<CommandTabs
|
||||
npm="npm run tauri dev"
|
||||
yarn="yarn tauri dev"
|
||||
pnpm="pnpm tauri dev"
|
||||
cargo="cargo tauri dev"
|
||||
/>
|
||||
|
||||
第一次运行此命令时,Rust 包管理器需要几分钟来下载和构建所有必需的包。 由于它们是缓存的,因此后续构建要快得多,因为只有新的代码需要重新构建。
|
||||
|
||||
一旦 Rust 完成构建,Web 视图就会打开,显示您的 Web 应用程序。 您可以对 Web 应用程序进行更改,如果您的工具启用了它,则 Web 视图应自动更新,就像浏览器一样。 当您对 Rust 文件进行更改时,它们会自动重建,并且您的应用程序会自动重新启动。
|
||||
|
||||
:::caution[info 关于 Cargo.toml 和源代码管理]
|
||||
|
||||
在您的项目仓库中,您应该将`src-tauri/Cargo.lock`和`src-tauri/Cargo.toml`提交到 git,因为 Cargo 使用锁文件来提供确定性构建。 因此,建议所有应用程序都签入到 `Cargo.lock`。 您不应该提交`src-tauri/target`文件夹或其任何内容。
|
||||
|
||||
:::
|
||||
@@ -1,14 +0,0 @@
|
||||
---
|
||||
title: 开发
|
||||
description: C使用 Tauri 开发的核心概念
|
||||
---
|
||||
|
||||
import { LinkCard, CardGrid } from '@astrojs/starlight/components';
|
||||
|
||||
<CardGrid>
|
||||
<LinkCard title="开发周期" href="/zh-cn/guides/develop/development-cycle/" />
|
||||
<LinkCard
|
||||
title="更新依赖关系"
|
||||
href="/zh-cn/guides/develop/updating-dependencies"
|
||||
/>
|
||||
</CardGrid>
|
||||
Reference in New Issue
Block a user