Skip to content

Commit bf2adc1

Browse files
committed
新增适配 I18n
1 parent f896adb commit bf2adc1

16 files changed

Lines changed: 3376 additions & 640 deletions

ChangeMirrors.sh

Lines changed: 1132 additions & 313 deletions
Large diffs are not rendered by default.

DockerInstallation.sh

Lines changed: 821 additions & 213 deletions
Large diffs are not rendered by default.

README.en-US.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,19 +156,19 @@
156156
- ### GNU/Linux System Software Mirror Switching
157157

158158
```bash
159-
bash <(curl -sSL https://linuxmirrors.cn/main.sh)
159+
bash <(curl -sSL https://linuxmirrors.cn/main.sh) --en
160160
```
161161

162162
- ### Docker Installation & Mirror Switching
163163

164164
```bash
165-
bash <(curl -sSL https://linuxmirrors.cn/docker.sh)
165+
bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --en
166166
```
167167

168168
- ### Docker Switch Registry Mirror
169169

170170
```bash
171-
bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --only-registry
171+
bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --en --only-registry
172172
```
173173

174174
## Special Thanks

README.zh-Hant.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,19 +156,19 @@
156156
- ### GNU/Linux 更換系統軟體源
157157

158158
```bash
159-
bash <(curl -sSL https://linuxmirrors.cn/main.sh)
159+
bash <(curl -sSL https://linuxmirrors.cn/main.sh) --zh-hant
160160
```
161161

162162
- ### Docker 安裝與換源
163163

164164
```bash
165-
bash <(curl -sSL https://linuxmirrors.cn/docker.sh)
165+
bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --zh-hant
166166
```
167167

168168
- ### Docker 更換鏡像加速器
169169

170170
```bash
171-
bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --only-registry
171+
bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --zh-hant --only-registry
172172
```
173173

174174
## 特別感謝

docs/other/index.en.md

Lines changed: 53 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -15,39 +15,39 @@ hide:
1515
=== ":linuxmirrors: Official Site (Recommended)"
1616

1717
``` bash
18-
bash <(curl -sSL https://linuxmirrors.cn/docker.sh)
18+
bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --en
1919
```
2020

2121
=== ":simple-github: GitHub"
2222

2323
``` bash
24-
bash <(curl -sSL https://raw.githubusercontent.com/SuperManito/LinuxMirrors/main/DockerInstallation.sh)
24+
bash <(curl -sSL https://raw.githubusercontent.com/SuperManito/LinuxMirrors/main/DockerInstallation.sh) --en
2525
```
2626

2727
=== ":simple-gitee: Gitee"
2828

2929
``` bash
30-
bash <(curl -sSL https://gitee.com/SuperManito/LinuxMirrors/raw/main/DockerInstallation.sh)
30+
bash <(curl -sSL https://gitee.com/SuperManito/LinuxMirrors/raw/main/DockerInstallation.sh) --en
3131
```
3232
> Real-time sync, no delay. Recommended for use in Chinese mainland network environments.
3333

3434
=== ":simple-gitcode: GitCode"
3535

3636
``` bash
37-
bash <(curl -sSL https://raw.gitcode.com/SuperManito/LinuxMirrors/raw/main/DockerInstallation.sh)
37+
bash <(curl -sSL https://raw.gitcode.com/SuperManito/LinuxMirrors/raw/main/DockerInstallation.sh) --en
3838
```
3939
> 1-hour sync delay.
4040

4141
=== ":simple-jsdelivr: jsDelivr (CDN)"
4242

4343
``` bash
44-
bash <(curl -sSL https://cdn.jsdelivr.net/gh/SuperManito/LinuxMirrors@main/DockerInstallation.sh)
44+
bash <(curl -sSL https://cdn.jsdelivr.net/gh/SuperManito/LinuxMirrors@main/DockerInstallation.sh) --en
4545
```
4646

4747
=== ":tencent-cloud: Tencent Cloud EO (CDN)"
4848

