Skip to content

Commit 3178087

Browse files
authored
docs: Provide CN translation for three docs (#1348)
1 parent 8c628ac commit 3178087

File tree

6 files changed

+141
-23
lines changed

6 files changed

+141
-23
lines changed
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
Configuring Environment Variables
22
==================================
33

4-
All the required environment variables are automatically configured by the IDE during the ESP-IDF and Tools installation process (``Espressif > ESP-IDF Manager > Add ESP-IDF``). You can verify these variables in the Preferences page under ``C/C++ > Build > Environment``.
4+
:link_to_translation:`zh_CN:[中文]`
5+
6+
Once you install ESP-IDF through `EIM <https://docs.espressif.com/projects/idf-im-ui/en/latest/>`_, all required environment variables are automatically configured by the IDE when you activate the ESP-IDF in ``Espressif`` > ``ESP-IDF Manager``. You can verify these variables on the ``Preferences`` page under ``C/C++`` > ``Build`` > ``Environment``.
57

68
.. image:: ../../../media/2_environment_pref.png
79
:alt: Environment Preferences

docs/en/additionalfeatures/lspeditor.rst

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
LSP C/C++ Editor
2-
=================
2+
================
33

4-
Starting with Espressif IDE 3.0.0, the LSP Editor is the default code editor, which differs in several ways from the previous default editor. Below are the most notable differences:
4+
:link_to_translation:`zh_CN:[中文]`
5+
6+
Starting with Espressif IDE 3.0.0, the LSP Editor becomes the default code editor and behaves differently from the previous default editor. The most notable differences are listed below.
57

68
Formatting
79
----------
@@ -25,18 +27,18 @@ You can also disable formatting for specific folders by using the ``DisableForma
2527
2628
project
2729
├── managed_components
28-
│ └── .clang-format
30+
│ └── .clang-format
2931
├── main
3032
└── .clang-format
3133
3234
Add the ``DisableFormat: true`` option to the ``.clang-format`` file in the ``managed_components`` folder. This flag tells ClangFormat to completely ignore this specific ``.clang-format`` file and its formatting rules within the ``managed_components`` directory.
3335

34-
For more information about available style options, refer to `the Clang-Format Style Options guide <https://clang.llvm.org/docs/ClangFormatStyleOptions.html#configurable-format-style-options>`_.
36+
For more information about available style options, refer to `Configurable Format Style Options <https://clang.llvm.org/docs/ClangFormatStyleOptions.html#configurable-format-style-options>`_.
3537

3638
Search
3739
------
3840

39-
The search text option in the right-click menu is currently unavailable in the LSP-based C/C++ Editor. However, you can use the toolbar menu ``Search`` > ``Text`` > ``Workspace`` as a workaround.
41+
The ``Search Text`` option in the right-click menu is currently unavailable in the LSP-based C/C++ Editor. However, as a workaround, you can use ``Search`` > ``Text`` > ``Workspace`` from the toolbar menu.
4042

4143
Inlay Hints
4244
-----------
@@ -59,28 +61,29 @@ Searching ESP-IDF Components
5961

6062
To browse ESP-IDF components, follow these steps:
6163

62-
- Create a new project.
63-
- Add the ESP-IDF components folder as a virtual folder to the newly created project.
64-
- Press **Ctrl + Shift + T** or **Ctrl + Shift + R**.
65-
- You should now be able to browse the ESP-IDF component files.
66-
- To search for a specific function or keyword, use the Search menu in the toolbar.
64+
1. Create a new project.
65+
2. Add the ESP-IDF components folder as a virtual folder to the newly created project.
66+
3. Press **Ctrl + Shift + T** or **Ctrl + Shift + R**.
67+
4. You should now be able to browse the ESP-IDF component files.
68+
5. To search for a specific function or keyword, use the ``Search`` menu in the toolbar.
6769

6870
Creating a Virtual Folder
6971
~~~~~~~~~~~~~~~~~~~~~~~~~
7072

71-
- Navigate to ``New`` > ``Folder``.
72-
- Click on ``Advanced``.
73-
- Select ``Link to alternate Location (Linked Folder)``.
74-
- Click ``Browse`` and select the ``ESP-IDF components`` folder.
73+
1. Navigate to ``New`` > ``Folder``.
74+
2. Click on ``Advanced``.
75+
3. Select ``Link to alternate Location (Linked Folder)``.
76+
4. Click ``Browse`` and select the ``ESP-IDF components`` folder.
7577

76-
It is recommended to always create a new project instead of modifying your current one to avoid unnecessary Git files and error markers created by the indexer for the components folder. Since both projects will be in the same workspace, you should be able to search anywhere within your workspace.
78+
It is recommended to always create a new project instead of modifying your current one to avoid unnecessary Git files and error markers created by the indexer for the ``components`` folder. Since both projects reside in the same workspace, you will still be able to search across your entire workspace.
7779

7880
If you have any issues with the Clangd Configuration with the LSP Editor, please refer to the :ref:`Clangd Configuration <clangd_cdt_support>` guide.
7981

8082
References
8183
----------
84+
8285
.. toctree::
8386
:maxdepth: 1
8487

8588
Clangd CDT Support and Configuration <clangd_cdt_support>
86-
Configuring Clang Toolchain<clangtoolchain>
89+
Clang Toolchain Configuration <clangtoolchain>
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
Write Binary to Flash
22
======================
33

4-
Binary data can be written to the ESP’s flash chip via the *ESP-IDF > Write Binary Data to Flash* command. To access this command, right-click on the project in the Project Explorer:
4+
:link_to_translation:`zh_CN:[中文]`
5+
6+
Binary data can be written to the ESP's flash chip via the ``ESP-IDF: Write Binary Data to Flash`` command. To access this command, right-click on the project in the Project Explorer:
57

68
.. image:: https://github.com/espressif/idf-eclipse-plugin/assets/24419842/186c8498-d779-4771-af53-e5bf09e29502
79
:alt: Write Binary Data to Flash command
810

9-
After clicking this command, the *Write Binary Data to Flash* dialog box will open. Editable default values are provided for the binary path and offset. You can check the correct offset by viewing the partition table via *ESP-IDF > Partition Table Editor* or by manually opening the `partitions.csv` file.
11+
After clicking this command, the ``Write Binary Data to Flash`` dialog box will open. Editable default values are provided for the binary path and offset. You can check the correct offset by viewing the partition table via ``ESP-IDF: Partition Table Editor`` or by manually opening the ``partitions.csv`` file.
1012

1113
.. image:: https://github.com/espressif/idf-eclipse-plugin/assets/24419842/46e24e89-a1ed-4169-8c92-1ba0b0089ea7
1214
:alt: Write Binary Data to Flash dialog
1315

14-
Clicking the *Flash* button will execute the flash command, and the result will be displayed within this dialog.
16+
Clicking the ``Flash`` button will execute the flash command, and the result will be displayed within this dialog.
Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,9 @@
1-
.. include:: ../../en/additionalfeatures/configureenvvariables.rst
1+
配置环境变量
2+
============
3+
4+
:link_to_translation:`en:[English]`
5+
6+
通过 `EIM <https://docs.espressif.com/projects/idf-im-ui/en/latest/>`_ 安装 ESP-IDF 后,在 ``Espressif`` > ``ESP-IDF Manager`` 中激活 ESP-IDF 时,IDE 会自动配置所有必需的环境变量。你可以在 ``Preferences`` 页面前往 ``C/C++`` > ``Build`` > ``Environment``,查看这些变量。
7+
8+
.. image:: ../../../media/2_environment_pref.png
9+
:alt: 环境首选项
Lines changed: 89 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,89 @@
1-
.. include:: ../../en/additionalfeatures/lspeditor.rst
1+
LSP C/C++ 编辑器
2+
================
3+
4+
:link_to_translation:`en:[English]`
5+
6+
从 Espressif IDE 3.0.0 开始,LSP 编辑器成为默认的代码编辑器,其行为与之前的默认编辑器存在显著差异,主要区别如下所示。
7+
8+
格式化
9+
------
10+
11+
如需自定义格式化,请打开项目中的 ``.clang-format`` 文件。默认情况下,文件包含以下内容:
12+
13+
.. code-block:: none
14+
15+
BasedOnStyle: LLVM
16+
UseTab: Always
17+
IndentWidth: 4
18+
TabWidth: 4
19+
PackConstructorInitializers: NextLineOnly
20+
BreakConstructorInitializers: AfterColon
21+
IndentAccessModifiers: false
22+
AccessModifierOffset: -4
23+
24+
也可以使用 ``DisableFormat: true`` 选项对特定文件夹禁用格式化。例如,如果希望在如下结构的项目中为 ``managed_components`` 文件夹禁用格式化:
25+
26+
.. code-block:: none
27+
28+
project
29+
├── managed_components
30+
│ └── .clang-format
31+
├── main
32+
└── .clang-format
33+
34+
在 ``managed_components`` 文件夹中的 ``.clang-format`` 文件中添加 ``DisableFormat: true`` 选项。该选项会指示 ClangFormat 完全忽略此 ``.clang-format`` 文件及其在 ``managed_components`` 目录下定义的所有格式化规则。
35+
36+
有关可用风格选项的更多信息,请参阅 `可配置的格式化风格选项 <https://clang.llvm.org/docs/ClangFormatStyleOptions.html#configurable-format-style-options>`_。
37+
38+
搜索
39+
----
40+
41+
在基于 LSP 的 C/C++ 编辑器中,右键菜单里的 ``Search Text`` 选项目前不可用。不过,你可以暂时通过工具栏菜单中的 ``Search`` > ``Text`` > ``Workspace`` 来实现相同的功能。
42+
43+
内联提示
44+
--------
45+
46+
LSP 编辑器默认启用内联提示。如果你不想使用此功能,可通过编辑 ``.clangd`` 文件将其禁用:
47+
48+
.. code-block:: none
49+
50+
CompileFlags:
51+
CompilationDatabase: build
52+
Remove:
53+
- -m*
54+
- -f*
55+
56+
InlayHints:
57+
Enabled: No
58+
59+
搜索 ESP-IDF 组件
60+
-----------------
61+
62+
如需浏览 ESP-IDF 组件,请执行以下步骤:
63+
64+
1. 创建一个新项目。
65+
2. 将 ESP-IDF 组件文件夹作为虚拟文件夹添加到新建项目中。
66+
3. 使用快捷键 **Ctrl + Shift + T** 或 **Ctrl + Shift + R**。
67+
4. 现在可以浏览 ESP-IDF 组件文件。
68+
5. 若要搜索特定函数或关键字,请使用工具栏中的 ``Search`` 菜单。
69+
70+
创建虚拟文件夹
71+
~~~~~~~~~~~~~~
72+
73+
1. 前往 ``New`` > ``Folder``。
74+
2. 点击 ``Advanced``。
75+
3. 选择 ``Link to alternate Location (Linked Folder)``。
76+
4. 点击 ``Browse`` 并选择 ``ESP-IDF components`` 文件夹。
77+
78+
建议始终创建一个新项目,而不是修改现有项目,从而避免索引器在 ``components`` 文件夹中生成不必要的 Git 文件和错误标记。由于两个项目都位于同一个工作区中,你仍然可以在整个工作区范围内进行搜索。
79+
80+
如果在 LSP 编辑器中使用 Clangd 配置时遇到任何问题,请参阅 :ref:`Clangd 配置 <clangd_cdt_support>` 指南。
81+
82+
参考文档
83+
--------
84+
85+
.. toctree::
86+
:maxdepth: 1
87+
88+
Clangd CDT 支持与配置 <clangd_cdt_support>
89+
配置 Clang 工具链 <clangtoolchain>
Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,16 @@
1-
.. include:: ../../en/additionalfeatures/writebinarytoflash.rst
1+
将二进制数据写入 flash
2+
======================
3+
4+
:link_to_translation:`en:[English]`
5+
6+
可以通过 ``ESP-IDF: Write Binary Data to Flash`` 命令将二进制数据写入乐鑫的 flash 芯片。要访问此命令,请在项目资源管理器中右键单击该项目:
7+
8+
.. image:: https://github.com/espressif/idf-eclipse-plugin/assets/24419842/186c8498-d779-4771-af53-e5bf09e29502
9+
:alt: 将二进制数据写入 flash 的命令
10+
11+
点击此命令后,将打开 ``Write Binary Data to Flash`` 对话框,为二进制路径和偏移地址提供了可编辑的默认值。可以使用 ``ESP-IDF: Partition Table Editor`` 命令或手动打开 ``partitions.csv`` 文件查看分区表,确认正确的偏移地址。
12+
13+
.. image:: https://github.com/espressif/idf-eclipse-plugin/assets/24419842/46e24e89-a1ed-4169-8c92-1ba0b0089ea7
14+
:alt: 将二进制数据写入 flash 的对话框
15+
16+
点击 ``Flash`` 按钮将执行烧录命令,并在此对话框中显示结果。

0 commit comments

Comments
 (0)