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

This commit is contained in:
Matan Kushner
2020-04-03 12:35:39 -04:00
committed by GitHub
parent 55503bb77b
commit 3ab4bab885
24 changed files with 2570 additions and 3094 deletions
+289 -242
View File
@@ -100,6 +100,7 @@ prompt_order = [
"hg_branch",
"package",
"dotnet",
"elixir",
"elm",
"golang",
"haskell",
@@ -313,31 +314,58 @@ This does not suppress conda's own prompt modifier, you may want to run `conda c
style = "dimmed green"
```
## 資料夾
## Crystal
`directory` 模組顯示到現在資料夾的路徑,並裁減到前三層資料夾。 你的資料夾也會被裁減到你所在的 git 儲存庫的根目錄。
The `crystal` module shows the currently installed version of Crystal. 這個模組在下列其中一個條件達成時顯示:
如果正在使用 fish 風格的 pwd 選項,將不會隱藏被裁減的資料夾,而是會根據你在選項中設定的數字看到每一層資料夾的縮寫。
例如,給定一個右列的路徑 `~/Dev/Nix/nixpkgs/pkgs` 其中 `nixpkgs` 是儲存庫的根目錄,而且該選項被設定為 `1`。 你會看到 `~/D/N/nixpkgs/pkgs`,而在這個設定之前則是 `nixpkgs/pkgs`
- The current directory contains a `shard.yml` file
- The current directory contains a `.cr` file
### 選項
| 變數 | 預設 | 說明 |
| ------------------- | ------------- | --------------------------------------------------- |
| `truncation_length` | `3` | 到達現在資料夾的路徑中,要被裁減掉的資料夾數目。 |
| `truncate_to_repo` | `true` | 是否要裁減到你現在所在的 git 儲存庫的根目錄。 |
| `prefix` | `"in "` | Prefix to display immediately before the directory. |
| `style` | `"bold cyan"` | 這個模組的風格。 |
| `disabled` | `false` | 停用 `directory` 模組。 |
| 變數 | 預設 | 說明 |
| ---------- | ------------ | --------------------------------------------------------- |
| `symbol` | `"🔮 "` | The symbol used before displaying the version of crystal. |
| `style` | `"bold red"` | 這個模組的風格。 |
| `disabled` | `false` | Disables the `crystal` module. |
### 範例
```toml
# ~/.config/starship.toml
[crystal]
symbol = "✨ "
style = "bold blue"
```
## 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.
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.
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`.
### 選項
| 變數 | 預設 | 說明 |
| ------------------- | ------------- | -------------------------------------------------------------------------------- |
| `truncation_length` | `3` | The number of parent folders that the current directory should be truncated to. |
| `truncate_to_repo` | `true` | Whether or not to truncate to the root of the git repo that you're currently in. |
| `prefix` | `"in "` | Prefix to display immediately before the directory. |
| `style` | `"bold cyan"` | 這個模組的風格。 |
| `disabled` | `false` | Disables the `directory` module. |
<details>
<summary>這個模組有些進階設定選項可以控制顯示資料夾。</summary>
<summary>This module has a few advanced configuration options that control how the directory is displayed.</summary>
| 變數 | 預設 | 說明 |
| --------------------------- | ------ | ------------------------------------ |
| `fish_style_pwd_dir_length` | `0` | 當使用 fish shell pwd 路徑邏輯時使用的字元數量。 |
| `use_logical_path` | `true` | 顯示 shell (`PWD`) 提供的邏輯路徑,而不是 OS 的路徑。 |
| 變數 | 預設 | 說明 |
| --------------------------- | ------ | ---------------------------------------------------------------------------------------- |
| `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. |
`fish_style_pwd_dir_length` interacts with the standard truncation options in a way that can be surprising at first: if it's non-zero, the components of the path that would normally be truncated are instead displayed with that many characters. For example, the path `/built/this/city/on/rock/and/roll`, which would normally be displayed as as `rock/and/roll`, would be displayed as `/b/t/c/o/rock/and/roll` with `fish_style_pwd_dir_length = 1`--the path components that would normally be removed are displayed with a single character. For `fish_style_pwd_dir_length = 2`, it would be `/bu/th/ci/on/rock/and/roll`.
</details>
@@ -352,20 +380,20 @@ truncation_length = 8
## Dotnet
`dotnet` 模組顯示現在資料夾使用的 .NET Core SDK 的版本。 如果這個資料夾已經選定一個 SDK,則顯示這個 SDK 的版本。 如果沒有的話,則顯示最新安裝的 SDK 版本。
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.
這個模組只會在下列檔案出現在你的現在資料夾中時,顯示在你的提示字元:`global.json``project.json``*.sln``*.csproj``*.fsproj``*.xproj`。 你也會需要安裝 .NET Core 文字命令工具來正確使用這個模組。
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.
這個模組內部是使用它自己的機制來偵測版本。 一般來說這個模組有 `dotnet --version` 的兩倍快,但是它可能會在你的 .NET 專案有不尋常的資料夾結構時顯示不正確的版本。 如果精確度比速度更重要的話,你可以藉由設定模組中的 `heuristic = false` 選項來停用這個功能。
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.
### 選項
| 變數 | 預設 | 說明 |
| ----------- | ------------- | ---------------------------- |
| `symbol` | `"•NET "` | 在顯示 dotnet 版本之前用的符號。 |
| `heuristic` | `true` | 使用更快速的版本偵測法來保持 starship 的速度。 |
| `style` | `"bold blue"` | 這個模組的風格。 |
| `disabled` | `false` | 停用 `dotnet` 模組。 |
| 變數 | 預設 | 說明 |
| ----------- | ------------- | -------------------------------------------------------- |
| `symbol` | `"•NET "` | The symbol used before displaying the version of dotnet. |
| `heuristic` | `true` | Use faster version detection to keep starship snappy. |
| `style` | `"bold blue"` | 這個模組的風格。 |
| `disabled` | `false` | Disables the `dotnet` module. |
### 範例
@@ -378,12 +406,34 @@ style = "green"
heuristic = false
```
## Elixir
The `elixir` module shows the currently installed version of Elixir and Erlang/OTP. 這個模組在下列其中一個條件達成時顯示:
- The current directory contains a `mix.exs` file.
### 選項
| 變數 | 預設 | 說明 |
| ---------- | ------- | --------------------------------------------------------------- |
| `symbol` | `"💧 "` | The symbol used before displaying the version of Elixir/Erlang. |
| `disabled` | `false` | Disables the `elixir` module. |
### 範例
```toml
# ~/.config/starship.toml
[elixir]
symbol = "🔮 "
```
## Elm
The `elm` module shows the currently installed version of Elm. 這個模組在下列其中一個條件達成時顯示:
- 現在資料夾中包含一個 `elm.json` 檔案
- 現在資料夾中包含一個 `elm-package.json` 檔案
- The current directory contains a `elm.json` file
- The current directory contains a `elm-package.json` file
- The current directory contains a `elm-stuff` folder
- The current directory contains a `*.elm` files
@@ -405,24 +455,24 @@ The `elm` module shows the currently installed version of Elm. 這個模組在
symbol = " "
```
## 環境變數
## Environment Variable
`env_var`模組顯示一個選擇的環境變數的現在數值。 這個模組只在下列條件其中之一達到時顯示:
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:
- `variable` 設定選項符合一個存在的環境變數。
- 沒有設定 `variable` 選項,但是有設定 `default` 選項。
- The `variable` configuration option matches an existing environment variable
- The `variable` configuration option is not defined, but the `default` configuration option is
### 選項
| 變數 | 預設 | 說明 |
| ---------- | ---------------- | -------------------- |
| `symbol` | | 顯示在變數數值之前的符號。 |
| `variable` | | 要顯示的環境變數。 |
| `default` | | 在選擇的變數值沒有定義時,顯示的預設值。 |
| `prefix` | `""` | 在變數值正前方顯示的前綴。 |
| `suffix` | `""` | 在變數值正後方顯示的後綴。 |
| `style` | `"dimmed black"` | 這個模組的風格。 |
| `disabled` | `false` | 停用 `env_var` 模組。 |
| 變數 | 預設 | 說明 |
| ---------- | ---------------- | ---------------------------------------------------------------------------- |
| `symbol` | | The symbol used before displaying the variable value. |
| `variable` | | The environment variable to be displayed. |
| `default` | | The default value to be displayed when the selected variable is not defined. |
| `prefix` | `""` | Prefix to display immediately before the variable value. |
| `suffix` | `""` | Suffix to display immediately after the variable value. |
| `style` | `"dimmed black"` | 這個模組的風格。 |
| `disabled` | `false` | Disables the `env_var` module. |
### 範例
@@ -434,19 +484,19 @@ variable = "SHELL"
default = "unknown shell"
```
## Git 分支
## Git Branch
`git_branch` 模組顯示現在的資料夾中使用中的儲存庫的分支。
The `git_branch` module shows the active branch of the repo in your current directory.
### 選項
| 變數 | 預設 | 說明 |
| ------------------- | --------------- | -------------------------------- |
| `symbol` | `" "` | 在你現在資料夾之中的儲存庫的分支名稱前使用的符號。 |
| `truncation_length` | `2^63 - 1` | 裁減一個 git 分支到 X 字素 (grapheme)。 |
| `truncation_symbol` | `"…"` | 用來指示分支名稱被縮減的符號。 你可以用 "" 來表示不要顯示。 |
| `style` | `"bold purple"` | 這個模組的風格。 |
| `disabled` | `false` | 停用 `git_branch` 模組。 |
| 變數 | 預設 | 說明 |
| ------------------- | --------------- | ------------------------------------------------------------------------------------- |
| `symbol` | `" "` | The symbol used before the branch name of the repo in your current directory. |
| `truncation_length` | `2^63 - 1` | Truncates a git branch to X graphemes |
| `truncation_symbol` | `"…"` | The symbol used to indicate a branch name was truncated. You can use "" for no symbol |
| `style` | `"bold purple"` | 這個模組的風格。 |
| `disabled` | `false` | Disables the `git_branch` module. |
### 範例
@@ -463,21 +513,16 @@ truncation_symbol = ""
The `git_commit` module shows the current commit hash of the repo in your current directory.
::: tip
這個模組預設是停用的。 想要啟用它的話,請在設定檔中將 `disabled` 設定為 `false`
:::
### 選項
| 變數 | 預設 | 說明 |
| -------------------- | -------------- | ------------------------------------------------ |
| `commit_hash_length` | `7` | The length of the displayed git commit hash. |
| `prefix` | `"("` | Prefix to display immediately before git commit. |
| `suffix` | `")"` | Suffix to display immediately after git commit. |
| `style` | `"bold green"` | 這個模組的風格。 |
| `disabled` | `true` | Disables the `git_commit` module. |
| 變數 | 預設 | 說明 |
| -------------------- | -------------- | ----------------------------------------------------- |
| `commit_hash_length` | `7` | The length of the displayed git commit hash. |
| `prefix` | `"("` | Prefix to display immediately before git commit. |
| `suffix` | `")"` | Suffix to display immediately after git commit. |
| `style` | `"bold green"` | 這個模組的風格。 |
| `only_detached` | `true` | Only show git commit hash when in detached HEAD state |
| `disabled` | `false` | Disables the `git_commit` module. |
### 範例
@@ -485,28 +530,27 @@ The `git_commit` module shows the current commit hash of the repo in your curren
# ~/.config/starship.toml
[git_commit]
disabled = false
commit_hash_length = 4
```
## Git State
`git_state` 模組會顯示在 git 儲存庫中的資料夾內,以及會在有作業正在進行時顯示,像是:_REBASING_、_BISECTING_ 等等。 如果有進展的資訊 (像是 REBASING 3/10),也會一併顯示出來。
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.
### 選項
| 變數 | 預設 | 說明 |
| ------------------ | ------------------ | -------------------------------------------------- |
| `rebase` | `"REBASING"` | `rebase` 進行中顯示的文字。 |
| `merge` | `"MERGING"` | `merge` 進行中顯示的文字。 |
| `revert` | `"REVERTING"` | `revert` 進行中顯示的文字。 |
| `cherry_pick` | `"CHERRY-PICKING"` | `cherry-pick` 進行中顯示的文字。 |
| `bisect` | `"BISECTING"` | `bisect` 進行中顯示的文字。 |
| `am` | `"AM"` | `apply-mailbox` (`git am`) 進行中顯示的文字。 |
| `am_or_rebase` | `"AM/REBASE"` | 當不容易分辨是 `apply-mailbox` `rebase` 正在進行中時顯示的文字。 |
| `progress_divider` | `"/"` | 用來分開現在與總共進度量的符號。 (例如:`" of "` 會得到 `"3 of 10"` 的效果) |
| `style` | `"bold yellow"` | 這個模組的風格。 |
| `disabled` | `false` | 停用 `git_state` 模組。 |
| 變數 | 預設 | 說明 |
| ------------------ | ------------------ | ---------------------------------------------------------------------------------------------------------------- |
| `rebase` | `"REBASING"` | The text displayed when a `rebase` is in progress. |
| `merge` | `"MERGING"` | The text displayed when a `merge` is in progress. |
| `revert` | `"REVERTING"` | The text displayed when a `revert` is in progress. |
| `cherry_pick` | `"CHERRY-PICKING"` | The text displayed when a `cherry-pick` is in progress. |
| `bisect` | `"BISECTING"` | The text displayed when a `bisect` is in progress. |
| `am` | `"AM"` | The text displayed when an `apply-mailbox` (`git am`) is in progress. |
| `am_or_rebase` | `"AM/REBASE"` | The text displayed when an ambiguous `apply-mailbox` or `rebase` is in progress. |
| `progress_divider` | `"/"` | The symbol or text which will separate the current and total progress amounts. (e.g., `" of "`, for `"3 of 10"`) |
| `style` | `"bold yellow"` | 這個模組的風格。 |
| `disabled` | `false` | Disables the `git_state` module. |
### 範例
@@ -520,34 +564,34 @@ cherry_pick = "🍒 PICKING"
## Git Status
`git_status` 模組顯示用來表示現在資料夾之中儲存庫狀態的符號。
The `git_status` module shows symbols representing the state of the repo in your current directory.
### 選項
| 變數 | 預設 | 說明 |
| ------------------ | ------------------------ | ------------------------------------------------ |
| `conflicted` | `"="` | 這個分支有合併衝突。 |
| `conflicted_count` | [連結](#git-status-counts) | Show and style the number of conflicts. |
| `ahead` | `"⇡"` | 這個分支超前正在追蹤的分支。 |
| `behind` | `"⇣"` | 這個分支落後正在追蹤的分支。 |
| `diverged` | `"⇕"` | 這個分支偏離正在追蹤的分支。 |
| `untracked` | `"?"` | 工作資料夾中有沒有追蹤的檔案。 |
| `untracked_count` | [連結](#git-status-counts) | Show and style the number of untracked files. |
| `stashed` | `"$"` | 本地儲存庫有 stash。 |
| `stashed_count` | [連結](#git-status-counts) | Show and style the number of stashes. |
| `modified` | `"!"` | 工作資料夾中有修改過的檔案。 |
| `modified_count` | [連結](#git-status-counts) | Show and style the number of modified files. |
| `staged` | `"+"` | 一個新檔案被加入了暫存區 (staging area)。 |
| `staged_count` | [連結](#git-status-counts) | Show and style the number of files staged files. |
| `renamed` | `"»"` | 一個被改名的檔案被加入了暫存區 (staging area)。 |
| `renamed_count` | [連結](#git-status-counts) | Show and style the number of renamed files. |
| `deleted` | `"✘"` | 一個刪除檔案的動作被加入了暫存區 (staging area)。 |
| `deleted_count` | [連結](#git-status-counts) | Show and style the number of deleted files. |
| `show_sync_count` | `false` | 顯示超前/落後追蹤的分支的數量。 |
| `prefix` | `[` | 在 git 狀態正前方顯示的前綴。 |
| `suffix` | `]` | 在 git 狀態正後方顯示的後綴。 |
| `style` | `"bold red"` | 這個模組的風格。 |
| `disabled` | `false` | 停用 `git_status` 模組。 |
| 變數 | 預設 | 說明 |
| ------------------ | ------------------------ | ------------------------------------------------------- |
| `conflicted` | `"="` | This branch has merge conflicts. |
| `conflicted_count` | [連結](#git-status-counts) | Show and style the number of conflicts. |
| `ahead` | `"⇡"` | This branch is ahead of the branch being tracked. |
| `behind` | `"⇣"` | This branch is behind of the branch being tracked. |
| `diverged` | `"⇕"` | This branch has diverged from the branch being tracked. |
| `untracked` | `"?"` | There are untracked files in the working directory. |
| `untracked_count` | [連結](#git-status-counts) | Show and style the number of untracked files. |
| `stashed` | `"$"` | A stash exists for the local repository. |
| `stashed_count` | [連結](#git-status-counts) | Show and style the number of stashes. |
| `modified` | `"!"` | There are file modifications in the working directory. |
| `modified_count` | [連結](#git-status-counts) | Show and style the number of modified files. |
| `staged` | `"+"` | A new file has been added to the staging area. |
| `staged_count` | [連結](#git-status-counts) | Show and style the number of files staged files. |
| `renamed` | `"»"` | A renamed file has been added to the staging area. |
| `renamed_count` | [連結](#git-status-counts) | Show and style the number of renamed files. |
| `deleted` | `"✘"` | A file's deletion has been added to the staging area. |
| `deleted_count` | [連結](#git-status-counts) | Show and style the number of deleted files. |
| `show_sync_count` | `false` | Show ahead/behind count of the branch being tracked. |
| `prefix` | `[` | Prefix to display immediately before git status. |
| `suffix` | `]` | Suffix to display immediately after git status. |
| `style` | `"bold red"` | 這個模組的風格。 |
| `disabled` | `false` | Disables the `git_status` module. |
#### Git Status Counts
@@ -579,23 +623,23 @@ deleted = "🗑"
## Golang
`golang` 模組顯示現在安裝的 Golang 版本。 這個模組在下列其中一個條件達成時顯示:
The `golang` module shows the currently installed version of Golang. 這個模組在下列其中一個條件達成時顯示:
- 現在資料夾中含有一個 `go.mod` 檔案
- 現在資料夾中含有一個 `go.sum` 檔案
- 現在資料夾中含有一個 `glide.yaml` 檔案
- 現在資料夾中含有一個 `Gopkg.yml` 檔案
- 現在資料夾中含有一個 `Gopkg.lock` 檔案
- 現在資料夾中含有一個 `Godeps` 資料夾
- 現在資料夾中含有一個檔案具有 `.go` 副檔名
- The current directory contains a `go.mod` file
- The current directory contains a `go.sum` file
- The current directory contains a `glide.yaml` file
- The current directory contains a `Gopkg.yml` file
- The current directory contains a `Gopkg.lock` file
- The current directory contains a `Godeps` directory
- The current directory contains a file with the `.go` extension
### 選項
| 變數 | 預設 | 說明 |
| ---------- | ------------- | ------------------- |
| `symbol` | `"🐹 "` | 顯示在 Golang 版本之前的符號。 |
| `style` | `"bold cyan"` | 這個模組的風格。 |
| `disabled` | `false` | 停用 `golang` 模組。 |
| 變數 | 預設 | 說明 |
| ---------- | ------------- | -------------------------------------------------------- |
| `symbol` | `"🐹 "` | The symbol used before displaying the version of Golang. |
| `style` | `"bold cyan"` | 這個模組的風格。 |
| `disabled` | `false` | Disables the `golang` module. |
### 範例
@@ -609,7 +653,7 @@ symbol = "🏎💨 "
The `haskell` module shows the currently installed version of Haskell Stack version. 這個模組在下列其中一個條件達成時顯示:
- 現在資料夾中含有一個 `stack.yaml` 檔案
- The current directory contains a `stack.yaml` file
### 選項
@@ -629,31 +673,6 @@ The `haskell` module shows the currently installed version of Haskell Stack vers
symbol = " "
```
## Mercurial Branch
The `hg_branch` module shows the active branch of the repo in your current directory.
### 選項
| 變數 | 預設 | 說明 |
| ------------------- | --------------- | -------------------------------------------------------------------------------------------- |
| `symbol` | `" "` | The symbol used before the hg bookmark or branch name of the repo in your current directory. |
| `truncation_length` | `2^63 - 1` | Truncates the hg branch name to X graphemes |
| `truncation_symbol` | `"…"` | 用來指示分支名稱被縮減的符號。 |
| `style` | `"bold purple"` | 這個模組的風格。 |
| `disabled` | `true` | Disables the `hg_branch` module. |
### 範例
```toml
# ~/.config/starship.toml
[hg_branch]
symbol = "🌱 "
truncation_length = 4
truncation_symbol = ""
```
## 主機名稱
`hostname` 模組顯示系統的主機名稱。
@@ -682,18 +701,42 @@ trim_at = ".companyname.com"
disabled = false
```
## 工作
## Java
`jobs` 模組顯示現在正在執行中的工作。 這個模組只會在有背景工作正在執行時顯示。 這個模組會在工作數量超過一個,或者有設定 `threshold` 時且數量超過設定值時,顯示工作的數量。
The `java` module shows the currently installed version of Java. 這個模組在下列其中一個條件達成時顯示:
- The current directory contains a `pom.xml`, `build.gradle.kts` or `build.sbt` file
- The current directory contains a file with the `.java`, `.class`, `.gradle` or `.jar` extension
### 選項
| 變數 | 預設 | 說明 |
| ----------- | ------------- | -------------- |
| `symbol` | `""` | 在顯示工作數量之前用的符號。 |
| `threshold` | `1` | 在超過指定值時顯示工作數量。 |
| `style` | `"bold blue"` | 這個模組的風格。 |
| `disabled` | `false` | 停用 `jobs` 模組。 |
| 變數 | 預設 | 說明 |
| ---------- | -------------- | ------------------------------------------------------ |
| `symbol` | `""` | The symbol used before displaying the version of Java. |
| `style` | `"dimmed red"` | 這個模組的風格。 |
| `disabled` | `false` | Disables the `java` module. |
### 範例
```toml
# ~/.config/starship.toml
[java]
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.
### 選項
| 變數 | 預設 | 說明 |
| ----------- | ------------- | ----------------------------------------------------- |
| `symbol` | `"✦"` | The symbol used before displaying the number of jobs. |
| `threshold` | `1` | Show number of jobs if exceeded. |
| `style` | `"bold blue"` | 這個模組的風格。 |
| `disabled` | `false` | Disables the `jobs` module. |
### 範例
@@ -707,7 +750,7 @@ threshold = 4
## Kubernetes
顯示現在 Kubernetes 主體名稱以及從 kubeconfig 檔案來的名稱空間 (如果有設定的話)。 The namespace needs to be set in the kubeconfig file, this can be done via `kubectl config set-context starship-cluster --namespace astronaut`. 如果有設定 `$KUBECONFIG` 環境變數,這個模組就會使用設定值;如果沒有,它就會使用 `~/.kube/config`
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`.
::: tip
@@ -717,11 +760,11 @@ threshold = 4
### 選項
| 變數 | 預設 | 說明 |
| ---------- | ------------- | ------------------------ |
| `symbol` | `"☸ "` | 顯示在叢集 (cluster) 資訊之前的符號。 |
| `style` | `"bold blue"` | 這個模組的風格。 |
| `disabled` | `true` | 停用 `kubernetes` 模組。 |
| 變數 | 預設 | 說明 |
| ---------- | ------------- | --------------------------------------------------- |
| `symbol` | `"☸ "` | The symbol used before displaying the Cluster info. |
| `style` | `"bold blue"` | 這個模組的風格。 |
| `disabled` | `true` | Disables the `kubernetes` module |
### 範例
@@ -730,19 +773,19 @@ threshold = 4
[kubernetes]
symbol = "⛵ "
style = "dim green"
style = "dimmed green"
disabled = false
```
## 換行
## Line Break
`line_break` 模組將提示字元分成兩行。
The `line_break` module separates the prompt into two lines.
### 選項
| 變數 | 預設 | 說明 |
| ---------- | ------- | ----------------------------- |
| `disabled` | `false` | 停用 `line_break` 模組,讓提示字元變成一行。 |
| 變數 | 預設 | 說明 |
| ---------- | ------- | ------------------------------------------------------------------ |
| `disabled` | `false` | Disables the `line_break` module, making the prompt a single line. |
### 範例
@@ -753,61 +796,11 @@ disabled = false
disabled = true
```
## Nix-shell
## Memory Usage
`nix_shell` 模組顯示 nix-shell 環境。 這個模組會在 nix-shell 環境中顯示。
The `memory_usage` module shows current system memory and swap usage.
### 選項
| 變數 | 預設 | 說明 |
| ------------ | ------------ | ------------------ |
| `use_name` | `false` | 顯示 nix-shell 的名稱。 |
| `impure_msg` | `"impure"` | 自定義「impure」訊息。 |
| `pure_msg` | `"pure"` | 自定義「pure」訊息。 |
| `style` | `"bold red"` | 這個模組的風格。 |
| `disabled` | `false` | 停用 `nix_shell` 模組。 |
### 範例
```toml
# ~/.config/starship.toml
[nix_shell]
disabled = true
use_name = true
impure_msg = "impure shell"
pure_msg = "pure shell"
```
## Java
`java` 模組顯示現在安裝的 Java 版本。 這個模組在下列其中一個條件達成時顯示:
- 現在資料夾中包含一個 `pom.xml``build.gradle.kts``build.sbt` 檔案
- The current directory contains a file with the `.java`, `.class`, `.gradle` or `.jar` extension
### 選項
| 變數 | 預設 | 說明 |
| ---------- | -------------- | ----------------- |
| `symbol` | `"☕ "` | 顯示在 Java 版本之前的符號。 |
| `style` | `"dimmed red"` | 這個模組的風格。 |
| `disabled` | `false` | 停用 `java` 模組。 |
### 範例
```toml
# ~/.config/starship.toml
[java]
symbol = "🌟 "
```
## 記憶體使用量
`memory_usage` 模組顯示現在系統記憶體與 swap 的使用量。
預設 swap 使用量會在系統總 swap 使用量不為 0 時顯示出來。
By default the swap usage is displayed if the total system swap is non-zero.
::: tip
@@ -819,13 +812,13 @@ symbol = "🌟 "
| 變數 | 預設 | 說明 |
| ----------------- | --------------------- | ------------------------------------------------------------- |
| `show_percentage` | `false` | 以剩餘記憶體佔有的百分比的方式顯示記憶體使用狀況。 |
| `show_swap` | `true` | 如果總 swap 使用量不為零的話,顯示 swap 使用量 |
| `threshold` | `75` | 將記憶體使用量隱藏,除非使用量超過指定值。 |
| `symbol` | `"🐏 "` | 顯示在記憶體使用量之前的符號。 |
| `show_percentage` | `false` | Display memory usage as a percentage of the available memory. |
| `show_swap` | `true` | Display swap usage if total swap is non-zero. |
| `threshold` | `75` | Hide the memory usage unless it exceeds this percentage. |
| `symbol` | `"🐏 "` | The symbol used before displaying the memory usage. |
| `separator` | `" | "` | The symbol or text that will seperate the ram and swap usage. |
| `style` | `"bold dimmed white"` | 這個模組的風格。 |
| `disabled` | `true` | 停用 `memory_usage` 模組。 |
| `disabled` | `true` | Disables the `memory_usage` module. |
### 範例
@@ -833,6 +826,7 @@ symbol = "🌟 "
# ~/.config/starship.toml
[memory_usage]
disabled = false
show_percentage = true
show_swap = true
threshold = -1
@@ -841,29 +835,55 @@ separator = "/"
style = "bold dimmed green"
```
## Crystal
## Mercurial Branch
The `crystal` module shows the currently installed version of Crystal. 這個模組在下列其中一個條件達成時顯示:
- 現在資料夾中含有一個 `shard.yml` 檔案
- The current directory contains a `.cr` file
The `hg_branch` module shows the active branch of the repo in your current directory.
### 選項
| 變數 | 預設 | 說明 |
| ---------- | ------------ | --------------------------------------------------------- |
| `symbol` | `"🔮 "` | The symbol used before displaying the version of crystal. |
| `style` | `"bold red"` | 這個模組的風格。 |
| `disabled` | `false` | Disables the `crystal` module. |
| 變數 | 預設 | 說明 |
| ------------------- | --------------- | -------------------------------------------------------------------------------------------- |
| `symbol` | `" "` | The symbol used before the hg bookmark or branch name of the repo in your current directory. |
| `truncation_length` | `2^63 - 1` | Truncates the hg branch name to X graphemes |
| `truncation_symbol` | `"…"` | The symbol used to indicate a branch name was truncated. |
| `style` | `"bold purple"` | 這個模組的風格。 |
| `disabled` | `true` | Disables the `hg_branch` module. |
### 範例
```toml
# ~/.config/starship.toml
[crystal]
symbol = " "
style = "bold blue"
[hg_branch]
symbol = "🌱 "
truncation_length = 4
truncation_symbol = ""
```
## Nix-shell
The `nix_shell` module shows the nix-shell environment. The module will be shown when inside a nix-shell environment.
### 選項
| 變數 | 預設 | 說明 |
| ------------ | ------------ | ---------------------------------- |
| `use_name` | `false` | Display the name of the nix-shell. |
| `impure_msg` | `"impure"` | Customize the "impure" msg. |
| `pure_msg` | `"pure"` | Customize the "pure" msg. |
| `style` | `"bold red"` | 這個模組的風格。 |
| `disabled` | `false` | Disables the `nix_shell` module. |
### 範例
```toml
# ~/.config/starship.toml
[nix_shell]
disabled = true
use_name = true
impure_msg = "impure shell"
pure_msg = "pure shell"
```
## NodeJS
@@ -893,12 +913,13 @@ symbol = "🤖 "
## 套件版本
The `package` 模組在現在資料夾是一個套件的儲藏庫時出現,並顯示他的現在版本。 這個模組目前支援 `npm``cargo` `poetry` 套件。
The `package` 模組在現在資料夾是一個套件的儲藏庫時出現,並顯示他的現在版本。 The module currently supports `npm`, `cargo`, `poetry`, `composer`, and `gradle` packages.
- **npm** `npm` 套件的版本是從現在資料夾中的 `package.json` 之中擷取出來的
- **cargo** `cargo` 套件的版本是從現在資料夾中的 `Cargo.toml` 之中擷取出來的
- **poetry** `poetry` 套件的版本是從現在資料夾中的 `pyproject.toml` 之中擷取出來的
- **composer** The `composer` package version is extracted from the `composer.json` present in the current directory
- **gradle** The `gradle` package version is extracted from the `build.gradle` present
> ⚠️ 顯示出來的版本是從你的現在資料夾之中擷取出來的,並非從套件管理員取得。
@@ -923,7 +944,7 @@ symbol = "🎁 "
The `php` module shows the currently installed version of PHP. 這個模組在下列其中一個條件達成時顯示:
- 目前資料夾中一個 `composer.json` 檔案
- 現在資料夾中包含一個 `composer.json` 檔案
- The current directory contains a `.php` file
### 選項
@@ -1030,6 +1051,32 @@ symbol = "🔺 "
symbol = "⚙️ "
```
## Singularity
The `singularity` module shows the current singularity image, if inside a container and `$SINGULARITY_NAME` is set.
:::
### 選項
| 變數 | 預設 | 說明 |
| ---------- | -------------------- | ------------------------------------------------ |
| `label` | `""` | Prefix before the image name display. |
| `prefix` | `"["` | Prefix to display immediately before image name. |
| `suffix` | `"]"` | Suffix to display immediately after image name. |
| `symbol` | `""` | The symbol used before the image name. |
| `style` | `"bold dimmed blue"` | 這個模組的風格。 |
| `disabled` | `false` | Disables the `singularity` module. |
### 範例
```toml
# ~/.config/starship.toml
[singularity]
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. 這個模組在下列其中一個條件達成時顯示:
@@ -1067,13 +1114,13 @@ symbol = "🏎💨 "
### 選項
| 變數 | 預設 | 說明 |
| ----------------- | ------------- | -------------------------------------------------------------------------------------- |
| `use_12hr` | `false` | 啟用 12 小時格式。 |
| `format` | 請看下列 | 用來顯示時間的 [chrono 格式字串](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html)。 |
| `style` | `bold yellow` | 這個模組的時間的風格。 |
| `utc_time_offset` | `local` | 設定相對於 UTC 的時差。 範圍 -24 < x < 24。 允許使用浮點數來表示 30/45 分鐘時差的時區。 |
| `disabled` | `true` | 停用 `time` 模組。 |
| 變數 | 預設 | 說明 |
| ----------------- | --------------- | -------------------------------------------------------------------------------------- |
| `use_12hr` | `false` | 啟用 12 小時格式。 |
| `format` | 請看下列 | 用來顯示時間的 [chrono 格式字串](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html)。 |
| `style` | `"bold yellow"` | 這個模組的時間的風格。 |
| `utc_time_offset` | `"local"` | 設定相對於 UTC 的時差。 範圍 -24 < x < 24。 允許使用浮點數來表示 30/45 分鐘時差的時區。 |
| `disabled` | `true` | 停用 `time` 模組。 |
如果 `use_12hr``true` 的話,`format` 會被預設為 `"%r"`。 不然的話,它會被預設為 `"%T"`。 手動設定 `format` 的設定值會覆寫 `use_12hr` 的設定。
@@ -1085,7 +1132,7 @@ symbol = "🏎💨 "
[time]
disabled = false
format = "🕙[ %T ]"
utc_time_offset = -5
utc_time_offset = "-5"
```
## 使用者名稱