Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i18n(zh-cn): update Debug/index.mdx #2494

Open
wants to merge 4 commits into
base: v2
Choose a base branch
from

Conversation

lonelysnows
Copy link

update Debug/index.mdx for Chinese doc.I translate the whole file to Chinese language

@lonelysnows lonelysnows requested a review from a team as a code owner August 3, 2024 07:01
@github-actions github-actions bot added i18n Is this related to translations? i18n: zh-cn Is this related to zh-cn translations? labels Aug 3, 2024
Copy link

netlify bot commented Aug 3, 2024

Deploy Preview for tauri-v2 ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit f452dad
🔍 Latest deploy log https://app.netlify.com/sites/tauri-v2/deploys/66b0253681aaf60009621966
😎 Deploy Preview https://deploy-preview-2494--tauri-v2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 99 (🔴 down 1 from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 92 (no change from production)
PWA: 80 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@FabianLars FabianLars changed the title update Debug/index.mdx i18n(zh-cn): update Debug/index.mdx Aug 3, 2024
Copy link
Contributor

@Embers-of-the-Fire Embers-of-the-Fire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some typo and style issues. Text is not checked :) maybe later if I have some more time.

<LinkCard title="在 VS Code 中调试" href="/zh-cn/develop/debug/vscode" />
<LinkCard title="在 RustRover 中调试" href="/zh-cn/develop/debug/rustrover" />
</CardGrid>
随着逐渐深入Tauri,你可能碰到一个问题需要调试。错误详情在许多地方输出,Tauri 提供了很多工具时代调试过程更加直接。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing empty line.

Comment on lines +18 to +43
```rs frame=none
fn main() {
// Whether the current instance was started with `tauri dev` or not.
#[cfg(dev)]
{
// `tauri dev` only code
}
if cfg!(dev) {
// `tauri dev` only code
} else {
// `tauri build` only code
}
let is_dev: bool = tauri::is_dev();

// Whether debug assertions are enabled or not. This is true for `tauri dev` and `tauri build --debug`.
#[cfg(debug_assertions)]
{
// Debug only code
}
if cfg!(debug_assertions) {
// Debug only code
} else {
// Production only code
}
}
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Untranslated comment in code.


## Rust控制台

第一个查看错误的地方就是Rust控制台。在终端中运行,比如,`tauri dev`。你可以使用下面的代码从一个rust文件输出一些内容到控制台:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
第一个查看错误的地方就是Rust控制台。在终端中运行,比如,`tauri dev`你可以使用下面的代码从一个rust文件输出一些内容到控制台:
第一个查看错误的地方就是 Rust 控制台。在终端中运行,比如,`tauri dev`你可以使用下面的代码从一个 rust 文件输出一些内容到控制台:
  1. Missing white space;
  2. Use full-width punctuation.

println!("Message from Rust: {}", msg);
```

有时候你rust代码中可能有一个错误,rust编译器会给你提供许多信息。比如,如果`tauri dev` 命令执行崩溃,你可以在Linux和macOS中重新运行:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
有时候你rust代码中可能有一个错误,rust编译器会给你提供许多信息。比如,如果`tauri dev` 命令执行崩溃,你可以在Linux和macOS中重新运行
有时候你 rust 代码中可能有一个错误,rust 编译器会给你提供许多信息。比如,如果 `tauri dev` 命令执行崩溃,你可以在 Linux 和 macOS 中重新运行

Missing whitespace.

RUST_BACKTRACE=1 tauri dev
```

或者在Windows (PowerShell):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
或者在Windows (PowerShell):
或者在 Windows (PowerShell):

Whitespace and punctuation.

Visual Studio窗口调试器是一个只能在Windows中使用的调试器,它比[`vscode-lldb`]更快,以及更好的支持一些Rust特性,比如枚举。
### 先决条件

安装[C/C++](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools) 扩展, 按照 https://code.visualstudio.com/docs/cpp/config-msvc#_prerequisites 安装 Visual Studio Windows Debugger.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
安装[C/C++](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools) 扩展, 按照 https://code.visualstudio.com/docs/cpp/config-msvc#_prerequisites 安装 Visual Studio Windows Debugger.
安装 [C/C++](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools) 扩展, 按照 https://code.visualstudio.com/docs/cpp/config-msvc#_prerequisites 安装 Visual Studio Windows Debugger.

Missing whitespace

Comment on lines +100 to +119
```json title=".vscode/launch.json"
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch App Debug",
"type": "cppvsdbg",
"request": "launch",
// change the exe name to your actual exe name
// (to debug release builds, change `target/debug` to `release/debug`)
"program": "${workspaceRoot}/src-tauri/target/debug/your-app-name-here.exe",
"cwd": "${workspaceRoot}",
"preLaunchTask": "ui:dev"
}
]
}
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Untranslated comment

}
```

注意它没有使用Tauri CLI,所以特有的CLI 特性没有执行。`tasks.json`和`lldb`一样,希望你添加一组配置,如果你想要在启动前进行编译,把`launch.json`的 `preLaunchTask`指向它。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
注意它没有使用Tauri CLI,所以特有的CLI 特性没有执行。`tasks.json``lldb`一样,希望你添加一组配置,如果你想要在启动前进行编译,把`launch.json``preLaunchTask`指向它。
注意它没有使用 Tauri CLI,所以特有的 CLI 特性没有执行。`tasks.json``lldb` 一样,希望你添加一组配置如果你想要在启动前进行编译,把 `launch.json``preLaunchTask` 指向它。

Missing whitespace


注意它没有使用Tauri CLI,所以特有的CLI 特性没有执行。`tasks.json`和`lldb`一样,希望你添加一组配置,如果你想要在启动前进行编译,把`launch.json`的 `preLaunchTask`指向它。

这里是一个示例:运行开发服务器(相当于`beforeDevCommand`),作为一个组进行汇编(`cargo build`),把`launch.json`中的`preLaunchTask` 配置改成`dev`(或者是你给配置的命名)。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
这里是一个示例:运行开发服务器(相当于`beforeDevCommand`),作为一个组进行汇编(`cargo build`),把`launch.json`中的`preLaunchTask` 配置改成`dev`(或者是你给配置的命名)
这里是一个示例:运行开发服务器相当于 `beforeDevCommand`),作为一个组进行汇编`cargo build`),把 `launch.json` 中的 `preLaunchTask` 配置改成 `dev`或者是你给配置的命名

Missing whitespace and wrong punctuation.

Comment on lines +124 to +155
```json title=".vscode/tasks.json"
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "build:debug",
"type": "cargo",
"command": "build"
},
{
"label": "ui:dev",
"type": "shell",
// `dev` keeps running in the background
// ideally you should also configure a `problemMatcher`
// see https://code.visualstudio.com/docs/editor/tasks#_can-a-background-task-be-used-as-a-prelaunchtask-in-launchjson
"isBackground": true,
// change this to your `beforeDevCommand`:
"command": "yarn",
"args": ["dev"]
},
{
"label": "dev",
"dependsOn": ["build:debug", "ui:dev"],
"group": {
"kind": "build"
}
}
]
}
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Untranslated comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
i18n: zh-cn Is this related to zh-cn translations? i18n Is this related to translations?
Projects
Status: 🏗️ In progress
Development

Successfully merging this pull request may close these issues.

2 participants