4949
``` bash
50-
bash <(curl -sSL https://edgeone.linuxmirrors.cn/docker.sh)
50+
bash <(curl -sSL https://edgeone.linuxmirrors.cn/docker.sh) --en
5151
```
5252
> Not recommended in Chinese mainland network environments.
5353

@@ -62,39 +62,39 @@ hide:
6262
=== ":linuxmirrors: Official Site (Recommended)"
6363

6464
``` bash
65-
bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --only-registry
65+
bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --en --only-registry
6666
```
6767

6868
=== ":simple-github: GitHub"
6969

7070
``` bash
71-
bash <(curl -sSL https://raw.githubusercontent.com/SuperManito/LinuxMirrors/main/DockerInstallation.sh) --only-registry
71+
bash <(curl -sSL https://raw.githubusercontent.com/SuperManito/LinuxMirrors/main/DockerInstallation.sh) --en --only-registry
7272
```
7373

7474
=== ":simple-gitee: Gitee"
7575

7676
``` bash
77-
bash <(curl -sSL https://gitee.com/SuperManito/LinuxMirrors/raw/main/DockerInstallation.sh) --only-registry
77+
bash <(curl -sSL https://gitee.com/SuperManito/LinuxMirrors/raw/main/DockerInstallation.sh) --en --only-registry
7878
```
7979
> Real-time sync, no delay. Recommended for use in Chinese mainland network environments.
8080

8181
=== ":simple-gitcode: GitCode"
8282

8383
``` bash
84-
bash <(curl -sSL https://raw.gitcode.com/SuperManito/LinuxMirrors/raw/main/DockerInstallation.sh) --only-registry
84+
bash <(curl -sSL https://raw.gitcode.com/SuperManito/LinuxMirrors/raw/main/DockerInstallation.sh) --en --only-registry
8585
```
8686
> 1-hour sync delay.
8787

8888
=== ":simple-jsdelivr: jsDelivr (CDN)"
8989

9090
``` bash
91-
bash <(curl -sSL https://cdn.jsdelivr.net/gh/SuperManito/LinuxMirrors@main/DockerInstallation.sh) --only-registry
91+
bash <(curl -sSL https://cdn.jsdelivr.net/gh/SuperManito/LinuxMirrors@main/DockerInstallation.sh) --en --only-registry
9292
```
9393

9494
=== ":tencent-cloud: Tencent Cloud EO (CDN)"
9595

9696
``` bash
97-
bash <(curl -sSL https://edgeone.linuxmirrors.cn/docker.sh) --only-registry
97+
bash <(curl -sSL https://edgeone.linuxmirrors.cn/docker.sh) --en --only-registry
9898
```
9999
> Not recommended in Chinese mainland network environments.
100100

@@ -209,7 +209,7 @@ hide:
209209

