Skip to content

Commit

Permalink
New Crowdin translations by GitHub Action (#591)
Browse files Browse the repository at this point in the history
  • Loading branch information
digital-teams authored Jun 23, 2024
1 parent 9d56be1 commit ec82af3
Show file tree
Hide file tree
Showing 27 changed files with 140 additions and 101 deletions.
4 changes: 2 additions & 2 deletions i18n/ja/code.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@
"message": "パンくずリストのナビゲーション",
"description": "The ARIA label for the breadcrumbs"
},
"theme.docs.DocCard.categoryDescription": {
"message": "{count} ",
"theme.docs.DocCard.categoryDescription.plurals": {
"message": "1 item|{count} items",
"description": "The default description for a category card in the generated index about how many items this category includes"
},
"theme.docs.paginator.navAriaLabel": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,15 @@ When you set e.g.: the `zsh` emulation in a function, you in general don’t hav

> [ functions-directory ]
Despite that, the current-standard plugins have their main directory added to `$fpath`, a more clean approach is being proposed: that the plugins use a subdirectory called `functions` to store their completions and autoload functions. This will allow a much cleaner design of plugins. The plugin manager should add such a directory to `$fpath`. The lack of support of the current plugin managers can be easily resolved via the [indicator](#indicator):
Despite that, the current-standard plugins have their main directory added to `$fpath`, a more clean approach is being proposed: that the plugins use a subdirectory called `functions` to store their completions and autoload functions. This will allow a much cleaner design of plugins. The plugin manager should add such a directory to `$fpath`. The lack of support of the current plugin managers can be easily resolved via the [indicator](#activity-indicator):

```shell showLineNumbers
if [[ ${zsh_loaded_plugins[-1]} != */kalc && -z ${fpath[(r)${0:h}/functions]} ]]; then
fpath+=( "${0:h}/functions" )
fi
```

or, via the use of the `PMSPEC` [parameter](#pmspec):
or, via the use of the `PMSPEC` [parameter](#global-parameter-with-capabilities):

```shell showLineNumbers
if [[ $PMSPEC != *f* ]]; then
Expand Down Expand Up @@ -441,7 +441,7 @@ The proposition of the standard prefixes is as follows:
4. `/`: for debugging functions, i.e.: for functions that output debug messages to the screen or a log or e.g.: gather some debug data. **Note:** The slash makes it impossible for such functions to be auto-loaded via the `autoload` mechanism. It is somewhat risky to assume, that this will never be needed for the functions, however, the limited number of available ASCII characters justifies such allocation. Example function name: `/prompt_zinc_dmsg`.
5. `@`: for API-like functions, i.e.: for functions that are on a boundary to a subsystem and expose their functionality through a well-defined, generally fixed interface. For example, this plugin standard [defines](#update-register-call) the function `@zsh-plugin-run-on-update`, which exposes a plugin manager’s functionality in a well-defined way.
5. `@`: for API-like functions, i.e.: for functions that are on a boundary to a subsystem and expose their functionality through a well-defined, generally fixed interface. For example, this plugin standard [defines](#run-on-update-call) the function `@zsh-plugin-run-on-update`, which exposes a plugin manager’s functionality in a well-defined way.
## Example code utilizing the prefixes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ local needle="?" required_preceding='[[:space:]]#'
[[ "$(svn status)" = *((#s)|$nl)${~required_preceding}${needle}* ]] && echo found
```

It does a single fork (called` svn` status). The `${~variable}` means (the`~` init): "the variable is holding a pattern, interpret it". All in all, instead of regular expressions we were using patterns (globs) (see [this section](#built-in-regular-expressions-engine)).
It does a single fork (called` svn` status). The `${~variable}` means (the`~` init): "the variable is holding a pattern, interpret it". All in all, instead of regular expressions we were using patterns (globs) (see [this section](#using-built-in-regular-expressions-engine)).

### Pattern matching in AND-fashion

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ An annex provides the following functionality:
5. Create the so-called `shims` known from [rbenv][rbenv/rbenv] the same feature as the first item of this enumeration of running a program without adding anything to `$PATH` with all of the above features, however through an automatic **script** created in `$ZPFX/bin`, not a **function** (the first item uses a function-based mechanism),
6. Automatic updates of Ruby gems and Node modules during regular plugin and snippet updates with `zi update …`.

The [sbin](#sbin-1) ice-modifier that creates forwarder-scripts instead of forwarder-functions created by the [fbin](#fbin-1) ice-modifier turned out to be the proper, best method for exposing binary programs and scripts. This way there is no need to add anything to `$PATH` `z-a-bin-gem-node` will automatically create a function that will wrap the binary and provide it on the command line as if it was being placed in the `$PATH`.
The [sbin](#sbin-1) ice-modifier that creates forwarder-scripts instead of forwarder-functions created by the [fbin](#fbin-2) ice-modifier turned out to be the proper, best method for exposing binary programs and scripts. This way there is no need to add anything to `$PATH` `z-a-bin-gem-node` will automatically create a function that will wrap the binary and provide it on the command line as if it was being placed in the `$PATH`.

As previously mentioned, the function can automatically export `$GEM_HOME`, `$NODE_PATH`, `$VIRTUALENV` shell variables and also automatically cd into the plugin or snippet directory right before executing the binary and then cd back to the original directory after the execution is finished. As previously mentioned, instead of the function an automatically created script the so-called `shim` can be used for the same purpose and with the same functionality, so that the command is accessible practically fully normally not only in the live Zsh session, only within which the functions created by [fbin](#fbin-1) exist, but also from any Zsh script.
As previously mentioned, the function can automatically export `$GEM_HOME`, `$NODE_PATH`, `$VIRTUALENV` shell variables and also automatically cd into the plugin or snippet directory right before executing the binary and then cd back to the original directory after the execution is finished. As previously mentioned, instead of the function an automatically created script the so-called `shim` can be used for the same purpose and with the same functionality, so that the command is accessible practically fully normally not only in the live Zsh session, only within which the functions created by [fbin](#fbin-2) exist, but also from any Zsh script.

Suppose that we want to install the `junegunn/fzf` plugin from GitHub Releases, which contains only a single file the `fzf` binary for the selected architecture. It is possible to do it in the standard way by adding the plugin's directory to the `$PATH`.

Expand Down Expand Up @@ -81,7 +81,7 @@ Running the script will forward the call to the program accessed through an embe
| [pip](#pip-5) | Installs and updates python packages into a `virtualenv` + creates functions for binaries of the packages. |
| [fmod](#fmod-6) | Creates wrapping functions for other functions. |
| [fsrc](#fsrc-7) | Creates functions that source given scripts. |
| [ferc](#ferc-8) | The same as [fsrc](#fscr-7), but using an alternate script-loading method. |
| [ferc](#ferc-8) | The same as [fsrc](#fsrc-7), but using an alternate script-loading method. |

```mdx-code-block
</APITable>
Expand Down Expand Up @@ -417,7 +417,7 @@ README.md
:::
## `FSCR''` {#fscr-7}
## `FSRC''` {#fsrc-7}
```shell
fsrc'[{g|n|c|N|E|O}:]{path-to-script}[ -> {name-of-the-function}];'
Expand All @@ -432,7 +432,7 @@ ferc'[{g|n|c|N|E|O}:]{path-to-script}[ -> {name-of-the-function}]; …'
Creates a wrapper function that at each invocation sources the given file. The second ice, `FERC''` works the same with the single difference that it uses `eval "$(<{path-to-script})"` instead of `source "{path-to-script}"` to load the script.
<Tabs className='player-tabs'>
<TabItem value='fscr-ferc-player' label='Player' default>
<TabItem value='fsrc-ferc-player' label='Player' default>
<Player
src='https://asciinema.org/a/513308.cast'
rows={26}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,6 @@ if [[ -r "${XDG_CONFIG_HOME:-${HOME}/.config}/zi/init.zsh" ]]; then
fi
```

:::tip

The loader can be manually fetched from available [links](#loader) to any location on the system, and sourced from <kbd>.zshrc</kbd> or as shown in the [quick-setup](#quick-setup).

:::

Then reload the shell with: `exec zsh`. すべて完了です!

</TabItem>
Expand Down Expand Up @@ -97,7 +91,9 @@ sh -c "$(curl -fsSL get.zshell.dev)" -- -a zunit

:::

インストール先を設定し、ディレクトリを作成します。
### <i class="fas fa-spinner fa-spin"></i> Prepare

Set up the install location and create a directory:

```shell showLineNumbers
typeset -Ag ZI
Expand All @@ -108,14 +104,16 @@ command mkdir -p "$ZI[BIN_DIR]"

For security reasons run function <kbd>compaudit</kbd> to check if the [completion system][completion-system] would use files owned by <kbd>root</kbd> or by the current <kbd>user</kbd>, or files in directories that are <kbd>world</kbd> or <kbd>group-writable</kbd>.

失敗した場合は、現在のユーザーをディレクトリのオーナーに設定し、グループ/その他の書き込み権限を削除して、リポジトリを複製します。
If failed, then set the current user as the owner of directories, then remove group/others write permissions, and clone the repository:

```shell showLineNumbers
compaudit | xargs chown -R "$(whoami)" "$ZI[HOME_DIR]"
compaudit | xargs chmod -R go-w "$ZI[HOME_DIR]"
command git clone https:/z-shell/zi.git "$ZI[BIN_DIR]"
```

### <i class="fas fa-spinner fa-spin"></i> Enable

To enable Zi, source the <kbd>zi.zsh</kbd> from the previously set up directory placing the following snippet in the <kbd>.zshrc</kbd> file:

```shell title="~/.zshrc" showLineNumbers
Expand All @@ -124,14 +122,16 @@ ZI[BIN_DIR]="${HOME}/.zi/bin"
source "${ZI[BIN_DIR]}/zi.zsh"
```

### <i class="fas fa-spinner fa-spin"></i> Completions {#enable-zi-completions}

Enable Zi completions by placing the following snippet in the <kbd>.zshrc</kbd> file:

:::caution

以下の2行は、上の行の後、つまりZiを有効にした後に配置する必要があります。
The snippet below must be placed after after enabling Zi.

:::

以下でZi補完を有効にします:

```shell title="~/.zshrc" showLineNumbers
autoload -Uz _zi
(( ${+_comps} )) && _comps[zi]=_zi
Expand Down Expand Up @@ -188,7 +188,8 @@ RUN zsh -i -c -- '@zi-scheduler burst || true'

The module transparently and automatically compiles sourced scripts and lists of all sourced files with the time the sourcing took in milliseconds on the left.

- [⚙️ Wiki: zpmod][zpmod-page]
- [⚙️ Wiki: zpmod][zpmod-page]

- [📦 Source: zpmod][z-shell/zpmod]

## <i class="fas fa-sync-alt fa-spin"></i> Available links {#available-links}
Expand All @@ -199,17 +200,13 @@ The module transparently and automatically compiles sourced scripts and lists of

| サービス | URL |
| :--------- | ----------------------------------------------------------------------- |
| リダイレクト | https://get.zshell.dev |
| Cloudflare | https://src.zshell.dev/sh/install.sh |
| Git.io | https://git.io/get-zi |
| GitHub RAW | https://raw.githubusercontent.com/z-shell/zi-src/main/lib/sh/install.sh |

### <i class="fa-brands fa-superpowers"></i> Loader {#loader}

| サービス | URL |
| :--------- | ---------------------------------------------------------------------- |
| リダイレクト | https://init.zshell.dev |
| Cloudflare | https://src.zshell.dev/zsh/init.zsh |
| Git.io | https://git.io/zi-loader |
| GitHub RAW | https://raw.githubusercontent.com/z-shell/zi-src/main/lib/zsh/init.zsh |

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ Following commands are passed to `zi …` to obtain described effects.
| `-h, help` | 利用方法 |
| `man` | マニュアル |

## Commands available using <kbd>^TAB</kbd> <Link to="/docs/getting_started/installation#enable-completions">completion</Link>
## Commands available using <kbd>^TAB</kbd> <Link to="/docs/getting_started/installation#enable-zi-completions">completion</Link>

<ZiTabCompletion />

Expand All @@ -245,8 +245,11 @@ Following commands are passed to `zi …` to obtain described effects.
<!-- footnotes -->

[^1]: There's also `light-mode` ice which can be used to induce the no-investigating (i.e.: _light_) loading, regardless of the command used.

[^2]: The URL can use the following shorthands: `PZT::` (Prezto), `PZTM::` (Prezto module), `OMZ::` (Oh-My-Zsh), `OMZP::` (OMZ plugin), `OMZL::` (OMZ library), `OMZT::` (OMZ theme), e.g.: `PZTM::environment`, `OMZP::git`, etc.

[^3]: The `'…'` can be an absolute path, i.e.: it's possible to also add regular directories. If the option `-f` or `--front` is given, the directory path is prepended instead of appended to `$fpath`.

[^4]: If the option `-l` will be given then the plugin should be skipped the option will cause the previous plugin to be reused.

<!-- links -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ The `make'…'` ice could also be: `make"install PREFIX=$ZPFX"`, if "install" wo

:::info

[$ZPFX][zpfx] is provided by Zi, it is set to `~/.zi/polaris` by default. However, it can be changed by specifying the `$ZPFX=` target.
[$ZPFX][global-parameter-with-prefix] is provided by Zi, it is set to `~/.zi/polaris` by default. However, it can be changed by specifying the `$ZPFX=` target.

:::

Expand Down Expand Up @@ -175,7 +175,7 @@ zi light vim/vim
</APITable>
```

The same but with **installation** (`make install`) under [$ZPFX][zpfx] by default:
The same but with **installation** (`make install`) under [$ZPFX][global-parameter-with-prefix] by default:

```shell showLineNumbers
zi ice as'program' atclone'rm -f src/auto/config.cache; \
Expand Down Expand Up @@ -764,16 +764,19 @@ As it can be seen, the creation of four additional Zle-widgets has been recorded
<!-- footnotes -->

[^1]: Save it to a file. The `atclone'…'` is being run on the **installation** while the `atpull'…'` hook is being run on an **update** of the [**trapd00r/LS_COLORS**][trapd00r-ls_colors] plugin.

[^2]: The `%atclone` is just a special string that denotes the `atclone'…'` hook and is copied onto the `atpull'…'` hook.

[^3]: Note that `atload'…'` uses apostrophes, not double quotes, to put `$f` into the string, `atload'…'`'s code is automatically being run **within the snippet's or plugin's directory**.

[^4]: Unless you load a plugin (not a snippet) with `zi load …` and prepend the value of the ice with an exclamation mark. Example: `atload'!local f; for …'`.

<!-- links -->

[for-syntax]: /docs/guides/syntax/for
[ice-mods]: /docs/guides/syntax/ice-modifiers
[exclamation]: /search?q=exclamation+mark
[zpfx]: /docs/guides/customization#$ZPFX
[global-parameter-with-prefix]: /community/zsh_plugin_standard#global-parameter-with-prefix
[multiple-prompts]: /docs/guides/customization#multiple-prompts

<!-- external -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ However, in practice, you just have to ensure that such plugin is loaded after p
<!-- footnotes -->

[^1]: Then the tracking of plugin, activity report gathering, accessible via the `zi report {plugin-name}` subcommand) is being disabled. Note that for turbo mode, the performance gains are almost `0`, so in this mode, you can load all plugins with the tracking and the `light-mode` ice can be removed from the command.

[^2]: They were recorded and `compinit` can be called later. `compinit` provides the `compdef` function, so it must be run before issuing the taken-over `compdef`s with `zicdreplay`.

<!-- links -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ The <strong>ice</strong> is something that melts in a drink, though in Zi syntax

:::

An ice-modifiers are [passed][alternate-syntax] to `zi ice …` to obtain described effects, additionally can be added with [annexes][12]. To see all available ice-modifiers run `zi icemods`.
An ice-modifiers are [passed][zi-syntax] to `zi ice …` to obtain described effects, additionally can be added with [annexes][12]. To see all available ice-modifiers run `zi icemods`.

いくつかのice 修飾子はハイライト表示されており、クリックすると該当するWikiページに移動し、詳しい説明が表示されます。 特に明記されていない限り、与えられたiceはプラグインとスニペットの両方で機能すると考えていただいて結構です。

Expand Down Expand Up @@ -186,14 +186,23 @@ An ice-modifiers are [passed][alternate-syntax] to `zi ice …` to obtain descri
<!-- footnotes -->

[^1]: This pattern will alphabetically match and choose the first file e.g: `zi ice pick"*.plugin.zsh"; zi load …`.

[^2]: Example: `multisrc'misc.zsh grep.zsh'` and also using brace-expansion syntax: `multisrc'{misc,grep}.zsh'` also supports patterns.

[^3]: For `wait'[[ ]]'`, `wait'(( ))'`, loading is done when given condition is meet. For `wait'!…'`, the prompt is reset after load. Zsh can start 80% (i.e.: 5x) faster thanks to postponed loading. **Fact:** when `wait` is used without a value, it works as `wait'0'`.

[^4]: It will load once, the condition can be still true, but will not trigger the second load, unless the plugin is unloaded earlier, see `unload`. E.g.: `load'[[ $PWD = */github* ]]'`.

[^5]: It will unload once, then only if loaded again e.g: `unload'[[ $PWD != */github* ]]'`.

[^6]: Example: `zi ice if'[[ -n "$commands[otool]" ]]'; zi load …` or `zi ice if'[[ $OSTYPE = darwin* ]]'; zi load …`.

[^7]: To use the option, precede the ice content with `!` to automatically forward the call afterward, to a command of the same name as the function. Can obtain multiple functions to create separate with `;`.

[^8]: The third possible value is `as"null"` a shorthand for `pick"/dev/null" nocompletions` i.e.: it disables the default script-file sourcing and also the installation of completions.

[^9]: In summary, `wrap` allows to extend the investigating beyond the moment of loading of a plugin. An example use is to `wrap` a precmd function of a prompt (like `_p9k_precmd()` of powerlevel10k) or other plugins that _postpones its initialization till the first prompt_ (like e.g.: zsh-autosuggestions). **Does not work with snippets.**

[^10]: If it has no value, then it works in the _auto_ mode it automatically extracts all files of known archive extensions IF they aren't located deeper than in a sub-directory (this is to prevent extraction of some helper archive files, typically located somewhere deeper in the tree). If no such files will be found, then it extracts all found files of known **type** the type is being read by the `file` Unix command. If not empty, then takes the names of the files to extract. Refer to the Wiki page for further information.

<!-- end-of-file -->
Expand All @@ -204,12 +213,12 @@ An ice-modifiers are [passed][alternate-syntax] to `zi ice …` to obtain descri
[9]: /docs/guides/syntax/standard#wrap
[10]: /docs/guides/syntax/standard#extract
[12]: /ecosystem/annexes/overview
[alternate-syntax]: /docs/guides/syntax/standard#the-alternative-syntaxes
[zi-syntax]: /docs/category/%EF%B8%8F-syntax
[1]: /docs/guides/syntax/standard#src-pick-multisrc
[2]: /docs/guides/syntax/standard#wait
[3]: /docs/guides/customization#multiple-prompts
[4]: /docs/guides/syntax/standard#atclone-atpull-atinit-atload
[5]: /docs/guides/syntax/standard#the-make-syntax
[5]: /docs/guides/syntax/standard#utilizing-make
[6]: /docs/guides/syntax/standard#id-as

<!-- external -->
Expand Down
Loading

0 comments on commit ec82af3

Please sign in to comment.