docs(i18n): new Crowdin translations (#1325)

This commit is contained in:
Matan Kushner
2020-06-19 17:05:45 -04:00
committed by GitHub
parent 611a754ec7
commit ee3c0ec9d5
18 changed files with 1052 additions and 718 deletions
+140 -122
View File
@@ -9,7 +9,7 @@ Starship 目前正在开发中。 很多新的配置选项将会在之后的版
您需要创建配置文件 `~/.config/starship.toml` 以供 Starship 使用。
```sh
$ mkdir -p ~/.config && touch ~/.config/starship.toml
mkdir -p ~/.config && touch ~/.config/starship.toml
```
Starship 的所有配置都在此 [TOML](https://github.com/toml-lang/toml) 配置文件中完成:
@@ -375,11 +375,11 @@ style = "bold blue"
<details>
<summary>此组件有几个高级配置选项来控制当前目录路径的显示方式。</summary>
| 字段 | 默认值 | 描述 |
| --------------------------- | ------ | ---------------------------------------------------------------------------------------- |
| `substitutions` | | A table of substitutions to be made to the path. |
| `fish_style_pwd_dir_length` | `0` | The number of characters to use when applying fish shell pwd path logic. |
| `use_logical_path` | `true` | Displays the logical path provided by the shell (`PWD`) instead of the path from the OS. |
| 字段 | 默认值 | 描述 |
| --------------------------- | ------ | ------------------------------------------------ |
| `substitutions` | | A table of substitutions to be made to the path. |
| `fish_style_pwd_dir_length` | `0` | 使用 fish shell 当前目录路径逻辑时每个省略目录名使用的字符数。 |
| `use_logical_path` | `true` | 显示由 shell 提供的逻辑路径(`PWD`)而不是 OS 提供的路径。 |
`substitutions` allows you to define arbitrary replacements for literal strings that occur in the path, for example long network prefixes or development directories (i.e. Java). Note that this will disable the fish style PWD.
@@ -426,11 +426,11 @@ symbol = "🐋 "
## 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 版本。
This module will only be shown in your prompt when one of the following files are present in the current directory: `global.json`, `project.json`, `*.sln`, `*.csproj`, `*.fsproj`, `*.xproj`. You'll also need the .NET Core command-line tools installed in order to use it correctly.
此组件只会在以下文件之一出现在当前目录中时显示:`global.json``project.json``*.sln``*.csproj``*.fsproj``*.xproj`。 为了正确使用此组件,您还需要安装 .NET Core 命令行工具。
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` 来禁用该机制。
### 配置项
@@ -505,7 +505,7 @@ symbol = " "
## 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`
@@ -534,7 +534,7 @@ default = "unknown shell"
## Erlang
The `erlang` module shows the currently installed version of Erlang/OTP. 此组件将在符合以下任意条件之一时显示:
The `erlang` module shows the currently installed version of Erlang/OTP. 此组件只有满足以下条件之一时才会被显示:
- 当前目录包含一个 `rebar.config` 文件.
- 当前目录包含一个 `erlang.mk` 文件.
@@ -558,7 +558,7 @@ symbol = "e "
## Git Branch
The `git_branch` module shows the active branch of the repo in your current directory.
`git_branch` 组件显示当前目录的 git 仓库的活动分支。
### 配置项
@@ -583,7 +583,7 @@ truncation_symbol = ""
## Git Commit
The `git_commit` module shows the current commit hash of the repo in your current directory.
`git_commit` 组件显示当前目录的 git 仓库的当前提交的哈希值。
### 配置项
@@ -607,7 +607,7 @@ commit_hash_length = 4
## 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)如果存在则也会被显示。
### 配置项
@@ -636,7 +636,7 @@ cherry_pick = "🍒 PICKING"
## Git Status
The `git_status` module shows symbols representing the state of the repo in your current directory.
`git_status`组件通过相应的符号显示您当前目录中 git 仓库的状态。
### 配置项
@@ -695,7 +695,7 @@ deleted = "🗑"
## Golang
The `golang` module shows the currently installed version of Golang. 此组件将在符合以下任意条件之一时显示:
`golang` 组件显示当前安装的 Golang 版本。 此组件将在符合以下任意条件之一时显示:
- 当前目录包含 `go.mod` 文件
- 当前目录包含 `go.sum` 文件
@@ -724,7 +724,7 @@ symbol = "🏎💨 "
```
## Haskell
The `haskell` module shows the currently installed version of Haskell Stack version. 此组件将在符合以下任意条件之一时显示:
`haskell` 组件显示当前安装的 Haskell Stack 版本。 此组件将在符合以下任意条件之一时显示:
- 当前目录包含 `stack.yaml` 文件
@@ -748,7 +748,7 @@ symbol = " "
## Hostname
The `hostname` module shows the system hostname.
`hostname` 组件显示系统主机名。
### 配置项
@@ -776,7 +776,7 @@ disabled = false
## Java
The `java` module shows the currently installed version of Java. 此组件将在符合以下任意条件之一时显示:
`java` 组件显示当前安装的 Java 版本。 此组件将在符合以下任意条件之一时显示:
- The current directory contains a `pom.xml`, `build.gradle.kts`, `build.sbt` or `.java-version` file
- 当前目录包含一个扩展名为 `.java``.class``.gradle``.jar` 的文件
@@ -800,7 +800,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` 字段,则使用它作为显示作业数量的下限。
### 配置项
@@ -823,7 +823,7 @@ threshold = 4
## Julia
The `julia` module shows the currently installed version of Julia. 此组件将在符合以下任意条件之一时显示:
The `julia` module shows the currently installed version of Julia. 此组件将在符合以下条件之一时显示:
- The current directory contains a `Project.toml` file
- The current directory contains a `Manifest.toml` file
@@ -847,11 +847,11 @@ symbol = "∴ "
```
## Kubernetes
Displays the current Kubernetes context name and, if set, the namespace from the kubeconfig file. The namespace needs to be set in the kubeconfig file, this can be done via `kubectl config set-context starship-cluster --namespace astronaut`. If the `$KUBECONFIG` env var is set the module will use that if not it will use the `~/.kube/config`.
显示当前的 Kubernetes 上下文名以及,如果有相关设置,则显示来自 kubeconig 文件的命名空间。 命名空间需要在 kubeconfig 文件中设置,这可以通过 `kubectl config set-context starship-cluster --namespace astronaut` 完成。 如果设置了环境变量 `$KUBECONFIG`,此组件将使用该值,否则会使用 `~/.kube/config`
::: tip
This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
此组件默认被禁用。 若要启用此组件,请在配置文件中设置 `disable` 字段为 `false`
:::
@@ -879,7 +879,7 @@ disabled = false
## Line Break
The `line_break` module separates the prompt into two lines.
`line_break` 组件将提示分隔为两行。
### 配置项
@@ -898,13 +898,13 @@ disabled = true
## 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`
:::
@@ -937,7 +937,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 仓库的活动分支。
### 配置项
@@ -962,7 +962,7 @@ truncation_symbol = ""
## Nim
The `nim` module shows the currently installed version of Nim. 此组件将在符合以下任意条件之一时显示:
The `nim` module shows the currently installed version of Nim. 此组件只有满足以下条件之一时才会被显示:
- The current directory contains a `nim.cfg` file
- The current directory contains a file with the `.nim` extension
- The current directory contains a file with the `.nims` extension
@@ -988,18 +988,18 @@ 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 环境中时,此组件会被显示。
### 配置项
| 字段 | 默认值 | 描述 |
| ------------ | ------------- | ------------------------------------------------- |
| `use_name` | `false` | Display the name of the nix-shell. |
| `impure_msg` | `"impure"` | Customize the "impure" msg. |
| `pure_msg` | `"pure"` | Customize the "pure" msg. |
| `use_name` | `false` | 显示 nix-shell 的名称。 |
| `impure_msg` | `"impure"` | 自定义“impure”消息。 |
| `pure_msg` | `"pure"` | 自定义“pure”消息。 |
| `symbol` | `"❄️ "` | The symbol used before displaying the shell name. |
| `style` | `"bold blue"` | 此组件的样式。 |
| `disabled` | `false` | Disables the `nix_shell` module. |
| `disabled` | `false` | 禁用 `nix_shell` 组件。 |
### 示例
@@ -1016,20 +1016,20 @@ symbol = "☃️ "
## NodeJS
The `nodejs` module shows the currently installed version of NodeJS. 此组件将在符合以下任意条件之一时显示:
`nodejs` 组件显示当前安装的 NodeJS 版本。 此组件将在符合以下任意条件时显示:
- The current directory contains a `package.json` file
- 当前目录包含 `package.json` 文件
- The current directory contains a `.node-version` file
- The current directory contains a `node_modules` directory
- The current directory contains a file with the `.js` extension
- 当前目录包含 `node_modules` 目录
- 当前目录包含一个使用 `.js` 扩展名的文件
### 配置项
| 字段 | 默认值 | 描述 |
| ---------- | -------------- | -------------------------------------------------------- |
| `symbol` | `"⬢ "` | The symbol used before displaying the version of NodeJS. |
| `style` | `"bold green"` | 此组件的样式。 |
| `disabled` | `false` | Disables the `nodejs` module. |
| 字段 | 默认值 | 描述 |
| ---------- | -------------- | -------------------------- |
| `symbol` | `"⬢ "` | 这个字段的内容会显示在当前 NodeJS 版本之前。 |
| `style` | `"bold green"` | 此组件的样式。 |
| `disabled` | `false` | 禁用 `nodejs` 组件。 |
### 示例
@@ -1042,12 +1042,12 @@ 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` and `mix` packages.
当前目录是软件包的代码仓库时,将显示 `package` 组件,并显示软件包当前版本。 The module currently supports `npm`, `cargo`, `poetry`, `composer`, `gradle`, `julia` and `mix` packages.
- **npm** The `npm` package version is extracted from the `package.json` present in the current directory
- **cargo** The `cargo` package version is extracted from the `Cargo.toml` present in the current directory
- **poetry** The `poetry` package version is extracted from the `pyproject.toml` present in the current directory
- **composer** The `composer` package version is extracted from the `composer.json` present in the current directory
- **npm** —— `npm` 软件包版本从当前目录下的 `package.json` 中得到
- **cargo** —— `cargo` 软件包的版本从当前目录下的 `Cargo.toml` 中得到
- **poetry** —— `poetry` 软件包版本从当前目录下的 `pyproject.toml` 中得到
- **composer** —— `composer` 软件包版本从当前目录下的 `composer.json` 中得到
- **gradle** The `gradle` package version is extracted from the `build.gradle` present
- **julia** - The package version is extracted from the `Project.toml` present
- **mix** - The `mix` package version is extracted from the `mix.exs` present
@@ -1056,12 +1056,12 @@ The `package` module is shown when the current directory is the repository for a
### 配置项
| 字段 | 默认值 | 描述 |
| ----------------- | ------------ | ---------------------------------------------------------- |
| `symbol` | `"📦 "` | The symbol used before displaying the version the package. |
| `style` | `"bold 208"` | 此组件的样式。 |
| `display_private` | `false` | Enable displaying version for packages marked as private. |
| `disabled` | `false` | Disables the `package` module. |
| 字段 | 默认值 | 描述 |
| ----------------- | ------------ | --------------------------------------------------------- |
| `symbol` | `"📦 "` | 这个字段的内容会显示在当前软件包版本之前。 |
| `style` | `"bold 208"` | 此组件的样式。 |
| `display_private` | `false` | Enable displaying version for packages marked as private. |
| `disabled` | `false` | 禁用 `package` 组件。 |
### 示例
@@ -1102,19 +1102,19 @@ symbol = "🐪 "
## PHP
The `php` module shows the currently installed version of PHP. 此组件将在符合以下任意条件之一时显示:
`php` 组件显示当前安装的 PHP 版本。 此组件只有满足以下条件之一时才会被显示:
- The current directory contains a `composer.json` file
- 当前目录包含一个 `composer.json` 文件
- The current directory contains a `.php-version` file
- The current directory contains a `.php` file
- 当前目录包含一个 `.php` 文件
### 配置项
| 字段 | 默认值 | 描述 |
| ---------- | ------------ | ----------------------------------------------------- |
| `symbol` | `"🐘 "` | The symbol used before displaying the version of PHP. |
| `style` | `"bold 147"` | 此组件的样式。 |
| `disabled` | `false` | Disables the `php` module. |
| 字段 | 默认值 | 描述 |
| ---------- | ------------ | ----------------------- |
| `symbol` | `"🐘 "` | 这个字段的内容会显示在当前 PHP 版本之前。 |
| `style` | `"bold 147"` | 此组件的样式。 |
| `disabled` | `false` | 禁用 `php` 组件。 |
### 示例
@@ -1133,26 +1133,44 @@ If `pyenv_version_name` is set to `true`, it will display the pyenv version name
此组件将在符合以下任意条件之一时显示:
- The current directory contains a `.python-version` file
- The current directory contains a `requirements.txt` file
- The current directory contains a `pyproject.toml` file
- 当前目录包含 `.python-version` 文件
- 当前目录包含 `requirements.txt` 文件
- 当前目录包含 `pyproject.toml` 文件
- The current directory contains a file with the `.py` extension (and `scan_for_pyfiles` is true)
- The current directory contains a `Pipfile` file
- The current directory contains a `tox.ini` file
- The current directory contains a `setup.py` file
- 当前目录包含 `Pipfile` 文件
- 当前目录包含一个 `tox.ini` 文件
- 当前目录包含一个 `setup.py` 文件
- The current directory contains a `__init__.py` file
- A virtual environment is currently activated
- 当前处于一个活跃的 python 虚拟环境中
### 配置项
| 字段 | 默认值 | 描述 |
| -------------------- | --------------- | --------------------------------------------------------------------------- |
| `symbol` | `"🐍 "` | The symbol used before displaying the version of Python. |
| `pyenv_version_name` | `false` | Use pyenv to get Python version |
| `pyenv_prefix` | `"pyenv "` | Prefix before pyenv version display (default display is `pyenv MY_VERSION`) |
| `scan_for_pyfiles` | `true` | If false, Python files in the current directory will not show this module. |
| `style` | `"bold yellow"` | 此组件的样式。 |
| `disabled` | `false` | Disables the `python` module. |
| 字段 | 默认值 | 描述 |
| -------------------- | --------------- | -------------------------------------------------------------------------- |
| `symbol` | `"🐍 "` | 这个字段的内容会显示在当前 Python 版本之前。 |
| `pyenv_version_name` | `false` | 使用 pyenv 获取 Python 版本 |
| `pyenv_prefix` | `"pyenv "` | 在 pyenv 版本前显示的前缀(默认显示 `pyenv MY_VERSION` |
| `scan_for_pyfiles` | `true` | If false, Python files in the current directory will not show this module. |
| `style` | `"bold yellow"` | 此组件的样式。 |
| `disabled` | `false` | 禁用 `python` 组件。 |
<details>
<summary>This module has some advanced configuration options.</summary>
| 字段 | 默认值 | 描述 |
| --------------- | -------- | ----------------------------------------------------------------------------- |
| `python_binary` | `python` | Configures the python binary that Starship executes when getting the version. |
The `python_binary` variable changes the binary that Starship executes to get the version of Python, it doesn't change the arguments that are used.
```toml
# ~/.config/starship.toml
[python]
python_binary = "python3"
```
</details>
### 示例
@@ -1167,11 +1185,11 @@ pyenv_prefix = "foo "
## Ruby
The `ruby` module shows the currently installed version of Ruby. 此组件将在符合以下任意条件之一时显示:
`ruby` 组件显示当前安装的 Ruby 版本。 此组件将在符合以下任意条件之一时显示:
- The current directory contains a `Gemfile` file
- 当前目录包含 `Gemfile` 文件
- The current directory contains a `.ruby-version` file
- The current directory contains a `.rb` file
- 当前目录包含 `.rb` 文件
### 配置项
@@ -1179,7 +1197,7 @@ The `ruby` module shows the currently installed version of Ruby. 此组件将在
| ---------- | ------------ | ------------------------------------------------------ |
| `symbol` | `"💎 "` | The symbol used before displaying the version of Ruby. |
| `style` | `"bold red"` | 此组件的样式。 |
| `disabled` | `false` | Disables the `ruby` module. |
| `disabled` | `false` | 禁用 `ruby` 组件。 |
### 示例
@@ -1192,18 +1210,18 @@ symbol = "🔺 "
## Rust
The `rust` module shows the currently installed version of Rust. 此组件将在符合以下任意条件之一时显示:
`rust` 组件显示当前安装的 Rust 版本。 此组件将在符合以下任意条件之一时显示:
- The current directory contains a `Cargo.toml` file
- The current directory contains a file with the `.rs` extension
- 当前目录包含 `Cargo.toml` 文件
- 当前目录包含一个使用 `.rs` 扩展名的文件
### 配置项
| 字段 | 默认值 | 描述 |
| ---------- | ------------ | ------------------------------------------------------ |
| `symbol` | `"🦀 "` | The symbol used before displaying the version of Rust. |
| `style` | `"bold red"` | 此组件的样式。 |
| `disabled` | `false` | Disables the `rust` module. |
| 字段 | 默认值 | 描述 |
| ---------- | ------------ | ------------------------ |
| `symbol` | `"🦀 "` | 这个字段的内容会显示在当前 Rust 版本之前。 |
| `style` | `"bold red"` | 此组件的样式。 |
| `disabled` | `false` | 禁用 `rust` 组件。 |
### 示例
@@ -1240,19 +1258,19 @@ symbol = "📦 "
## Terraform
The `terraform` module shows the currently selected terraform workspace and version. By default the terraform version is not shown, since this is slow on current versions of terraform when a lot of plugins are in use. 此组件将在符合以下任意条件之一时显示:
`terraform` 组件显示当前选定的 terraform 工作区和版本。 默认情况下不会显示 terraform 版本,因为当使用大量插件时,当前版本 terraform 查询版本号很慢。 此组件将在符合以下任意条件之一时显示:
- The current directory contains a `.terraform` folder
- Current directory contains a file with the `.tf` extension
- 当前目录包含 `.terraform` 目录
- 当前目录包含一个使用 `.tf` 扩展名的文件
### 配置项
| 字段 | 默认值 | 描述 |
| -------------- | ------------ | ----------------------------------------------------------- |
| `symbol` | `"💠 "` | The symbol used before displaying the terraform workspace. |
| `show_version` | `false` | Shows the terraform version. Very slow on large workspaces. |
| `style` | `"bold 105"` | 此组件的样式。 |
| `disabled` | `false` | Disables the `terraform` module. |
| 字段 | 默认值 | 描述 |
| -------------- | ------------ | -------------------------------- |
| `symbol` | `"💠 "` | 这个字段的内容会显示在当前 terraform 工作区之前。 |
| `show_version` | `false` | 显示 terraform 版本信息。 在大型工作空间中非常缓慢。 |
| `style` | `"bold 105"` | 此组件的样式。 |
| `disabled` | `false` | 禁用 `terraform` 组件。 |
### 示例
@@ -1265,26 +1283,26 @@ symbol = "🏎💨 "
## 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`
:::
### 配置项
| 字段 | 默认值 | 描述 |
| ----------------- | --------------- | ------------------------------------------------------------------------------------------------------------------- |
| `use_12hr` | `false` | Enables 12 hour formatting. |
| `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 < x < 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 |
| 字段 | 默认值 | 描述 |
| ----------------- | --------------- | ----------------------------------------------------------------------------------------------------- |
| `use_12hr` | `false` | 启用 12 小时格式. |
| `format` | 见下文解释 | 用来格式化时间显示的 [chrono 格式字符串](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) |
| `style` | `"bold yellow"` | The style for the module time. |
| `utc_time_offset` | `"local"` | 设置所用 UTC 偏移量。 范围是 -24 < x < 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 `format` defaults to `"%r"`. Otherwise, it defaults to `"%T"`. Manually setting `format` will override the `use_12hr` setting.
如果 `use_12hr` `true`,则`format` 默认值为 `"%r"`。 否则,其默认值为 `"%T"`。 手动设置 `format` 将使 `use_12hr` 被忽略。
### 示例
@@ -1300,21 +1318,21 @@ time_range = "10:00:00-14:00:00"
## Username
The `username` module shows active user's username. 此组件将在符合以下任意条件之一时显示:
`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
### 配置项
| 字段 | 默认值 | 描述 |
| ------------- | --------------- | ------------------------------------- |
| `style_root` | `"bold red"` | The style used when the user is root. |
| `style_user` | `"bold yellow"` | The style used for non-root users. |
| `show_always` | `false` | Always shows the `username` module. |
| `disabled` | `false` | Disables the `username` module. |
| 字段 | 默认值 | 描述 |
| ------------- | --------------- | ------------------- |
| `style_root` | `"bold red"` | 当前用户为 root 时使用的样式。 |
| `style_user` | `"bold yellow"` | 非 root 用户使用的样式。 |
| `show_always` | `false` | 总是显示 `username` 组件。 |
| `disabled` | `false` | 禁用 `username` 组件。 |
### 示例
@@ -1378,7 +1396,7 @@ The order in which custom modules are shown can be individually set by setting `
| `command` | | The command whose output should be printed. |
| `when` | | A shell command used as a condition to show the module. The module will be shown if the command returns a `0` status code. |
| `shell` | | [See below](#custom-command-shell) |
| `description` | `"<custom module>"` | The description of the module that is shown when running `starship explain`. |
| `描述` | `"<custom module>"` | The description of the module that is shown when running `starship explain`. |
| `files` | `[]` | The files that will be searched in the working directory for a match. |
| `directories` | `[]` | The directories that will be searched in the working directory for a match. |
| `extensions` | `[]` | The extensions that will be searched in the working directory for a match. |
@@ -1436,7 +1454,7 @@ shell = ["pwsh.exe", "-NoProfile", "-Command", "-"]
The `purescript` module shows the currently installed version of PureScript version. 此组件将在符合以下任意条件之一时显示:
- The current directory contains a `spago.dhall` file
- 当前目录包含一个 `spago.dhall` 文件
- The current directory contains a \*.purs files
### 配置项
+19
View File
@@ -51,3 +51,22 @@ If you get an error like "*version 'GLIBC_2.18' not found (required by starship)
```sh
curl -fsSL https://starship.rs/install.sh | bash -s -- --platform unknown-linux-musl
```
## Why don't I see a glyph symbol in my prompt?
The most common cause of this is system misconfiguration. Some Linux distros in particular do not come with font support out-of-the-box. You need to ensure that:
- Your locale is set to a UTF-8 value, like `de_DE.UTF-8` or `ja_JP.UTF-8`. If `LC_ALL` is not a UTF-8 value, [you will need to change it](https://www.tecmint.com/set-system-locales-in-linux/).
- You have an emoji font installed. Most systems come with an emoji font by default, but some (notably Arch Linux) do not. You can usually install one through your system's package manager--[noto emoji](https://www.google.com/get/noto/help/emoji/) is a popular choice.
- You are using a [powerline-patched font](https://github.com/powerline/fonts).
To test your system, run the following commands in a terminal:
```
echo -e "\xf0\x9f\x90\x8d"
echo -e "\xee\x82\xa0"
```
The first line should produce a [snake emoji](https://emojipedia.org/snake/), while the second should produce a [powerline branch symbol (e0a0)](https://github.com/ryanoasis/powerline-extra-symbols#glyphs).
If either symbol fails to display correctly, your system is still misconfigured. Unfortunately, getting font configuration correct is sometimes difficult. Users on the Discord may be able to help. If both symbols display correctly, but you still don't see them in starship, [file a bug report!](https://github.com/starship/starship/issues/new/choose)