210210
<!-- termynal -->
211211
```
212-
$ bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --help
212+
$ bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --en --help
213213
214214
Command options(name/meaning/value):
215215
@@ -224,6 +224,7 @@ Command options(name/meaning/value):
224224
--install-latest Whether to install the latest Docker Engine true or false
225225
--close-firewall Whether to disable the firewall true or false
226226
--clean-screen Whether to clear the screen before running true or false
227+
--lang Specify the language of the script output language
227228
--only-registry Only switch registry mirror mode none
228229
--ignore-backup-tips Ignore backup overwrite prompt (do not backup) none
229230
--pure-mode Pure mode, minimal output none
@@ -243,6 +244,7 @@ Command options(name/meaning/value):
243244
| `--install-latest` | Whether to install the latest `Docker Engine` | `true` or `false` |
244245
| `--close-firewall` | Whether to disable the firewall | `true` or `false` |
245246
| `--clean-screen` | Whether to clear the screen before running | `true` or `false` |
247+
| `--lang` | Specify the language of the script output | `language id (see docs below)` |
246248
| `--only-registry` | Only switch registry mirror mode | none |
247249
| `--ignore-backup-tips` | Ignore backup overwrite prompt (do not backup) | none |
248250
| `--pure-mode` | Pure mode, minimal output | none |
@@ -253,7 +255,7 @@ Command options(name/meaning/value):
253255
- ### Specify Registry Mirror Address
254256

255257
``` { .bash .no-copy }
256-
bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --source-registry registry.example.com
258+
bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --en --source-registry registry.example.com
257259
```
258260

259261
- ### Only Switch Registry Mirror
@@ -263,7 +265,7 @@ Command options(name/meaning/value):
263265
Only switches the registry accelerator. If Docker is not installed, an error will be reported and exit.
264266

265267
``` bash
266-
bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --only-registry
268+
bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --en --only-registry
267269
```
268270

269271
=== "Manual Replacement"
@@ -314,7 +316,7 @@ Command options(name/meaning/value):
314316
- ### Specify Docker CE Source Address
315317

316318
``` { .bash .no-copy }
317-
bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --source mirror.example.com/docker-ce
319+
bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --en --source mirror.example.com/docker-ce
318320
```
319321
> Note: The address path must include the Docker CE mirror repository path, i.e., `docker-ce`.
320322
@@ -323,13 +325,13 @@ Command options(name/meaning/value):
323325
The script will automatically detect this in most cases. Specify only if you have special requirements.
324326
325327
``` { .bash .no-copy }
326-
bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --branch centos
328+
bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --en --branch centos
327329
```
328330
> Repository names are fixed: `centos`, `debian`, `fedora`, `raspbian`, `rhel`, `sles`, `static`, `ubuntu`
329331
> See [official installation docs](https://docs.docker.com/engine/install) and [Docker CE official repo](https://download.docker.com/linux) for details.
330332
331333
``` { .bash .no-copy title="Can also specify the repository version number." }
332-
bash <(curl -sSL https://linuxmirrors.cn/docker.sh) \
334+
bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --en \
333335
--branch centos \
334336
--branch-version 9
335337
```
@@ -340,7 +342,7 @@ Command options(name/meaning/value):
340342
When specifying a version, the "install latest" option is ignored. Format: `major.minor.patch`, e.g., `28.4.1`.
341343
342344
``` { .bash .no-copy }
343-
bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --designated-version 28.0.0
345+
bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --en --designated-version 28.0.0
344346
```
345347
> If the specified version does not exist or is not supported on your system, the script will report an error and exit.
346348
@@ -364,13 +366,41 @@ Command options(name/meaning/value):
364366
365367
Versions not listed are not supported by this script. If you cannot get the version list, your system environment has not been properly configured for the Docker CE repository (this will not happen when running the script).
366368
369+
- ### I18n (Internationalization)
370+
371+
The script provides multi-language support. Currently, there are three built-in display languages: `简体中文``繁體中文``English`. The default is `简体中文`.
372+
373+
- #### Specify Language
374+
375+
``` { .bash .no-copy }
376+
bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --lang xxx
377+
```
378+
379+
| Type | Value |
380+
| :-: | :-: |
381+
| 简体中文 | `zh-hans` `zh-cn` `zh` |
382+
| 繁體中文 | `zh-hant` `zh-tw` `zh-hk` |
383+
| English | `en` `en-us` |
384+
385+
It can also be used directly as a command option
386+
387+
``` bash
388+
bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --zh-hant
389+
```
390+
> `--en` `--en-us` `--zh` `--zh-cn` `--zh-hans` `--zh-hant`
391+
392+
- #### Select through interaction
393+
394+
``` bash
395+
bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --lang auto
396+
```
367397
368398
- ### Unattended (Automation)
369399
370400
To perform installation without interaction, use at least the following options. Recommended for experienced users.
371401
372402
``` { .bash .no-copy title="Example Command" }
373-
bash <(curl -sSL https://linuxmirrors.cn/docker.sh) \
403+
bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --en \
374404
--source mirror.example.com/docker-ce \
375405
--source-registry registry.hub.docker.com \
376406
--protocol http \
@@ -386,14 +416,14 @@ Command options(name/meaning/value):
386416
This feature is introduced to facilitate the use of developers and operation and maintenance personnel. After it is enabled, the script content output will be simplified. It is recommended to use it with other command options without interaction.
387417
388418
``` bash
389-
bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --pure-mode
419+
bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --en --pure-mode
390420
```
391421
392422
!!! tip "Scrolling command logs may have unpredictable display issues, but no problems have been found so far."
393423
394424
## FAQ
395425
396-
- ### About Service Startup Errors
426+
- #### About Service Startup Errors
397427
398428
!!! quote ""
399429
@@ -419,7 +449,7 @@ Command options(name/meaning/value):
419449
420450
After uninstalling, simply rerun the script to install.
421451
422-
- ### About unsupported operating systems
452+
- #### About unsupported operating systems
423453
424454
If it prompts that it is not supported, please use the system's own package management tool to install it. Because these packages are built and maintained by the Linux distribution's package maintainers and may have differences in configuration or are built from modified source code.
425455

docs/other/index.md

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ $ bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --help
224224
--install-latest 是否安装最新版本的 Docker Engine true 或 false
225225
--close-firewall 是否关闭防火墙 true 或 false
226226
--clean-screen 是否在运行前清除屏幕上的所有内容 true 或 false
227+
--lang 指定脚本输出的语言 语言
227228
--only-registry 仅更换镜像仓库模式 无
228229
--ignore-backup-tips 忽略覆盖备份提示 无
229230
--pure-mode 纯净模式,精简打印内容 无
@@ -243,6 +244,7 @@ $ bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --help
243244
| `--install-latest` | 是否安装最新版本的 `Docker Engine` | `true``false` |
244245
| `--close-firewall` | 是否关闭防火墙 | `true``false` |
245246
| `--clean-screen` | 是否在运行前清除屏幕上的所有内容 | `true``false` |
247+
| `--lang` | 指定脚本输出的语言 | `语言ID(详见下方文档)` |
246248
| `--only-registry` | 仅更换镜像仓库模式 ||
247249
| `--ignore-backup-tips` | 忽略覆盖备份提示(即不覆盖备份) ||
248250
| `--pure-mode` | 纯净模式,精简打印内容 ||
@@ -364,6 +366,34 @@ $ bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --help
364366
365367
未出现在该列表中的版本则不支持通过本脚本安装,如果获取不到版本列表说明你当前的系统环境还没有正确配置 Docker CE 软件源(运行脚本时不存在该问题)
366368
369+
- ### 国际化(I18n)
370+
371+
脚本提供多语言支持,当前内置 `简体中文``繁體中文``English` 共三种显示语言,默认为 `简体中文`
372+
373+
- #### 指定语言
374+
375+
``` { .bash .no-copy }
376+
bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --lang xxx
377+
```
378+
379+
| 类型 ||
380+
| :-: | :-: |
381+
| 简体中文 | `zh-hans` `zh-cn` `zh` |
382+
| 繁體中文 | `zh-hant` `zh-tw` `zh-hk` |
383+
| English | `en` `en-us` |
384+
385+
也可以直接作为命令选项使用
386+
387+
``` bash
388+
bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --en
389+
```
390+
> `--en` `--en-us` `--zh` `--zh-cn` `--zh-hans` `--zh-hant`
391+
392+
- #### 通过交互进行选择
393+
394+
``` bash
395+
bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --lang auto
396+
```
367397
368398
- ### 无人值守(自动化)
369399
@@ -393,7 +423,7 @@ $ bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --help
393423
394424
## 常见问题
395425
396-
- ### 关于服务报错无法启动
426+
- #### 关于服务报错无法启动
397427
398428
!!! quote ""
399429
@@ -419,7 +449,7 @@ $ bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --help
419449
420450
卸载完成后重新执行脚本安装即可
421451
422-
- ### 关于不支持的操作系统
452+
- #### 关于不支持的操作系统
423453
424454
如果提示不支持那么请使用系统自带的包管理工具进行安装。因为这些软件包由 Linux 发行版的软件包维护者构建和维护,可能存在配置差异或由修改后的源代码构建。
425455

0 commit comments

Comments
 (0)