Skip to content

Commit 7c0a396

Browse files
authored
Update Simplified Chinese translations for the Cookbook and Internals sections (#371)
* Complete the translation of the cookbook and internals * Optimize VitePress configuration
1 parent 656b9e2 commit 7c0a396

File tree

98 files changed

+2166
-2357
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+2166
-2357
lines changed

_translations/po/zh-CN/cookbook_configuring-webservers_apache.md.po

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ msgstr ""
1919
#: ../src/cookbook/configuring-webservers/apache.md
2020
#, no-wrap
2121
msgid "Configuring web servers: Apache"
22-
msgstr ""
22+
msgstr "配置 Web 服务器:Apache"
2323

2424
#. type: Plain text
2525
#: ../src/cookbook/configuring-webservers/apache.md
2626
msgid "Use the following configuration in Apache's `httpd.conf` file or within a virtual host configuration. Note that you should replace `path/to/app/public` with the actual path for `app/public`."
27-
msgstr ""
27+
msgstr "在 Apache 的 `httpd.conf` 文件或虚拟主机配置中使用以下配置。注意,你应该将 `path/to/app/public` 替换为 `app/public` 的实际路径。"
2828

2929
#. type: Fenced code block (apache)
3030
#: ../src/cookbook/configuring-webservers/apache.md
@@ -52,11 +52,32 @@ msgid ""
5252
" # ...other settings...\n"
5353
"</Directory>\n"
5454
msgstr ""
55+
"# 将文档根目录设置为 \"app/public\"\n"
56+
"DocumentRoot \"path/to/app/public\"\n"
57+
"\n"
58+
"<Directory \"path/to/app/public\">\n"
59+
" # 使用 mod_rewrite 支持美化 URL\n"
60+
" RewriteEngine on\n"
61+
" \n"
62+
" # 如果 UrlManager 中的 $showScriptName 为 false,则不允许访问带脚本名称的 URL\n"
63+
" RewriteRule ^index.php/ - [L,R=404]\n"
64+
" \n"
65+
" # 如果目录或文件存在,直接使用请求\n"
66+
" RewriteCond %{REQUEST_FILENAME} !-f\n"
67+
" RewriteCond %{REQUEST_FILENAME} !-d\n"
68+
" \n"
69+
" # 否则将请求转发到 index.php\n"
70+
" RewriteRule . index.php\n"
71+
" \n"
72+
" SetEnv APP_ENV dev\n"
73+
"\n"
74+
" # ...其他设置...\n"
75+
"</Directory>\n"
5576

5677
#. type: Plain text
5778
#: ../src/cookbook/configuring-webservers/apache.md
5879
msgid "In case you have `AllowOverride All` you can add `.htaccess` file with the following configuration instead of using `httpd.conf`:"
59-
msgstr ""
80+
msgstr "如果你设置了 `AllowOverride All`,可以添加包含以下配置的 `.htaccess` 文件,而不是使用 `httpd.conf`:"
6081

6182
#. type: Fenced code block (apache)
6283
#: ../src/cookbook/configuring-webservers/apache.md
@@ -79,8 +100,24 @@ msgid ""
79100
"\n"
80101
"# ...other settings...\n"
81102
msgstr ""
103+
"# 使用 mod_rewrite 支持美化 URL\n"
104+
"RewriteEngine on\n"
105+
"\n"
106+
"# 如果 UrlManager 中的 $showScriptName 为 false,则不允许访问带脚本名称的 URL\n"
107+
"RewriteRule ^index.php/ - [L,R=404]\n"
108+
"\n"
109+
"# 如果目录或文件存在,直接使用请求\n"
110+
"RewriteCond %{REQUEST_FILENAME} !-f\n"
111+
"RewriteCond %{REQUEST_FILENAME} !-d\n"
112+
"\n"
113+
"# 否则将请求转发到 index.php\n"
114+
"RewriteRule . index.php\n"
115+
"\n"
116+
"SetEnv APP_ENV dev\n"
117+
"\n"
118+
"# ...其他设置...\n"
82119

83120
#. type: Plain text
84121
#: ../src/cookbook/configuring-webservers/apache.md
85122
msgid "In the above, note the usage of `SetEnv`. Since the Yii3 application template is using environment variables, this is a possible place to set them. In production environment remember to set `APP_ENV` to `prod`."
86-
msgstr ""
123+
msgstr "在上面的配置中,请注意 `SetEnv` 的用法。由于 Yii3 应用程序模板使用环境变量,这是设置它们的一个可行位置。在生产环境中,请记得将 `APP_ENV` 设置为 `prod`。"

_translations/po/zh-CN/cookbook_configuring-webservers_general.md.po

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ msgstr ""
1919
#: ../src/cookbook/configuring-webservers/general.md
2020
#, no-wrap
2121
msgid "Configuring web servers: General"
22-
msgstr ""
22+
msgstr "配置 Web 服务器:通用"
2323

2424
#. type: Plain text
2525
#: ../src/cookbook/configuring-webservers/general.md
2626
msgid "On a production server, if you don't use Docker, configure your web server to serve only the application's public files. Point the document root of your web server to the `app/public` folder."
27-
msgstr ""
27+
msgstr "在生产服务器上,如果你不使用 Docker,请配置你的 Web 服务器仅提供应用程序的公共文件。将 Web 服务器的文档根目录指向 `app/public` 文件夹。"
2828

2929
#. type: Plain text
3030
#: ../src/cookbook/configuring-webservers/general.md
@@ -34,12 +34,15 @@ msgid ""
3434
"> If you're running your Yii application behind a reverse proxy, you might need to configure\n"
3535
"> [Trusted proxies and headers](../../guide/security/trusted-request.md).\n"
3636
msgstr ""
37+
"> [!IMPORTANT]\n"
38+
"> 如果你在反向代理后面运行 Yii 应用程序,可能需要配置\n"
39+
"> [受信任的代理和标头](../../guide/security/trusted-request.md)。\n"
3740

3841
#. type: Title ##
3942
#: ../src/cookbook/configuring-webservers/general.md
4043
#, no-wrap
4144
msgid "Specific server configurations"
42-
msgstr ""
45+
msgstr "特定服务器配置"
4346

4447
#. type: Bullet: '- '
4548
#: ../src/cookbook/configuring-webservers/general.md

_translations/po/zh-CN/cookbook_configuring-webservers_iis.md.po

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ msgstr ""
1919
#: en/configuring-webservers/iis.md
2020
#, no-wrap
2121
msgid "Configuring web servers: IIS"
22-
msgstr ""
22+
msgstr "配置 Web 服务器:IIS"
2323

2424
#. type: Plain text
2525
#: en/configuring-webservers/iis.md
2626
msgid "When you use [IIS](https://www.iis.net/), host the application in a virtual host (Website) where the document root points to the `path/to/app/public` folder and configure the website to run PHP. In that `public` folder, place a file named `web.config` at `path/to/app/public/web.config`. Use the following content:"
27-
msgstr ""
27+
msgstr "当你使用 [IIS](https://www.iis.net/) 时,在虚拟主机(网站)中托管应用程序,其中文档根目录指向 `path/to/app/public` 文件夹,并配置网站运行 PHP。在该 `public` 文件夹中,放置一个名为 `web.config` 的文件,路径为 `path/to/app/public/web.config`。使用以下内容:"
2828

2929
#. type: Fenced code block (xml)
3030
#: en/configuring-webservers/iis.md
@@ -55,14 +55,14 @@ msgstr ""
5555
#. type: Plain text
5656
#: en/configuring-webservers/iis.md
5757
msgid "Also, the following list of Microsoft's official resources could be useful to configure PHP on IIS:"
58-
msgstr ""
58+
msgstr "此外,以下 Microsoft 官方资源列表可能对在 IIS 上配置 PHP 有所帮助:"
5959

6060
#. type: Bullet: '1. '
6161
#: en/configuring-webservers/iis.md
6262
msgid "[How to set up your first IIS website](https://support.microsoft.com/en-us/help/323972/how-to-set-up-your-first-iis-web-site)"
63-
msgstr ""
63+
msgstr "[如何设置你的第一个 IIS 网站](https://support.microsoft.com/en-us/help/323972/how-to-set-up-your-first-iis-web-site)"
6464

6565
#. type: Bullet: '2. '
6666
#: en/configuring-webservers/iis.md
6767
msgid "[Configure a PHP Website on IIS](https://docs.microsoft.com/en-us/iis/application-frameworks/scenario-build-a-php-website-on-iis/configure-a-php-website-on-iis)"
68-
msgstr ""
68+
msgstr "[在 IIS 上配置 PHP 网站](https://docs.microsoft.com/en-us/iis/application-frameworks/scenario-build-a-php-website-on-iis/configure-a-php-website-on-iis)"

_translations/po/zh-CN/cookbook_configuring-webservers_lighttpd.md.po

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ msgstr ""
1919
#: en/configuring-webservers/lighttpd.md
2020
#, no-wrap
2121
msgid "Configuring web servers: lighttpd"
22-
msgstr ""
22+
msgstr "配置 Web 服务器:lighttpd"
2323

2424
#. type: Plain text
2525
#: en/configuring-webservers/lighttpd.md
2626
#, no-wrap
2727
msgid "To use [lighttpd](https://www.lighttpd.net/) >= 1.4.24, put `index.php` in the web root and add the following to the configuration:\n"
28-
msgstr ""
28+
msgstr "要使用 [lighttpd](https://www.lighttpd.net/) >= 1.4.24,将 `index.php` 放在 Web 根目录中,并将以下内容添加到配置中:\n"
2929

3030
#. type: Fenced code block
3131
#: en/configuring-webservers/lighttpd.md

_translations/po/zh-CN/cookbook_configuring-webservers_nginx-unit.md.po

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ msgstr ""
1919
#: en/configuring-webservers/nginx-unit.md
2020
#, no-wrap
2121
msgid "Configuring web servers: NGINX Unit"
22-
msgstr ""
22+
msgstr "配置 Web 服务器:NGINX Unit"
2323

2424
#. type: Plain text
2525
#: en/configuring-webservers/nginx-unit.md
2626
msgid "Run Yii-based apps using [NGINX Unit](https://unit.nginx.org/) with a PHP language module. Here is a sample configuration."
27-
msgstr ""
27+
msgstr "使用带有 PHP 语言模块的 [NGINX Unit](https://unit.nginx.org/) 运行基于 Yii 的应用程序。以下是一个示例配置。"
2828

2929
#. type: Fenced code block (json)
3030
#: en/configuring-webservers/nginx-unit.md
@@ -88,9 +88,9 @@ msgstr ""
8888
#. type: Plain text
8989
#: en/configuring-webservers/nginx-unit.md
9090
msgid "You can also [set up](https://unit.nginx.org/configuration/#php) your PHP environment or supply a custom `php.ini` in the same configuration."
91-
msgstr ""
91+
msgstr "你还可以在同一配置中 [设置](https://unit.nginx.org/configuration/#php) PHP 环境或提供自定义的 `php.ini`。"
9292

9393
#. type: Plain text
9494
#: en/configuring-webservers/nginx-unit.md
9595
msgid "In the above, note the usage of `environment`. Since the Yii3 application template is using environment variables, this is a possible place to set them. In production environment remember to set `APP_ENV` to `prod`."
96-
msgstr ""
96+
msgstr "在上面的配置中,请注意 `environment` 的用法。由于 Yii3 应用程序模板使用环境变量,这是设置它们的一个可行位置。在生产环境中,请记得将 `APP_ENV` 设置为 `prod`。"

_translations/po/zh-CN/cookbook_configuring-webservers_nginx.md.po

Lines changed: 48 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ msgstr ""
1919
#: ../src/cookbook/configuring-webservers/nginx.md
2020
#, no-wrap
2121
msgid "Configuring web servers: Nginx"
22-
msgstr ""
22+
msgstr "配置 Web 服务器:Nginx"
2323

2424
#. type: Plain text
2525
#: ../src/cookbook/configuring-webservers/nginx.md
2626
msgid "To use [Nginx](https://wiki.nginx.org/), install PHP as an [FPM SAPI](https://secure.php.net/install.fpm). Use the following Nginx configuration, replacing `path/to/app/public` with the actual path for `app/public` and `mysite.test` with the actual hostname to serve."
27-
msgstr ""
27+
msgstr "要使用 [Nginx](https://wiki.nginx.org/),请将 PHP 安装为 [FPM SAPI](https://secure.php.net/install.fpm)。使用以下 Nginx 配置,将 `path/to/app/public` 替换为 `app/public` 的实际路径,将 `mysite.test` 替换为要提供服务的实际主机名。"
2828

2929
#. type: Fenced code block (nginx)
3030
#: ../src/cookbook/configuring-webservers/nginx.md
@@ -74,18 +74,61 @@ msgid ""
7474
" }\n"
7575
"}\n"
7676
msgstr ""
77+
"server {\n"
78+
" charset utf-8;\n"
79+
" client_max_body_size 128M;\n"
80+
"\n"
81+
" listen 80; ## 监听 ipv4\n"
82+
" #listen [::]:80 default_server ipv6only=on; ## 监听 ipv6\n"
83+
"\n"
84+
" server_name mysite.test;\n"
85+
" root /path/to/app/public;\n"
86+
" index index.php;\n"
87+
"\n"
88+
" access_log /path/to/basic/log/access.log;\n"
89+
" error_log /path/to/basic/log/error.log;\n"
90+
"\n"
91+
" location / {\n"
92+
" # 将所有不是真实文件的请求重定向到 index.php\n"
93+
" try_files $uri $uri/ /index.php$is_args$args;\n"
94+
" }\n"
95+
"\n"
96+
" # 取消注释以避免 Yii 处理对不存在的静态文件的调用\n"
97+
" #location ~ \\.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ {\n"
98+
" # try_files $uri =404;\n"
99+
" #}\n"
100+
" #error_page 404 /404.html;\n"
101+
"\n"
102+
" # 拒绝访问 /assets 目录中的 php 文件\n"
103+
" location ~ ^/assets/.*\\.php$ {\n"
104+
" deny all;\n"
105+
" }\n"
106+
"\n"
107+
" location ~ \\.php$ {\n"
108+
" include fastcgi_params;\n"
109+
" fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\n"
110+
" fastcgi_pass 127.0.0.1:9000;\n"
111+
" #fastcgi_pass unix:/var/run/php8-fpm.sock;\n"
112+
" try_files $uri =404;\n"
113+
" fastcgi_param APP_ENV \"dev\";\n"
114+
" }\n"
115+
"\n"
116+
" location ~* /\\. {\n"
117+
" deny all;\n"
118+
" }\n"
119+
"}\n"
77120

78121
#. type: Plain text
79122
#: ../src/cookbook/configuring-webservers/nginx.md
80123
msgid "When you use this configuration, also set `cgi.fix_pathinfo=0` in the `php.ini` file to avoid many unnecessary system `stat()` calls."
81-
msgstr ""
124+
msgstr "使用此配置时,还要在 `php.ini` 文件中设置 `cgi.fix_pathinfo=0`,以避免许多不必要的系统 `stat()` 调用。"
82125

83126
#. type: Plain text
84127
#: ../src/cookbook/configuring-webservers/nginx.md
85128
msgid "Also, note that when running an HTTPS server, you need to add `fastcgi_param HTTPS on;` so that Yii can detect if a connection is secure."
86-
msgstr ""
129+
msgstr "另外,请注意,当运行 HTTPS 服务器时,需要添加 `fastcgi_param HTTPS on;`,以便 Yii 可以检测连接是否安全。"
87130

88131
#. type: Plain text
89132
#: ../src/cookbook/configuring-webservers/nginx.md
90133
msgid "In the above, note the usage of `fastcgi_param APP_ENV`. Since the Yii3 application template is using environment variables, this is a possible place to set them. In production environment remember to set `APP_ENV` to `prod`."
91-
msgstr ""
134+
msgstr "在上面的配置中,请注意 `fastcgi_param APP_ENV` 的用法。由于 Yii3 应用程序模板使用环境变量,这是设置它们的一个可行位置。在生产环境中,请记得将 `APP_ENV` 设置为 `prod`。"

0 commit comments

Comments
 (0)