docs(i18n): new Crowdin updates (#3460)

This commit is contained in:
Matan Kushner
2022-02-07 15:53:55 +01:00
committed by GitHub
parent db86a93824
commit 1d965a9d24
128 changed files with 7869 additions and 5504 deletions
+4 -4
View File
@@ -119,7 +119,7 @@ eval $(starship init ion)
#### Elvish
::: warning Only elvish v0.17 or higher is supported. :::
::: warning Chỉ elvish v0.17 hoặc cao hơn được hỗ trợ. :::
Thêm đoạn sau vào cuối tệp tin `~/.elvish/rc.elv`:
@@ -147,9 +147,9 @@ eval $(starship init ion)
```toml
startup = [
"mkdir ~/.cache/starship",
"starship init nu | save ~/.cache/starship/init.nu",
"source ~/.cache/starship/init.nu"
"mkdir ~/.cache/starship",
"starship init nu | save ~/.cache/starship/init.nu",
"source ~/.cache/starship/init.nu",
]
prompt = "starship_prompt"
```
+34 -32
View File
@@ -32,11 +32,11 @@ end
load(io.popen('starship init cmd'):read("*a"))()
```
## Custom pre-prompt and pre-execution Commands in Bash
## Tùy chỉnh các hàm được thực thi trước prompt và các lệnh Linux mặc định của bash shell
Bash does not have a formal preexec/precmd framework like most other shells. Because of this, it is difficult to provide fully customizable hooks in `bash`. Tuy nhiên, Starship cho phép bạn viết các hàm riêng của bạn để tùy biến việc render prompt:
Bash không có một preexec/precmd framework chính thống giống như các shells khác. Do đó rất khó để cung cấp các hook với khả năng tuỳ biến hoàn toàn cho `bash` shell. Tuy nhiên, Starship cho phép bạn viết các hàm riêng của bạn để tùy biến việc render prompt:
- To run a custom function right before the prompt is drawn, define a new function and then assign its name to `starship_precmd_user_func`. For example, to draw a rocket before the prompt, you would do
- Để thực thi một hàm custom trước khi prompt được render, ta cần định nghĩa một hàm mới và gán `starship_precmd_user_func` cho tên của hàm này. Ví dụ, để vẽ một tên lửa trước prompt
```bash
function blastoff(){
@@ -45,14 +45,16 @@ function blastoff(){
starship_precmd_user_func="blastoff"
```
- To run a custom function right before a command runs, you can use the [`DEBUG` trap mechanism](https://jichu4n.com/posts/debug-trap-and-prompt_command-in-bash/). However, you **must** trap the DEBUG signal *before* initializing Starship! Starship can preserve the value of the DEBUG trap, but if the trap is overwritten after starship starts up, some functionality will break.
- Để thực thi một hàm custom trước khi một câu lệnh Linux chạy, ta có thể sử dụng cơ chế bẫy tín hiệu [`DEBUG`](https://jichu4n.com/posts/debug-trap-and-prompt_command-in-bash/). Tuy nhiên, bạn **phải** đặt bẫy tín hiệu DEBUG _trước_ khởi tạo Starship! Starship có thể giữ giá trị của DEBUG trap, nhưng nếu trap bị ghi đè sau khi starship khởi động, một vài chức năng sẽ không hoạt động.
```bash
function blastoff(){
echo "🚀"
}
trap blastoff DEBUG # Trap DEBUG *before* running starship
set -o functrace
eval $(starship init bash)
set +o functrace
```
## Custom pre-prompt and pre-execution Commands in PowerShell
@@ -67,11 +69,11 @@ function Invoke-Starship-PreCommand {
}
```
## Change Window Title
## Thay đổi tên gọi trên cửa sổ của chương trình terminal
Some shell prompts will automatically change the window title for you (e.g. to reflect your working directory). Fish even does it by default. Starship does not do this, but it's fairly straightforward to add this functionality to `bash`, `zsh`, `cmd` or `powershell`.
Một vài shell có khả năng tự động thay đổi tên hiển thị (chng hạn như tên của thư mục hiện thời) trên cửa số của trình mô phỏng terminal. Fish shell mặc định thực hiện thay đổi này. Starship does not do this, but it's fairly straightforward to add this functionality to `bash`, `zsh`, `cmd` or `powershell`.
First, define a window title change function (identical in bash and zsh):
Đầu tiên, ta cần định nghĩa một hàm thay đổi tiêu đề cửa sổ (dùng chung cho cả bash zsh):
```bash
function set_win_title(){
@@ -79,23 +81,23 @@ function set_win_title(){
}
```
You can use variables to customize this title (`$USER`, `$HOSTNAME`, and `$PWD` are popular choices).
Ta có thể sử dụng biến số để tuỳ chỉnh tên hiển thị này (`$USER`, `$HOSTNAME`, `$PWD` là những biến số thường được dùng).
In `bash`, set this function to be the precmd starship function:
Với `bash` shell, set precmd của starship bằng tên của hàm này:
```bash
starship_precmd_user_func="set_win_title"
```
In `zsh`, add this to the `precmd_functions` array:
Với `zsh` shell, thêm hàm này vào mảng `precmd_functions`:
```bash
precmd_functions+=(set_win_title)
```
If you like the result, add these lines to your shell configuration file (`~/.bashrc` or `~/.zshrc`) to make it permanent.
Nếu ta hài lòng với các tùy biến đã được thiết lập, thêm những dòng sau vào cấu hình shell (`~/.bashrc` hoặc `~/.zshrc`) để thực thi chúng mỗi khi ta khởi tạo một shell mới.
For example, if you want to display your current directory in your terminal tab title, add the following snippet to your `~/.bashrc` or `~/.zshrc`:
Ví dụ, nếu ta muốn hiển thị đường dẫn thư mục hiện tại trong tiêu đề của một terminal tab, thêm đoạn code sau vào `~/.bashrc` hoặc `~/.zshrc`:
```bash
function set_win_title(){
@@ -161,9 +163,9 @@ Note: `continuation_prompt` should be set to a literal string without any variab
Note: Continuation prompts are only available in the following shells:
- `bash`
- `zsh`
- `PowerShell`
- `bash`
- `zsh`
- `PowerShell`
### Ví dụ
@@ -176,26 +178,26 @@ continuation_prompt = "▶▶"
## Các chuỗi kiểu
Style strings are a list of words, separated by whitespace. The words are not case sensitive (i.e. `bold` and `BoLd` are considered the same string). Each word can be one of the following:
Chuỗi kiểu là một danh sách các từ, được phân cách bởi khoảng trắng. Các từ là không phân biệt hoa thường (ví dụ. `bold` `Bold` là hai chuỗi tương đương). Mỗi từ có thể là một trong các từ sau:
- `bold`
- `italic`
- `underline`
- `dimmed`
- `inverted`
- `bg:<color>`
- `fg:<color>`
- `<color>`
- `none`
- `bold`
- `nghiêng`
- `underline`
- `dimmed`
- `đảo ngược`
- `bg:<color>`
- `fg:<color>`
- `<color>`
- `none`
where `<color>` is a color specifier (discussed below). `fg:<color>` and `<color>` currently do the same thing, though this may change in the future. `inverted` swaps the background and foreground colors. The order of words in the string does not matter.
`<color>` là một nơi quy định màu (được bàn luận ở phía dưới). `fg:<color>` and `<color>` currently do the same thing, though this may change in the future. `inverted` swaps the background and foreground colors. Thứ tự các từ trong chuỗi là không quan trọng.
The `none` token overrides all other tokens in a string if it is not part of a `bg:` specifier, so that e.g. `fg:red none fg:blue` will still create a string with no styling. `bg:none` sets the background to the default color so `fg:red bg:none` is equivalent to `red` or `fg:red` and `bg:green fg:red bg:none` is also equivalent to `fg:red` or `red`. It may become an error to use `none` in conjunction with other tokens in the future.
Từ mã `none` ghi đè tất cả các từ mã khác trong chuỗi nếu nó không là một phần của `bg:` specifier, vậy nên `fg:red none fg:blue` sẽ vẫn tạo một chuỗi mà không có kiểu. `bg:none` sets the background to the default color so `fg:red bg:none` is equivalent to `red` or `fg:red` and `bg:green fg:red bg:none` is also equivalent to `fg:red` or `red`. Nó có thể trở thành một lỗi để sử dụng `none` trong việc kết hợp với các từ mã khác trong tương lai.
A color specifier can be one of the following:
Một quy định màu có thể là một trong các thứ sau:
- One of the standard terminal colors: `black`, `red`, `green`, `blue`, `yellow`, `purple`, `cyan`, `white`. You can optionally prefix these with `bright-` to get the bright version (e.g. `bright-white`).
- A `#` followed by a six-digit hexadecimal number. This specifies an [RGB color hex code](https://www.w3schools.com/colors/colors_hexadecimal.asp).
- A number between 0-255. This specifies an [8-bit ANSI Color Code](https://i.stack.imgur.com/KTSQa.png).
- One of the standard terminal colors: `black`, `red`, `green`, `blue`, `yellow`, `purple`, `cyan`, `white`. You can optionally prefix these with `bright-` to get the bright version (e.g. `bright-white`).
- Một `#` được theo sau bởi một số thập lục phân gồm sáu chữ số. Cái này quy định một [mã thập lục phân cho màu RGB](https://www.w3schools.com/colors/colors_hexadecimal.asp).
- Một số nằm giữa 0-255. Cái này quy định một [mã màu ANSI 8-bit](https://i.stack.imgur.com/KTSQa.png).
If multiple colors are specified for foreground/background, the last one in the string will take priority.
Nếu nhiều màu được quy định cho màu chữ/màu nền, cái cuối cùng trong chuỗi sẽ được ưu tiên.
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -58,7 +58,7 @@ sh -c "$(curl -fsSL https://starship.rs/install.sh)" -- --platform unknown-linux
## Why do I see `Executing command "..." timed out.` warnings?
Starship executes different commands to get information to display in the prompt, for example the version of a program or the current git status. To make sure starship doesn't hang while trying to execute these commands we set a time limit, if a command takes longer than this limit starship will stop the execution of the command and output the above warning, this is expected behaviour. This time limit is configurable using the [`command_timeout` key](/config/#prompt) so if you want you can increase the time limit. You can also follow the debugging steps below to see which command is being slow and see if you can optimise it. Finally you can set the `STARSHIP_LOG` env var to `error` to hide these warnings.
Starship executes different commands to get information to display in the prompt, for example the version of a program or the current git status. To make sure starship doesn't hang while trying to execute these commands we set a time limit, if a command takes longer than this limit starship will stop the execution of the command and output the above warning, this is expected behaviour. This time limit is configurable using the [`command_timeout`key](/config/#prompt) so if you want you can increase the time limit. You can also follow the debugging steps below to see which command is being slow and see if you can optimise it. Finally you can set the `STARSHIP_LOG` env var to `error` to hide these warnings.
## Tôi thấy các biểu tượng tôi không hiểu hoặc không mong muốn, chúng có nghĩa là gì?
+161 -93
View File
@@ -95,7 +95,7 @@
><img
height="20"
src="https://raw.githubusercontent.com/starship/starship/master/media/flag-jp.png"
alt="日本語"
alt="Tiếng Nhật"
/></a>
&nbsp;
<a
@@ -111,7 +111,7 @@
><img
height="20"
src="https://raw.githubusercontent.com/starship/starship/master/media/flag-ru.png"
alt="Русский"
alt="Tiếng Nga"
/></a>
&nbsp;
<a
@@ -127,7 +127,7 @@
><img
height="20"
src="https://raw.githubusercontent.com/starship/starship/master/media/flag-cn.png"
alt="简体中文"
alt="Tiếng Trung giản thể"
/></a>
&nbsp;
<a
@@ -135,7 +135,7 @@
><img
height="20"
src="https://raw.githubusercontent.com/starship/starship/master/media/flag-tw.png"
alt="繁體中文"
alt="Tiếng Trung hiện đại"
/></a>
</p>
@@ -169,159 +169,227 @@
- Đã cài đặt [Nerd Font](https://www.nerdfonts.com/) và đã kích hoạt trong giao diện dòng lệnh của bạn (ví dụ, thử [Fira Code Nerd Font](https://www.nerdfonts.com/font-downloads)).
### Bắt đầu
### Step 1. Install Starship
**Lưu ý**: do sự gia tăng của các nền tảng khác nhau, chỉ một tập con các nền tảng hỗ trợ được hiển thị bên dưới. Không thể tìm thấy nền tảng phù hợp của bạn? Hãy xem một [hướng dẫn bổ sung cho các nền tảng khác](https://starship.rs/installing/).
Select your operating system from the list below to view installation instructions:
1. Cài đặt **starship** nhị phân:
<details>
<summary>Android</summary>
Install Starship using any of the following package managers:
#### Cài đặt phiên bản cuối cùng
| Repository | Instructions |
| --------------------------------------------------------------------------------- | ---------------------- |
| [Termux](https://github.com/termux/termux-packages/tree/master/packages/starship) | `pkg install starship` |
</details>
##### Từ bản nhị phân có sẵn, với Shell:
<details>
<summary>BSD</summary>
```sh
sh -c "$(curl -fsSL https://starship.rs/install.sh)"
```
Install Starship using any of the following package managers:
Để cập nhật chính Starship, hãy chạy lại đoạn script bên trên. Nó sẽ thay thế phiên bản hiện tại mà không hề thay đổi gì những cài đặt của Starship trước đó.
| Distribution | Repository | Instructions |
| ------------ | -------------------------------------------------------- | --------------------------------- |
| **_Any_** | **[crates.io](https://crates.io/crates/starship)** | `cargo install starship --locked` |
| FreeBSD | [FreshPorts](https://www.freshports.org/shells/starship) | `pkg install starship` |
| NetBSD | [pkgsrc](https://pkgsrc.se/shells/starship) | `pkgin install starship` |
**Ghi chú** - Script cài đặt mặc định có thể bị ghi đè.
</details>
```sh
sh -c "$(curl -fsSL https://starship.rs/install.sh)" -- --help
```
<details>
<summary>Linux</summary>
Install the latest version for your system:
#### Cài đặt thông qua Trình quản lí gói
```sh
sh -c "$(curl -fsSL https://starship.rs/install.sh)"
```
Alternatively, install Starship using any of the following package managers:
##### Với [Homebrew](https://brew.sh/):
| Distribution | Repository | Instructions |
| ------------------ | ----------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
| **_Any_** | **[crates.io](https://crates.io/crates/starship)** | `cargo install starship --locked` |
| _Any_ | [conda-forge](https://anaconda.org/conda-forge/starship) | `conda install -c conda-forge starship` |
| _Any_ | [Linuxbrew](https://formulae.brew.sh/formula/starship) | `brew install starship` |
| _Any_ | [Snapcraft](https://snapcraft.io/starship) | `snap install starship` |
| Alpine Linux 3.13+ | [Alpine Linux Packages](https://pkgs.alpinelinux.org/packages?name=starship) | `apk add starship` |
| Arch Linux | [Arch Linux Community](https://archlinux.org/packages/community/x86_64/starship) | `pacman -S starship` |
| CentOS 7+ | [Copr](https://copr.fedorainfracloud.org/coprs/atim/starship) | `dnf copr enable atim/starship` <br /> `dnf install starship` |
| Fedora 31+ | [Fedora Packages](https://src.fedoraproject.org/rpms/rust-starship) | `dnf install starship` |
| NixOS | [nixpkgs](https://github.com/NixOS/nixpkgs/blob/master/pkgs/tools/misc/starship/default.nix) | `nix-env -iA nixos.starship` |
| Gentoo | [Gentoo Packages](https://packages.gentoo.org/packages/app-shells/starship) | `emerge app-shells/starship` |
| Manjaro | | `pacman -S starship` |
| NixOS | [nixpkgs](https://github.com/NixOS/nixpkgs/blob/master/pkgs/tools/misc/starship/default.nix) | `nix-env -iA nixpkgs.starship` |
| Void Linux | [Void Linux Packages](https://github.com/void-linux/void-packages/tree/master/srcpkgs/starship) | `xbps-install -S starship` |
```sh
brew install starship
```
</details>
<details>
<summary>macOS</summary>
##### Với [Scoop](https://scoop.sh):
Install the latest version for your system:
```powershell
scoop install starship
```
```sh
sh -c "$(curl -fsSL https://starship.rs/install.sh)"
```
2. Thêm đoạn mã khởi tạo vào tệp tin cấu hình shell của bạn:
Alternatively, install Starship using any of the following package managers:
| Repository | Instructions |
| -------------------------------------------------------- | --------------------------------------- |
| **[crates.io](https://crates.io/crates/starship)** | `cargo install starship --locked` |
| [conda-forge](https://anaconda.org/conda-forge/starship) | `conda install -c conda-forge starship` |
| [Homebrew](https://formulae.brew.sh/formula/starship) | `brew install starship` |
| [MacPorts](https://ports.macports.org/port/starship) | `port install starship` |
#### Bash
</details>
Thêm đoạn sau vào cuối tệp tin `~/.bashrc`:
<details>
<summary>Windows</summary>
```sh
# ~/.bashrc
Install Starship using any of the following package managers:
eval "$(starship init bash)"
```
| Repository | Instructions |
| -------------------------------------------------------------------------------- | --------------------------------------- |
| **[crates.io](https://crates.io/crates/starship)** | `cargo install starship --locked` |
| [Chocolatey](https://community.chocolatey.org/packages/starship) | `choco install starship` |
| [conda-forge](https://anaconda.org/conda-forge/starship) | `conda install -c conda-forge starship` |
| [Scoop](https://github.com/ScoopInstaller/Main/blob/master/bucket/starship.json) | `scoop install starship` |
</details>
#### Fish
### Step 2. Setup your shell to use Starship
Thêm đoạn sau vào cuối tệp tin `~/.config/fish/config.fish`:
Configure your shell to initialize starship. Select yours from the list below:
```sh
# ~/.config/fish/config.fish
<details>
<summary>Bash</summary>
starship init fish | source
```
Thêm đoạn sau vào cuối tệp tin `~/.bashrc`:
```sh
eval "$(starship init bash)"
```
#### Zsh
</details>
Thêm đoạn sau vào cuối tệp tin `~/.zshrc`:
<details>
<summary>Cmd</summary>
```sh
# ~/.zshrc
You need to use [Clink](https://chrisant996.github.io/clink/clink.html) (v1.2.30+) with Cmd. Create a file at this path `%LocalAppData%\clink\starship.lua` with the following contents:
eval "$(starship init zsh)"
```
```lua
load(io.popen('starship init cmd'):read("*a"))()
```
</details>
#### PowerShell
<details>
<summary>Elvish</summary>
Thêm đoạn sau vào cuối tệp tin `Microsoft.PowerShell_profile.ps1`. Bạn có thể kiểm tra vị trí tệp tin này bằng việc truy xuất biến `$PROFILE` trong PowerShell. Thông thường, đường dẫn là `~\Documents\PowerShell\Microsoft.PowerShell_profile.ps1` hoặc `~/.config/powershell/Microsoft.PowerShell_profile.ps1` trên -Nix.
Thêm đoạn sau vào cuối tệp tin `~/.elvish/rc.elv`:
```powershell
Invoke-Expression (&starship init powershell)
```
```sh
eval (starship init elvish)
```
Note: Only Elvish v0.17+ is supported
#### Ion
</details>
Thêm đoạn sau vào cuối tệp tin `~/.config/ion/initrc`:
<details>
<summary>Fish</summary>
```sh
# ~/.config/ion/initrc
Thêm đoạn sau vào cuối tệp tin `~/.config/fish/config.fish`:
eval $(starship init ion)
```
```fish
starship init fish | source
```
</details>
#### Elvish
<details>
<summary>Ion</summary>
**Warning** Only elvish v0.17 or higher is supported. Thêm đoạn sau vào cuối tệp tin `~/.elvish/rc.elv`:
Thêm vào cuối tệp tin `~/.config/ion/initrc`:
```sh
# ~/.elvish/rc.elv
```sh
eval $(starship init ion)
```
eval (starship init elvish)
```
</details>
<details>
<summary>Nushell</summary>
#### Tcsh
Add the following to the end of your Nushell configuration (find it by running `config path`):
Thêm đoạn sau vào cuối tệp tin `~/.tcshrc`:
```toml
startup = [
"mkdir ~/.cache/starship",
"starship init nu | save ~/.cache/starship/init.nu",
"source ~/.cache/starship/init.nu",
]
prompt = "starship_prompt"
```
```sh
# ~/.tcshrc
</details>
eval `starship init tcsh`
```
<details>
<summary>PowerShell</summary>
Add the following to the end of your PowerShell configuration (find it by running `$PROFILE`):
#### Xonsh
```powershell
Invoke-Expression (&starship init powershell)
```
Thêm dòng này vào cuối của file `~/.xonshrc`:
</details>
```sh
# ~/.xonshrc
<details>
<summary>Tcsh</summary>
execx($(starship init xonsh))
```
Thêm đoạn dưới vào cuối file `~/.tcshrc`:
```sh
eval `starship init tcsh`
```
#### Cmd
</details>
You need to use [Clink](https://chrisant996.github.io/clink/clink.html) (v1.2.30+) with Cmd. Add the following to a file `starship.lua` and place this file in Clink scripts directory:
<details>
<summary>Xonsh</summary>
```lua
-- starship.lua
Thêm dòng này vào cuối của file `~/.xonshrc`:
load(io.popen('starship init cmd'):read("*a"))()
```
```python
execx($(starship init xonsh))
```
</details>
#### Nushell
<details>
<summary>Zsh</summary>
**Warning** This will change in the future. Chỉ có nu phiên bản v. 033 hoặc cao hơn được hỗ trợ. Add the following to your nu config file. Bạn có thể kiểm tra vị trí của cái file này bằng cách chạy `đường dẫn cấu hình` trong nu.
Thêm đoạn sau vào cuối tệp tin `~/.zshrc`:
```toml
startup = [
"mkdir ~/.cache/starship",
"starship init nu | save ~/.cache/starship/init.nu",
"source ~/.cache/starship/init.nu"
]
prompt = "starship_prompt"
```
```sh
eval "$(starship init zsh)"
```
</details>
### Step 3. Configure Starship
Start a new shell instance, and you should see your beautiful new shell prompt. If you're happy with the defaults, enjoy!
If you're looking to further customize Starship:
- **[Configuration](https://starship.rs/config/)** learn how to configure Starship to tweak your prompt to your liking
- **[Presets](https://starship.rs/presets/)** get inspired by the pre-built configuration of others
## 🤝 Đóng góp
@@ -335,11 +403,11 @@ Nếu bạn thích thú trong việc giúp đỡ đóng góp cho starship, xin h
Xin hãy xem qua những công việc này trước đây, những thứ đã giúp truyền cảm hứng để tạo ra starship. 🙏
- **[denysdovhan/spaceship-prompt](https://github.com/denysdovhan/spaceship-prompt)** - A ZSH prompt cho những phi hành gia.
- **[denysdovhan/spaceship-prompt](https://github.com/denysdovhan/spaceship-prompt)** A ZSH prompt for astronauts.
- **[denysdovhan/robbyrussell-node](https://github.com/denysdovhan/robbyrussell-node)** - Cross-shell robbyrussell theme được viết bằng JavaScript.
- **[denysdovhan/robbyrussell-node](https://github.com/denysdovhan/robbyrussell-node)** Cross-shell robbyrussell theme written in JavaScript.
- **[reujab/silver](https://github.com/reujab/silver)** - A cross-shell có khả năng tuỳ biến giống powerline prompt với các icon.
- **[reujab/silver](https://github.com/reujab/silver)** A cross-shell customizable powerline-like prompt with icons.
<p align="center">
<br>
+1 -1
View File
@@ -109,7 +109,7 @@ Cấu hình dâu nhắc lệnh để sử dụng cấu hình `use_symbol_for_sta
error_symbol = "[](bold red)"
```
*Lưu ý:* Phần tử `character` tự động thêm vào một khoảng trắng phía sau, so unlike the other `format` strings, we specifically do not add one in the above examples.
_Lưu ý:_ Phần tử `character` tự động thêm vào một khoảng trắng phía sau, so unlike the other `format` strings, we specifically do not add one in the above examples.
#### Command Duration
+4 -1
View File
@@ -60,6 +60,9 @@ symbol = " "
[nix_shell]
symbol = " "
[nodejs]
symbol = " "
[package]
symbol = " "
@@ -110,7 +113,7 @@ format = '\[[$symbol($profile)(\($region\))(\[$duration\])]($style)\]'
format = '\[[$symbol($version)]($style)\]'
[cmd_duration]
format = '\[[⏱ $duration ]($style)\]'
format = '\[[⏱ $duration]($style)\]'
[cobol]
format = '\[[$symbol($version)]($style)\]'