summaryrefslogtreecommitdiffstats
path: root/docs/zh-CN/config/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/zh-CN/config/README.md')
-rw-r--r--docs/zh-CN/config/README.md172
1 files changed, 86 insertions, 86 deletions
diff --git a/docs/zh-CN/config/README.md b/docs/zh-CN/config/README.md
index d60313226..f35d38073 100644
--- a/docs/zh-CN/config/README.md
+++ b/docs/zh-CN/config/README.md
@@ -305,7 +305,7 @@ symbol = "🅰 "
## Battery
-The `battery` module shows how charged the device's battery is and its current charging status. The module is only visible when the device's battery is below 10%.
+`battery` 组件显示电池充电情况和当前充电状态。 这个组件只会在当前电量低于 10% 时显示。
### 配置项
@@ -333,7 +333,7 @@ discharging_symbol = "💀 "
### Battery 组件的显示
-The `display` configuration option is used to define when the battery indicator should be shown (threshold) and what it looks like (style). If no `display` is provided. 默认设置如下:
+`display` 选项用于定义电池指示器的显示阈值(threshold)和显示效果(style)。 如果 `display` 没有设置, 默认设置如下:
```toml
[[battery.display]]
@@ -343,7 +343,7 @@ style = "bold red"
#### 配置项
-The `display` option is an array of the following table.
+`display` 字段的子字段如下:
| Option | 描述 |
| ----------- | ---------------- |
@@ -367,9 +367,9 @@ style = "bold yellow"
## Character
-The `character` module shows a character (usually an arrow) beside where the text is entered in your terminal.
+`character` 组件用于在您输入终端的文本旁显示一个字符(通常是一个箭头)。
-The character will tell you whether the last command was successful or not. It can do this in two ways:
+这个字符可以告诉您最后一个命令是否执行成功。 It can do this in two ways:
- changing color (`red`/`green`)
- changing shape (`❯`/`✖`)
@@ -456,15 +456,15 @@ The `cmake` module shows the currently installed version of CMake. By default th
## Command Duration
-The `cmd_duration` module shows how long the last command took to execute. The module will be shown only if the command took longer than two seconds, or the `min_time` config value, if it exists.
+`cmd_duration` 组件显示上一个命令执行的时间。 此组件只在命令执行时间长于两秒时显示,或者当其 `min_time` 字段被设置时,按此值为执行时间的显示下限。
-::: warning Do not hook the DEBUG trap in Bash
+::: warning 不要在 Bash 里捕获 DEBUG 信号
-If you are running Starship in `bash`, do not hook the `DEBUG` trap after running `eval $(starship init $0)`, or this module **will** break.
+如果您正在 `bash` 上使用 Starship,在运行 `eval $(starship)` 后,不要捕获 `DEBUG` 信号,否则此组件**将会**坏掉。
:::
-Bash users who need preexec-like functionality can use [rcaloras's bash_preexec framework](https://github.com/rcaloras/bash-preexec). Simply define the arrays `preexec_functions` and `precmd_functions` before running `eval $(starship init $0)`, and then proceed as normal.
+需要在自动每一条命令前执行某些操作的 Bash 用户可以使用 [rcaloras 的 bash_preexec 框架](https://github.com/rcaloras/bash-preexec)。 只需要在执行 `eval $(starship init $0)` 前简单地定义 `preexec_functions` 和 `precmd_functions` 两个列表,就可以照常运行了。
### 配置项
@@ -505,11 +505,11 @@ format = "underwent [$duration](bold yellow)"
## Conda
-The `conda` module shows the current conda environment, if `$CONDA_DEFAULT_ENV` is set.
+`conda` 组件在 `$CONDA_DEFAULT_ENV` 被设置时显示当前 conda 环境。
::: tip
-This does not suppress conda's own prompt modifier, you may want to run `conda config --set changeps1 False`.
+此组件没有禁用 conda 自带的提示符修改,您可能需要执行 `conda config --set changeps1 False`。
:::
@@ -587,7 +587,7 @@ The `dart` module shows the currently installed version of Dart. By default the
- The current directory contains a file with `.dart` extension
- The current directory contains a `.dart_tool` directory
-- The current directory contains a `pubspec.yaml`, `pubspec.yml` or `pubspec.lock` file
+- 当前目录包含 `pubspec.yaml`,`pubspec.yml` 或 `pubspec.lock` 文件
### 配置项
@@ -622,11 +622,11 @@ format = "via [🔰 $version](bold red) "
## Directory
-The `directory` module shows the path to your current directory, truncated to three parent folders. Your directory will also be truncated to the root of the git repo that you're currently in.
+`directory` 组件显示当前目录的路径,显示的路径会截断到三个父目录以内。 如果您处于一个 git 仓库中,显示的路径则最多会截断到该仓库的根目录。
-When using the fish style pwd option, instead of hiding the path that is truncated, you will see a shortened name of each directory based on the number you enable for the option.
+当使用 fish 风格的当前目录显示样式时,您会看到基于您的设置的每个上级目录的短名称,而不是隐藏被截断的上级目录。
-For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root, and the option set to `1`. You will now see `~/D/N/nixpkgs/pkgs`, whereas before it would have been `nixpkgs/pkgs`.
+例如,对于 `~/Dev/Nix/nixpkgs/pkgs`,其中 `nixpkgs` 是 git 仓库根目录,fish 风格相关选项设置为 `1`。 您将会看到 `~/D/N/nixpkgs/pkgs`,而在设置 fish 风格之前,当前路径将显示成 `nixpkgs/pkgs`。
### 配置项
@@ -643,7 +643,7 @@ For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root, an
| `home_symbol` | `"~"` | The symbol indicating home directory. |
<details>
-<summary>This module has a few advanced configuration options that control how the directory is displayed.</summary>
+<summary>此组件有几个高级配置选项来控制当前目录路径的显示方式。</summary>
| Advanced Option | 默认值 | 描述 |
| --------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
@@ -720,7 +720,7 @@ format = "via [🐋 $context](blue bold)"
## Dotnet
-The `dotnet` module shows the relevant version of the .NET Core SDK for the current directory. If the SDK has been pinned in the current directory, the pinned version is shown. Otherwise the module shows the latest installed version of the SDK.
+`dotnet` 模块显示与当前目录下使用的 .NET Core SDK 相关联的版本。 如果当前目录已被绑定了一个版本的 SDK,则显示被帮定的版本。 否则此组件将显示最新安装的 SDK 版本。
By default this module will only be shown in your prompt when one or more of the following files are present in the current directory:
@@ -736,7 +736,7 @@ By default this module will only be shown in your prompt when one or more of the
You'll also need the .NET Core SDK installed in order to use it correctly.
-Internally, this module uses its own mechanism for version detection. Typically it is twice as fast as running `dotnet --version`, but it may show an incorrect version if your .NET project has an unusual directory layout. If accuracy is more important than speed, you can disable the mechanism by setting `heuristic = false` in the module options.
+在内部,此组件使用自己的版本检测机制。 一般来说此组件是直接执行 `dotnet --version` 的两倍快,但当你的 .NET 项目使用了不常见的目录布局时此组件可能显示一个错误的版本。 如果相比于速度您更需要正确的版本号,您可以在组件设置中设置 `heuristic = false` 来禁用该机制。
The module will also show the Target Framework Moniker (<https://docs.microsoft.com/en-us/dotnet/standard/frameworks#supported-target-framework-versions>) when there is a csproj file in the current directory.
@@ -751,7 +751,7 @@ The module will also show the Target Framework Moniker (<https://docs.microsoft.
| `detect_files` | `["global.json", "project.json", "Directory.Build.props", "Directory.Build.targets", "Packages.props"]` | Which filenames should trigger this module. |
| `detect_folders` | `[]` | Which folders should trigger this modules. |
| `style` | `"bold blue"` | 此组件的样式。 |
-| `disabled` | `false` | Disables the `dotnet` module. |
+| `disabled` | `false` | 禁用 `dotnet` 组件。 |
### Variables
@@ -856,7 +856,7 @@ format = "via [ $version](cyan bold) "
## Environment Variable
-The `env_var` module displays the current value of a selected environment variable. The module will be shown only if any of the following conditions are met:
+`env_var` 组件显示选定的环境变量的当前值。 此组件只有满足以下条件之一时才会被显示:
- 设置的 `variable` 是一个已存在的环境变量
- 未定义 `variable`,但定义了 `default`
@@ -991,7 +991,7 @@ asia-northeast1 = "an1"
## Git Branch
-The `git_branch` module shows the active branch of the repo in your current directory.
+`git_branch` 组件显示当前目录的 git 仓库的活动分支。
### 配置项
@@ -1066,7 +1066,7 @@ tag_symbol = "🔖 "
## Git State
-The `git_state` module will show in directories which are part of a git repository, and where there is an operation in progress, such as: _REBASING_, _BISECTING_, etc. If there is progress information (e.g., REBASING 3/10), that information will be shown too.
+`git_state` 组件会显示当前目录在哪个 git 仓库中,以及正在进行的操作,例如:_REBASING_,_BISECTING_ 等。 进度信息(例如 REBASING 3/10)如果存在则也会被显示。
### 配置项
@@ -1106,7 +1106,7 @@ cherry_pick = "[🍒 PICKING](bold red)"
## Git Status
-The `git_status` module shows symbols representing the state of the repo in your current directory.
+`git_status`组件通过相应的符号显示您当前目录中 git 仓库的状态。
### 配置项
@@ -1189,7 +1189,7 @@ behind = "⇣${count}"
## Golang
-The `golang` module shows the currently installed version of Golang. By default the module will be shown if any of the following conditions are met:
+`golang` 组件显示当前安装的 Golang 版本。 By default the module will be shown if any of the following conditions are met:
- 当前目录包含 `go.mod` 文件
- 当前目录包含 `go.sum` 文件
@@ -1210,7 +1210,7 @@ The `golang` module shows the currently installed version of Golang. By default
| `detect_files` | `["go.mod", "go.sum", "glide.yaml", "Gopkg.yml", "Gopkg.lock", ".go-version"]` | Which filenames should trigger this module. |
| `detect_folders` | `["Godeps"]` | Which folders should trigger this module. |
| `style` | `"bold cyan"` | 此组件的样式。 |
-| `disabled` | `false` | Disables the `golang` module. |
+| `disabled` | `false` | 禁用 `golang` 组件。 |
### Variables
@@ -1271,7 +1271,7 @@ format = "via [⎈ $version](bold white) "
## Hostname
-The `hostname` module shows the system hostname.
+`hostname` 组件显示系统主机名。
### 配置项
@@ -1306,7 +1306,7 @@ disabled = false
## Java
-The `java` module shows the currently installed version of Java. By default the module will be shown if any of the following conditions are met:
+`java` 组件显示当前安装的 Java 版本。 By default the module will be shown if any of the following conditions are met:
- The current directory contains a `pom.xml`, `build.gradle.kts`, `build.sbt`, `.java-version`, `.deps.edn`, `project.clj`, or `build.boot` file
- The current directory contains a file with the `.java`, `.class`, `.gradle`, `.jar`, `.clj`, or `.cljc` extension
@@ -1321,7 +1321,7 @@ The `java` module shows the currently installed version of Java. By default the
| `detect_folders` | `[]` | Which folders should trigger this modules. |
| `symbol` | `"☕ "` | A format string representing the symbol of Java |
| `style` | `"red dimmed"` | 此组件的样式。 |
-| `disabled` | `false` | Disables the `java` module. |
+| `disabled` | `false` | 禁用 `java` 组件。 |
### Variables
@@ -1344,7 +1344,7 @@ symbol = "🌟 "
## Jobs
-The `jobs` module shows the current number of jobs running. The module will be shown only if there are background jobs running. The module will show the number of jobs running if there is more than 1 job, or more than the `threshold` config value, if it exists.
+`jobs` 组件显示当前正在运行的任务数量。 仅当有后台任务运行时,此组件才会显示。 如果有超过 1 个作业,模块将显示正在运行的作业数量,如果配置了 `threshold` 字段,则使用它作为显示作业数量的下限。
::: warning
@@ -1473,7 +1473,7 @@ Displays the current Kubernetes context name and, if set, the namespace from the
::: tip
-This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
+此组件默认被禁用。 若要启用此组件,请在配置文件中设置 `disable` 字段为 `false`。
:::
@@ -1512,7 +1512,7 @@ disabled = false
## Line Break
-The `line_break` module separates the prompt into two lines.
+`line_break` 组件将提示分隔为两行。
### 配置项
@@ -1571,13 +1571,13 @@ format = "via [🌕 $version](bold blue) "
## Memory Usage
-The `memory_usage` module shows current system memory and swap usage.
+`memory_usage` 组件显示当前系统内存和交换区使用情况。
-By default the swap usage is displayed if the total system swap is non-zero.
+默认情况下,如果系统交换区使用不为 0,则会显示交换区使用情况。
::: tip
-This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
+此组件默认被禁用。 若要启用此组件,请在配置文件中设置 `disable` 字段为 `false`。
:::
@@ -1618,7 +1618,7 @@ style = "bold dimmed green"
## Mercurial Branch
-The `hg_branch` module shows the active branch of the repo in your current directory.
+`hg_branch` 组件显示当前目录的 hg 仓库的活动分支。
### 配置项
@@ -1695,7 +1695,7 @@ symbol = "🎣 "
## Nix-shell
-The `nix_shell` module shows the nix-shell environment. The module will be shown when inside a nix-shell environment.
+`nix_shell` 组件显示 nix-shell 环境。 当处于一个 nix-shell 环境中时,此组件会被显示。
### 配置项
@@ -1733,7 +1733,7 @@ format = 'via [☃️ $state( \($name\))](bold blue) '
## NodeJS
-The `nodejs` module shows the currently installed version of NodeJS. By default the module will be shown if any of the following conditions are met:
+`nodejs` 组件显示当前安装的 NodeJS 版本。 By default the module will be shown if any of the following conditions are met:
- 当前目录包含 `package.json` 文件
- The current directory contains a `.node-version` file
@@ -1751,7 +1751,7 @@ The `nodejs` module shows the currently installed version of NodeJS. By default
| `detect_files` | `["package.json", ".node-version"]` | Which filenames should trigger this module. |
| `detect_folders` | `["node_modules"]` | Which folders should trigger this module. |
| `style` | `"bold green"` | 此组件的样式。 |
-| `disabled` | `false` | Disables the `nodejs` module. |
+| `disabled` | `false` | 禁用 `nodejs` 组件。 |
| `not_capable_style` | `bold red` | The style for the module when an engines property in `package.json` does not match the NodeJS version. |
### Variables
@@ -1856,7 +1856,7 @@ symbol = "☁️ "
## Package Version
-The `package` module is shown when the current directory is the repository for a package, and shows its current version. The module currently supports `npm`, `cargo`, `poetry`, `composer`, `gradle`, `julia`, `mix` and `helm` packages.
+当前目录是软件包的代码仓库时,将显示 `package` 组件,并显示软件包当前版本。 The module currently supports `npm`, `cargo`, `poetry`, `composer`, `gradle`, `julia`, `mix` and `helm` packages.
- **npm** —— `npm` 软件包版本从当前目录下的 `package.json` 中得到
- **cargo** —— `cargo` 软件包的版本从当前目录下的 `Cargo.toml` 中得到
@@ -1941,7 +1941,7 @@ format = "via [🦪 $version]($style) "
## PHP
-The `php` module shows the currently installed version of PHP. By default the module will be shown if any of the following conditions are met:
+`php` 组件显示当前安装的 PHP 版本。 By default the module will be shown if any of the following conditions are met:
- 当前目录包含一个 `composer.json` 文件
- The current directory contains a `.php-version` file
@@ -1957,7 +1957,7 @@ The `php` module shows the currently installed version of PHP. By default the mo
| `detect_files` | `["composer.json", ".php-version"]` | Which filenames should trigger this module. |
| `detect_folders` | `[]` | Which folders should trigger this module. |
| `style` | `"147 bold"` | 此组件的样式。 |
-| `disabled` | `false` | Disables the `php` module. |
+| `disabled` | `false` | 禁用 `php` 组件。 |
### Variables
@@ -2018,20 +2018,20 @@ format = "via [$symbol$version](bold white)"
## Python
-The `python` module shows the currently installed version of Python and the current Python virtual environment if one is activated.
+`python` 组件组件展示已经安装了的Python版本以及如果虚拟环境被激活则会显示当前Python虚拟环境
-If `pyenv_version_name` is set to `true`, it will display the pyenv version name. Otherwise, it will display the version number from `python --version`.
+如果`pyenv_version_name`被设置为`true`, 本组件将会展示pyenv版本名。 否则则显示通过`python --version`获得的版本号
By default the module will be shown if any of the following conditions are met:
- 当前目录包含 `.python-version` 文件
-- The current directory contains a `Pipfile` file
-- The current directory contains a `__init__.py` file
-- The current directory contains a `pyproject.toml` file
-- The current directory contains a `requirements.txt` file
-- The current directory contains a `setup.py` file
-- The current directory contains a `tox.ini` file
-- The current directory contains a file with the `.py` extension.
+- 当前目录包含 `Pipfile` 文件
+- 当前目录包含一个名为`__init__.py`的文件
+- 当前目录包含 `pyproject.toml` 文件
+- 当前目录包含 `requirements.txt` 文件
+- 当前目录包含一个 `setup.py` 文件
+- 当前目录包含一个 `tox.ini` 文件
+- 当前目录包含一个使用 `.py` 扩展名的文件.
- 当前处于一个活跃的 python 虚拟环境中
### 配置项
@@ -2047,7 +2047,7 @@ By default the module will be shown if any of the following conditions are met:
| `detect_extensions` | `[".py"]` | Which extensions should trigger this module |
| `detect_files` | `[".python-version", "Pipfile", "__init__.py", "pyproject.toml", "requirements.txt", "setup.py", "tox.ini"]` | Which filenames should trigger this module |
| `detect_folders` | `[]` | Which folders should trigger this module |
-| `disabled` | `false` | Disables the `python` module. |
+| `disabled` | `false` | 禁用 `python` 组件。 |
::: tip
@@ -2095,7 +2095,7 @@ detect_extensions = []
## Ruby
-By default the `ruby` module shows the currently installed version of Ruby. The module will be shown if any of the following conditions are met:
+By default the `ruby` module shows the currently installed version of Ruby. 此组件将在符合以下任意条件之一时显示:
- 当前目录包含 `Gemfile` 文件
- The current directory contains a `.ruby-version` file
@@ -2111,7 +2111,7 @@ By default the `ruby` module shows the currently installed version of Ruby. The
| `detect_files` | `["Gemfile", ".ruby-version"]` | Which filenames should trigger this module. |
| `detect_folders` | `[]` | Which folders should trigger this module. |
| `style` | `"bold red"` | 此组件的样式。 |
-| `disabled` | `false` | Disables the `ruby` module. |
+| `disabled` | `false` | 禁用 `ruby` 组件。 |
### Variables
@@ -2134,7 +2134,7 @@ symbol = "🔺 "
## Rust
-By default the `rust` module shows the currently installed version of Rust. The module will be shown if any of the following conditions are met:
+By default the `rust` module shows the currently installed version of Rust. 此组件将在符合以下任意条件之一时显示:
- 当前目录包含 `Cargo.toml` 文件
- 当前目录包含一个使用 `.rs` 扩展名的文件
@@ -2149,7 +2149,7 @@ By default the `rust` module shows the currently installed version of Rust. The
| `detect_files` | `["Cargo.toml"]` | Which filenames should trigger this module. |
| `detect_folders` | `[]` | Which folders should trigger this module. |
| `style` | `"bold red"` | 此组件的样式。 |
-| `disabled` | `false` | Disables the `rust` module. |
+| `disabled` | `false` | 禁用 `rust` 组件。 |
### Variables
@@ -2215,7 +2215,7 @@ The `shell` module shows an indicator for currently used shell.
::: tip
-This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
+此组件默认被禁用。 若要启用此组件,请在配置文件中设置 `disable` 字段为 `false`。
:::
@@ -2324,7 +2324,7 @@ The `status` module displays the exit code of the previous command. The module w
::: tip
-This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
+此组件默认被禁用。 若要启用此组件,请在配置文件中设置 `disable` 字段为 `false`。
:::
@@ -2377,7 +2377,7 @@ disabled = false
## Swift
-By default the `swift` module shows the currently installed version of Swift. The module will be shown if any of the following conditions are met:
+By default the `swift` module shows the currently installed version of Swift. 此组件将在符合以下任意条件之一时显示:
- The current directory contains a `Package.swift` file
- The current directory contains a file with the `.swift` extension
@@ -2415,7 +2415,7 @@ format = "via [🏎 $version](red bold)"
## Terraform
-The `terraform` module shows the currently selected terraform workspace and version.
+`terraform` 组件显示当前选定的 terraform 工作区和版本。
::: tip
@@ -2425,7 +2425,7 @@ By default the terraform version is not shown, since this is slow for current ve
By default the module will be shown if any of the following conditions are met:
-- The current directory contains a `.terraform` folder
+- 当前目录包含 `.terraform` 目录
- Current directory contains a file with the `.tf` or `.hcl` extensions
### 配置项
@@ -2438,7 +2438,7 @@ By default the module will be shown if any of the following conditions are met:
| `detect_files` | `[]` | Which filenames should trigger this module. |
| `detect_folders` | `[".terraform"]` | Which folders should trigger this module. |
| `style` | `"bold 105"` | 此组件的样式。 |
-| `disabled` | `false` | Disables the `terraform` module. |
+| `disabled` | `false` | 禁用 `terraform` 组件。 |
### Variables
@@ -2473,27 +2473,27 @@ format = "[🏎💨 $workspace]($style) "
## Time
-The `time` module shows the current **local** time. The `format` configuration value is used by the [`chrono`](https://crates.io/crates/chrono) crate to control how the time is displayed. Take a look [at the chrono strftime docs](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) to see what options are available.
+`time` 组件显示当前的 **本地** 时间。 `format` 字段值会提供给 [`chrono`](https://crates.io/crates/chrono) crate 用来控制时间显示方式。 请参阅 [chrono strftime 文档](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) 以了解可用格式选项。
::: tip
-This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
+此组件默认被禁用。 若要启用此组件,请在配置文件中设置 `disable` 字段为 `false`。
:::
### 配置项
-| Option | 默认值 | 描述 |
-| ----------------- | ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
-| `format` | `"at [$time]($style) "` | The format string for the module. |
-| `use_12hr` | `false` | Enables 12 hour formatting |
-| `time_format` | see below | The [chrono format string](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) used to format the time. |
-| `style` | `"bold yellow"` | The style for the module time |
-| `utc_time_offset` | `"local"` | Sets the UTC offset to use. Range from -24 &lt; x &lt; 24. Allows floats to accommodate 30/45 minute timezone offsets. |
-| `disabled` | `true` | Disables the `time` module. |
-| `time_range` | `"-"` | Sets the time range during which the module will be shown. Times must be specified in 24-hours format |
+| Option | 默认值 | 描述 |
+| ----------------- | ----------------------- | ----------------------------------------------------------------------------------------------------- |
+| `format` | `"at [$time]($style) "` | The format string for the module. |
+| `use_12hr` | `false` | 启用 12 小时格式 |
+| `time_format` | 见下文解释 | 用来格式化时间显示的 [chrono 格式字符串](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) |
+| `style` | `"bold yellow"` | 显示时间的样式。 |
+| `utc_time_offset` | `"local"` | 设置所用 UTC 偏移量。 Range from -24 &lt; x &lt; 24. 允许使用浮点数来得到 30/45 分钟的时区偏移。 |
+| `disabled` | `true` | 禁用 `time` 组件。 |
+| `time_range` | `"-"` | Sets the time range during which the module will be shown. Times must be specified in 24-hours format |
-If `use_12hr` is `true`, then `time_format` defaults to `"%r"`. Otherwise, it defaults to `"%T"`. Manually setting `time_format` will override the `use_12hr` setting.
+If `use_12hr` is `true`, then `time_format` defaults to `"%r"`. 否则,其默认值为 `"%T"`。 Manually setting `time_format` will override the `use_12hr` setting.
### Variables
@@ -2519,12 +2519,12 @@ time_range = "10:00:00-14:00:00"
## Username
-The `username` module shows active user's username. The module will be shown if any of the following conditions are met:
+`username` 组件显示当前活跃的用户名。 此组件将在符合以下任意条件之一时显示:
-- The current user is root
-- The current user isn't the same as the one that is logged in
-- The user is currently connected as an SSH session
-- The variable `show_always` is set to true
+- 当前用户是 root
+- 当前用户与登录用户不相同
+- 用户正通过 SSH 会话连接访问
+- 字段 `show_always` 被设置为 true
::: tip
@@ -2534,13 +2534,13 @@ SSH connection is detected by checking environment variables `SSH_CONNECTION`, `
### 配置项
-| Option | 默认值 | 描述 |
-| ------------- | ----------------------- | ------------------------------------- |
-| `style_root` | `"bold red"` | The style used when the user is root. |
-| `style_user` | `"bold yellow"` | The style used for non-root users. |
-| `format` | `"[$user]($style) in "` | 组件格式化模板。 |
-| `show_always` | `false` | Always shows the `username` module. |
-| `disabled` | `false` | Disables the `username` module. |
+| Option | 默认值 | 描述 |
+| ------------- | ----------------------- | ------------------- |
+| `style_root` | `"bold red"` | 当前用户为 root 时使用的样式。 |
+| `style_user` | `"bold yellow"` | 非 root 用户使用的样式。 |
+| `format` | `"[$user]($style) in "` | 组件格式化模板。 |
+| `show_always` | `false` | 总是显示 `username` 组件。 |
+| `disabled` | `false` | 禁用 `username` 组件。 |
### Variables
@@ -2633,7 +2633,7 @@ format = "[🆅 $repo](bold blue) "
## Zig
-By default the the `zig` module shows the currently installed version of Zig. The module will be shown if any of the following conditions are met:
+By default the the `zig` module shows the currently installed version of Zig. 此组件将在符合以下任意条件之一时显示:
- The current directory contains a `.zig` file