diff --git a/_translations/po/zh-CN/cookbook_configuring-webservers_apache.md.po b/_translations/po/zh-CN/cookbook_configuring-webservers_apache.md.po
index 1dfff870..206dcb8d 100644
--- a/_translations/po/zh-CN/cookbook_configuring-webservers_apache.md.po
+++ b/_translations/po/zh-CN/cookbook_configuring-webservers_apache.md.po
@@ -19,12 +19,12 @@ msgstr ""
#: ../src/cookbook/configuring-webservers/apache.md
#, no-wrap
msgid "Configuring web servers: Apache"
-msgstr ""
+msgstr "配置 Web 服务器:Apache"
#. type: Plain text
#: ../src/cookbook/configuring-webservers/apache.md
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`."
-msgstr ""
+msgstr "在 Apache 的 `httpd.conf` 文件或虚拟主机配置中使用以下配置。注意,你应该将 `path/to/app/public` 替换为 `app/public` 的实际路径。"
#. type: Fenced code block (apache)
#: ../src/cookbook/configuring-webservers/apache.md
@@ -52,11 +52,32 @@ msgid ""
" # ...other settings...\n"
"\n"
msgstr ""
+"# 将文档根目录设置为 \"app/public\"\n"
+"DocumentRoot \"path/to/app/public\"\n"
+"\n"
+"\n"
+" # 使用 mod_rewrite 支持美化 URL\n"
+" RewriteEngine on\n"
+" \n"
+" # 如果 UrlManager 中的 $showScriptName 为 false,则不允许访问带脚本名称的 URL\n"
+" RewriteRule ^index.php/ - [L,R=404]\n"
+" \n"
+" # 如果目录或文件存在,直接使用请求\n"
+" RewriteCond %{REQUEST_FILENAME} !-f\n"
+" RewriteCond %{REQUEST_FILENAME} !-d\n"
+" \n"
+" # 否则将请求转发到 index.php\n"
+" RewriteRule . index.php\n"
+" \n"
+" SetEnv APP_ENV dev\n"
+"\n"
+" # ...其他设置...\n"
+" \n"
#. type: Plain text
#: ../src/cookbook/configuring-webservers/apache.md
msgid "In case you have `AllowOverride All` you can add `.htaccess` file with the following configuration instead of using `httpd.conf`:"
-msgstr ""
+msgstr "如果你设置了 `AllowOverride All`,可以添加包含以下配置的 `.htaccess` 文件,而不是使用 `httpd.conf`:"
#. type: Fenced code block (apache)
#: ../src/cookbook/configuring-webservers/apache.md
@@ -79,8 +100,24 @@ msgid ""
"\n"
"# ...other settings...\n"
msgstr ""
+"# 使用 mod_rewrite 支持美化 URL\n"
+"RewriteEngine on\n"
+"\n"
+"# 如果 UrlManager 中的 $showScriptName 为 false,则不允许访问带脚本名称的 URL\n"
+"RewriteRule ^index.php/ - [L,R=404]\n"
+"\n"
+"# 如果目录或文件存在,直接使用请求\n"
+"RewriteCond %{REQUEST_FILENAME} !-f\n"
+"RewriteCond %{REQUEST_FILENAME} !-d\n"
+"\n"
+"# 否则将请求转发到 index.php\n"
+"RewriteRule . index.php\n"
+"\n"
+"SetEnv APP_ENV dev\n"
+"\n"
+"# ...其他设置...\n"
#. type: Plain text
#: ../src/cookbook/configuring-webservers/apache.md
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`."
-msgstr ""
+msgstr "在上面的配置中,请注意 `SetEnv` 的用法。由于 Yii3 应用程序模板使用环境变量,这是设置它们的一个可行位置。在生产环境中,请记得将 `APP_ENV` 设置为 `prod`。"
diff --git a/_translations/po/zh-CN/cookbook_configuring-webservers_general.md.po b/_translations/po/zh-CN/cookbook_configuring-webservers_general.md.po
index e9815e62..3546abf6 100644
--- a/_translations/po/zh-CN/cookbook_configuring-webservers_general.md.po
+++ b/_translations/po/zh-CN/cookbook_configuring-webservers_general.md.po
@@ -19,12 +19,12 @@ msgstr ""
#: ../src/cookbook/configuring-webservers/general.md
#, no-wrap
msgid "Configuring web servers: General"
-msgstr ""
+msgstr "配置 Web 服务器:通用"
#. type: Plain text
#: ../src/cookbook/configuring-webservers/general.md
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."
-msgstr ""
+msgstr "在生产服务器上,如果你不使用 Docker,请配置你的 Web 服务器仅提供应用程序的公共文件。将 Web 服务器的文档根目录指向 `app/public` 文件夹。"
#. type: Plain text
#: ../src/cookbook/configuring-webservers/general.md
@@ -34,12 +34,15 @@ msgid ""
"> If you're running your Yii application behind a reverse proxy, you might need to configure\n"
"> [Trusted proxies and headers](../../guide/security/trusted-request.md).\n"
msgstr ""
+"> [!IMPORTANT]\n"
+"> 如果你在反向代理后面运行 Yii 应用程序,可能需要配置\n"
+"> [受信任的代理和标头](../../guide/security/trusted-request.md)。\n"
#. type: Title ##
#: ../src/cookbook/configuring-webservers/general.md
#, no-wrap
msgid "Specific server configurations"
-msgstr ""
+msgstr "特定服务器配置"
#. type: Bullet: '- '
#: ../src/cookbook/configuring-webservers/general.md
diff --git a/_translations/po/zh-CN/cookbook_configuring-webservers_iis.md.po b/_translations/po/zh-CN/cookbook_configuring-webservers_iis.md.po
index 140265f3..dd74e596 100644
--- a/_translations/po/zh-CN/cookbook_configuring-webservers_iis.md.po
+++ b/_translations/po/zh-CN/cookbook_configuring-webservers_iis.md.po
@@ -19,12 +19,12 @@ msgstr ""
#: en/configuring-webservers/iis.md
#, no-wrap
msgid "Configuring web servers: IIS"
-msgstr ""
+msgstr "配置 Web 服务器:IIS"
#. type: Plain text
#: en/configuring-webservers/iis.md
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:"
-msgstr ""
+msgstr "当你使用 [IIS](https://www.iis.net/) 时,在虚拟主机(网站)中托管应用程序,其中文档根目录指向 `path/to/app/public` 文件夹,并配置网站运行 PHP。在该 `public` 文件夹中,放置一个名为 `web.config` 的文件,路径为 `path/to/app/public/web.config`。使用以下内容:"
#. type: Fenced code block (xml)
#: en/configuring-webservers/iis.md
@@ -55,14 +55,14 @@ msgstr ""
#. type: Plain text
#: en/configuring-webservers/iis.md
msgid "Also, the following list of Microsoft's official resources could be useful to configure PHP on IIS:"
-msgstr ""
+msgstr "此外,以下 Microsoft 官方资源列表可能对在 IIS 上配置 PHP 有所帮助:"
#. type: Bullet: '1. '
#: en/configuring-webservers/iis.md
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)"
-msgstr ""
+msgstr "[如何设置你的第一个 IIS 网站](https://support.microsoft.com/en-us/help/323972/how-to-set-up-your-first-iis-web-site)"
#. type: Bullet: '2. '
#: en/configuring-webservers/iis.md
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)"
-msgstr ""
+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)"
diff --git a/_translations/po/zh-CN/cookbook_configuring-webservers_lighttpd.md.po b/_translations/po/zh-CN/cookbook_configuring-webservers_lighttpd.md.po
index 44327782..3794e485 100644
--- a/_translations/po/zh-CN/cookbook_configuring-webservers_lighttpd.md.po
+++ b/_translations/po/zh-CN/cookbook_configuring-webservers_lighttpd.md.po
@@ -19,13 +19,13 @@ msgstr ""
#: en/configuring-webservers/lighttpd.md
#, no-wrap
msgid "Configuring web servers: lighttpd"
-msgstr ""
+msgstr "配置 Web 服务器:lighttpd"
#. type: Plain text
#: en/configuring-webservers/lighttpd.md
#, no-wrap
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"
-msgstr ""
+msgstr "要使用 [lighttpd](https://www.lighttpd.net/) >= 1.4.24,将 `index.php` 放在 Web 根目录中,并将以下内容添加到配置中:\n"
#. type: Fenced code block
#: en/configuring-webservers/lighttpd.md
diff --git a/_translations/po/zh-CN/cookbook_configuring-webservers_nginx-unit.md.po b/_translations/po/zh-CN/cookbook_configuring-webservers_nginx-unit.md.po
index 39d9c69e..442ced5e 100644
--- a/_translations/po/zh-CN/cookbook_configuring-webservers_nginx-unit.md.po
+++ b/_translations/po/zh-CN/cookbook_configuring-webservers_nginx-unit.md.po
@@ -19,12 +19,12 @@ msgstr ""
#: en/configuring-webservers/nginx-unit.md
#, no-wrap
msgid "Configuring web servers: NGINX Unit"
-msgstr ""
+msgstr "配置 Web 服务器:NGINX Unit"
#. type: Plain text
#: en/configuring-webservers/nginx-unit.md
msgid "Run Yii-based apps using [NGINX Unit](https://unit.nginx.org/) with a PHP language module. Here is a sample configuration."
-msgstr ""
+msgstr "使用带有 PHP 语言模块的 [NGINX Unit](https://unit.nginx.org/) 运行基于 Yii 的应用程序。以下是一个示例配置。"
#. type: Fenced code block (json)
#: en/configuring-webservers/nginx-unit.md
@@ -88,9 +88,9 @@ msgstr ""
#. type: Plain text
#: en/configuring-webservers/nginx-unit.md
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."
-msgstr ""
+msgstr "你还可以在同一配置中 [设置](https://unit.nginx.org/configuration/#php) PHP 环境或提供自定义的 `php.ini`。"
#. type: Plain text
#: en/configuring-webservers/nginx-unit.md
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`."
-msgstr ""
+msgstr "在上面的配置中,请注意 `environment` 的用法。由于 Yii3 应用程序模板使用环境变量,这是设置它们的一个可行位置。在生产环境中,请记得将 `APP_ENV` 设置为 `prod`。"
diff --git a/_translations/po/zh-CN/cookbook_configuring-webservers_nginx.md.po b/_translations/po/zh-CN/cookbook_configuring-webservers_nginx.md.po
index 999028ff..adca273d 100644
--- a/_translations/po/zh-CN/cookbook_configuring-webservers_nginx.md.po
+++ b/_translations/po/zh-CN/cookbook_configuring-webservers_nginx.md.po
@@ -19,12 +19,12 @@ msgstr ""
#: ../src/cookbook/configuring-webservers/nginx.md
#, no-wrap
msgid "Configuring web servers: Nginx"
-msgstr ""
+msgstr "配置 Web 服务器:Nginx"
#. type: Plain text
#: ../src/cookbook/configuring-webservers/nginx.md
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."
-msgstr ""
+msgstr "要使用 [Nginx](https://wiki.nginx.org/),请将 PHP 安装为 [FPM SAPI](https://secure.php.net/install.fpm)。使用以下 Nginx 配置,将 `path/to/app/public` 替换为 `app/public` 的实际路径,将 `mysite.test` 替换为要提供服务的实际主机名。"
#. type: Fenced code block (nginx)
#: ../src/cookbook/configuring-webservers/nginx.md
@@ -74,18 +74,61 @@ msgid ""
" }\n"
"}\n"
msgstr ""
+"server {\n"
+" charset utf-8;\n"
+" client_max_body_size 128M;\n"
+"\n"
+" listen 80; ## 监听 ipv4\n"
+" #listen [::]:80 default_server ipv6only=on; ## 监听 ipv6\n"
+"\n"
+" server_name mysite.test;\n"
+" root /path/to/app/public;\n"
+" index index.php;\n"
+"\n"
+" access_log /path/to/basic/log/access.log;\n"
+" error_log /path/to/basic/log/error.log;\n"
+"\n"
+" location / {\n"
+" # 将所有不是真实文件的请求重定向到 index.php\n"
+" try_files $uri $uri/ /index.php$is_args$args;\n"
+" }\n"
+"\n"
+" # 取消注释以避免 Yii 处理对不存在的静态文件的调用\n"
+" #location ~ \\.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ {\n"
+" # try_files $uri =404;\n"
+" #}\n"
+" #error_page 404 /404.html;\n"
+"\n"
+" # 拒绝访问 /assets 目录中的 php 文件\n"
+" location ~ ^/assets/.*\\.php$ {\n"
+" deny all;\n"
+" }\n"
+"\n"
+" location ~ \\.php$ {\n"
+" include fastcgi_params;\n"
+" fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\n"
+" fastcgi_pass 127.0.0.1:9000;\n"
+" #fastcgi_pass unix:/var/run/php8-fpm.sock;\n"
+" try_files $uri =404;\n"
+" fastcgi_param APP_ENV \"dev\";\n"
+" }\n"
+"\n"
+" location ~* /\\. {\n"
+" deny all;\n"
+" }\n"
+"}\n"
#. type: Plain text
#: ../src/cookbook/configuring-webservers/nginx.md
msgid "When you use this configuration, also set `cgi.fix_pathinfo=0` in the `php.ini` file to avoid many unnecessary system `stat()` calls."
-msgstr ""
+msgstr "使用此配置时,还要在 `php.ini` 文件中设置 `cgi.fix_pathinfo=0`,以避免许多不必要的系统 `stat()` 调用。"
#. type: Plain text
#: ../src/cookbook/configuring-webservers/nginx.md
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."
-msgstr ""
+msgstr "另外,请注意,当运行 HTTPS 服务器时,需要添加 `fastcgi_param HTTPS on;`,以便 Yii 可以检测连接是否安全。"
#. type: Plain text
#: ../src/cookbook/configuring-webservers/nginx.md
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`."
-msgstr ""
+msgstr "在上面的配置中,请注意 `fastcgi_param APP_ENV` 的用法。由于 Yii3 应用程序模板使用环境变量,这是设置它们的一个可行位置。在生产环境中,请记得将 `APP_ENV` 设置为 `prod`。"
diff --git a/_translations/po/zh-CN/cookbook_deployment_docker-swarm-caddy.md.po b/_translations/po/zh-CN/cookbook_deployment_docker-swarm-caddy.md.po
index 24281caa..c8371e9c 100644
--- a/_translations/po/zh-CN/cookbook_deployment_docker-swarm-caddy.md.po
+++ b/_translations/po/zh-CN/cookbook_deployment_docker-swarm-caddy.md.po
@@ -19,12 +19,12 @@ msgstr ""
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#, no-wrap
msgid "Deploying Yii applications to Docker Swarm and Caddy"
-msgstr ""
+msgstr "将 Yii 应用部署到 Docker Swarm 和 Caddy"
#. type: Plain text
#: ../src/cookbook/deployment/docker-swarm-caddy.md
msgid "This guide walks you through deploying a Yii application to [Docker Swarm](https://docs.docker.com/engine/swarm/) starting from a blank server, using [Caddy](https://caddyserver.com/) as a reverse proxy and deploying from a container registry ([Forgejo](https://forgejo.org/) or [Gitea](https://about.gitea.com/))."
-msgstr ""
+msgstr "本指南将引导你从空白服务器开始,使用 [Caddy](https://caddyserver.com/) 作为反向代理,从容器注册表([Forgejo](https://forgejo.org/) 或 [Gitea](https://about.gitea.com/))部署 Yii 应用程序到 [Docker Swarm](https://docs.docker.com/engine/swarm/)。"
#. type: Fenced code block (mermaid)
#: ../src/cookbook/deployment/docker-swarm-caddy.md
@@ -48,64 +48,64 @@ msgstr ""
#: ../src/cookbook/preface.md
#, no-wrap
msgid "Prerequisites"
-msgstr ""
+msgstr "前提条件"
#. type: Bullet: '- '
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
msgid "A server with a fresh installation of a Linux distribution (Ubuntu 22.04 LTS or later recommended)"
-msgstr ""
+msgstr "一台全新安装 Linux 发行版的服务器(推荐 Ubuntu 22.04 LTS 或更高版本)"
#. type: Bullet: '- '
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
msgid "A domain name pointing to your server's IP address"
-msgstr ""
+msgstr "指向服务器 IP 地址的域名"
#. type: Bullet: '- '
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
msgid "SSH access to your server"
-msgstr ""
+msgstr "对服务器的 SSH 访问权限"
#. type: Bullet: '- '
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
msgid "Basic knowledge of Docker and command-line tools"
-msgstr ""
+msgstr "Docker 和命令行工具的基础知识"
#. type: Title ##
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
#, no-wrap
msgid "Server preparation"
-msgstr ""
+msgstr "服务器准备"
#. type: Title ###
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
#, no-wrap
msgid "Install Docker"
-msgstr ""
+msgstr "安装 Docker"
#. type: Plain text
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
msgid "For installation instructions, see the [official Docker documentation](https://docs.docker.com/engine/install/ubuntu/)."
-msgstr ""
+msgstr "有关安装说明,请参阅[官方 Docker 文档](https://docs.docker.com/engine/install/ubuntu/)。"
#. type: Title ###
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
#, no-wrap
msgid "Initialize Docker Swarm"
-msgstr ""
+msgstr "初始化 Docker Swarm"
#. type: Plain text
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
msgid "Initialize your server as a Docker Swarm manager:"
-msgstr ""
+msgstr "将服务器初始化为 Docker Swarm 管理器:"
#. type: Fenced code block (bash)
#: ../src/cookbook/deployment/docker-swarm-caddy.md
@@ -119,20 +119,20 @@ msgstr ""
#: ../src/cookbook/deployment/docker-swarm-traefik.md
#, no-wrap
msgid "Replace `` with your server's public IP address.\n"
-msgstr ""
+msgstr "将 `` 替换为服务器的公共 IP 地址。\n"
#. type: Title ###
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
#, no-wrap
msgid "Set up the reverse proxy network"
-msgstr ""
+msgstr "设置反向代理网络"
#. type: Plain text
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
msgid "Create a dedicated overlay network for reverse proxy to communicate with your services:"
-msgstr ""
+msgstr "创建一个专用的覆盖网络,供反向代理与服务通信:"
#. type: Fenced code block (bash)
#: ../src/cookbook/deployment/docker-swarm-caddy.md
@@ -145,12 +145,12 @@ msgstr ""
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#, no-wrap
msgid "Setting up Caddy as reverse proxy"
-msgstr ""
+msgstr "设置 Caddy 作为反向代理"
#. type: Plain text
#: ../src/cookbook/deployment/docker-swarm-caddy.md
msgid "To deploy Caddy as reverse proxy create a file `caddy-stack.yml`:"
-msgstr ""
+msgstr "要将 Caddy 部署为反向代理,请创建文件 `caddy-stack.yml`:"
#. type: Fenced code block (yaml)
#: ../src/cookbook/deployment/docker-swarm-caddy.md
@@ -179,18 +179,18 @@ msgstr ""
#. type: Plain text
#: ../src/cookbook/deployment/docker-swarm-caddy.md
msgid "Deploy Caddy:"
-msgstr ""
+msgstr "部署 Caddy:"
#. type: Fenced code block (bash)
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#, no-wrap
msgid "docker stack deploy -c caddy-stack.yml caddy\n"
-msgstr ""
+msgstr "docker stack deploy -c caddy-stack.yml caddy\n"
#. type: Plain text
#: ../src/cookbook/deployment/docker-swarm-caddy.md
msgid "Caddy automatically discovers services with Caddy labels and sets up HTTPS using Let's Encrypt. Yii3 application templates are using Caddy labels by default:"
-msgstr ""
+msgstr "Caddy 会自动发现带有 Caddy 标签的服务,并使用 Let's Encrypt 设置 HTTPS。Yii3 应用程序模板默认使用 Caddy 标签:"
#. type: Fenced code block (yaml)
#: ../src/cookbook/deployment/docker-swarm-caddy.md
@@ -216,26 +216,26 @@ msgstr ""
#: ../src/cookbook/deployment/docker-swarm-traefik.md
#, no-wrap
msgid "Setting up a container registry"
-msgstr ""
+msgstr "设置容器注册表"
#. type: Plain text
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
msgid "You need a container registry to store your Docker images. Choose one of the following options."
-msgstr ""
+msgstr "你需要一个容器注册表来存储 Docker 镜像。选择以下选项之一。"
#. type: Title ###
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
#, no-wrap
msgid "Option 1: Using Forgejo"
-msgstr ""
+msgstr "选项 1:使用 Forgejo"
#. type: Plain text
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
msgid "To deploy Forgejo create a file `forgejo-stack.yml`:"
-msgstr ""
+msgstr "要部署 Forgejo,请创建文件 `forgejo-stack.yml`:"
#. type: Fenced code block (yaml)
#: ../src/cookbook/deployment/docker-swarm-caddy.md
@@ -267,7 +267,7 @@ msgstr ""
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
msgid "Deploy Forgejo:"
-msgstr ""
+msgstr "部署 Forgejo:"
#. type: Fenced code block (bash)
#: ../src/cookbook/deployment/docker-swarm-caddy.md
@@ -280,25 +280,25 @@ msgstr ""
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
msgid "Replace `git.example.com` with your desired subdomain."
-msgstr ""
+msgstr "将 `git.example.com` 替换为所需的子域名。"
#. type: Plain text
#: ../src/cookbook/deployment/docker-swarm-caddy.md
msgid "After deployment, access Forgejo at `https://git.example.com` and complete the initial setup. Make sure to enable the container registry in the settings."
-msgstr ""
+msgstr "部署后,访问 `https://git.example.com` 上的 Forgejo 并完成初始设置。确保在设置中启用容器注册表。"
#. type: Title ###
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
#, no-wrap
msgid "Option 2: Using Gitea"
-msgstr ""
+msgstr "选项 2:使用 Gitea"
#. type: Plain text
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
msgid "To deploy Gitea create a file `gitea-stack.yml`:"
-msgstr ""
+msgstr "要部署 Gitea,请创建文件 `gitea-stack.yml`:"
#. type: Fenced code block (yaml)
#: ../src/cookbook/deployment/docker-swarm-caddy.md
@@ -330,7 +330,7 @@ msgstr ""
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
msgid "Deploy Gitea:"
-msgstr ""
+msgstr "部署 Gitea:"
#. type: Fenced code block (bash)
#: ../src/cookbook/deployment/docker-swarm-caddy.md
@@ -343,27 +343,27 @@ msgstr ""
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
msgid "After deployment, access Gitea at `https://git.example.com` and complete the initial setup. Make sure to enable the container registry in the settings."
-msgstr ""
+msgstr "部署后,访问 `https://git.example.com` 上的 Gitea 并完成初始设置。确保在设置中启用容器注册表。"
#. type: Title ##
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
#, no-wrap
msgid "Configuring your Yii application"
-msgstr ""
+msgstr "配置 Yii 应用程序"
#. type: Title ###
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
#, no-wrap
msgid "Update the Makefile configuration"
-msgstr ""
+msgstr "更新 Makefile 配置"
#. type: Plain text
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
msgid "The [Yii application template](https://github.com/yiisoft/app) includes a Makefile with deployment commands. Update the `docker/.env` file in your project:"
-msgstr ""
+msgstr "[Yii 应用程序模板](https://github.com/yiisoft/app)包含一个带有部署命令的 Makefile。更新项目中的 `docker/.env` 文件:"
#. type: Fenced code block (bash)
#: ../src/cookbook/deployment/docker-swarm-caddy.md
@@ -387,20 +387,20 @@ msgstr ""
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
msgid "Replace the values: - `STACK_NAME`: A unique name for your application stack - `PROD_HOST`: The domain name where your app will be accessible - `PROD_SSH`: SSH connection string to your server (format: `ssh://user@host`) - `IMAGE`: Full path to your container image in the registry - `IMAGE_TAG`: Image tag, typically `latest` or a version number"
-msgstr ""
+msgstr "替换以下值:- `STACK_NAME`:应用程序堆栈的唯一名称 - `PROD_HOST`:应用程序可访问的域名 - `PROD_SSH`:到服务器的 SSH 连接字符串(格式:`ssh://user@host`)- `IMAGE`:注册表中容器镜像的完整路径 - `IMAGE_TAG`:镜像标签,通常为 `latest` 或版本号"
#. type: Title ###
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
#, no-wrap
msgid "Configure the production environment"
-msgstr ""
+msgstr "配置生产环境"
#. type: Plain text
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
msgid "Update `docker/prod/.env` with your production environment variables:"
-msgstr ""
+msgstr "使用生产环境变量更新 `docker/prod/.env`:"
#. type: Fenced code block (bash)
#: ../src/cookbook/deployment/docker-swarm-caddy.md
@@ -428,18 +428,20 @@ msgid ""
"> [!WARNING]\n"
"> Never commit sensitive credentials to version control. Use `docker/prod/override.env` for sensitive values and add it to `.gitignore`.\n"
msgstr ""
+"> [!WARNING]\n"
+"> 切勿将敏感凭据提交到版本控制。对敏感值使用 `docker/prod/override.env` 并将其添加到 `.gitignore`。\n"
#. type: Title ###
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
#, no-wrap
msgid "Review the production Docker Compose configuration"
-msgstr ""
+msgstr "查看生产环境 Docker Compose 配置"
#. type: Plain text
#: ../src/cookbook/deployment/docker-swarm-caddy.md
msgid "The default `docker/prod/compose.yml` includes:"
-msgstr ""
+msgstr "默认的 `docker/prod/compose.yml` 包括:"
#. type: Fenced code block (yaml)
#: ../src/cookbook/deployment/docker-swarm-caddy.md
@@ -493,12 +495,18 @@ msgid ""
"- Disables obtaining of HTTPs certificates on the container itself\n"
" since proxy communicates with the container via HTTP. That is `auto_https off`.\n"
msgstr ""
+"此配置:\n"
+"- 运行 2 个副本以实现高可用性\n"
+"- 使用滚动更新策略,失败时自动回滚\n"
+"- 配置 `labels` 以在反向代理上自动启用 HTTPS\n"
+"- 禁用容器本身获取 HTTPS 证书\n"
+" 因为代理通过 HTTP 与容器通信。即 `auto_https off`。\n"
#. type: Plain text
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
msgid "If you need a database, add it to the stack:"
-msgstr ""
+msgstr "如果需要数据库,请将其添加到堆栈中:"
#. type: Fenced code block (yaml)
#: ../src/cookbook/deployment/docker-swarm-caddy.md
@@ -539,7 +547,7 @@ msgstr ""
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
msgid "Create the database password secret on the server:"
-msgstr ""
+msgstr "在服务器上创建数据库 password secret:"
#. type: Fenced code block (bash)
#: ../src/cookbook/deployment/docker-swarm-caddy.md
@@ -553,20 +561,20 @@ msgstr ""
#: ../src/cookbook/deployment/docker-swarm-traefik.md
#, no-wrap
msgid "Building and pushing the image"
-msgstr ""
+msgstr "构建并推送镜像"
#. type: Title ###
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
#, no-wrap
msgid "Set up Docker login on your local machine"
-msgstr ""
+msgstr "在本地机器上设置 Docker 登录"
#. type: Plain text
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
msgid "Configure Docker to authenticate with your container registry:"
-msgstr ""
+msgstr "配置 Docker 以向容器注册表进行身份验证:"
#. type: Fenced code block (bash)
#: ../src/cookbook/deployment/docker-swarm-caddy.md
@@ -579,20 +587,20 @@ msgstr ""
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
msgid "Enter your username and password when prompted."
-msgstr ""
+msgstr "在提示时输入用户名和 password。"
#. type: Title ###
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
#, no-wrap
msgid "Build the production image"
-msgstr ""
+msgstr "构建生产镜像"
#. type: Plain text
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
msgid "Use the Makefile to build your production image:"
-msgstr ""
+msgstr "使用 Makefile 构建生产镜像:"
#. type: Fenced code block (bash)
#: ../src/cookbook/deployment/docker-swarm-caddy.md
@@ -605,7 +613,7 @@ msgstr ""
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
msgid "This runs the command defined in the Makefile:"
-msgstr ""
+msgstr "这将运行 Makefile 中定义的命令:"
#. type: Fenced code block (bash)
#: ../src/cookbook/deployment/docker-swarm-caddy.md
@@ -618,20 +626,20 @@ msgstr ""
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
msgid "The Dockerfile uses a multi-stage build: 1. Installs Composer dependencies in a builder stage 2. Creates a minimal production image with only the necessary files 3. Runs as a non-root user (`www-data`)"
-msgstr ""
+msgstr "Dockerfile 使用多阶段构建:1. 在构建器阶段安装 Composer 依赖项 2. 创建仅包含必要文件的最小生产镜像 3. 以非 root 用户(`www-data`)身份运行"
#. type: Title ###
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
#, no-wrap
msgid "Push the image to the registry"
-msgstr ""
+msgstr "将镜像推送到注册表"
#. type: Plain text
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
msgid "Push your built image to the container registry:"
-msgstr ""
+msgstr "将构建的镜像推送到容器注册表:"
#. type: Fenced code block (bash)
#: ../src/cookbook/deployment/docker-swarm-caddy.md
@@ -644,7 +652,7 @@ msgstr ""
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
msgid "This executes:"
-msgstr ""
+msgstr "这将执行:"
#. type: Fenced code block (bash)
#: ../src/cookbook/deployment/docker-swarm-caddy.md
@@ -658,7 +666,7 @@ msgstr ""
#: ../src/cookbook/deployment/docker-swarm-traefik.md
#, no-wrap
msgid "Deploying to Docker Swarm"
-msgstr ""
+msgstr "部署到 Docker Swarm"
#. type: Title ###
#: ../src/cookbook/deployment/docker-swarm-caddy.md
@@ -698,13 +706,13 @@ msgstr ""
#: ../src/cookbook/deployment/docker-swarm-traefik.md
#, no-wrap
msgid "Set up Docker context"
-msgstr ""
+msgstr "设置 Docker 上下文"
#. type: Plain text
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
msgid "Create a Docker context for remote deployment:"
-msgstr ""
+msgstr "创建用于远程部署的 Docker 上下文:"
#. type: Fenced code block (bash)
#: ../src/cookbook/deployment/docker-swarm-caddy.md
@@ -717,7 +725,7 @@ msgstr ""
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
msgid "Alternatively, configure the `DOCKER_HOST` environment variable:"
-msgstr ""
+msgstr "或者,配置 `DOCKER_HOST` 环境变量:"
#. type: Fenced code block (bash)
#: ../src/cookbook/deployment/docker-swarm-caddy.md
@@ -731,13 +739,13 @@ msgstr ""
#: ../src/cookbook/deployment/docker-swarm-traefik.md
#, no-wrap
msgid "Deploy the application"
-msgstr ""
+msgstr "部署应用程序"
#. type: Plain text
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
msgid "Deploy your application stack to Docker Swarm:"
-msgstr ""
+msgstr "将应用程序堆栈部署到 Docker Swarm:"
#. type: Fenced code block (bash)
#: ../src/cookbook/deployment/docker-swarm-caddy.md
@@ -757,20 +765,20 @@ msgstr ""
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
msgid "The `--with-registry-auth` flag ensures the Swarm nodes can pull images from your private registry."
-msgstr ""
+msgstr "`--with-registry-auth` 标志确保 Swarm 节点可以从私有注册表拉取镜像。"
#. type: Title ###
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
#, no-wrap
msgid "Verify the deployment"
-msgstr ""
+msgstr "验证部署"
#. type: Plain text
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
msgid "Check the status of your services:"
-msgstr ""
+msgstr "检查服务状态:"
#. type: Fenced code block (bash)
#: ../src/cookbook/deployment/docker-swarm-caddy.md
@@ -785,7 +793,7 @@ msgstr ""
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
msgid "View logs:"
-msgstr ""
+msgstr "查看日志:"
#. type: Fenced code block (bash)
#: ../src/cookbook/deployment/docker-swarm-caddy.md
@@ -799,14 +807,14 @@ msgstr ""
#: ../src/cookbook/deployment/docker-swarm-traefik.md
#, no-wrap
msgid "Monitoring and maintenance"
-msgstr ""
+msgstr "监控和维护"
#. type: Title ###
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
#, no-wrap
msgid "View service logs"
-msgstr ""
+msgstr "查看服务日志"
#. type: Fenced code block (bash)
#: ../src/cookbook/deployment/docker-swarm-caddy.md
@@ -828,13 +836,13 @@ msgstr ""
#: ../src/cookbook/deployment/docker-swarm-traefik.md
#, no-wrap
msgid "Scale the application"
-msgstr ""
+msgstr "扩展应用程序"
#. type: Plain text
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
msgid "Adjust the number of replicas:"
-msgstr ""
+msgstr "调整副本数量:"
#. type: Fenced code block (bash)
#: ../src/cookbook/deployment/docker-swarm-caddy.md
@@ -847,20 +855,20 @@ msgstr ""
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
msgid "Or update the `replicas` value in `docker/prod/compose.yml` and redeploy."
-msgstr ""
+msgstr "或者更新 `docker/prod/compose.yml` 中的 `replicas` 值并重新部署。"
#. type: Title ###
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
#, no-wrap
msgid "Resource limits"
-msgstr ""
+msgstr "资源限制"
#. type: Plain text
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
msgid "Add resource limits to prevent containers from consuming all server resources. Update `docker/prod/compose.yml`:"
-msgstr ""
+msgstr "添加资源限制以防止容器消耗所有服务器资源。更新 `docker/prod/compose.yml`:"
#. type: Fenced code block (yaml)
#: ../src/cookbook/deployment/docker-swarm-caddy.md
@@ -886,20 +894,20 @@ msgstr ""
#: ../src/cookbook/disabling-csrf-protection.md
#, no-wrap
msgid "Security considerations"
-msgstr ""
+msgstr "安全注意事项"
#. type: Title ###
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
#, no-wrap
msgid "Use Docker secrets for sensitive data"
-msgstr ""
+msgstr "对敏感数据使用 Docker secrets"
#. type: Plain text
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
msgid "Instead of environment variables, use Docker secrets for sensitive information:"
-msgstr ""
+msgstr "对于敏感信息,使用 Docker secrets 而不是环境变量:"
#. type: Fenced code block (bash)
#: ../src/cookbook/deployment/docker-swarm-caddy.md
@@ -910,12 +918,15 @@ msgid ""
"echo \"database_password\" | docker secret create db_password -\n"
"echo \"api_key\" | docker secret create api_key -\n"
msgstr ""
+"# 创建 secrets\n"
+"echo \"database_password\" | docker secret create db_password -\n"
+"echo \"api_key\" | docker secret create api_key -\n"
#. type: Plain text
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
msgid "Update `docker/prod/compose.yml`:"
-msgstr ""
+msgstr "更新 `docker/prod/compose.yml`:"
#. type: Fenced code block (yaml)
#: ../src/cookbook/deployment/docker-swarm-caddy.md
@@ -939,20 +950,20 @@ msgstr ""
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
msgid "Access secrets in your application at `/run/secrets/secret_name`."
-msgstr ""
+msgstr "在应用程序中通过 `/run/secrets/secret_name` 访问 secrets。"
#. type: Title ###
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
#, no-wrap
msgid "Set up a firewall"
-msgstr ""
+msgstr "设置防火墙"
#. type: Plain text
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
msgid "Configure UFW (Uncomplicated Firewall) on your server:"
-msgstr ""
+msgstr "在服务器上配置 UFW(简单防火墙):"
#. type: Fenced code block (bash)
#: ../src/cookbook/deployment/docker-swarm-caddy.md
@@ -981,13 +992,13 @@ msgstr ""
#: ../src/cookbook/deployment/docker-swarm-traefik.md
#, no-wrap
msgid "Keep the system updated"
-msgstr ""
+msgstr "保持系统更新"
#. type: Plain text
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
msgid "Regularly update your server and Docker:"
-msgstr ""
+msgstr "定期更新服务器和 Docker:"
#. type: Fenced code block (bash)
#: ../src/cookbook/deployment/docker-swarm-caddy.md
@@ -1000,6 +1011,11 @@ msgid ""
"# Update Docker images\n"
"docker -H ssh://docker-web service update --image ${IMAGE}:${IMAGE_TAG} ${STACK_NAME}_app\n"
msgstr ""
+"# 更新系统包\n"
+"sudo apt-get update && sudo apt-get upgrade -y\n"
+"\n"
+"# 更新 Docker 镜像\n"
+"docker -H ssh://docker-web service update --image ${IMAGE}:${IMAGE_TAG} ${STACK_NAME}_app\n"
#. type: Title ##
#: ../src/cookbook/deployment/docker-swarm-caddy.md
@@ -1007,20 +1023,20 @@ msgstr ""
#: ../src/guide/views/asset.md
#, no-wrap
msgid "Troubleshooting"
-msgstr ""
+msgstr "故障排除"
#. type: Title ###
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
#, no-wrap
msgid "Service won't start"
-msgstr ""
+msgstr "服务无法启动"
#. type: Plain text
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
msgid "Check service events and logs:"
-msgstr ""
+msgstr "检查服务事件和日志:"
#. type: Fenced code block (bash)
#: ../src/cookbook/deployment/docker-swarm-caddy.md
@@ -1035,32 +1051,32 @@ msgstr ""
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
msgid "Common issues: - **Image pull errors**: Verify registry authentication with `docker -H ssh://docker-web login` - **Port conflicts**: Ensure no other services are using ports 80/443 - **Resource constraints**: Check available resources with `docker -H ssh://docker-web node ls`"
-msgstr ""
+msgstr "常见问题:- **镜像拉取错误**:使用 `docker -H ssh://docker-web login` 验证注册表身份验证 - **端口冲突**:确保没有其他服务使用端口 80/443 - **资源约束**:使用 `docker -H ssh://docker-web node ls` 检查可用资源"
#. type: Title ###
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
#, no-wrap
msgid "SSL certificate issues"
-msgstr ""
+msgstr "SSL 证书问题"
#. type: Plain text
#: ../src/cookbook/deployment/docker-swarm-caddy.md
msgid "If Caddy can't obtain certificates: - Verify DNS is pointing to your server - Check that ports 80 and 443 are accessible from the internet - Ensure the email in the Let's Encrypt configuration is valid - Check logs: `docker -H ssh://docker-web service logs caddy`"
-msgstr ""
+msgstr "如果 Caddy 无法获取证书:- 验证 DNS 是否指向服务器 - 检查端口 80 和 443 是否可从互联网访问 - 确保 Let's Encrypt 配置中的电子邮件有效 - 检查日志:`docker -H ssh://docker-web service logs caddy`"
#. type: Title ###
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
#, no-wrap
msgid "Container registry connection issues"
-msgstr ""
+msgstr "容器注册表连接问题"
#. type: Plain text
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
msgid "Test registry connectivity:"
-msgstr ""
+msgstr "测试注册表连接:"
#. type: Fenced code block (bash)
#: ../src/cookbook/deployment/docker-swarm-caddy.md
@@ -1073,26 +1089,31 @@ msgid ""
"# From the server\n"
"docker -H ssh://docker-web pull git.example.com/username/myapp:latest\n"
msgstr ""
+"# 从本地机器\n"
+"docker pull git.example.com/username/myapp:latest\n"
+"\n"
+"# 从服务器\n"
+"docker -H ssh://docker-web pull git.example.com/username/myapp:latest\n"
#. type: Title ##
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
#, no-wrap
msgid "Summary"
-msgstr ""
+msgstr "总结"
#. type: Plain text
#: ../src/cookbook/deployment/docker-swarm-caddy.md
msgid "You've successfully deployed a Yii application to Docker Swarm with: - A container registry (Forgejo or Gitea) - Automatic HTTPS via Caddy - Zero-downtime deployments with rolling updates - High availability with multiple replicas"
-msgstr ""
+msgstr "你已成功将 Yii 应用程序部署到 Docker Swarm,包括:- 容器注册表(Forgejo 或 Gitea)- 通过 Caddy 自动启用 HTTPS - 通过滚动更新实现零停机部署 - 通过多个副本实现高可用性"
#. type: Plain text
#: ../src/cookbook/deployment/docker-swarm-caddy.md
#: ../src/cookbook/deployment/docker-swarm-traefik.md
msgid "The Makefile commands simplify the deployment workflow: - `make prod-build` - Build the production image - `make prod-push` - Push to the registry - `make prod-deploy` - Deploy to Docker Swarm"
-msgstr ""
+msgstr "Makefile 命令简化了部署工作流程:- `make prod-build` - 构建生产镜像 - `make prod-push` - 推送到注册表 - `make prod-deploy` - 部署到 Docker Swarm"
#. type: Plain text
#: ../src/cookbook/deployment/docker-swarm-caddy.md
msgid "For more information, see: - [Yii Application Template](https://github.com/yiisoft/app) - [Docker Swarm Documentation](https://docs.docker.com/engine/swarm/) - [Caddy Docker Proxy](https://github.com/lucaslorentz/caddy-docker-proxy)"
-msgstr ""
+msgstr "有关更多信息,请参阅:- [Yii 应用程序模板](https://github.com/yiisoft/app) - [Docker Swarm 文档](https://docs.docker.com/engine/swarm/) - [Caddy Docker Proxy](https://github.com/lucaslorentz/caddy-docker-proxy)"
diff --git a/_translations/po/zh-CN/cookbook_deployment_docker-swarm-traefik.md.po b/_translations/po/zh-CN/cookbook_deployment_docker-swarm-traefik.md.po
index e86fda62..dda4dc99 100644
--- a/_translations/po/zh-CN/cookbook_deployment_docker-swarm-traefik.md.po
+++ b/_translations/po/zh-CN/cookbook_deployment_docker-swarm-traefik.md.po
@@ -887,12 +887,12 @@ msgstr ""
#: ../src/cookbook/deployment/docker-swarm-traefik.md
#, no-wrap
msgid "Deploying Yii applications to Docker Swarm and Traefik"
-msgstr ""
+msgstr "将 Yii 应用部署到 Docker Swarm 和 Traefik"
#. type: Plain text
#: ../src/cookbook/deployment/docker-swarm-traefik.md
msgid "This guide walks you through deploying a Yii application to [Docker Swarm](https://docs.docker.com/engine/swarm/) starting from a blank server, using [Traefik](https://traefik.io/traefik) as a reverse proxy and deploying from a container registry ([Forgejo](https://forgejo.org/) or [Gitea](https://about.gitea.com/))."
-msgstr ""
+msgstr "本指南将引导你从空白服务器开始,使用 [Traefik](https://traefik.io/traefik) 作为反向代理,从容器注册表([Forgejo](https://forgejo.org/) 或 [Gitea](https://about.gitea.com/))部署 Yii 应用程序到 [Docker Swarm](https://docs.docker.com/engine/swarm/)。"
#. type: Fenced code block (mermaid)
#: ../src/cookbook/deployment/docker-swarm-traefik.md
@@ -914,12 +914,12 @@ msgstr ""
#: ../src/cookbook/deployment/docker-swarm-traefik.md
#, no-wrap
msgid "Setting up Traefik as reverse proxy"
-msgstr ""
+msgstr "设置 Traefik 作为反向代理"
#. type: Plain text
#: ../src/cookbook/deployment/docker-swarm-traefik.md
msgid "To deploy Traefik as reverse proxy create a file `traefik-stack.yml`:"
-msgstr ""
+msgstr "要将 Traefik 部署为反向代理,请创建文件 `traefik-stack.yml`:"
#. type: Fenced code block (yaml)
#: ../src/cookbook/deployment/docker-swarm-traefik.md
@@ -963,7 +963,7 @@ msgstr ""
#. type: Plain text
#: ../src/cookbook/deployment/docker-swarm-traefik.md
msgid "Deploy Traefik:"
-msgstr ""
+msgstr "部署 Traefik:"
#. type: Fenced code block (bash)
#: ../src/cookbook/deployment/docker-swarm-traefik.md
@@ -1003,7 +1003,7 @@ msgstr ""
#. type: Plain text
#: ../src/cookbook/deployment/docker-swarm-traefik.md
msgid "After deployment, access Forgejo at `https://git.example.com` and complete the initial setup. Make sure to enable the container registry in the settings."
-msgstr ""
+msgstr "部署后,访问 `https://git.example.com` 上的 Forgejo 并完成初始设置。确保在设置中启用容器注册表。"
#. type: Fenced code block (yaml)
#: ../src/cookbook/deployment/docker-swarm-traefik.md
@@ -1037,7 +1037,7 @@ msgstr ""
#. type: Plain text
#: ../src/cookbook/deployment/docker-swarm-traefik.md
msgid "When using Traefik, you'll need to modify the Yii application's `docker/prod/compose.yml` to use Traefik labels instead of Caddy labels:"
-msgstr ""
+msgstr "使用 Traefik 时,你需要修改 Yii 应用程序的 `docker/prod/compose.yml` 以使用 Traefik 标签而不是 Caddy 标签:"
#. type: Fenced code block (yaml)
#: ../src/cookbook/deployment/docker-swarm-traefik.md
@@ -1085,14 +1085,14 @@ msgstr ""
#. type: Plain text
#: ../src/cookbook/deployment/docker-swarm-traefik.md
msgid "If Traefik can't obtain certificates: - Verify DNS is pointing to your server - Check that ports 80 and 443 are accessible from the internet - Ensure the email in the Let's Encrypt configuration is valid - Check logs: `docker -H ssh://docker-web service logs traefik_traefik`"
-msgstr ""
+msgstr "如果 Traefik 无法获取证书:- 验证 DNS 是否指向服务器 - 检查端口 80 和 443 是否可从互联网访问 - 确保 Let's Encrypt 配置中的电子邮件有效 - 检查日志:`docker -H ssh://docker-web service logs traefik_traefik`"
#. type: Plain text
#: ../src/cookbook/deployment/docker-swarm-traefik.md
msgid "You've successfully deployed a Yii application to Docker Swarm with: - A container registry (Forgejo or Gitea) - Automatic HTTPS via Traefik - Zero-downtime deployments with rolling updates - High availability with multiple replicas"
-msgstr ""
+msgstr "你已成功将 Yii 应用程序部署到 Docker Swarm,包括:- 容器注册表(Forgejo 或 Gitea)- 通过 Traefik 自动启用 HTTPS - 通过滚动更新实现零停机部署 - 通过多个副本实现高可用性"
#. type: Plain text
#: ../src/cookbook/deployment/docker-swarm-traefik.md
msgid "For more information, see: - [Yii Application Template](https://github.com/yiisoft/app) - [Docker Swarm Documentation](https://docs.docker.com/engine/swarm/) - [Traefik Documentation](https://doc.traefik.io/traefik/)"
-msgstr ""
+msgstr "有关更多信息,请参阅:- [Yii 应用程序模板](https://github.com/yiisoft/app) - [Docker Swarm 文档](https://docs.docker.com/engine/swarm/) - [Traefik 文档](https://doc.traefik.io/traefik/)"
diff --git a/_translations/po/zh-CN/cookbook_deployment_docker-swarm.md.po b/_translations/po/zh-CN/cookbook_deployment_docker-swarm.md.po
index 11b219e1..6e1c1908 100644
--- a/_translations/po/zh-CN/cookbook_deployment_docker-swarm.md.po
+++ b/_translations/po/zh-CN/cookbook_deployment_docker-swarm.md.po
@@ -19,14 +19,14 @@ msgstr ""
#: ../src/cookbook/deployment/docker-swarm.md
#, no-wrap
msgid "Deploying Yii applications to Docker Swarm"
-msgstr ""
+msgstr "将 Yii 应用部署到 Docker Swarm"
#. type: Bullet: '- '
#: ../src/cookbook/deployment/docker-swarm.md
msgid "[Using Caddy](docker-swarm-caddy.md)"
-msgstr ""
+msgstr "[使用 Caddy](docker-swarm-caddy.md)"
#. type: Bullet: '- '
#: ../src/cookbook/deployment/docker-swarm.md
msgid "[Using Traefik](docker-swarm-traefik.md)"
-msgstr ""
+msgstr "[使用 Traefik](docker-swarm-traefik.md)"
diff --git a/_translations/po/zh-CN/cookbook_disabling-csrf-protection.md.po b/_translations/po/zh-CN/cookbook_disabling-csrf-protection.md.po
index 1b816d30..fbde9a72 100644
--- a/_translations/po/zh-CN/cookbook_disabling-csrf-protection.md.po
+++ b/_translations/po/zh-CN/cookbook_disabling-csrf-protection.md.po
@@ -21,97 +21,97 @@ msgstr ""
#: ../src/cookbook/disabling-csrf-protection.md
#, no-wrap
msgid "Security considerations"
-msgstr ""
+msgstr "安全注意事项"
#. type: Title #
#: ../src/cookbook/disabling-csrf-protection.md
#, no-wrap
msgid "Disabling CSRF protection"
-msgstr ""
+msgstr "禁用 CSRF 保护"
#. type: Title ##
#: ../src/cookbook/disabling-csrf-protection.md
#, no-wrap
msgid "What is CSRF protection?"
-msgstr ""
+msgstr "什么是 CSRF 保护?"
#. type: Plain text
#: ../src/cookbook/disabling-csrf-protection.md
msgid "Cross-Site Request Forgery (CSRF) protection is a security mechanism that prevents malicious websites from making unauthorized requests on behalf of authenticated users. Yii3 includes built-in CSRF protection through the `Yiisoft\\Yii\\Web\\Middleware\\Csrf` middleware."
-msgstr ""
+msgstr "跨站请求伪造(CSRF)保护是一种安全机制,可防止恶意网站代表已认证用户发出未经授权的请求。Yii3 通过 `Yiisoft\\Yii\\Web\\Middleware\\Csrf` 中间件提供内置的 CSRF 保护。"
#. type: Plain text
#: ../src/cookbook/disabling-csrf-protection.md
msgid "For a comprehensive understanding of CSRF attacks and protection mechanisms, see the [Security best practices](../guide/security/best-practices.md#avoiding-csrf) section in the main guide."
-msgstr ""
+msgstr "要全面了解 CSRF 攻击和保护机制,请参阅主指南中的[安全最佳实践](../guide/security/best-practices.md#avoiding-csrf)部分。"
#. type: Title ##
#: ../src/cookbook/disabling-csrf-protection.md
#, no-wrap
msgid "When to disable CSRF protection"
-msgstr ""
+msgstr "何时禁用 CSRF 保护"
#. type: Plain text
#: ../src/cookbook/disabling-csrf-protection.md
msgid "While CSRF protection should generally remain enabled for web applications, there are specific scenarios where you might need to disable it:"
-msgstr ""
+msgstr "虽然 Web 应用程序通常应保持启用 CSRF 保护,但在某些特定场景下你可能需要禁用它:"
#. type: Title ###
#: ../src/cookbook/disabling-csrf-protection.md
#, no-wrap
msgid "When external systems cannot provide CSRF tokens"
-msgstr ""
+msgstr "当外部系统无法提供 CSRF 令牌时"
#. type: Plain text
#: ../src/cookbook/disabling-csrf-protection.md
msgid "When building APIs or handling automated requests from external systems, CSRF protection can interfere with legitimate requests since these systems cannot provide valid CSRF tokens:"
-msgstr ""
+msgstr "在构建 API 或处理来自外部系统的自动化请求时,CSRF 保护可能会干扰合法请求,因为这些系统无法提供有效的 CSRF 令牌:"
#. type: Bullet: '- '
#: ../src/cookbook/disabling-csrf-protection.md
msgid "**Third-party integrations**: External services cannot provide valid CSRF tokens"
-msgstr ""
+msgstr "**第三方集成**:外部服务无法提供有效的 CSRF 令牌"
#. type: Bullet: '- '
#: ../src/cookbook/disabling-csrf-protection.md
msgid "**Mobile applications**: Native mobile apps typically don't use cookies or sessions in the same way as web browsers"
-msgstr ""
+msgstr "**移动应用程序**:原生移动应用通常不像 Web 浏览器那样使用 cookie 或会话"
#. type: Bullet: '- '
#: ../src/cookbook/disabling-csrf-protection.md
msgid "**Server-to-server communication**: API endpoints designed for machine-to-machine communication"
-msgstr ""
+msgstr "**服务器到服务器通信**:为机器对机器通信设计的 API 端点"
#. type: Bullet: '- '
#: ../src/cookbook/disabling-csrf-protection.md
msgid "**Payment processors**: PayPal, Stripe, and other payment systems send webhook notifications"
-msgstr ""
+msgstr "**支付处理器**:PayPal、Stripe 和其他支付系统发送 webhook 通知"
#. type: Bullet: '- '
#: ../src/cookbook/disabling-csrf-protection.md
msgid "**Version control systems**: GitHub, GitLab webhooks for CI/CD pipelines"
-msgstr ""
+msgstr "**版本控制系统**:用于 CI/CD 流水线的 GitHub、GitLab webhook"
#. type: Bullet: '- '
#: ../src/cookbook/disabling-csrf-protection.md
msgid "**Social media platforms**: Twitter, Facebook webhook notifications"
-msgstr ""
+msgstr "**社交媒体平台**:Twitter、Facebook webhook 通知"
#. type: Bullet: '- '
#: ../src/cookbook/disabling-csrf-protection.md
msgid "**Communication services**: Slack, Discord bot integrations"
-msgstr ""
+msgstr "**通信服务**:Slack、Discord 机器人集成"
#. type: Title ##
#: ../src/cookbook/disabling-csrf-protection.md
#, no-wrap
msgid "How to disable CSRF protection"
-msgstr ""
+msgstr "如何禁用 CSRF 保护"
#. type: Plain text
#: ../src/cookbook/disabling-csrf-protection.md
msgid "First, you need to remove CSRF middleware from your main application middleware list in `config/web/di/application.php`:"
-msgstr ""
+msgstr "首先,你需要从 `config/web/di/application.php` 中的主应用程序中间件列表中删除 CSRF 中间件:"
#. type: Fenced code block (php)
#: ../src/cookbook/disabling-csrf-protection.md
@@ -132,7 +132,7 @@ msgstr ""
#. type: Plain text
#: ../src/cookbook/disabling-csrf-protection.md
msgid "Now, if you need to leave CSRF on for specific routes or route groups, you can do so by adding the `CsrfMiddleware` middleware to the router configuration in `config/common/routes.php`. For a group that would be the following:"
-msgstr ""
+msgstr "现在,如果你需要为特定路由或路由组保留 CSRF 保护,可以通过在 `config/common/routes.php` 的路由器配置中添加 `CsrfMiddleware` 中间件来实现。对于路由组,配置如下:"
#. type: Fenced code block (php)
#: ../src/cookbook/disabling-csrf-protection.md
@@ -147,7 +147,7 @@ msgstr ""
#. type: Plain text
#: ../src/cookbook/disabling-csrf-protection.md
msgid "For a single route, you can add the middleware directly to the route:"
-msgstr ""
+msgstr "对于单个路由,你可以直接将中间件添加到路由:"
#. type: Fenced code block (php)
#: ../src/cookbook/disabling-csrf-protection.md
@@ -162,75 +162,75 @@ msgstr ""
#. type: Plain text
#: ../src/cookbook/disabling-csrf-protection.md
msgid "When disabling CSRF protection, keep these security considerations in mind:"
-msgstr ""
+msgstr "禁用 CSRF 保护时,请牢记以下安全注意事项:"
#. type: Title ###
#: ../src/cookbook/disabling-csrf-protection.md
#, no-wrap
msgid "Alternative authentication methods"
-msgstr ""
+msgstr "替代身份验证方法"
#. type: Plain text
#: ../src/cookbook/disabling-csrf-protection.md
msgid "For API endpoints, implement proper authentication mechanisms:"
-msgstr ""
+msgstr "对于 API 端点,实施适当的身份验证机制:"
#. type: Bullet: '- '
#: ../src/cookbook/disabling-csrf-protection.md
msgid "**API keys**: Require API keys for authentication"
-msgstr ""
+msgstr "**API 密钥**:要求使用 API 密钥进行身份验证"
#. type: Bullet: '- '
#: ../src/cookbook/disabling-csrf-protection.md
msgid "**Bearer tokens**: Use JWT or similar token-based authentication"
-msgstr ""
+msgstr "**Bearer 令牌**:使用 JWT 或类似的基于令牌的身份验证"
#. type: Bullet: '- '
#: ../src/cookbook/disabling-csrf-protection.md
msgid "**OAuth 2.0**: Implement OAuth 2.0 for third-party access"
-msgstr ""
+msgstr "**OAuth 2.0**:为第三方访问实施 OAuth 2.0"
#. type: Bullet: '- '
#: ../src/cookbook/disabling-csrf-protection.md
msgid "**IP whitelisting**: Restrict access to known IP addresses for webhooks"
-msgstr ""
+msgstr "**IP 白名单**:将 webhook 的访问限制为已知的 IP 地址"
#. type: Title ###
#: ../src/cookbook/disabling-csrf-protection.md
#, no-wrap
msgid "Request validation"
-msgstr ""
+msgstr "请求验证"
#. type: Plain text
#: ../src/cookbook/disabling-csrf-protection.md
msgid "Implement additional validation for requests without CSRF protection:"
-msgstr ""
+msgstr "为没有 CSRF 保护的请求实施额外的验证:"
#. type: Bullet: '- '
#: ../src/cookbook/disabling-csrf-protection.md
msgid "**Signature verification**: Verify webhook signatures (e.g., GitHub's X-Hub-Signature)"
-msgstr ""
+msgstr "**签名验证**:验证 webhook 签名(例如,GitHub 的 X-Hub-Signature)"
#. type: Bullet: '- '
#: ../src/cookbook/disabling-csrf-protection.md
msgid "**Timestamp validation**: Check request timestamps to prevent replay attacks"
-msgstr ""
+msgstr "**时间戳验证**:检查请求时间戳以防止重放攻击"
#. type: Bullet: '- '
#: ../src/cookbook/disabling-csrf-protection.md
msgid "**Rate limiting**: Implement rate limiting to prevent abuse"
-msgstr ""
+msgstr "**速率限制**:实施速率限制以防止滥用"
#. type: Bullet: '- '
#: ../src/cookbook/disabling-csrf-protection.md
msgid "**Input validation**: Strictly validate all input parameters"
-msgstr ""
+msgstr "**输入验证**:严格验证所有输入参数"
#. type: Title ###
#: ../src/cookbook/disabling-csrf-protection.md
#, no-wrap
msgid "Example: Webhook signature verification"
-msgstr ""
+msgstr "示例:Webhook 签名验证"
#. type: Fenced code block (php)
#: ../src/cookbook/disabling-csrf-protection.md
@@ -267,45 +267,45 @@ msgstr ""
#: ../src/cookbook/making-http-requests.md
#, no-wrap
msgid "Best practices"
-msgstr ""
+msgstr "最佳实践"
#. type: Bullet: '1. '
#: ../src/cookbook/disabling-csrf-protection.md
msgid "**Minimize exposure**: Only disable CSRF protection where absolutely necessary"
-msgstr ""
+msgstr "**最小化暴露**:仅在绝对必要时禁用 CSRF 保护"
#. type: Bullet: '2. '
#: ../src/cookbook/disabling-csrf-protection.md
msgid "**Use HTTPS**: Always use HTTPS for API endpoints and webhooks"
-msgstr ""
+msgstr "**使用 HTTPS**:始终对 API 端点和 webhook 使用 HTTPS"
#. type: Bullet: '3. '
#: ../src/cookbook/disabling-csrf-protection.md
msgid "**Monitor logs**: Log all requests to API endpoints for security monitoring"
-msgstr ""
+msgstr "**监控日志**:记录所有对 API 端点的请求以进行安全监控"
#. type: Bullet: '4. '
#: ../src/cookbook/disabling-csrf-protection.md
msgid "**Regular security audits**: Periodically review your API endpoints and their security measures"
-msgstr ""
+msgstr "**定期安全审计**:定期审查你的 API 端点及其安全措施"
#. type: Bullet: '5. '
#: ../src/cookbook/disabling-csrf-protection.md
msgid "**Documentation**: Clearly document which endpoints have CSRF protection disabled and why"
-msgstr ""
+msgstr "**文档记录**:清楚地记录哪些端点禁用了 CSRF 保护以及原因"
#. type: Title ##
#: ../src/cookbook/disabling-csrf-protection.md
#, no-wrap
msgid "Conclusion"
-msgstr ""
+msgstr "结论"
#. type: Plain text
#: ../src/cookbook/disabling-csrf-protection.md
msgid "While CSRF protection is crucial for web applications, there are legitimate scenarios where it needs to be disabled, particularly for external APIs and webhooks. When disabling CSRF protection, always implement alternative security measures and follow security best practices to maintain the overall security of your application."
-msgstr ""
+msgstr "虽然 CSRF 保护对 Web 应用程序至关重要,但在某些合法场景下需要禁用它,特别是对于外部 API 和 webhook。禁用 CSRF 保护时,始终实施替代安全措施并遵循安全最佳实践,以维护应用程序的整体安全性。"
#. type: Plain text
#: ../src/cookbook/disabling-csrf-protection.md
msgid "Remember that disabling CSRF protection increases security risks, so careful consideration and proper implementation of alternative security measures are essential."
-msgstr ""
+msgstr "请记住,禁用 CSRF 保护会增加安全风险,因此仔细考虑并正确实施替代安全措施至关重要。"
diff --git a/_translations/po/zh-CN/cookbook_index.md.po b/_translations/po/zh-CN/cookbook_index.md.po
index eee76180..c94932e7 100644
--- a/_translations/po/zh-CN/cookbook_index.md.po
+++ b/_translations/po/zh-CN/cookbook_index.md.po
@@ -19,64 +19,64 @@ msgstr ""
#: ../src/cookbook/index.md
#, no-wrap
msgid "Yii3 community cookbook"
-msgstr ""
+msgstr "Yii3 社区手册"
#. type: Plain text
#: ../src/cookbook/index.md
msgid "Yii3 Community Cookbook is an OpenSource book full of tips and tricks about the [Yii3](https://www.yiiframework.com/) PHP framework."
-msgstr ""
+msgstr "Yii3 社区手册是一本开源书籍,包含了关于 [Yii3](https://www.yiiframework.com/) PHP 框架的技巧和窍门。"
#. type: Bullet: '- '
#: ../src/cookbook/index.md
msgid "The Yii community creates the cookbook."
-msgstr ""
+msgstr "Yii 社区创建了这本手册。"
#. type: Bullet: '- '
#: ../src/cookbook/index.md
msgid "Yii core team members curate and edit it."
-msgstr ""
+msgstr "Yii 核心团队成员负责策划和编辑。"
#. type: Plain text
#: ../src/cookbook/index.md
msgid "Feel free to pull-request your own writings. Team members will review it, give feedback and merge the best possible way."
-msgstr ""
+msgstr "欢迎提交你自己的文章。团队成员将审查它,提供反馈并以最佳方式合并。"
#. type: Plain text
#: ../src/cookbook/index.md
msgid "This book conforms to the [Terms of Yii Documentation](https://www.yiiframework.com/license#docs)."
-msgstr ""
+msgstr "本书遵循 [Yii 文档条款](https://www.yiiframework.com/license#docs)。"
#. type: Bullet: '- '
#: ../src/cookbook/index.md
msgid "[Preface](preface.md)"
-msgstr ""
+msgstr "[前言](preface.md)"
#. type: Bullet: '- '
#: ../src/cookbook/index.md
msgid "[Structuring code by use-case with vertical slices](organizing-code/structuring-by-use-case-with-vertical-slices.md)"
-msgstr ""
+msgstr "[使用垂直切片按用例组织代码](organizing-code/structuring-by-use-case-with-vertical-slices.md)"
#. type: Bullet: '- '
#: ../src/cookbook/index.md
msgid "[Making HTTP requests](making-http-requests.md)"
-msgstr ""
+msgstr "[发起 HTTP 请求](making-http-requests.md)"
#. type: Bullet: '- '
#: ../src/cookbook/index.md
msgid "[Disabling CSRF protection](disabling-csrf-protection.md)"
-msgstr ""
+msgstr "[禁用 CSRF 保护](disabling-csrf-protection.md)"
#. type: Bullet: '- '
#: ../src/cookbook/index.md
msgid "[Sentry integration](sentry-integration.md)"
-msgstr ""
+msgstr "[Sentry 集成](sentry-integration.md)"
#. type: Bullet: '- '
#: ../src/cookbook/index.md
msgid "[Configuring webservers](configuring-webservers/general.md)"
-msgstr ""
+msgstr "[配置 Web 服务器](configuring-webservers/general.md)"
#. type: Bullet: '- '
#: ../src/cookbook/index.md
msgid "[Deploying to Docker Swarm](deployment/docker-swarm.md)"
-msgstr ""
+msgstr "[部署到 Docker Swarm](deployment/docker-swarm.md)"
diff --git a/_translations/po/zh-CN/cookbook_making-http-requests.md.po b/_translations/po/zh-CN/cookbook_making-http-requests.md.po
index 3486e815..4e6974ba 100644
--- a/_translations/po/zh-CN/cookbook_making-http-requests.md.po
+++ b/_translations/po/zh-CN/cookbook_making-http-requests.md.po
@@ -20,49 +20,49 @@ msgstr ""
#: ../src/en/cookbook/making-http-requests.md
#, no-wrap
msgid "Best practices"
-msgstr ""
+msgstr "最佳实践"
#. type: Title #
#: ../src/en/cookbook/making-http-requests.md
#, no-wrap
msgid "Making HTTP requests"
-msgstr ""
+msgstr "发起 HTTP 请求"
#. type: Plain text
#: ../src/en/cookbook/making-http-requests.md
msgid "When building modern applications, you often need to make HTTP requests to external APIs. This article demonstrates how to make HTTP requests in Yii3 applications using Guzzle with and [PSR interfaces](https://www.php-fig.org/psr/)."
-msgstr ""
+msgstr "在构建现代应用程序时,你经常需要向外部 API 发起 HTTP 请求。本文演示如何在 Yii3 应用程序中使用 Guzzle 和 [PSR 接口](https://www.php-fig.org/psr/)发起 HTTP 请求。"
#. type: Title ##
#: ../src/en/cookbook/making-http-requests.md
#, no-wrap
msgid "What are PSR interfaces for HTTP"
-msgstr ""
+msgstr "什么是 HTTP 的 PSR 接口"
#. type: Plain text
#: ../src/en/cookbook/making-http-requests.md
msgid "The PHP-FIG (PHP Framework Interoperability Group) has defined several PSR standards for HTTP handling:"
-msgstr ""
+msgstr "PHP-FIG(PHP 框架互操作性组)为 HTTP 处理定义了几个 PSR 标准:"
#. type: Bullet: '- '
#: ../src/en/cookbook/making-http-requests.md
msgid "**PSR-7**: HTTP message interfaces for requests and responses"
-msgstr ""
+msgstr "**PSR-7**:用于请求和响应的 HTTP 消息接口"
#. type: Bullet: '- '
#: ../src/en/cookbook/making-http-requests.md
msgid "**PSR-17**: HTTP factory interfaces for creating PSR-7 message objects"
-msgstr ""
+msgstr "**PSR-17**:用于创建 PSR-7 消息对象的 HTTP 工厂接口"
#. type: Bullet: '- '
#: ../src/en/cookbook/making-http-requests.md
msgid "**PSR-18**: HTTP client interface for sending PSR-7 requests and returning PSR-7 responses"
-msgstr ""
+msgstr "**PSR-18**:用于发送 PSR-7 请求并返回 PSR-7 响应的 HTTP 客户端接口"
#. type: Plain text
#: ../src/en/cookbook/making-http-requests.md
msgid "Using these interfaces ensures your code is framework-agnostic and follows established PHP standards."
-msgstr ""
+msgstr "使用这些接口可以确保你的代码与框架无关,并遵循已建立的 PHP 标准。"
#. type: Title ##
#: ../src/en/cookbook/making-http-requests.md
@@ -73,12 +73,12 @@ msgstr ""
#: ../src/en/guide/views/widget.md
#, no-wrap
msgid "Installation"
-msgstr ""
+msgstr "安装"
#. type: Plain text
#: ../src/en/cookbook/making-http-requests.md
msgid "Install the Guzzle HTTP client with PSR-18 support and PSR-17 factories:"
-msgstr ""
+msgstr "安装支持 PSR-18 和 PSR-17 工厂的 Guzzle HTTP 客户端:"
#. type: Fenced code block (shell)
#: ../src/en/cookbook/making-http-requests.md
@@ -92,18 +92,18 @@ msgstr ""
#: ../src/en/cookbook/making-http-requests.md
#, no-wrap
msgid "Basic usage"
-msgstr ""
+msgstr "基本用法"
#. type: Title ###
#: ../src/en/cookbook/making-http-requests.md
#, no-wrap
msgid "Simple GET request"
-msgstr ""
+msgstr "简单的 GET 请求"
#. type: Plain text
#: ../src/en/cookbook/making-http-requests.md
msgid "Here's how to make a basic GET request using PSR-18 interfaces:"
-msgstr ""
+msgstr "以下是如何使用 PSR-18 接口发起基本 GET 请求:"
#. type: Fenced code block (php)
#: ../src/en/cookbook/making-http-requests.md
@@ -141,12 +141,12 @@ msgstr ""
#: ../src/en/cookbook/making-http-requests.md
#, no-wrap
msgid "POST request with JSON data"
-msgstr ""
+msgstr "带 JSON 数据的 POST 请求"
#. type: Plain text
#: ../src/en/cookbook/making-http-requests.md
msgid "Here's an example of making a POST request with JSON payload:"
-msgstr ""
+msgstr "以下是发起带 JSON 负载的 POST 请求的示例:"
#. type: Fenced code block (php)
#: ../src/en/cookbook/making-http-requests.md
@@ -189,19 +189,19 @@ msgstr ""
#: ../src/en/cookbook/making-http-requests.md
#, no-wrap
msgid "Configuration in Yii3"
-msgstr ""
+msgstr "在 Yii3 中的配置"
#. type: Title ###
#: ../src/en/cookbook/making-http-requests.md
#: ../src/en/guide/concept/configuration.md
#, no-wrap
msgid "Container configuration"
-msgstr ""
+msgstr "容器配置"
#. type: Plain text
#: ../src/en/cookbook/making-http-requests.md
msgid "Configure the HTTP client and PSR factories in your DI container:"
-msgstr ""
+msgstr "在 DI 容器中配置 HTTP 客户端和 PSR 工厂:"
#. type: Fenced code block (php)
#: ../src/en/cookbook/making-http-requests.md
@@ -251,12 +251,12 @@ msgstr ""
#: ../src/en/cookbook/making-http-requests.md
#, no-wrap
msgid "Service with error handling"
-msgstr ""
+msgstr "带错误处理的服务"
#. type: Plain text
#: ../src/en/cookbook/making-http-requests.md
msgid "Here's a more robust service example with proper error handling:"
-msgstr ""
+msgstr "以下是一个更健壮的服务示例,具有适当的错误处理:"
#. type: Fenced code block (php)
#: ../src/en/cookbook/making-http-requests.md
@@ -324,18 +324,18 @@ msgstr ""
#: ../src/en/cookbook/making-http-requests.md
#, no-wrap
msgid "Advanced usage"
-msgstr ""
+msgstr "高级用法"
#. type: Title ###
#: ../src/en/cookbook/making-http-requests.md
#, no-wrap
msgid "Using middlewares"
-msgstr ""
+msgstr "使用中间件"
#. type: Plain text
#: ../src/en/cookbook/making-http-requests.md
msgid "Guzzle supports middleware for cross-cutting concerns like authentication, logging, or retrying:"
-msgstr ""
+msgstr "Guzzle 支持用于横切关注点的中间件,如身份验证、日志记录或重试:"
#. type: Fenced code block (php)
#: ../src/en/cookbook/making-http-requests.md
@@ -387,18 +387,18 @@ msgstr ""
#: ../src/en/cookbook/making-http-requests.md
#, no-wrap
msgid "Async requests"
-msgstr ""
+msgstr "异步请求"
#. type: Plain text
#: ../src/en/cookbook/making-http-requests.md
msgid "For better performance when making multiple requests, you can use asynchronous requests:"
-msgstr ""
+msgstr "为了在发起多个请求时获得更好的性能,你可以使用异步请求:"
#. type: Plain text
#: ../src/en/cookbook/making-http-requests.md
#, no-wrap
msgid "> **Note**: Async functionality is not part of PSR interfaces, so this code depends on Guzzle explicitly.\n"
-msgstr ""
+msgstr "> **Note**:异步功能不是 PSR 接口的一部分,因此此代码明确依赖于 Guzzle。\n"
#. type: Fenced code block (php)
#: ../src/en/cookbook/making-http-requests.md
@@ -452,12 +452,12 @@ msgstr ""
#: ../src/en/cookbook/making-http-requests.md
#, no-wrap
msgid "Testing HTTP clients"
-msgstr ""
+msgstr "测试 HTTP 客户端"
#. type: Plain text
#: ../src/en/cookbook/making-http-requests.md
msgid "When testing services that make HTTP requests, you can use Guzzle's MockHandler:"
-msgstr ""
+msgstr "在测试发起 HTTP 请求的服务时,你可以使用 Guzzle 的 MockHandler:"
#. type: Fenced code block (php)
#: ../src/en/cookbook/making-http-requests.md
@@ -507,34 +507,34 @@ msgstr ""
#. type: Bullet: '1. '
#: ../src/en/cookbook/making-http-requests.md
msgid "**Use PSR interfaces**: Always type-hint against PSR interfaces rather than concrete implementations for better testability and flexibility."
-msgstr ""
+msgstr "**使用 PSR 接口**:始终针对 PSR 接口进行类型提示,而不是具体实现,以获得更好的可测试性和灵活性。"
#. type: Bullet: '2. '
#: ../src/en/cookbook/making-http-requests.md
msgid "**Handle errors gracefully**: Always wrap HTTP requests in try-catch blocks and handle network failures appropriately."
-msgstr ""
+msgstr "**优雅地处理错误**:始终将 HTTP 请求包装在 try-catch 块中,并适当处理网络故障。"
#. type: Bullet: '3. '
#: ../src/en/cookbook/making-http-requests.md
msgid "**Configure timeouts**: Set reasonable connection and request timeouts to prevent hanging requests."
-msgstr ""
+msgstr "**配置超时**:设置合理的连接和请求超时,以防止请求挂起。"
#. type: Bullet: '4. '
#: ../src/en/cookbook/making-http-requests.md
msgid "**Log requests**: Use middleware or manual logging to track API calls for debugging and monitoring."
-msgstr ""
+msgstr "**记录请求**:使用中间件或手动日志记录来跟踪 API 调用,以便调试和监控。"
#. type: Bullet: '5. '
#: ../src/en/cookbook/making-http-requests.md
msgid "**Use dependency injection**: Inject HTTP clients and factories through your DI container rather than creating them directly."
-msgstr ""
+msgstr "**使用依赖注入**:通过 DI 容器注入 HTTP 客户端和工厂,而不是直接创建它们。"
#. type: Bullet: '6. '
#: ../src/en/cookbook/making-http-requests.md
msgid "**Mock in tests**: Use Guzzle's MockHandler or similar tools to test your HTTP client code without making real network requests."
-msgstr ""
+msgstr "**在测试中使用模拟**:使用 Guzzle 的 MockHandler 或类似工具来测试 HTTP 客户端代码,而无需发起真实的网络请求。"
#. type: Plain text
#: ../src/en/cookbook/making-http-requests.md
msgid "By following these patterns and using PSR interfaces, you'll create maintainable, testable, and interoperable HTTP client code in your Yii3 applications."
-msgstr ""
+msgstr "通过遵循这些模式并使用 PSR 接口,你将在 Yii3 应用程序中创建可维护、可测试和可互操作的 HTTP 客户端代码。"
diff --git a/_translations/po/zh-CN/cookbook_organizing-code_structuring-by-use-case-with-vertical-slices.md.po b/_translations/po/zh-CN/cookbook_organizing-code_structuring-by-use-case-with-vertical-slices.md.po
index a2915d32..92e71202 100644
--- a/_translations/po/zh-CN/cookbook_organizing-code_structuring-by-use-case-with-vertical-slices.md.po
+++ b/_translations/po/zh-CN/cookbook_organizing-code_structuring-by-use-case-with-vertical-slices.md.po
@@ -19,37 +19,37 @@ msgstr ""
#: ../src/cookbook/organizing-code/structuring-by-use-case-with-vertical-slices.md
#, no-wrap
msgid "Structuring code by use-case with vertical slices"
-msgstr ""
+msgstr "使用垂直切片按用例组织代码"
#. type: Plain text
#: ../src/cookbook/organizing-code/structuring-by-use-case-with-vertical-slices.md
msgid "When building an application, it's important to organize the code in a way that makes it easy to understand, support, and scale. One popular approach is to structure the code by use-case with vertical slices."
-msgstr ""
+msgstr "在构建应用程序时,以易于理解、支持和扩展的方式组织代码非常重要。一种流行的方法是使用垂直切片按用例组织代码。"
#. type: Plain text
#: ../src/cookbook/organizing-code/structuring-by-use-case-with-vertical-slices.md
msgid "Vertical slices are self-contained pieces of functionality that cover the entire stack, from the user interface to the data access layer. Developer organizes each slice around a specific use case, such as creating a new user or updating a product."
-msgstr ""
+msgstr "垂直切片是自包含的功能片段,涵盖整个技术栈,从用户界面到数据访问层。开发人员围绕特定用例组织每个切片,例如创建新用户或更新产品。"
#. type: Plain text
#: ../src/cookbook/organizing-code/structuring-by-use-case-with-vertical-slices.md
msgid "When structuring code classically by type (such as models, views, controllers, helpers, etc.), it can be easy to lose sight of the bigger picture and how different pieces of code interact to support specific features or use cases. This can lead to code duplication, tight coupling, and poor maintainability as the application grows."
-msgstr ""
+msgstr "当按类型(如模型、视图、控制器、辅助函数等)以经典方式组织代码时,很容易忽视全局以及不同代码片段如何交互以支持特定功能或用例。随着应用程序的增长,这可能导致代码重复、紧密耦合和可维护性差。"
#. type: Plain text
#: ../src/cookbook/organizing-code/structuring-by-use-case-with-vertical-slices.md
msgid "On the other hand, structuring code by use-case makes developers focus on a specific feature or workflow and understand how different pieces of code work together to support that feature. This approach also helps to keep related code together in a single directory, making it easier to navigate and support. Vertical slicing also encourages the use of domain-driven design concepts, such as entities, repositories, and services, which can help to promote good separation of concerns and modularity."
-msgstr ""
+msgstr "另一方面,按用例组织代码使开发人员专注于特定功能或工作流程,并理解不同代码片段如何协同工作以支持该功能。这种方法还有助于将相关代码保存在单个目录中,使其更易于导航和支持。垂直切片还鼓励使用领域驱动设计概念,如实体、仓储和服务,这有助于促进良好的关注点分离和模块化。"
#. type: Plain text
#: ../src/cookbook/organizing-code/structuring-by-use-case-with-vertical-slices.md
msgid "Additionally, structuring code by use-case can make it easier to test and debug the application since use-case namespace encapsulates each feature or workflow in its own directory with clear boundaries and well-defined interfaces."
-msgstr ""
+msgstr "此外,按用例组织代码可以使测试和调试应用程序变得更容易,因为用例命名空间将每个功能或工作流程封装在自己的目录中,具有清晰的边界和定义良好的接口。"
#. type: Plain text
#: ../src/cookbook/organizing-code/structuring-by-use-case-with-vertical-slices.md
msgid "Here's an example directory structure for a PHP application organized using vertical slices:"
-msgstr ""
+msgstr "以下是使用垂直切片组织的 PHP 应用程序的示例目录结构:"
#. type: Fenced code block
#: ../src/cookbook/organizing-code/structuring-by-use-case-with-vertical-slices.md
@@ -94,12 +94,12 @@ msgstr ""
#. type: Plain text
#: ../src/cookbook/organizing-code/structuring-by-use-case-with-vertical-slices.md
msgid "Each vertical slice has its own directory, which has code associated with the use case."
-msgstr ""
+msgstr "每个垂直切片都有自己的目录,其中包含与用例相关的代码。"
#. type: Plain text
#: ../src/cookbook/organizing-code/structuring-by-use-case-with-vertical-slices.md
msgid "The use-case subdirectories and their respective classes are organized by type within each directory, omitting a directory if there's a single class of the type. If code is shared between multiple use-cases, it's moved one level up such as `Model` or `Service`."
-msgstr ""
+msgstr "用例子目录及其各自的类在每个目录中按类型组织,如果某个类型只有一个类,则省略目录。如果代码在多个用例之间共享,则将其向上移动一级,例如 `Model` 或 `Service`。"
#. type: Title ##
#: ../src/cookbook/organizing-code/structuring-by-use-case-with-vertical-slices.md
@@ -110,9 +110,9 @@ msgstr ""
#: ../src/internals/008-interfaces.md
#, no-wrap
msgid "References"
-msgstr ""
+msgstr "参考资料"
#. type: Bullet: '- '
#: ../src/cookbook/organizing-code/structuring-by-use-case-with-vertical-slices.md
msgid "[Application structure overview](../../guide/structure/overview.md)"
-msgstr ""
+msgstr "[应用程序结构概述](../../guide/structure/overview.md)"
diff --git a/_translations/po/zh-CN/cookbook_preface.md.po b/_translations/po/zh-CN/cookbook_preface.md.po
index 5050f951..e28a3aa2 100644
--- a/_translations/po/zh-CN/cookbook_preface.md.po
+++ b/_translations/po/zh-CN/cookbook_preface.md.po
@@ -19,62 +19,62 @@ msgstr ""
#: ../src/en/cookbook/deployment/docker-swarm.md ../src/en/cookbook/preface.md
#, no-wrap
msgid "Prerequisites"
-msgstr ""
+msgstr "前提条件"
#. type: Title #
#: ../src/en/cookbook/preface.md
#, no-wrap
msgid "Preface"
-msgstr ""
+msgstr "前言"
#. type: Plain text
#: ../src/en/cookbook/preface.md ../src/en/guide/intro/what-is-yii.md
msgid "Yii is a high-performance, package-based PHP framework for developing modern applications. The name Yii (pronounced `Yee` or `[ji:]`) means \"simple and evolutionary\" in Chinese. You can also think about it as an acronym for **Yes It Is**!"
-msgstr ""
+msgstr "Yii 是一个高性能、基于包的 PHP 框架,用于开发现代应用程序。Yii(发音为 `Yee` 或 `[ji:]`)在中文中意为“简单且不断演进”。你也可以把它看作是 **Yes It Is**(是的,就是它)的首字母缩写!"
#. type: Plain text
#: ../src/en/cookbook/preface.md ../src/en/guide/intro/what-is-yii.md
msgid "Yii is a generic Web programming framework. You can use it for developing all kinds of Web applications using PHP. Because of its architecture and sophisticated caching support, it's especially suitable for developing large-scale applications such as portals, content management systems, e-commerce, REST APIs, etc."
-msgstr ""
+msgstr "Yii 是一个通用的 Web 编程框架。你可以使用它来开发各种类型的 PHP Web 应用程序。由于其架构和完善的缓存支持,它特别适合开发大型应用程序,如门户网站、内容管理系统、电子商务、REST API 等。"
#. type: Plain text
#: ../src/en/cookbook/preface.md
msgid "With comprehensive documentation and an enthusiastic user community, Yii can significantly reduce your development time in the long run."
-msgstr ""
+msgstr "凭借全面的文档和热情的用户社区,从长远来看,Yii 可以显著减少你的开发时间。"
#. type: Title ##
#: ../src/en/cookbook/preface.md
#, no-wrap
msgid "What's the book about"
-msgstr ""
+msgstr "本书内容"
#. type: Plain text
#: ../src/en/cookbook/preface.md
msgid "This book is for you if you're familiar with Yii3, building Yii applications, and read the official Yii3 guide. It covers fundamentally important development concepts, application architecture approaches, integrating third party services with Yii3, etc."
-msgstr ""
+msgstr "如果你熟悉 Yii3、构建 Yii 应用程序并阅读过官方 Yii3 指南,那么本书适合你。它涵盖了基本的重要开发概念、应用程序架构方法、将第三方服务与 Yii3 集成等内容。"
#. type: Plain text
#: ../src/en/cookbook/preface.md
msgid "The book consists of individual recipes gathered from Yii experts that you can apply in your applications. These go by topic, but you are free to read them in any order as there is no dependency between them."
-msgstr ""
+msgstr "本书由 Yii 专家收集的独立配方组成,你可以在应用程序中应用这些配方。这些配方按主题分类,但你可以按任意顺序阅读它们,因为它们之间没有依赖关系。"
#. type: Bullet: '- '
#: ../src/en/cookbook/preface.md
msgid "You should have Yii3 installed."
-msgstr ""
+msgstr "你应该已经安装了 Yii3。"
#. type: Bullet: '- '
#: ../src/en/cookbook/preface.md
msgid "You should be familiar with the framework basics and the official guide."
-msgstr ""
+msgstr "你应该熟悉框架基础知识和官方指南。"
#. type: Title ##
#: ../src/en/cookbook/preface.md
#, no-wrap
msgid "How to participate"
-msgstr ""
+msgstr "如何参与"
#. type: Plain text
#: ../src/en/cookbook/preface.md
msgid "If you've found any errata, wrong information, want to improve something or have a good recipe, create an issue or make a pull request in [the book GitHub repository](https://github.com/yiisoft/docs)."
-msgstr ""
+msgstr "如果你发现任何勘误、错误信息,想要改进某些内容或有好的配方,请在[本书的 GitHub 仓库](https://github.com/yiisoft/docs)中创建 issue 或提交 pull request。"
diff --git a/_translations/po/zh-CN/cookbook_sentry-integration.md.po b/_translations/po/zh-CN/cookbook_sentry-integration.md.po
index eb4ac372..2619ae5e 100644
--- a/_translations/po/zh-CN/cookbook_sentry-integration.md.po
+++ b/_translations/po/zh-CN/cookbook_sentry-integration.md.po
@@ -24,19 +24,19 @@ msgstr ""
#: ../src/en/guide/views/widget.md
#, no-wrap
msgid "Installation"
-msgstr ""
+msgstr "安装"
#. type: Title #
#: ../src/en/cookbook/sentry-integration.md
#, no-wrap
msgid "Sentry integration"
-msgstr ""
+msgstr "Sentry 集成"
#. type: Title ##
#: ../src/en/cookbook/sentry-integration.md
#, no-wrap
msgid "What is Sentry"
-msgstr ""
+msgstr "什么是 Sentry"
#. type: Plain text
#: ../src/en/cookbook/sentry-integration.md
@@ -45,55 +45,57 @@ msgid ""
"[Sentry](https://sentry.io/) is a tool for monitoring and debugging application stability and performance.\n"
"Sentry gives you access to the events that you send there from your application.\n"
msgstr ""
+"[Sentry](https://sentry.io/) 是一个用于监控和调试应用程序稳定性和性能的工具。\n"
+"Sentry 让你可以访问从应用程序发送到那里的事件。\n"
#. type: Plain text
#: ../src/en/cookbook/sentry-integration.md
msgid "Most often, Sentry is used for monitoring errors (exceptions). You can enrich errors with context to better understand the problem: - Request arguments - Tags for grouping exceptions - Environment state: environment variables, application state, and other global attributes"
-msgstr ""
+msgstr "最常见的是,Sentry 用于监控错误(异常)。你可以使用上下文丰富错误信息以更好地理解问题:- 请求参数 - 用于分组异常的标签 - 环境状态:环境变量、应用程序状态和其他全局属性"
#. type: Plain text
#: ../src/en/cookbook/sentry-integration.md
msgid "You can find the full list of features on the official website: https://sentry.io/welcome/"
-msgstr ""
+msgstr "你可以在官方网站上找到完整的功能列表:https://sentry.io/welcome/"
#. type: Title ###
#: ../src/en/cookbook/sentry-integration.md
#, no-wrap
msgid "Install the package"
-msgstr ""
+msgstr "安装包"
#. type: Plain text
#: ../src/en/cookbook/sentry-integration.md
msgid "Install the required package `yiisoft/yii-sentry` with the following command:"
-msgstr ""
+msgstr "使用以下命令安装所需的包 `yiisoft/yii-sentry`:"
#. type: Fenced code block (shell)
#: ../src/en/cookbook/sentry-integration.md
#, no-wrap
msgid "composer require yiisoft/yii-sentry --prefer-dist\n"
-msgstr ""
+msgstr "composer require yiisoft/yii-sentry --prefer-dist\n"
#. type: Title ###
#: ../src/en/cookbook/sentry-integration.md
#, no-wrap
msgid "Install an HTTP driver"
-msgstr ""
+msgstr "安装 HTTP 驱动"
#. type: Plain text
#: ../src/en/cookbook/sentry-integration.md
msgid "The [`getsentry/sentry-php`](https://github.com/getsentry/sentry-php) library requires the `php-http/httplug` package and any HTTP driver. In the example below we’ll use the Guzzle adapter."
-msgstr ""
+msgstr "[`getsentry/sentry-php`](https://github.com/getsentry/sentry-php) 库需要 `php-http/httplug` 包和任何 HTTP 驱动。在下面的示例中,我们将使用 Guzzle 适配器。"
#. type: Plain text
#: ../src/en/cookbook/sentry-integration.md
#, no-wrap
msgid "> You can find the list of all adapters on [this page](https://docs.php-http.org/en/latest/clients.html#clients-adapters).\n"
-msgstr ""
+msgstr "> 你可以在[此页面](https://docs.php-http.org/en/latest/clients.html#clients-adapters)上找到所有适配器的列表。\n"
#. type: Plain text
#: ../src/en/cookbook/sentry-integration.md
msgid "To install the packages, run the following command:"
-msgstr ""
+msgstr "要安装这些包,请运行以下命令:"
#. type: Fenced code block (shell)
#: ../src/en/cookbook/sentry-integration.md
@@ -108,28 +110,28 @@ msgstr ""
#: ../src/en/guide/views/view-injections.md
#, no-wrap
msgid "Configuration"
-msgstr ""
+msgstr "配置"
#. type: Title ###
#: ../src/en/cookbook/sentry-integration.md
#, no-wrap
msgid "Get and store the token"
-msgstr ""
+msgstr "获取并存储令牌"
#. type: Plain text
#: ../src/en/cookbook/sentry-integration.md
msgid "Next, configure the application."
-msgstr ""
+msgstr "接下来,配置应用程序。"
#. type: Plain text
#: ../src/en/cookbook/sentry-integration.md
msgid "First, register at [Sentry](https://sentry.io) and create a project."
-msgstr ""
+msgstr "首先,在 [Sentry](https://sentry.io) 注册并创建一个项目。"
#. type: Plain text
#: ../src/en/cookbook/sentry-integration.md
msgid "Then, in the project settings on the “General Settings” tab, find the “Security Token” field and copy its value."
-msgstr ""
+msgstr "然后,在项目设置的“常规设置”选项卡中,找到“安全令牌”字段并复制其值。"
#. type: Plain text
#: ../src/en/cookbook/sentry-integration.md
@@ -138,6 +140,8 @@ msgid ""
"Now put this token into the package configuration. By default, the config is located at `config/packages/yiisoft/yii-sentry/config/params.php`.\n"
"Set the copied token as the value of the array element at `yiisoft/yii-sentry` => `options` => `dsn`. Example:\n"
msgstr ""
+"现在将此令牌放入包配置中。默认情况下,配置位于 `config/packages/yiisoft/yii-sentry/config/params.php`。\n"
+"将复制的令牌设置为数组元素 `yiisoft/yii-sentry` => `options` => `dsn` 的值。示例:\n"
#. type: Fenced code block (diff)
#: ../src/en/cookbook/sentry-integration.md
@@ -156,17 +160,17 @@ msgstr ""
#: ../src/en/cookbook/sentry-integration.md
#, no-wrap
msgid "Configure the HTTP client"
-msgstr ""
+msgstr "配置 HTTP 客户端"
#. type: Plain text
#: ../src/en/cookbook/sentry-integration.md
msgid "After installing the HTTP client, configure it."
-msgstr ""
+msgstr "安装 HTTP 客户端后,对其进行配置。"
#. type: Plain text
#: ../src/en/cookbook/sentry-integration.md
msgid "Create the file `config/common/sentry.php` and put the following code into it:"
-msgstr ""
+msgstr "创建文件 `config/common/sentry.php` 并将以下代码放入其中:"
#. type: Fenced code block (php)
#: ../src/en/cookbook/sentry-integration.md
@@ -191,23 +195,23 @@ msgstr ""
#: ../src/en/cookbook/sentry-integration.md
#, no-wrap
msgid "Integration"
-msgstr ""
+msgstr "集成"
#. type: Title ###
#: ../src/en/cookbook/sentry-integration.md
#, no-wrap
msgid "Web"
-msgstr ""
+msgstr "Web"
#. type: Plain text
#: ../src/en/cookbook/sentry-integration.md
msgid "Sentry support for `web` is implemented as middleware."
-msgstr ""
+msgstr "对 `web` 的 Sentry 支持是作为中间件实现的。"
#. type: Plain text
#: ../src/en/cookbook/sentry-integration.md
msgid "That means you only need to add `SentryMiddleware` to the global middleware list in `config/web/application.php`:"
-msgstr ""
+msgstr "这意味着你只需要将 `SentryMiddleware` 添加到 `config/web/application.php` 中的全局中间件列表中:"
#. type: Fenced code block (diff)
#: ../src/en/cookbook/sentry-integration.md
@@ -237,14 +241,14 @@ msgstr ""
#: ../src/en/cookbook/sentry-integration.md ../src/en/internals/003-roadmap.md
#, no-wrap
msgid "Console"
-msgstr ""
+msgstr "控制台"
#. type: Plain text
#: ../src/en/cookbook/sentry-integration.md
msgid "Sentry supports `console` via a handler for the [ConsoleEvents::ERROR](https://symfony.com/doc/current/components/console/events.html#the-consoleevents-error-event) event."
-msgstr ""
+msgstr "Sentry 通过 [ConsoleEvents::ERROR](https://symfony.com/doc/current/components/console/events.html#the-consoleevents-error-event) 事件的处理程序支持 `console`。"
#. type: Plain text
#: ../src/en/cookbook/sentry-integration.md
msgid "The package provides a configuration file that automatically subscribes the application to this event."
-msgstr ""
+msgstr "该包提供了一个配置文件,可以自动将应用程序订阅到此事件。"
diff --git a/_translations/po/zh-CN/index.md.po b/_translations/po/zh-CN/index.md.po
index dfce9b89..f406d49a 100644
--- a/_translations/po/zh-CN/index.md.po
+++ b/_translations/po/zh-CN/index.md.po
@@ -19,61 +19,61 @@ msgstr ""
#: ../src/index.md
#, no-wrap
msgid "Yii gives you the maximum functionality by adding the least possible overhead."
-msgstr ""
+msgstr "Yii 以最小的开销为您提供最大的功能。"
#. type: Yaml Front Matter Hash Value: features title
#: ../src/index.md
#, no-wrap
msgid "Fast"
-msgstr ""
+msgstr "快速"
#. type: Yaml Front Matter Hash Value: features details
#: ../src/index.md
#, no-wrap
msgid "Sane defaults and built-in tools helps you write solid and secure code."
-msgstr ""
+msgstr "合理的默认设置和内置工具帮助您编写稳固且安全的代码。"
#. type: Yaml Front Matter Hash Value: features title
#: ../src/index.md
#, no-wrap
msgid "Secure"
-msgstr ""
+msgstr "安全"
#. type: Yaml Front Matter Hash Value: features details
#: ../src/index.md
#, no-wrap
msgid "Write more code in less time with simple, yet powerful APIs and code generation."
-msgstr ""
+msgstr "通过简单而强大的 API 和代码生成,在更短的时间内编写更多代码。"
#. type: Yaml Front Matter Hash Value: features title
#: ../src/index.md
#, no-wrap
msgid "Efficient"
-msgstr ""
+msgstr "高效"
#. type: Yaml Front Matter Hash Value: hero actions text
#: ../src/index.md
#, no-wrap
msgid "Get Started"
-msgstr ""
+msgstr "开始使用"
#. type: Yaml Front Matter Hash Value: hero name
#: ../src/index.md
#, no-wrap
msgid "Yii3 Framework"
-msgstr ""
+msgstr "Yii3 框架"
#. type: Yaml Front Matter Hash Value: hero tagline
#: ../src/index.md
#, no-wrap
msgid "A simple, powerful and fast framework. Meet the modern, definitive guide to Yii you've always wanted."
-msgstr ""
+msgstr "一个简单、强大且快速的框架。这是您一直想要的现代、权威的 Yii 指南。"
#. type: Title ##
#: ../src/index.md ../src/internals/003-roadmap.md
#, no-wrap
msgid "Documentation"
-msgstr ""
+msgstr "文档"
#. type: Plain text
#: ../src/index.md
@@ -84,14 +84,14 @@ msgstr ""
#. type: Bullet: '- '
#: ../src/index.md
msgid "[The Definitive Guide](guide/) — the comprehensive guide covering all aspects of the framework."
-msgstr ""
+msgstr "[权威指南](guide/) — 涵盖框架所有方面的综合指南。"
#. type: Bullet: '- '
#: ../src/index.md
msgid "[Community Cookbook](cookbook/) — a collection of community-contributed tips, tricks, and solutions for common Yii development tasks."
-msgstr ""
+msgstr "[社区手册](cookbook/) — 社区贡献的技巧、窍门和常见 Yii 开发任务解决方案的集合。"
#. type: Bullet: '- '
#: ../src/index.md
msgid "[Internals](internals/) — documentation for developers contributing to the Yii framework itself, including guidelines, workflows, and best practices."
-msgstr ""
+msgstr "[内部文档](internals/) — 为贡献 Yii 框架本身的开发者提供的文档,包括指南、工作流程和最佳实践。"
diff --git a/_translations/po/zh-CN/internals_000-packages.md.po b/_translations/po/zh-CN/internals_000-packages.md.po
index 4c30bf32..76c12a47 100644
--- a/_translations/po/zh-CN/internals_000-packages.md.po
+++ b/_translations/po/zh-CN/internals_000-packages.md.po
@@ -24,120 +24,120 @@ msgstr ""
#: ../src/en/internals/000-packages.md
#, no-wrap
msgid "000 — Packages"
-msgstr ""
+msgstr "000 — 包"
#. type: Plain text
#: ../src/en/internals/000-packages.md
msgid "Yii3 team divided the framework into several packages that conform to the following agreements."
-msgstr ""
+msgstr "Yii3 团队将框架划分为几个符合以下约定的包。"
#. type: Plain text
#: ../src/en/internals/000-packages.md
msgid "For all packages, the GitHub repository name exactly matches the Packagist package name."
-msgstr ""
+msgstr "对于所有包,GitHub 仓库名称与 Packagist 包名称完全匹配。"
#. type: Plain text
#: ../src/en/internals/000-packages.md
msgid "For a full list of packages and their building status, see [status page at yiiframework.com](https://www.yiiframework.com/status/3.0)."
-msgstr ""
+msgstr "有关包及其构建状态的完整列表,请参阅 [yiiframework.com 的状态页面](https://www.yiiframework.com/status/3.0)。"
#. type: Title ##
#: ../src/en/internals/000-packages.md
#, no-wrap
msgid "Yii-specific packages (framework and extensions)"
-msgstr ""
+msgstr "Yii 特定包(框架和扩展)"
#. type: Bullet: '- '
#: ../src/en/internals/000-packages.md
msgid "named `yiisoft/yii-something` or more specific: `yii-type-something` e.g.:"
-msgstr ""
+msgstr "命名为 `yiisoft/yii-something` 或更具体的:`yii-type-something`,例如:"
#. type: Bullet: ' - '
#: ../src/en/internals/000-packages.md
msgid "modules: `yii-module-users`, `yii-module-pages`"
-msgstr ""
+msgstr "模块:`yii-module-users`,`yii-module-pages`"
#. type: Bullet: ' - '
#: ../src/en/internals/000-packages.md
msgid "themes: `yii-theme-adminlte`, `yii-theme-hyde`"
-msgstr ""
+msgstr "主题:`yii-theme-adminlte`,`yii-theme-hyde`"
#. type: Bullet: ' - '
#: ../src/en/internals/000-packages.md
msgid "widgets: `yii-widget-datepicker`"
-msgstr ""
+msgstr "小部件:`yii-widget-datepicker`"
#. type: Bullet: '- '
#: ../src/en/internals/000-packages.md
msgid "titled as \"Yii Framework ...\""
-msgstr ""
+msgstr "标题为“Yii Framework ...”"
#. type: Bullet: '- '
#: ../src/en/internals/000-packages.md
msgid "may have any dependencies and Yii-specific code"
-msgstr ""
+msgstr "可以有任何依赖项和 Yii 特定代码"
#. type: Title ##
#: ../src/en/internals/000-packages.md
#, no-wrap
msgid "General purpose packages (libraries)"
-msgstr ""
+msgstr "通用包(库)"
#. type: Bullet: '- '
#: ../src/en/internals/000-packages.md
msgid "you can use these independently of Yii Framework"
-msgstr ""
+msgstr "您可以独立于 Yii 框架使用这些"
#. type: Bullet: '- '
#: ../src/en/internals/000-packages.md
msgid "named as `yiisoft/something` without yii-prefix"
-msgstr ""
+msgstr "命名为 `yiisoft/something`,不带 yii 前缀"
#. type: Bullet: '- '
#: ../src/en/internals/000-packages.md
msgid "titled as \"Yii ...\""
-msgstr ""
+msgstr "标题为“Yii ...”"
#. type: Bullet: '- '
#: ../src/en/internals/000-packages.md
msgid "must not have dependencies on any Yii-specific packages"
-msgstr ""
+msgstr "不得依赖任何 Yii 特定包"
#. type: Bullet: '- '
#: ../src/en/internals/000-packages.md
msgid "should have as fewer dependencies as possible"
-msgstr ""
+msgstr "应尽可能少的依赖项"
#. type: Title ##
#: ../src/en/internals/000-packages.md
#, no-wrap
msgid "Configs and defaults"
-msgstr ""
+msgstr "配置和默认值"
#. type: Plain text
#: ../src/en/internals/000-packages.md
msgid "The following applies to both Yii-specific packages and general purpose packages:"
-msgstr ""
+msgstr "以下适用于 Yii 特定包和通用包:"
#. type: Bullet: '- '
#: ../src/en/internals/000-packages.md
msgid "Package may have `config` directory with Yii-specific defaults."
-msgstr ""
+msgstr "包可以有包含 Yii 特定默认值的 `config` 目录。"
#. type: Bullet: '- '
#: ../src/en/internals/000-packages.md
msgid "Package may have \"config-plugin\" in \"extra\" section of `composer.json`."
-msgstr ""
+msgstr "包可以在 `composer.json` 的“extra”部分中有“config-plugin”。"
#. type: Bullet: '- '
#: ../src/en/internals/000-packages.md
msgid "Package mustn't have dependencies in `require` section of `composer.json` that are used in `config` only."
-msgstr ""
+msgstr "包不得在 `composer.json` 的 `require` 部分中有仅在 `config` 中使用的依赖项。"
#. type: Bullet: '- '
#: ../src/en/internals/000-packages.md
msgid "You should namespace parameters with `vendor/package-name`:"
-msgstr ""
+msgstr "您应该使用 `vendor/package-name` 命名空间参数:"
#. type: Fenced code block (php)
#: ../src/en/internals/000-packages.md
@@ -155,73 +155,73 @@ msgstr ""
#: ../src/en/internals/000-packages.md
#, no-wrap
msgid "Versions"
-msgstr ""
+msgstr "版本"
#. type: Plain text
#: ../src/en/internals/000-packages.md
msgid "All packages follow [SemVer](https://semver.org/) versioning:"
-msgstr ""
+msgstr "所有包都遵循 [SemVer](https://semver.org/) 版本控制:"
#. type: Bullet: '- '
#: ../src/en/internals/000-packages.md
msgid "`x.*.*` - incompatible API changes."
-msgstr ""
+msgstr "`x.*.*` - 不兼容的 API 更改。"
#. type: Bullet: '- '
#: ../src/en/internals/000-packages.md
msgid "`*.x.*` - add functionality (backwards-compatible)."
-msgstr ""
+msgstr "`*.x.*` - 添加功能(向后兼容)。"
#. type: Bullet: '- '
#: ../src/en/internals/000-packages.md
msgid "`*.*.x` - bug fixes (backwards-compatible)."
-msgstr ""
+msgstr "`*.*.x` - bug 修复(向后兼容)。"
#. type: Plain text
#: ../src/en/internals/000-packages.md
msgid "The first stable version should be 1.0.0."
-msgstr ""
+msgstr "第一个稳定版本应该是 1.0.0。"
#. type: Plain text
#: ../src/en/internals/000-packages.md
msgid "Each package version number doesn't depend on any other package version or framework name/version, only on its own public contract. The framework as a whole has the \"Yii3\" name."
-msgstr ""
+msgstr "每个包的版本号不依赖于任何其他包的版本或框架名称/版本,仅依赖于其自己的公共契约。整个框架的名称为 \"Yii3\"。"
#. type: Plain text
#: ../src/en/internals/000-packages.md
msgid "It's alright to use packages with different major versions together, as long as they're compatible."
-msgstr ""
+msgstr "只要兼容,一起使用不同主版本的包是可以的。"
#. type: Title ##
#: ../src/en/internals/000-packages.md
#, no-wrap
msgid "PHP versions support"
-msgstr ""
+msgstr "PHP 版本支持"
#. type: Plain text
#: ../src/en/internals/000-packages.md
msgid "The support of PHP versions supported for a package depends on [PHP versions life cycle](https://www.php.net/supported-versions.php)."
-msgstr ""
+msgstr "包支持的 PHP 版本取决于 [PHP 版本生命周期](https://www.php.net/supported-versions.php)。"
#. type: Bullet: '- '
#: ../src/en/internals/000-packages.md
msgid "Package versions with active support MUST support all PHP versions that have active support."
-msgstr ""
+msgstr "具有活跃支持的包版本必须支持所有具有活跃支持的 PHP 版本。"
#. type: Bullet: '- '
#: ../src/en/internals/000-packages.md
msgid "Both packages and application templates MUST have supported versions that receive bug and security fixes. These SHOULD correspond to PHP versions receiving security fixes."
-msgstr ""
+msgstr "包和应用程序模板都必须有接收 bug 和安全修复的受支持版本。这些应该对应于接收安全修复的 PHP 版本。"
#. type: Bullet: '- '
#: ../src/en/internals/000-packages.md
msgid "Packages and application templates MIGHT have supported versions that work with unsupported PHP versions."
-msgstr ""
+msgstr "包和应用程序模板可能有与不受支持的 PHP 版本一起工作的受支持版本。"
#. type: Bullet: '- '
#: ../src/en/internals/000-packages.md
msgid "Bumping the minimal PHP version in a package or an application template is a minor change."
-msgstr ""
+msgstr "提升包或应用程序模板中的最低 PHP 版本是一个次要更改。"
#. type: Title ##
#: ../src/en/internals/000-packages.md
@@ -233,4 +233,4 @@ msgstr ""
#: ../src/en/internals/000-packages.md
#, no-wrap
msgid "A logical OR operator in version ranges MUST use double pipe (`||`). For example: `\"yiisoft/arrays\": \"^1.0 || ^2.0\"`. \n"
-msgstr ""
+msgstr "版本范围中的逻辑 OR 运算符必须使用双管道(`||`)。例如:`\"yiisoft/arrays\": \"^1.0 || ^2.0\"`。\n"
diff --git a/_translations/po/zh-CN/internals_001-yii-values.md.po b/_translations/po/zh-CN/internals_001-yii-values.md.po
index 7eae6159..07fbac64 100644
--- a/_translations/po/zh-CN/internals_001-yii-values.md.po
+++ b/_translations/po/zh-CN/internals_001-yii-values.md.po
@@ -19,224 +19,224 @@ msgstr ""
#: ../src/en/internals/001-yii-values.md
#, no-wrap
msgid "001 — Yii goal and values"
-msgstr ""
+msgstr "001 — Yii 目标和价值观"
#. type: Title ##
#: ../src/en/internals/001-yii-values.md
#, no-wrap
msgid "Goal"
-msgstr ""
+msgstr "目标"
#. type: Plain text
#: ../src/en/internals/001-yii-values.md
msgid "The Yii project aims to build and support _practical_ and _helpful_ tools and community."
-msgstr ""
+msgstr "Yii 项目旨在构建和支持 _practical_ 和 _helpful_ 的工具和社区。"
#. type: Title ##
#: ../src/en/internals/001-yii-values.md
#, no-wrap
msgid "Values"
-msgstr ""
+msgstr "价值观"
#. type: Plain text
#: ../src/en/internals/001-yii-values.md
msgid "The values we express in our work support the goal. We try to"
-msgstr ""
+msgstr "我们在工作中表达的价值观支持这一目标。我们努力"
#. type: Title ##
#: ../src/en/internals/001-yii-values.md
#, no-wrap
msgid "Be practical"
-msgstr ""
+msgstr "实用"
#. type: Bullet: ' - '
#: ../src/en/internals/001-yii-values.md
msgid "[High performance](#high-performance)"
-msgstr ""
+msgstr "[高性能](#high-performance)"
#. type: Bullet: ' - '
#: ../src/en/internals/001-yii-values.md
msgid "[Sensible defaults and flexibility](#sensible-defaults-and-flexibility)"
-msgstr ""
+msgstr "[合理的默认值和灵活性](#sensible-defaults-and-flexibility)"
#. type: Bullet: ' - '
#: ../src/en/internals/001-yii-values.md
msgid "[Be practice-oriented](#be-practice-oriented)"
-msgstr ""
+msgstr "[以实践为导向](#be-practice-oriented)"
#. type: Title ##
#: ../src/en/internals/001-yii-values.md
#, no-wrap
msgid "Be helpful"
-msgstr ""
+msgstr "有帮助"
#. type: Bullet: ' - '
#: ../src/en/internals/001-yii-values.md
msgid "[Be simple](#be-simple)"
-msgstr ""
+msgstr "[保持简单](#be-simple)"
#. type: Bullet: ' - '
#: ../src/en/internals/001-yii-values.md
msgid "[Be explicit](#be-explicit)"
-msgstr ""
+msgstr "[明确表达](#be-explicit)"
#. type: Bullet: ' - '
#: ../src/en/internals/001-yii-values.md
msgid "[Be consistent](#be-consistent)"
-msgstr ""
+msgstr "[保持一致](#be-consistent)"
#. type: Title ###
#: ../src/en/internals/001-yii-values.md
#, no-wrap
msgid "High performance"
-msgstr ""
+msgstr "高性能"
#. type: Plain text
#: ../src/en/internals/001-yii-values.md
msgid "Performance is a necessary condition of practicality. Software shouldn't waste machine resources or human resources."
-msgstr ""
+msgstr "性能是实用性的必要条件。软件不应浪费机器资源或人力资源。"
#. type: Title ###
#: ../src/en/internals/001-yii-values.md
#, no-wrap
msgid "Sensible defaults and flexibility"
-msgstr ""
+msgstr "合理的默认值和灵活性"
#. type: Plain text
#: ../src/en/internals/001-yii-values.md
msgid "We prefer sensible defaults and conventions that users can customize. We seek a balance between flexibility, discipline and simplicity that meets common needs."
-msgstr ""
+msgstr "我们更喜欢用户可以自定义的合理默认值和约定。我们寻求灵活性、纪律性和简单性之间的平衡,以满足常见需求。"
#. type: Title ###
#: ../src/en/internals/001-yii-values.md
#, no-wrap
msgid "Be practice-oriented"
-msgstr ""
+msgstr "以实践为导向"
#. type: Plain text
#: ../src/en/internals/001-yii-values.md
msgid "We prefer practice to theory. For example:"
-msgstr ""
+msgstr "我们更喜欢实践而不是理论。例如:"
#. type: Bullet: '- '
#: ../src/en/internals/001-yii-values.md
msgid "Solutions for known use cases should avoid excess complexity by providing only necessary flexibility."
-msgstr ""
+msgstr "已知用例的解决方案应通过仅提供必要的灵活性来避免过度复杂性。"
#. type: Bullet: '- '
#: ../src/en/internals/001-yii-values.md
msgid "Standard implementations should take practical use into account."
-msgstr ""
+msgstr "标准实现应考虑实际使用。"
#. type: Bullet: '- '
#: ../src/en/internals/001-yii-values.md
msgid "Experience is at least as useful as theory in guiding design."
-msgstr ""
+msgstr "在指导设计方面,经验至少与理论一样有用。"
#. type: Bullet: '- '
#: ../src/en/internals/001-yii-values.md
msgid "Context is critical in determining appropriateness."
-msgstr ""
+msgstr "上下文对于确定适当性至关重要。"
#. type: Plain text
#: ../src/en/internals/001-yii-values.md
msgid "This value guides technical decisions as well as community activity. Consideration of how software features help users should guide development. Community-wise, we value any helpful contribution, be it a pull request or an answer in the forum."
-msgstr ""
+msgstr "这一价值观指导技术决策和社区活动。对软件功能如何帮助用户的考虑应该指导开发。在社区方面,我们重视任何有帮助的贡献,无论是 pull request 还是论坛中的回答。"
#. type: Plain text
#: ../src/en/internals/001-yii-values.md
msgid "When the other principles conflict, we choose a solution that's more helpful to the community."
-msgstr ""
+msgstr "当其他原则发生冲突时,我们选择对社区更有帮助的解决方案。"
#. type: Title ###
#: ../src/en/internals/001-yii-values.md
#, no-wrap
msgid "Be simple"
-msgstr ""
+msgstr "保持简单"
#. type: Plain text
#: ../src/en/internals/001-yii-values.md
msgid "Solutions should be simple and expressive:"
-msgstr ""
+msgstr "解决方案应该简单且富有表现力:"
#. type: Bullet: '- '
#: ../src/en/internals/001-yii-values.md
msgid "We use as much complexity as needed and no more."
-msgstr ""
+msgstr "我们使用所需的复杂性,不多不少。"
#. type: Bullet: '- '
#: ../src/en/internals/001-yii-values.md
msgid "We avoid ugly solutions unless there is no alternative."
-msgstr ""
+msgstr "除非别无选择,否则我们避免丑陋的解决方案。"
#. type: Bullet: '- '
#: ../src/en/internals/001-yii-values.md
msgid "Fewer rules are better than more rules."
-msgstr ""
+msgstr "规则越少越好。"
#. type: Title ###
#: ../src/en/internals/001-yii-values.md
#, no-wrap
msgid "Be Explicit"
-msgstr ""
+msgstr "明确表达"
#. type: Plain text
#: ../src/en/internals/001-yii-values.md
msgid "We prefer explicit, obvious solutions and code. Solutions should clearly express exactly what they do. For example:"
-msgstr ""
+msgstr "我们更喜欢明确、显而易见的解决方案和代码。解决方案应该清楚地表达它们的确切作用。例如:"
#. type: Bullet: '- '
#: ../src/en/internals/001-yii-values.md
msgid "A straightforward solution is better than an abstract one unless the abstraction has a practical purpose."
-msgstr ""
+msgstr "除非抽象有实际目的,否则直接的解决方案比抽象的解决方案更好。"
#. type: Bullet: '- '
#: ../src/en/internals/001-yii-values.md
msgid "Loud fails are better than silent fails or masking errors."
-msgstr ""
+msgstr "明确的失败比静默失败或掩盖错误更好。"
#. type: Bullet: '- '
#: ../src/en/internals/001-yii-values.md
msgid "Explicit casts are better than PHP type juggling, type hints are good."
-msgstr ""
+msgstr "显式转换比 PHP 类型转换更好,类型提示很好。"
#. type: Bullet: '- '
#: ../src/en/internals/001-yii-values.md
msgid "No magic unless necessary."
-msgstr ""
+msgstr "除非必要,否则不要使用魔术。"
#. type: Title ###
#: ../src/en/internals/001-yii-values.md
#, no-wrap
msgid "Be consistent"
-msgstr ""
+msgstr "保持一致"
#. type: Plain text
#: ../src/en/internals/001-yii-values.md
msgid "We try to be consistent in:"
-msgstr ""
+msgstr "我们努力在以下方面保持一致:"
#. type: Bullet: '- '
#: ../src/en/internals/001-yii-values.md
msgid "Code style"
-msgstr ""
+msgstr "代码风格"
#. type: Bullet: '- '
#: ../src/en/internals/001-yii-values.md
msgid "Naming"
-msgstr ""
+msgstr "命名"
#. type: Bullet: '- '
#: ../src/en/internals/001-yii-values.md
msgid "Design"
-msgstr ""
+msgstr "设计"
#. type: Bullet: '- '
#: ../src/en/internals/001-yii-values.md
msgid "Structure"
-msgstr ""
+msgstr "结构"
#. type: Bullet: '- '
#: ../src/en/internals/001-yii-values.md
msgid "Values and goals"
-msgstr ""
+msgstr "价值观和目标"
diff --git a/_translations/po/zh-CN/internals_002-issue-workflow.md.po b/_translations/po/zh-CN/internals_002-issue-workflow.md.po
index dfce02b9..a1842347 100644
--- a/_translations/po/zh-CN/internals_002-issue-workflow.md.po
+++ b/_translations/po/zh-CN/internals_002-issue-workflow.md.po
@@ -19,77 +19,77 @@ msgstr ""
#: ../src/internals/002-issue-workflow.md
#, no-wrap
msgid "002 — Issue workflow"
-msgstr ""
+msgstr "002 — Issue 工作流程"
#. type: Plain text
#: ../src/internals/002-issue-workflow.md
msgid "The process of handing incoming issues is the following:"
-msgstr ""
+msgstr "处理传入 issue 的流程如下:"
#. type: Plain text
#: ../src/internals/002-issue-workflow.md
msgid ""
-msgstr ""
+msgstr ""
#. type: Title ##
#: ../src/internals/002-issue-workflow.md
#, no-wrap
msgid "Roles"
-msgstr ""
+msgstr "角色"
#. type: Plain text
#: ../src/internals/002-issue-workflow.md
msgid "We've many roles:"
-msgstr ""
+msgstr "我们有多个角色:"
#. type: Bullet: '- '
#: ../src/internals/002-issue-workflow.md
msgid "Process managers - initially triage issues and manage labels."
-msgstr ""
+msgstr "流程管理员 - 初步分类 issue 并管理标签。"
#. type: Bullet: '- '
#: ../src/internals/002-issue-workflow.md
msgid "Decision makers - participate in discussions moving them to resolutions."
-msgstr ""
+msgstr "决策者 - 参与讨论并推动解决方案。"
#. type: Bullet: '- '
#: ../src/internals/002-issue-workflow.md
msgid "Bug hunters - verifying bugs."
-msgstr ""
+msgstr "Bug 猎人 - 验证 bug。"
#. type: Bullet: '- '
#: ../src/internals/002-issue-workflow.md
msgid "Contributors - create code for pull requests."
-msgstr ""
+msgstr "贡献者 - 为 pull request 创建代码。"
#. type: Bullet: '- '
#: ../src/internals/002-issue-workflow.md
msgid "Code reviewers - review pull requests."
-msgstr ""
+msgstr "代码审查员 - 审查 pull request。"
#. type: Plain text
#: ../src/internals/002-issue-workflow.md
msgid "A single person may take one or more roles in the issue-resolving process."
-msgstr ""
+msgstr "一个人可以在 issue 解决过程中担任一个或多个角色。"
#. type: Title ##
#: ../src/internals/002-issue-workflow.md
#, no-wrap
msgid "Labels"
-msgstr ""
+msgstr "标签"
#. type: Plain text
#: ../src/internals/002-issue-workflow.md
msgid "We label issues to mark many things: current status, issue type, component affected. Status labels speak for themselves."
-msgstr ""
+msgstr "我们使用标签标记许多内容:当前状态、issue 类型、受影响的组件。状态标签不言自明。"
#. type: Title ##
#: ../src/internals/002-issue-workflow.md
#, no-wrap
msgid "Milestones"
-msgstr ""
+msgstr "里程碑"
#. type: Plain text
#: ../src/internals/002-issue-workflow.md
msgid "Issues aren't assigned to milestones unless they're critical or there is a likely good pull request exists."
-msgstr ""
+msgstr "除非 issue 是关键的或存在一个可能不错的 pull request,否则不会将其分配到里程碑。"
diff --git a/_translations/po/zh-CN/internals_003-roadmap.md.po b/_translations/po/zh-CN/internals_003-roadmap.md.po
index 8512d173..045c6563 100644
--- a/_translations/po/zh-CN/internals_003-roadmap.md.po
+++ b/_translations/po/zh-CN/internals_003-roadmap.md.po
@@ -19,425 +19,425 @@ msgstr ""
#: ../src/index.md ../src/internals/003-roadmap.md
#, no-wrap
msgid "Documentation"
-msgstr ""
+msgstr "文档"
#. type: Title ##
#: ../src/cookbook/sentry-integration.md ../src/internals/003-roadmap.md
#, no-wrap
msgid "Console"
-msgstr ""
+msgstr "控制台"
#. type: Title #
#: ../src/internals/003-roadmap.md
#, no-wrap
msgid "003 — Roadmap"
-msgstr ""
+msgstr "003 — 路线图"
#. type: Plain text
#: ../src/internals/003-roadmap.md
msgid "We want Yii 3 to:"
-msgstr ""
+msgstr "我们希望 Yii 3:"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "Not limit a developer to choosing architecture. Allow anything from \"classic\" MVC to DDD."
-msgstr ""
+msgstr "不限制开发者选择架构。允许从“经典”MVC 到 DDD 的任何架构。"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "Be based on the best practices such as SOLID, GRASP, etc. and teach them to the community."
-msgstr ""
+msgstr "基于 SOLID、GRASP 等最佳实践,并将它们教给社区。"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "Keep the most good things from Yii 2."
-msgstr ""
+msgstr "保留 Yii 2 中最好的东西。"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "Be more open to the global PHP community and infrastructure."
-msgstr ""
+msgstr "对全球 PHP 社区和基础设施更加开放。"
#. type: Title ##
#: ../src/internals/003-roadmap.md
#, no-wrap
msgid "PSRs compliance"
-msgstr ""
+msgstr "PSR 合规性"
#. type: Plain text
#: ../src/internals/003-roadmap.md
msgid "PSR compliance helps with customizability, the ability to use general PHP libraries and implement fewer wrappers. Here's the list of PSRs we want to implement."
-msgstr ""
+msgstr "PSR 合规性有助于可定制性、使用通用 PHP 库的能力以及实现更少的包装器。以下是我们想要实现的 PSR 列表。"
#. type: Title ###
#: ../src/internals/003-roadmap.md
#, no-wrap
msgid "PSR-3 Logger"
-msgstr ""
+msgstr "PSR-3 日志记录器"
#. type: Plain text
#: ../src/internals/003-roadmap.md
msgid "Implemented as a [separate package that isn't dependent on a framework](https://github.com/yiisoft/log)."
-msgstr ""
+msgstr "实现为 [不依赖于框架的独立包](https://github.com/yiisoft/log)。"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] Framework packages should depend on interface only."
-msgstr ""
+msgstr "[x] 框架包应仅依赖于接口。"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] Split drivers into packages."
-msgstr ""
+msgstr "[x] 将驱动程序拆分为包。"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] Clean-up code."
-msgstr ""
+msgstr "[x] 清理代码。"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] [Fix email target](https://github.com/yiisoft/log-target-email)."
-msgstr ""
+msgstr "[x] [修复电子邮件目标](https://github.com/yiisoft/log-target-email)。"
#. type: Title ###
#: ../src/internals/003-roadmap.md
#, no-wrap
msgid "PSR-4 Autoloading"
-msgstr ""
+msgstr "PSR-4 自动加载"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] Autoloading is fine already."
-msgstr ""
+msgstr "[x] 自动加载已经很好了。"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] Document on how it works."
-msgstr ""
+msgstr "[x] 记录它的工作原理。"
#. type: Title ###
#: ../src/internals/003-roadmap.md
#, no-wrap
msgid "PSR-7 HTTP message"
-msgstr ""
+msgstr "PSR-7 HTTP 消息"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] Remove our own implementation. At least for now."
-msgstr ""
+msgstr "[x] 删除我们自己的实现。至少目前如此。"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] Framework packages should depend on interfaces only."
-msgstr ""
+msgstr "[x] 框架包应仅依赖于接口。"
#. type: Title ###
#: ../src/internals/003-roadmap.md
#, no-wrap
msgid "PSR-11 Container"
-msgstr ""
+msgstr "PSR-11 容器"
#. type: Plain text
#: ../src/internals/003-roadmap.md
msgid "Implemented as a [separate package that isn't dependent on a framework](https://github.com/yiisoft/di)."
-msgstr ""
+msgstr "实现为 [不依赖于框架的独立包](https://github.com/yiisoft/di)。"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] Framework packages shouldn't use container directly. One should be able to instantiate everything manually."
-msgstr ""
+msgstr "[x] 框架包不应直接使用容器。应该能够手动实例化所有内容。"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] Finish refactoring."
-msgstr ""
+msgstr "[x] 完成重构。"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] Remove all framework-specific implementations from the package. Move to a framework."
-msgstr ""
+msgstr "[x] 从包中删除所有框架特定的实现。移至框架。"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] [Implement autoloader fallback](https://github.com/yiisoft/di/issues/88)"
-msgstr ""
+msgstr "[x] [实现自动加载器回退](https://github.com/yiisoft/di/issues/88)"
#. type: Title ###
#: ../src/internals/003-roadmap.md
#, no-wrap
msgid "PSR-12 Code style"
-msgstr ""
+msgstr "PSR-12 代码风格"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] Make sure the code follows it."
-msgstr ""
+msgstr "[x] 确保代码遵循它。"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] Automate fixing style before release."
-msgstr ""
+msgstr "[x] 在发布前自动修复风格。"
#. type: Title ###
#: ../src/internals/003-roadmap.md
#, no-wrap
msgid "PSR-14 Event dispatcher"
-msgstr ""
+msgstr "PSR-14 事件调度器"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] [Implement as a separate library](https://github.com/yiisoft/event-dispatcher)."
-msgstr ""
+msgstr "[x] [实现为独立库](https://github.com/yiisoft/event-dispatcher)。"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] Use in other packages."
-msgstr ""
+msgstr "[x] 在其他包中使用。"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] Polish."
-msgstr ""
+msgstr "[x] 完善。"
#. type: Title ###
#: ../src/internals/003-roadmap.md
#, no-wrap
msgid "PSR-15 HTTP handlers"
-msgstr ""
+msgstr "PSR-15 HTTP 处理器"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] Rewrite HTTP flow to PSR-7 request-response + formatting response via emitter."
-msgstr ""
+msgstr "[x] 将 HTTP 流程重写为 PSR-7 请求-响应 + 通过 Emitter 进行格式化响应。"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] Offer SAPI emitter out of the box."
-msgstr ""
+msgstr "[x] 开箱即用地提供 SAPI Emitter。"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] Make it possible to use alternative emitters such as RoadRunner."
-msgstr ""
+msgstr "[x] 支持使用 RoadRunner 等替代的 Emitter 实现。"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] Support middleware."
-msgstr ""
+msgstr "[x] 支持中间件。"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] Implement filters as middleware:"
-msgstr ""
+msgstr "[x] 将过滤器实现为中间件:"
#. type: Bullet: ' - '
#: ../src/internals/003-roadmap.md
msgid "[x] [Rate limiting](https://github.com/yiisoft/yii-web/issues/63)"
-msgstr ""
+msgstr "[x] [速率限制](https://github.com/yiisoft/yii-web/issues/63)"
#. type: Bullet: ' - '
#: ../src/internals/003-roadmap.md
msgid "[x] [Authentication](https://github.com/yiisoft/yii-web/issues/114)"
-msgstr ""
+msgstr "[x] [身份验证](https://github.com/yiisoft/yii-web/issues/114)"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] Re-implement router w/ middleware support for route groups."
-msgstr ""
+msgstr "[x] 重新实现路由器,支持路由组的中间件。"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] Filters should be middlewares."
-msgstr ""
+msgstr "[x] 过滤器应该是中间件。"
#. type: Title ###
#: ../src/internals/003-roadmap.md
#, no-wrap
msgid "PSR-16 Simple cache"
-msgstr ""
+msgstr "PSR-16 简单缓存"
#. type: Plain text
#: ../src/internals/003-roadmap.md
msgid "Implemented as a [separate package that isn't dependent on a framework](https://github.com/yiisoft/cache)."
-msgstr ""
+msgstr "实现为 [不依赖于框架的独立包](https://github.com/yiisoft/cache)。"
#. type: Title ###
#: ../src/internals/003-roadmap.md
#, no-wrap
msgid "PSR-17 HTTP factories"
-msgstr ""
+msgstr "PSR-17 HTTP 工厂"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] Use PSR factories."
-msgstr ""
+msgstr "[x] 使用 PSR 工厂。"
#. type: Title ###
#: ../src/internals/003-roadmap.md
#, no-wrap
msgid "PSR-18 HTTP client"
-msgstr ""
+msgstr "PSR-18 HTTP 客户端"
#. type: Title ##
#: ../src/internals/003-roadmap.md
#, no-wrap
msgid "Stricter types"
-msgstr ""
+msgstr "更严格的类型"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] Make sure type hinting is used everywhere."
-msgstr ""
+msgstr "[x] 确保在所有地方都使用类型提示。"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] Make sure types are as definitive as possible. Avoid varying types if possible."
-msgstr ""
+msgstr "[x] 确保类型尽可能明确。尽可能避免变化的类型。"
#. type: Title ##
#: ../src/internals/003-roadmap.md
#, no-wrap
msgid "Single application template"
-msgstr ""
+msgstr "单一应用程序模板"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] Drop basic/advanced."
-msgstr ""
+msgstr "[x] 放弃 basic/advanced。"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] Create a [single application template that works out of the box](https://github.com/yiisoft/app)."
-msgstr ""
+msgstr "[x] 创建一个 [开箱即用的单一应用程序模板](https://github.com/yiisoft/app)。"
#. type: Title ##
#: ../src/internals/003-roadmap.md
#, no-wrap
msgid "Router"
-msgstr ""
+msgstr "路由器"
#. type: Plain text
#: ../src/internals/003-roadmap.md
msgid "Implemented as a [separate package that isn't dependent on a framework](https://github.com/yiisoft/router)."
-msgstr ""
+msgstr "实现为 [不依赖于框架的独立包](https://github.com/yiisoft/router)。"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] DSL for configuration."
-msgstr ""
+msgstr "[x] 用于配置的 DSL。"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] Ability to route to any callable."
-msgstr ""
+msgstr "[x] 能够路由到任何可调用对象。"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] Named routes."
-msgstr ""
+msgstr "[x] 命名路由。"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] Route groups w/ middleware support."
-msgstr ""
+msgstr "[x] 支持中间件的路由组。"
#. type: Title ##
#: ../src/internals/003-roadmap.md
#, no-wrap
msgid "Best practices and SOLID compliance of all classes/packages"
-msgstr ""
+msgstr "所有类/包的最佳实践和 SOLID 合规性"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] Make sure interfaces follow the \"interface segregation\" principle."
-msgstr ""
+msgstr "[x] 确保接口遵循“接口隔离”原则。"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] Don't use public properties."
-msgstr ""
+msgstr "[x] 不要使用公共属性。"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] Don't use `init()`."
-msgstr ""
+msgstr "[x] 不要使用 `init()`。"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] Don't inherit from `BaseObject` or `Component`. Remove these."
-msgstr ""
+msgstr "[x] 不要从 `BaseObject` 或 `Component` 继承。删除这些。"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] No globals."
-msgstr ""
+msgstr "[x] 没有全局变量。"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] No static calls except helpers that are final."
-msgstr ""
+msgstr "[x] 除了 final 的辅助函数外,没有静态调用。"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] Prefer throwing exceptions to fixing input."
-msgstr ""
+msgstr "[x] 优先抛出异常而不是修复输入。"
#. type: Title ##
#: ../src/internals/003-roadmap.md
#, no-wrap
msgid "Development toolkit"
-msgstr ""
+msgstr "开发工具包"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] Release command line tool"
-msgstr ""
+msgstr "[x] 发布命令行工具"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] Development command line tool (symlinks packages into usable application)"
-msgstr ""
+msgstr "[x] 开发命令行工具(将包符号链接到可用的应用程序)"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] Separate web and console application"
-msgstr ""
+msgstr "[x] 分离 web 和控制台应用程序"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] Possibly eliminate base application (still needed)"
-msgstr ""
+msgstr "[x] 可能消除基础应用程序(仍然需要)"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] Create an interface for the console (using Symfony one)"
-msgstr ""
+msgstr "[x] 为控制台创建接口(使用 Symfony 的)"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] Implementation may be one of the popular ones (using Symfony one)"
-msgstr ""
+msgstr "[x] 实现可能是流行的之一(使用 Symfony 的)"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] Ensure application can add commands via config"
-msgstr ""
+msgstr "[x] 确保应用程序可以通过配置添加命令"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[ ] Follow best practices."
-msgstr ""
+msgstr "[ ] 遵循最佳实践。"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[ ] Don't use the \"MVC\" term."
-msgstr ""
+msgstr "[ ] 不要使用“MVC”术语。"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[ ] Upgrading from Yii 2."
-msgstr ""
+msgstr "[ ] 从 Yii 2 升级。"
#. type: Title ##
#: ../src/internals/003-roadmap.md
@@ -448,101 +448,101 @@ msgstr ""
#. type: Plain text
#: ../src/internals/003-roadmap.md
msgid "RBAC is implemented as [a framework-independent package](https://github.com/yiisoft/rbac)."
-msgstr ""
+msgstr "RBAC 实现为 [独立于框架的包](https://github.com/yiisoft/rbac)。"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] Make sure it follows best practices."
-msgstr ""
+msgstr "[x] 确保它遵循最佳实践。"
#. type: Title ##
#: ../src/internals/003-roadmap.md
#, no-wrap
msgid "View"
-msgstr ""
+msgstr "视图"
#. type: Plain text
#: ../src/internals/003-roadmap.md
msgid "View is implemented as [framework-independent package](https://github.com/yiisoft/view)."
-msgstr ""
+msgstr "视图实现为 [独立于框架的包](https://github.com/yiisoft/view)。"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] Finish refactoring ([see issues](https://github.com/yiisoft/view/issues))."
-msgstr ""
+msgstr "[x] 完成重构([查看 issue](https://github.com/yiisoft/view/issues))。"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] Port widgets."
-msgstr ""
+msgstr "[x] 移植小部件。"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] Rethink and implement active form widgets."
-msgstr ""
+msgstr "[x] 重新思考并实现活动表单小部件。"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] Implement caching widgets."
-msgstr ""
+msgstr "[x] 实现缓存小部件。"
#. type: Title ##
#: ../src/internals/003-roadmap.md
#, no-wrap
msgid "Data abstractions and grid"
-msgstr ""
+msgstr "数据抽象和网格"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] Finish [data abstractions](https://github.com/yiisoft/data)."
-msgstr ""
+msgstr "[x] 完成 [数据抽象](https://github.com/yiisoft/data)。"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] Port sort, use data abstractions. Should be part of [yii-dataview](https://github.com/yiisoft/yii-dataview)."
-msgstr ""
+msgstr "[x] 移植排序,使用数据抽象。应该是 [yii-dataview](https://github.com/yiisoft/yii-dataview) 的一部分。"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] Port paging, use data abstractions. Should be part of [yii-dataview](https://github.com/yiisoft/yii-dataview)."
-msgstr ""
+msgstr "[x] 移植分页,使用数据抽象。应该是 [yii-dataview](https://github.com/yiisoft/yii-dataview) 的一部分。"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] Port grid, use data abstractions. Should be part of [yii-dataview](https://github.com/yiisoft/yii-dataview)."
-msgstr ""
+msgstr "[x] 移植网格,使用数据抽象。应该是 [yii-dataview](https://github.com/yiisoft/yii-dataview) 的一部分。"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] Port list, use data abstractions. Should be part of [yii-dataview](https://github.com/yiisoft/yii-dataview)."
-msgstr ""
+msgstr "[x] 移植列表,使用数据抽象。应该是 [yii-dataview](https://github.com/yiisoft/yii-dataview) 的一部分。"
#. type: Title ##
#: ../src/internals/003-roadmap.md
#, no-wrap
msgid "Validators"
-msgstr ""
+msgstr "验证器"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] Finish [the main package](https://github.com/yiisoft/validator) redesign"
-msgstr ""
+msgstr "[x] 完成 [主包](https://github.com/yiisoft/validator) 重新设计"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] Port necessary validators"
-msgstr ""
+msgstr "[x] 移植必要的验证器"
#. type: Title ##
#: ../src/internals/003-roadmap.md
#, no-wrap
msgid "Debug toolbar"
-msgstr ""
+msgstr "调试工具栏"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] Port debug toolbar."
-msgstr ""
+msgstr "[x] 移植调试工具栏。"
#. type: Title ##
#: ../src/internals/003-roadmap.md
@@ -553,46 +553,46 @@ msgstr ""
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] Port Gii."
-msgstr ""
+msgstr "[x] 移植 Gii。"
#. type: Title ##
#: ../src/internals/003-roadmap.md
#, no-wrap
msgid "Infrastructure"
-msgstr ""
+msgstr "基础设施"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] Cover [config](https://github.com/yiisoft/config) with tests."
-msgstr ""
+msgstr "[x] 为 [config](https://github.com/yiisoft/config) 编写测试。"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] Release stable [config](https://github.com/yiisoft/config)."
-msgstr ""
+msgstr "[x] 发布稳定的 [config](https://github.com/yiisoft/config)。"
#. type: Title ##
#: ../src/internals/003-roadmap.md ../src/internals/022-config-groups.md
#, no-wrap
msgid "Others"
-msgstr ""
+msgstr "其他"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] [Decide on namespaces](https://forum.yiiframework.com/t/lowercase-or-camelcase-namespaces/124983/52)."
-msgstr ""
+msgstr "[x] [决定命名空间](https://forum.yiiframework.com/t/lowercase-or-camelcase-namespaces/124983/52)。"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] [Clean up error handler](https://github.com/yiisoft/yii2/issues/14348). Make sure the error handler catches fatals and is using response."
-msgstr ""
+msgstr "[x] [清理错误处理器](https://github.com/yiisoft/yii2/issues/14348)。确保错误处理器捕获致命错误并使用响应。"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] Make validators independent of models to allow reusing them in handlers."
-msgstr ""
+msgstr "[x] 使验证器独立于模型,以允许在处理器中重用它们。"
#. type: Bullet: '- '
#: ../src/internals/003-roadmap.md
msgid "[x] [Split IdentityInterface](https://github.com/yiisoft/yii2/issues/13825)."
-msgstr ""
+msgstr "[x] [拆分 IdentityInterface](https://github.com/yiisoft/yii2/issues/13825)。"
diff --git a/_translations/po/zh-CN/internals_004-namespaces.md.po b/_translations/po/zh-CN/internals_004-namespaces.md.po
index 51e93b30..31606246 100644
--- a/_translations/po/zh-CN/internals_004-namespaces.md.po
+++ b/_translations/po/zh-CN/internals_004-namespaces.md.po
@@ -25,43 +25,43 @@ msgstr ""
#: ../src/en/internals/008-interfaces.md
#, no-wrap
msgid "References"
-msgstr ""
+msgstr "参考资料"
#. type: Title #
#: ../src/en/internals/004-namespaces.md
#, no-wrap
msgid "004 — Namespaces"
-msgstr ""
+msgstr "004 — 命名空间"
#. type: Plain text
#: ../src/en/internals/004-namespaces.md
msgid "Package namespace rules are the following:"
-msgstr ""
+msgstr "包命名空间规则如下:"
#. type: Bullet: '1. '
#: ../src/en/internals/004-namespaces.md
msgid "PascalCase is used for namespace parts."
-msgstr ""
+msgstr "命名空间部分使用 PascalCase(帕斯卡命名法)。"
#. type: Bullet: '2. '
#: ../src/en/internals/004-namespaces.md
msgid "Root vendor namespace is `Yiisoft`."
-msgstr ""
+msgstr "根供应商命名空间是 `Yiisoft`。"
#. type: Bullet: '3. '
#: ../src/en/internals/004-namespaces.md
msgid "Package name parts are used in namespace."
-msgstr ""
+msgstr "包名称部分用于命名空间。"
#. type: Bullet: '4. '
#: ../src/en/internals/004-namespaces.md
msgid "Adjective is added to a noun and is a single part."
-msgstr ""
+msgstr "形容词添加到名词后,作为单个部分。"
#. type: Plain text
#: ../src/en/internals/004-namespaces.md
msgid "Some examples:"
-msgstr ""
+msgstr "一些示例:"
#. type: Plain text
#: ../src/en/internals/004-namespaces.md
@@ -78,4 +78,4 @@ msgstr ""
#. type: Bullet: '- '
#: ../src/en/internals/004-namespaces.md
msgid "[International forum discussion](https://forum.yiiframework.com/t/use-yiisoft-as-a-root-namespace-instead-of-yii-for-yii-3-packages/125734)"
-msgstr ""
+msgstr "[国际论坛讨论](https://forum.yiiframework.com/t/use-yiisoft-as-a-root-namespace-instead-of-yii-for-yii-3-packages/125734)"
diff --git a/_translations/po/zh-CN/internals_005-development-tool.md.po b/_translations/po/zh-CN/internals_005-development-tool.md.po
index 89139a11..f9931120 100644
--- a/_translations/po/zh-CN/internals_005-development-tool.md.po
+++ b/_translations/po/zh-CN/internals_005-development-tool.md.po
@@ -19,12 +19,12 @@ msgstr ""
#: ../src/en/internals/005-development-tool.md
#, no-wrap
msgid "005 — Yii development tool"
-msgstr ""
+msgstr "005 — Yii 开发工具"
#. type: Plain text
#: ../src/en/internals/005-development-tool.md
msgid "For Yii3, the number of packages increased significantly to achieve more reusability and independent releases. To ease development of the framework itself, we've created a special tool available from [yiisoft/yii-dev-tool](https://github.com/yiisoft/yii-dev-tool)."
-msgstr ""
+msgstr "对于 Yii3,为了实现更好的可重用性和独立发布,包的数量显著增加。为了简化框架本身的开发,我们创建了一个特殊的工具,可从 [yiisoft/yii-dev-tool](https://github.com/yiisoft/yii-dev-tool) 获取。"
#. type: Fenced code block
#: ../src/en/internals/005-development-tool.md
@@ -60,24 +60,24 @@ msgstr ""
#. type: Plain text
#: ../src/en/internals/005-development-tool.md
msgid "There are many commands available. The most important ones are `install` and `update`. What it does is:"
-msgstr ""
+msgstr "有许多可用的命令。最重要的是 `install` 和 `update`。它的作用是:"
#. type: Bullet: '1. '
#: ../src/en/internals/005-development-tool.md
msgid "Install/update all packages listed in [`packages.php`](https://github.com/yiisoft/yii-dev-tool/blob/master/packages.php) or individual package from that list if specified."
-msgstr ""
+msgstr "安装/更新 [`packages.php`](https://github.com/yiisoft/yii-dev-tool/blob/master/packages.php) 中列出的所有包,或者如果指定了,则安装/更新该列表中的单个包。"
#. type: Bullet: '2. '
#: ../src/en/internals/005-development-tool.md
msgid "For every package installed check `vendor` directory for packages listed in `packages.php`. If there is any, replace the package directory with a symlink to another package source."
-msgstr ""
+msgstr "对于每个已安装的包,检查 `vendor` 目录中是否有 `packages.php` 中列出的包。如果有,则将包目录替换为指向另一个包源的符号链接。"
#. type: Plain text
#: ../src/en/internals/005-development-tool.md
msgid "As a result, you will have many packages using each other, so there is no need to `git push` and `composer install` / `composer update` during development."
-msgstr ""
+msgstr "因此,您将拥有许多相互使用的包,所以在开发过程中无需执行 `git push` 和 `composer install` / `composer update`。"
#. type: Plain text
#: ../src/en/internals/005-development-tool.md
msgid "A [detailed example](https://github.com/yiisoft/yii-dev-tool#usage-example) of using the tool is available in its README."
-msgstr ""
+msgstr "工具的 [详细使用示例](https://github.com/yiisoft/yii-dev-tool#usage-example) 可在其 README 中找到。"
diff --git a/_translations/po/zh-CN/internals_006-git-commit-messages.md.po b/_translations/po/zh-CN/internals_006-git-commit-messages.md.po
index 9e428753..0cdb29e2 100644
--- a/_translations/po/zh-CN/internals_006-git-commit-messages.md.po
+++ b/_translations/po/zh-CN/internals_006-git-commit-messages.md.po
@@ -20,56 +20,56 @@ msgstr ""
#: ../src/en/internals/006-git-commit-messages.md
#, no-wrap
msgid "Body"
-msgstr ""
+msgstr "正文"
#. type: Title #
#: ../src/en/internals/006-git-commit-messages.md
#, no-wrap
msgid "006 — Git commit messages"
-msgstr ""
+msgstr "006 — Git 提交消息"
#. type: Title ##
#: ../src/en/internals/006-git-commit-messages.md
#, no-wrap
msgid "Subject line"
-msgstr ""
+msgstr "主题行"
#. type: Bullet: '- '
#: ../src/en/internals/006-git-commit-messages.md
msgid "Use `#123` to reference issue by number"
-msgstr ""
+msgstr "使用 `#123` 通过编号引用问题"
#. type: Bullet: '- '
#: ../src/en/internals/006-git-commit-messages.md
msgid "Use imperative mood that's `Fix`, not `Fixed`"
-msgstr ""
+msgstr "使用祈使语气,即 `Fix` 而不是 `Fixed`"
#. type: Bullet: '- '
#: ../src/en/internals/006-git-commit-messages.md
msgid "Don't add a period at the end"
-msgstr ""
+msgstr "末尾不要添加句号"
#. type: Bullet: '- '
#: ../src/en/internals/006-git-commit-messages.md
msgid "Use `[skip ci]` if there is no need to run unit tests"
-msgstr ""
+msgstr "如果不需要运行单元测试,使用 `[skip ci]`"
#. type: Bullet: '- '
#: ../src/en/internals/006-git-commit-messages.md
msgid "Start with a capital letter"
-msgstr ""
+msgstr "以大写字母开头"
#. type: Bullet: '- '
#: ../src/en/internals/006-git-commit-messages.md
msgid "Limit to 50 characters"
-msgstr ""
+msgstr "限制在 50 个字符以内"
#. type: Plain text
#: ../src/en/internals/006-git-commit-messages.md
msgid "Use the message body **if** you need an extra explanation. Explain why, not how."
-msgstr ""
+msgstr "**如果**需要额外说明,使用消息正文。解释为什么,而不是如何做。"
#. type: Bullet: '- '
#: ../src/en/internals/006-git-commit-messages.md
msgid "Limit line length to 72 characters"
-msgstr ""
+msgstr "限制行长度为 72 个字符"
diff --git a/_translations/po/zh-CN/internals_007-exceptions.md.po b/_translations/po/zh-CN/internals_007-exceptions.md.po
index 225f640b..fe7b1b7c 100644
--- a/_translations/po/zh-CN/internals_007-exceptions.md.po
+++ b/_translations/po/zh-CN/internals_007-exceptions.md.po
@@ -25,45 +25,45 @@ msgstr ""
#: ../src/en/internals/008-interfaces.md
#, no-wrap
msgid "References"
-msgstr ""
+msgstr "参考资料"
#. type: Title #
#: ../src/en/internals/007-exceptions.md
#, no-wrap
msgid "007 — Exceptions"
-msgstr ""
+msgstr "007 — 异常"
#. type: Bullet: '- '
#: ../src/en/internals/007-exceptions.md
msgid "Throw exceptions instead of returning an error code."
-msgstr ""
+msgstr "抛出异常而不是返回错误代码。"
#. type: Bullet: '- '
#: ../src/en/internals/007-exceptions.md
msgid "Exception class name must be suffixed with `Exception`."
-msgstr ""
+msgstr "异常类名必须以 `Exception` 作为后缀。"
#. type: Bullet: '- '
#: ../src/en/internals/007-exceptions.md
msgid "Use grammatically correct error messages including ending punctuation, that's most exceptions must end with a period."
-msgstr ""
+msgstr "使用语法正确的错误消息,包括结束标点符号,即大多数异常必须以句号结尾。"
#. type: Bullet: '- '
#: ../src/en/internals/007-exceptions.md
msgid "`\\InvalidArgumentException` must be used directly. There should be no exceptions inherited from it."
-msgstr ""
+msgstr "`\\InvalidArgumentException` 必须直接使用。不应该有从它继承的异常。"
#. type: Bullet: '- '
#: ../src/en/internals/007-exceptions.md
msgid "`\\InvalidArgumentException` must never be caught."
-msgstr ""
+msgstr "`\\InvalidArgumentException` 绝不能被捕获。"
#. type: Bullet: '- '
#: ../src/en/internals/007-exceptions.md
msgid "[International community discussion and poll](https://forum.yiiframework.com/t/naming-exceptions/126613/6)"
-msgstr ""
+msgstr "[国际社区讨论和投票](https://forum.yiiframework.com/t/naming-exceptions/126613/6)"
#. type: Bullet: '- '
#: ../src/en/internals/007-exceptions.md
msgid "[Russian community discussion and poll](https://yiiframework.ru/forum/viewtopic.php?f=39&t=51290)"
-msgstr ""
+msgstr "[俄罗斯社区讨论和投票](https://yiiframework.ru/forum/viewtopic.php?f=39&t=51290)"
diff --git a/_translations/po/zh-CN/internals_008-interfaces.md.po b/_translations/po/zh-CN/internals_008-interfaces.md.po
index 0f5ef680..b0b7f971 100644
--- a/_translations/po/zh-CN/internals_008-interfaces.md.po
+++ b/_translations/po/zh-CN/internals_008-interfaces.md.po
@@ -25,25 +25,25 @@ msgstr ""
#: ../src/en/internals/008-interfaces.md
#, no-wrap
msgid "References"
-msgstr ""
+msgstr "参考资料"
#. type: Title #
#: ../src/en/internals/008-interfaces.md
#, no-wrap
msgid "008 — Interfaces"
-msgstr ""
+msgstr "008 — 接口"
#. type: Bullet: '- '
#: ../src/en/internals/008-interfaces.md
msgid "Interface name should be suffixed with `Interface`."
-msgstr ""
+msgstr "接口名称应以 `Interface` 作为后缀。"
#. type: Bullet: '- '
#: ../src/en/internals/008-interfaces.md
msgid "[International community discussion and poll](https://forum.yiiframework.com/t/naming-interfaces/126612/5)"
-msgstr ""
+msgstr "[国际社区讨论和投票](https://forum.yiiframework.com/t/naming-interfaces/126612/5)"
#. type: Bullet: '- '
#: ../src/en/internals/008-interfaces.md
msgid "[Russian community discussion and poll](https://yiiframework.ru/forum/viewtopic.php?f=39&t=51289)"
-msgstr ""
+msgstr "[俄罗斯社区讨论和投票](https://yiiframework.ru/forum/viewtopic.php?f=39&t=51289)"
diff --git a/_translations/po/zh-CN/internals_009-design-decisions.md.po b/_translations/po/zh-CN/internals_009-design-decisions.md.po
index c21606b2..841bf76e 100644
--- a/_translations/po/zh-CN/internals_009-design-decisions.md.po
+++ b/_translations/po/zh-CN/internals_009-design-decisions.md.po
@@ -19,177 +19,177 @@ msgstr ""
#: ../src/en/internals/009-design-decisions.md
#, no-wrap
msgid "009 — Design Decisions"
-msgstr ""
+msgstr "009 — 设计决策"
#. type: Plain text
#: ../src/en/internals/009-design-decisions.md
msgid "In this document, we list important design decisions taken during Yii3 development."
-msgstr ""
+msgstr "在本文档中,我们列出了 Yii3 开发过程中做出的重要设计决策。"
#. type: Title ##
#: ../src/en/internals/009-design-decisions.md
#, no-wrap
msgid "Remove magic properties"
-msgstr ""
+msgstr "移除魔术属性"
#. type: Plain text
#: ../src/en/internals/009-design-decisions.md
msgid "Magic properties in Yii 2 were an interesting idea that allowed a developer to start with public property and then seamlessly migrate to using getter/setter called via magic methods without changing the code."
-msgstr ""
+msgstr "Yii 2 中的魔术属性是一个有趣的想法,它允许开发者从公共属性开始,然后无缝迁移到通过魔术方法调用的 getter/setter,而无需更改代码。"
#. type: Plain text
#: ../src/en/internals/009-design-decisions.md
msgid "The main reason for removal in Yii 3 is that it resulted in using public properties everywhere, thus lack of encapsulation and code fragility."
-msgstr ""
+msgstr "在 Yii 3 中移除它的主要原因是它导致到处使用公共属性,从而缺乏封装性和代码脆弱性。"
#. type: Title ##
#: ../src/en/internals/009-design-decisions.md
#, no-wrap
msgid "Remove the service locator"
-msgstr ""
+msgstr "移除服务定位器"
#. type: Plain text
#: ../src/en/internals/009-design-decisions.md
msgid "Service locator both Yii 1 and Yii 2 was convenient but was also abused a lot. Although a dependency injection container was available in Yii 2, service locator was generally preferred to cause both a dependency on the service locator itself, high coupling, hard to test code."
-msgstr ""
+msgstr "Yii 1 和 Yii 2 中的服务定位器很方便,但也被大量滥用。尽管 Yii 2 中提供了依赖注入容器,但服务定位器通常更受欢迎,这导致了对服务定位器本身的依赖、高耦合和难以测试的代码。"
#. type: Plain text
#: ../src/en/internals/009-design-decisions.md
msgid "Yii 3 relies on dependency injection only lowering coupling significantly and making code way more testable."
-msgstr ""
+msgstr "Yii 3 仅依赖依赖注入,显著降低了耦合度,使代码更易于测试。"
#. type: Title ##
#: ../src/en/internals/009-design-decisions.md
#, no-wrap
msgid "Extract general packages"
-msgstr ""
+msgstr "提取通用包"
#. type: Plain text
#: ../src/en/internals/009-design-decisions.md
msgid "Yii 1 and Yii 2 were fully closed communities. All the code we had wasn't useful outside Yii, and most of the \"external\" code wasn't useful in Yii without wrappers. It was noted many times by communities external to Yii that many parts of Yii are well-designed and unique, and they'd use these if these were available as standalone packages."
-msgstr ""
+msgstr "Yii 1 和 Yii 2 是完全封闭的社区。我们拥有的所有代码在 Yii 之外都没有用处,而大多数“外部”代码在没有包装器的情况下在 Yii 中也没有用处。Yii 外部的社区多次指出,Yii 的许多部分设计良好且独特,如果这些部分作为独立包提供,他们会使用它们。"
#. type: Plain text
#: ../src/en/internals/009-design-decisions.md
msgid "As part of Yii 3 packages such as cache, RBAC, view, etc. were extracted into framework-independent packages. Benefits are:"
-msgstr ""
+msgstr "作为 Yii 3 的一部分,缓存、RBAC、视图等包被提取为独立于框架的包。好处是:"
#. type: Bullet: '- '
#: ../src/en/internals/009-design-decisions.md
msgid "Increased usage and contribution"
-msgstr ""
+msgstr "增加使用和贡献"
#. type: Bullet: '- '
#: ../src/en/internals/009-design-decisions.md
msgid "Yii team could delegate maintenance"
-msgstr ""
+msgstr "Yii 团队可以委托维护"
#. type: Bullet: '- '
#: ../src/en/internals/009-design-decisions.md
msgid "Independent releases are possible"
-msgstr ""
+msgstr "可以独立发布"
#. type: Title ##
#: ../src/en/internals/009-design-decisions.md
#, no-wrap
msgid "Adopt PSRs"
-msgstr ""
+msgstr "采用 PSR"
#. type: Plain text
#: ../src/en/internals/009-design-decisions.md
msgid "The team adopted some PSRs in Yii 2, such as PSR-4 and PSR-2. Interfaces in general weren't, although Yii is part of PHP-FIG. Mainly because when Yii 2 was released, these were either in the making or not adopted enough."
-msgstr ""
+msgstr "团队在 Yii 2 中采用了一些 PSR,例如 PSR-4 和 PSR-2。尽管 Yii 是 PHP-FIG 的一部分,但通常没有采用接口。主要是因为当 Yii 2 发布时,这些要么正在制定中,要么还没有被充分采用。"
#. type: Plain text
#: ../src/en/internals/009-design-decisions.md
msgid "Yii3 benefits from PSRs since there are nowadays many ready-to-use libraries that one can get via Composer: cache backends, middleware, loggers, DI containers, etc."
-msgstr ""
+msgstr "Yii3 从 PSR 中受益,因为现在有许多可以通过 Composer 获得的即用型库:缓存后端、中间件、日志记录器、DI 容器等。"
#. type: Plain text
#: ../src/en/internals/009-design-decisions.md
msgid "By implementing PSRs in general packages, we allow these to be used in more projects, thus raising the contribution level."
-msgstr ""
+msgstr "通过在通用包中实现 PSR,我们允许这些包在更多项目中使用,从而提高贡献水平。"
#. type: Title ##
#: ../src/en/internals/009-design-decisions.md
#, no-wrap
msgid "Improve DI container"
-msgstr ""
+msgstr "改进 DI 容器"
#. type: Plain text
#: ../src/en/internals/009-design-decisions.md
msgid "The problem with the Yii 2 container was that it's tailored to be used with Yii 2 components. API isn't well-designed to be used with general PHP classes."
-msgstr ""
+msgstr "Yii 2 容器的问题在于它是为与 Yii 2 组件一起使用而定制的。API 设计不适合与通用 PHP 类一起使用。"
#. type: Plain text
#: ../src/en/internals/009-design-decisions.md
msgid "In Yii3, we ensured that container can be used to conveniently configure any PHP class."
-msgstr ""
+msgstr "在 Yii3 中,我们确保容器可以方便地配置任何 PHP 类。"
#. type: Plain text
#: ../src/en/internals/009-design-decisions.md
msgid "That should result in the absence of Yii-specific wrapper packages and more direct usages of Composer packages."
-msgstr ""
+msgstr "这应该会导致不再需要 Yii 特定的包装器包,并更直接地使用 Composer 包。"
#. type: Title ##
#: ../src/en/internals/009-design-decisions.md
#, no-wrap
msgid "Adopt strict types"
-msgstr ""
+msgstr "采用严格类型"
#. type: Plain text
#: ../src/en/internals/009-design-decisions.md
msgid "Strict types were introduced because:"
-msgstr ""
+msgstr "引入严格类型是因为:"
#. type: Bullet: '- '
#: ../src/en/internals/009-design-decisions.md
msgid "PHP 7 is now mainstream"
-msgstr ""
+msgstr "PHP 7 现在已成为主流"
#. type: Bullet: '- '
#: ../src/en/internals/009-design-decisions.md
msgid "While they solve no significant Yii 2 problems, they help to avoid many day-to-day development issues"
-msgstr ""
+msgstr "虽然它们没有解决 Yii 2 的重大问题,但它们有助于避免许多日常开发问题"
#. type: Title ##
#: ../src/en/internals/009-design-decisions.md
#, no-wrap
msgid "Adopt SemVer"
-msgstr ""
+msgstr "采用 SemVer"
#. type: Plain text
#: ../src/en/internals/009-design-decisions.md
msgid "Yii 2 has its own version policy. Problems:"
-msgstr ""
+msgstr "Yii 2 有自己的版本策略。问题:"
#. type: Bullet: '- '
#: ../src/en/internals/009-design-decisions.md
msgid "It wasn't standard"
-msgstr ""
+msgstr "它不是标准的"
#. type: Bullet: '- '
#: ../src/en/internals/009-design-decisions.md
msgid "Composer relies on SemVer"
-msgstr ""
+msgstr "Composer 依赖于 SemVer"
#. type: Bullet: '- '
#: ../src/en/internals/009-design-decisions.md
msgid "It's hard to support a framework built on top of packages if the versioning policy isn't strict"
-msgstr ""
+msgstr "如果版本策略不严格,很难支持建立在包之上的框架"
#. type: Title ##
#: ../src/en/internals/009-design-decisions.md
#, no-wrap
msgid "Prevent validators mutating data"
-msgstr ""
+msgstr "防止验证器改变数据"
#. type: Plain text
#: ../src/en/internals/009-design-decisions.md
msgid "In Yii 1 and Yii 2, validators such as \"date\" were mutating data. It was confusing for a validation process not initially meant to mutate data it validates."
-msgstr ""
+msgstr "在 Yii 1 和 Yii 2 中,诸如“date”之类的验证器会改变数据。对于最初不打算改变其验证的数据的验证过程来说,这令人困惑。"
#. type: Plain text
#: ../src/en/internals/009-design-decisions.md
msgid "[See related discussion](https://forum.yiiframework.com/t/saving-or-killing-non-validation-in-validators/126086)."
-msgstr ""
+msgstr "[查看相关讨论](https://forum.yiiframework.com/t/saving-or-killing-non-validation-in-validators/126086)。"
diff --git a/_translations/po/zh-CN/internals_010-code-style.md.po b/_translations/po/zh-CN/internals_010-code-style.md.po
index 2249cbcb..59d74f50 100644
--- a/_translations/po/zh-CN/internals_010-code-style.md.po
+++ b/_translations/po/zh-CN/internals_010-code-style.md.po
@@ -19,119 +19,119 @@ msgstr ""
#: ../src/guide/databases/db-migrations.md ../src/internals/010-code-style.md
#, no-wrap
msgid "Strings"
-msgstr ""
+msgstr "字符串"
#. type: Title #
#: ../src/internals/010-code-style.md
#, no-wrap
msgid "010 — Code style"
-msgstr ""
+msgstr "010 — 代码风格"
#. type: Plain text
#: ../src/internals/010-code-style.md
msgid "Code formatting used in Yii 3 packages is based on [PSR-1](https://www.php-fig.org/psr/psr-1/) and [PSR-12](https://www.php-fig.org/psr/psr-12/) with extra rules added on top of it."
-msgstr ""
+msgstr "Yii 3 包中使用的代码格式基于 [PSR-1](https://www.php-fig.org/psr/psr-1/) 和 [PSR-12](https://www.php-fig.org/psr/psr-12/),并在此基础上添加了额外的规则。"
#. type: Title ###
#: ../src/internals/010-code-style.md ../src/internals/017-tags.md
#: ../src/internals/018-widgets.md
#, no-wrap
msgid "Names"
-msgstr ""
+msgstr "命名"
#. type: Bullet: '- '
#: ../src/internals/010-code-style.md
msgid "Use English only."
-msgstr ""
+msgstr "仅使用英语。"
#. type: Bullet: '- '
#: ../src/internals/010-code-style.md
msgid "Use camelCase notation, including abbreviations (e.g., `enableIdn`)."
-msgstr ""
+msgstr "使用驼峰命名法,包括缩写(例如,`enableIdn`)。"
#. type: Bullet: '- '
#: ../src/internals/010-code-style.md
msgid "Use the shortest possible, but an explanatory name."
-msgstr ""
+msgstr "使用尽可能短但具有解释性的名称。"
#. type: Bullet: '- '
#: ../src/internals/010-code-style.md
msgid "Never trim or abbreviate a name."
-msgstr ""
+msgstr "永远不要修剪或缩写名称。"
#. type: Bullet: '- '
#: ../src/internals/010-code-style.md
msgid "Postfix classes, interfaces, traits and variables, which is a [collection](https://en.wikipedia.org/wiki/Collection_(abstract_data_type)), with `Collection`."
-msgstr ""
+msgstr "对于 [集合](https://en.wikipedia.org/wiki/Collection_(abstract_data_type)) 的类、接口、trait 和变量,使用 `Collection` 后缀。"
#. type: Bullet: '- '
#: ../src/internals/010-code-style.md
msgid "Postfix middleware classes with `Middleware`."
-msgstr ""
+msgstr "对中间件类使用 `Middleware` 后缀。"
#. type: Title ##
#: ../src/internals/010-code-style.md
#, no-wrap
msgid "Types"
-msgstr ""
+msgstr "类型"
#. type: Bullet: '- '
#: ../src/internals/010-code-style.md
msgid "Declare [argument and return types](https://www.php.net/manual/en/migration70.new-features.php) where possible."
-msgstr ""
+msgstr "尽可能声明 [参数和返回类型](https://www.php.net/manual/en/migration70.new-features.php)。"
#. type: Bullet: '- '
#: ../src/internals/010-code-style.md
msgid "[Use types for properties](https://wiki.php.net/rfc/typed_properties_v2)."
-msgstr ""
+msgstr "[为属性使用类型](https://wiki.php.net/rfc/typed_properties_v2)。"
#. type: Bullet: '- '
#: ../src/internals/010-code-style.md
msgid "Use strict typing. Avoid mixed and union types where possible except compatible types such as `string|Stringable`."
-msgstr ""
+msgstr "使用严格类型。尽可能避免混合类型和联合类型,除非是兼容类型,如 `string|Stringable`。"
#. type: Title ##
#: ../src/internals/010-code-style.md
#, no-wrap
msgid "Comments"
-msgstr ""
+msgstr "注释"
#. type: Plain text
#: ../src/internals/010-code-style.md
msgid "Inline comments are to be avoided unless code couldn't be understood without them. A good example is a workaround for a bug in a certain PHP version."
-msgstr ""
+msgstr "除非没有注释就无法理解代码,否则应避免内联注释。一个好的例子是针对某个 PHP 版本中的 bug 的解决方法。"
#. type: Plain text
#: ../src/internals/010-code-style.md
msgid "Method comment is necessary except it adds nothing to what method name and signature already has."
-msgstr ""
+msgstr "方法注释是必要的,除非它没有为方法名称和签名已有的内容添加任何内容。"
#. type: Plain text
#: ../src/internals/010-code-style.md
msgid "Class comment should describe the purpose of the class."
-msgstr ""
+msgstr "类注释应描述类的目的。"
#. type: Plain text
#: ../src/internals/010-code-style.md
msgid "[See PHPDoc](https://github.com/yiisoft/docs/blob/master/014-docs.md#phpdoc)."
-msgstr ""
+msgstr "[查看 PHPDoc](https://github.com/yiisoft/docs/blob/master/014-docs.md#phpdoc)。"
#. type: Title ##
#: ../src/internals/010-code-style.md
#, no-wrap
msgid "Formatting"
-msgstr ""
+msgstr "格式化"
#. type: Title ###
#: ../src/internals/010-code-style.md
#, no-wrap
msgid "No alignment"
-msgstr ""
+msgstr "不对齐"
#. type: Plain text
#: ../src/internals/010-code-style.md
msgid "Property, variable and constant value assignments shouldn't be aligned. The same applies to phpdoc tags. The reason is that aligned statements often cause larger diff and even conflicts."
-msgstr ""
+msgstr "属性、变量和常量值赋值不应对齐。phpdoc 标签也是如此。原因是对齐的语句通常会导致更大的差异甚至冲突。"
#. type: Fenced code block (php)
#: ../src/internals/010-code-style.md
@@ -161,12 +161,12 @@ msgstr ""
#: ../src/internals/010-code-style.md
#, no-wrap
msgid "Chain calls"
-msgstr ""
+msgstr "链式调用"
#. type: Plain text
#: ../src/internals/010-code-style.md
msgid "Chained calls should be formatted for better readability. If it's a long chain that doesn't fit the line length of 120 characters, then each call should on a new line:"
-msgstr ""
+msgstr "链式调用应格式化以提高可读性。如果是不适合 120 个字符行长度的长链,则每个调用应在新行上:"
#. type: Fenced code block (php)
#: ../src/internals/010-code-style.md
@@ -183,7 +183,7 @@ msgstr ""
#. type: Plain text
#: ../src/internals/010-code-style.md
msgid "If it's a short chain, it's alright for it to be on a single line:"
-msgstr ""
+msgstr "如果是短链,可以在单行上:"
#. type: Fenced code block (php)
#: ../src/internals/010-code-style.md
@@ -194,84 +194,84 @@ msgstr ""
#. type: Bullet: '- '
#: ../src/internals/010-code-style.md
msgid "When no variables involved, use `'Hello!'`"
-msgstr ""
+msgstr "当不涉及变量时,使用 `'Hello!'`"
#. type: Bullet: '- '
#: ../src/internals/010-code-style.md
msgid "To get variables into string prefer `\"Hello, $username!\"`"
-msgstr ""
+msgstr "要将变量放入字符串,首选 `\"Hello, $username!\"`"
#. type: Title ##
#: ../src/internals/010-code-style.md
#, no-wrap
msgid "Classes and interfaces"
-msgstr ""
+msgstr "类和接口"
#. type: Title ###
#: ../src/internals/010-code-style.md
#, no-wrap
msgid "Final by default"
-msgstr ""
+msgstr "默认为 final"
#. type: Plain text
#: ../src/internals/010-code-style.md
msgid "Classes should be `final` by default."
-msgstr ""
+msgstr "类默认应该是 `final` 的。"
#. type: Title ###
#: ../src/internals/010-code-style.md
#, no-wrap
msgid "Private by default"
-msgstr ""
+msgstr "默认为 private"
#. type: Plain text
#: ../src/internals/010-code-style.md
msgid "Constants, properties and methods should be private by default."
-msgstr ""
+msgstr "常量、属性和方法默认应该是 private 的。"
#. type: Title ###
#: ../src/internals/010-code-style.md
#, no-wrap
msgid "Composition over inheritance"
-msgstr ""
+msgstr "组合优于继承"
#. type: Plain text
#: ../src/internals/010-code-style.md
msgid "Prefer [composition to inheritance](guide/en/concept/di-container.md)."
-msgstr ""
+msgstr "优先使用[组合而不是继承](guide/en/concept/di-container.md)。"
#. type: Title ###
#: ../src/internals/010-code-style.md
#, no-wrap
msgid "Property, constant and method order"
-msgstr ""
+msgstr "属性、常量和方法顺序"
#. type: Plain text
#: ../src/internals/010-code-style.md
msgid "Order should be the following:"
-msgstr ""
+msgstr "顺序应该如下:"
#. type: Bullet: '- '
#: ../src/internals/010-code-style.md
msgid "Constants"
-msgstr ""
+msgstr "常量"
#. type: Bullet: '- '
#: ../src/internals/010-code-style.md
msgid "Properties"
-msgstr ""
+msgstr "属性"
#. type: Title ##
#: ../src/internals/010-code-style.md ../src/internals/017-tags.md
#: ../src/internals/018-widgets.md
#, no-wrap
msgid "Methods"
-msgstr ""
+msgstr "方法"
#. type: Plain text
#: ../src/internals/010-code-style.md
msgid "Within each category, items should be sorted by visibility:"
-msgstr ""
+msgstr "在每个类别中,项目应按可见性排序:"
#. type: Bullet: '- '
#: ../src/internals/010-code-style.md
@@ -292,23 +292,23 @@ msgstr ""
#: ../src/internals/010-code-style.md
#, no-wrap
msgid "Abstract classes"
-msgstr ""
+msgstr "抽象类"
#. type: Plain text
#: ../src/internals/010-code-style.md
msgid "Abstract classes *shouldn't* be prefixed or postfixed with `Abstract`."
-msgstr ""
+msgstr "抽象类*不应该*使用 `Abstract` 前缀或后缀。"
#. type: Title ####
#: ../src/internals/010-code-style.md
#, no-wrap
msgid "Immutable methods"
-msgstr ""
+msgstr "不可变方法"
#. type: Plain text
#: ../src/internals/010-code-style.md
msgid "Immutable method convention is the following:"
-msgstr ""
+msgstr "不可变方法约定如下:"
#. type: Fenced code block (php)
#: ../src/internals/010-code-style.md
@@ -325,23 +325,23 @@ msgstr ""
#. type: Bullet: '1. '
#: ../src/internals/010-code-style.md
msgid "Cloned object name is `$new`."
-msgstr ""
+msgstr "克隆对象名称为 `$new`。"
#. type: Bullet: '2. '
#: ../src/internals/010-code-style.md
msgid "Return type is `self`."
-msgstr ""
+msgstr "返回类型为 `self`。"
#. type: Title ####
#: ../src/internals/010-code-style.md
#, no-wrap
msgid "Boolean check methods"
-msgstr ""
+msgstr "布尔检查方法"
#. type: Plain text
#: ../src/internals/010-code-style.md
msgid "Methods that are there to check if something is true should be named like the following:"
-msgstr ""
+msgstr "用于检查某事是否为真的方法应命名如下:"
#. type: Fenced code block (php)
#: ../src/internals/010-code-style.md
@@ -356,12 +356,12 @@ msgstr ""
#: ../src/internals/010-code-style.md
#, no-wrap
msgid "Flags in methods "
-msgstr ""
+msgstr "方法中的标志"
#. type: Plain text
#: ../src/internals/010-code-style.md
msgid "Boolean flags in methods are better to be avoided. It's a sign the method may be doing too much, and there should be two methods instead of one."
-msgstr ""
+msgstr "最好避免在方法中使用布尔标志。这表明该方法可能做得太多,应该有两个方法而不是一个。"
#. type: Fenced code block (php)
#: ../src/internals/010-code-style.md
@@ -372,7 +372,7 @@ msgstr ""
#. type: Plain text
#: ../src/internals/010-code-style.md
msgid "It is better to be two methods:"
-msgstr ""
+msgstr "最好是两个方法:"
#. type: Fenced code block (php)
#: ../src/internals/010-code-style.md
@@ -386,12 +386,12 @@ msgstr ""
#: ../src/internals/010-code-style.md
#, no-wrap
msgid "Variables"
-msgstr ""
+msgstr "变量"
#. type: Plain text
#: ../src/internals/010-code-style.md
msgid "Add an underscore (`_`) prefix for unused variables. For example:"
-msgstr ""
+msgstr "为未使用的变量添加下划线(`_`)前缀。例如:"
#. type: Fenced code block (php)
#: ../src/internals/010-code-style.md
@@ -406,12 +406,12 @@ msgstr ""
#: ../src/internals/010-code-style.md
#, no-wrap
msgid "Imports"
-msgstr ""
+msgstr "导入"
#. type: Plain text
#: ../src/internals/010-code-style.md
msgid "Prefer importing classes and functions to using fully qualified names:"
-msgstr ""
+msgstr "优先导入类和函数,而不是使用完全限定名称:"
#. type: Fenced code block (php)
#: ../src/internals/010-code-style.md
@@ -429,19 +429,19 @@ msgstr ""
#: ../src/internals/010-code-style.md
#, no-wrap
msgid "Additional conventions"
-msgstr ""
+msgstr "其他约定"
#. type: Bullet: '- '
#: ../src/internals/010-code-style.md
msgid "[Namespaces](004-namespaces.md)"
-msgstr ""
+msgstr "[命名空间](004-namespaces.md)"
#. type: Bullet: '- '
#: ../src/internals/010-code-style.md
msgid "[Exceptions](007-exceptions.md)"
-msgstr ""
+msgstr "[异常](007-exceptions.md)"
#. type: Bullet: '- '
#: ../src/internals/010-code-style.md
msgid "[Interfaces](008-interfaces.md)"
-msgstr ""
+msgstr "[接口](008-interfaces.md)"
diff --git a/_translations/po/zh-CN/internals_011-error-correction.md.po b/_translations/po/zh-CN/internals_011-error-correction.md.po
index afa46c09..82e83a9a 100644
--- a/_translations/po/zh-CN/internals_011-error-correction.md.po
+++ b/_translations/po/zh-CN/internals_011-error-correction.md.po
@@ -19,9 +19,9 @@ msgstr ""
#: ../src/en/internals/011-error-correction.md
#, no-wrap
msgid "011 — Error correction"
-msgstr ""
+msgstr "011 — 错误修正"
#. type: Plain text
#: ../src/en/internals/011-error-correction.md
msgid "If it's unambiguous within a class what the developer who incorrectly used the class meant, it's OK to correct the error. Otherwise, the error MUST NOT be corrected."
-msgstr ""
+msgstr "如果在类中可以明确判断开发者错误使用该类的意图,则可以修正错误。否则,不得修正错误。"
diff --git a/_translations/po/zh-CN/internals_012-tests.md.po b/_translations/po/zh-CN/internals_012-tests.md.po
index 85a7f390..e44cb3a5 100644
--- a/_translations/po/zh-CN/internals_012-tests.md.po
+++ b/_translations/po/zh-CN/internals_012-tests.md.po
@@ -19,54 +19,54 @@ msgstr ""
#: ../src/en/internals/012-tests.md
#, no-wrap
msgid "012 — Tests"
-msgstr ""
+msgstr "012 — 测试"
#. type: Plain text
#: ../src/en/internals/012-tests.md
msgid "For each package, we're adding unit-tests that are run via [PHPUnit](https://phpunit.de/). When designing tests, the following guidelines should be taken into account."
-msgstr ""
+msgstr "对于每个包,我们都添加了通过 [PHPUnit](https://phpunit.de/) 运行的单元测试。在设计测试时,应考虑以下准则。"
#. type: Bullet: '- '
#: ../src/en/internals/012-tests.md
msgid "Test class should be marked as `final` by default."
-msgstr ""
+msgstr "测试类默认应标记为 `final`。"
#. type: Bullet: '- '
#: ../src/en/internals/012-tests.md
msgid "`@test` annotation must not be used, prefix methods with `test`."
-msgstr ""
+msgstr "不得使用 `@test` 注解,方法应以 `test` 为前缀。"
#. type: Bullet: '- '
#: ../src/en/internals/012-tests.md
msgid "The test method name must reflect the purpose of the test."
-msgstr ""
+msgstr "测试方法名称必须反映测试的目的。"
#. type: Bullet: '- '
#: ../src/en/internals/012-tests.md
msgid "\"should\" must not be used in the test method name."
-msgstr ""
+msgstr "测试方法名称中不得使用“should”。"
#. type: Bullet: '- '
#: ../src/en/internals/012-tests.md
msgid "If necessary, the test method phpdoc may describe the desired behavior."
-msgstr ""
+msgstr "如有必要,测试方法的 phpdoc 可以描述期望的行为。"
#. type: Bullet: '- '
#: ../src/en/internals/012-tests.md
msgid "The test must follow AAA: first arrange the necessary preconditions, then act, then assert expected results."
-msgstr ""
+msgstr "测试必须遵循 AAA 模式:首先安排(Arrange)必要的前置条件,然后执行(Act),最后断言(Assert)预期结果。"
#. type: Bullet: '- '
#: ../src/en/internals/012-tests.md
msgid "There must be one test case per test method that's a single AAA."
-msgstr ""
+msgstr "每个测试方法必须只有一个测试用例,即单个 AAA。"
#. type: Bullet: '- '
#: ../src/en/internals/012-tests.md
msgid "Test must use public API. Private properties or methods shouldn't be accessed, assumptions on internals of the class tested shouldn't be made."
-msgstr ""
+msgstr "测试必须使用公共 API。不应访问私有属性或方法,不应对被测试类的内部实现做出假设。"
#. type: Bullet: '- '
#: ../src/en/internals/012-tests.md
msgid "Tests shouldn't rely on composer-config-plugin and DI container unless necessary."
-msgstr ""
+msgstr "除非必要,测试不应依赖 composer-config-plugin 和 DI 容器。"
diff --git a/_translations/po/zh-CN/internals_013-code-review.md.po b/_translations/po/zh-CN/internals_013-code-review.md.po
index dfa52e1f..0b230085 100644
--- a/_translations/po/zh-CN/internals_013-code-review.md.po
+++ b/_translations/po/zh-CN/internals_013-code-review.md.po
@@ -19,89 +19,89 @@ msgstr ""
#: ../src/en/internals/013-code-review.md
#, no-wrap
msgid "013 — Code review"
-msgstr ""
+msgstr "013 — 代码审查"
#. type: Plain text
#: ../src/en/internals/013-code-review.md
msgid "Code reviews are essential for the success of the project and are as important as contributing code."
-msgstr ""
+msgstr "代码审查对项目的成功至关重要,与贡献代码同样重要。"
#. type: Plain text
#: ../src/en/internals/013-code-review.md
msgid "Reviews are handled via GitHub pull requests. When the request is ready for review, the \"status: code review\" label is added to it."
-msgstr ""
+msgstr "审查通过 GitHub pull request 处理。当请求准备好审查时,会添加“status: code review”标签。"
#. type: Plain text
#: ../src/en/internals/013-code-review.md
msgid "[A full list of pull requests that need review](https://github.com/search?q=org%3Ayiisoft+label%3A\"status%3Acode+review\"&state=open&type=Issues) is available at GitHub."
-msgstr ""
+msgstr "[需要审查的 pull request 完整列表](https://github.com/search?q=org%3Ayiisoft+label%3A\"status%3Acode+review\"&state=open&type=Issues) 可在 GitHub 上查看。"
#. type: Title ##
#: ../src/en/internals/013-code-review.md
#, no-wrap
msgid "Guidelines"
-msgstr ""
+msgstr "指南"
#. type: Bullet: '- '
#: ../src/en/internals/013-code-review.md
msgid "Check out the pull request branch, open the project in the IDE, get a big picture."
-msgstr ""
+msgstr "检出 pull request 分支,在 IDE 中打开项目,了解全局。"
#. type: Bullet: '- '
#: ../src/en/internals/013-code-review.md
msgid "Does the pull request make sense overall?"
-msgstr ""
+msgstr "pull request 整体上是否合理?"
#. type: Bullet: '- '
#: ../src/en/internals/013-code-review.md
msgid "Run tests and/or application using code from the pull request. Are these OK?"
-msgstr ""
+msgstr "使用 pull request 中的代码运行测试和/或应用程序。这些是否正常?"
#. type: Bullet: '- '
#: ../src/en/internals/013-code-review.md
msgid "Read all lines of code in the pull request."
-msgstr ""
+msgstr "阅读 pull request 中的所有代码行。"
#. type: Bullet: '- '
#: ../src/en/internals/013-code-review.md
msgid "Could it be done simpler?"
-msgstr ""
+msgstr "能否做得更简单?"
#. type: Bullet: '- '
#: ../src/en/internals/013-code-review.md
msgid "Are there security issues?"
-msgstr ""
+msgstr "是否存在安全问题?"
#. type: Bullet: '- '
#: ../src/en/internals/013-code-review.md
msgid "Are there performance issues?"
-msgstr ""
+msgstr "是否存在性能问题?"
#. type: Bullet: '- '
#: ../src/en/internals/013-code-review.md
msgid "When leaving comments, be polite."
-msgstr ""
+msgstr "留下评论时,要有礼貌。"
#. type: Bullet: '- '
#: ../src/en/internals/013-code-review.md
msgid "Avoid code-formatting comments."
-msgstr ""
+msgstr "避免代码格式化方面的评论。"
#. type: Title ##
#: ../src/en/internals/013-code-review.md
#, no-wrap
msgid "Mandatory parts"
-msgstr ""
+msgstr "必需部分"
#. type: Bullet: '- '
#: ../src/en/internals/013-code-review.md
msgid "[ ] Tests that fail without code and pass with code."
-msgstr ""
+msgstr "[ ] 没有代码时失败、有代码时通过的测试。"
#. type: Bullet: '- '
#: ../src/en/internals/013-code-review.md
msgid "[ ] Type hints."
-msgstr ""
+msgstr "[ ] 类型提示。"
#. type: Bullet: '- '
#: ../src/en/internals/013-code-review.md
@@ -111,9 +111,9 @@ msgstr ""
#. type: Bullet: '- '
#: ../src/en/internals/013-code-review.md
msgid "[ ] Documentation: phpdoc, yiisoft/docs."
-msgstr ""
+msgstr "[ ] 文档:phpdoc,yiisoft/docs。"
#. type: Bullet: '- '
#: ../src/en/internals/013-code-review.md
msgid "[ ] Changelog entry (if package is stable)."
-msgstr ""
+msgstr "[ ] 变更日志条目(如果包是稳定的)。"
diff --git a/_translations/po/zh-CN/internals_014-docs.md.po b/_translations/po/zh-CN/internals_014-docs.md.po
index 27f64a24..741a9913 100644
--- a/_translations/po/zh-CN/internals_014-docs.md.po
+++ b/_translations/po/zh-CN/internals_014-docs.md.po
@@ -19,101 +19,101 @@ msgstr ""
#: ../src/internals/014-docs.md
#, no-wrap
msgid "014 — Documentation"
-msgstr ""
+msgstr "014 — 文档"
#. type: Plain text
#: ../src/internals/014-docs.md
msgid "Documentation is one of the most important parts of Yii."
-msgstr ""
+msgstr "文档是 Yii 最重要的部分之一。"
#. type: Title ##
#: ../src/internals/014-docs.md
#, no-wrap
msgid "Package documentation"
-msgstr ""
+msgstr "包文档"
#. type: Plain text
#: ../src/internals/014-docs.md
msgid "Documentation for a package could either be in `README.md` or `docs/{language}/{type}` where `{language}` is a language code and `{type}` could be \"guide,\" \"cookbook\" or something else. Usually `docs` is there if the package usage or configuration isn't trivial or there's a need for translation."
-msgstr ""
+msgstr "包的文档可以在 `README.md` 中,也可以在 `docs/{language}/{type}` 中,其中 `{language}` 是语言代码,`{type}` 可以是“guide”、“cookbook”或其他内容。通常,如果包的使用或配置不简单,或者需要翻译,就会有 `docs`。"
#. type: Plain text
#: ../src/internals/014-docs.md
msgid "Some indicators that it's time to create `docs`:"
-msgstr ""
+msgstr "以下是创建 `docs` 的一些指标:"
#. type: Bullet: '1. '
#: ../src/internals/014-docs.md
msgid "There is a need for translation."
-msgstr ""
+msgstr "需要翻译。"
#. type: Bullet: '2. '
#: ../src/internals/014-docs.md
msgid "Many topics exist. Each of these is big by itself."
-msgstr ""
+msgstr "存在许多主题。每个主题本身都很大。"
#. type: Plain text
#: ../src/internals/014-docs.md
msgid "If the total length of readme is less than about 200 lines, it's fine to keep documentation in the readme."
-msgstr ""
+msgstr "如果 readme 的总长度少于约 200 行,则可以将文档保留在 readme 中。"
#. type: Title ##
#: ../src/internals/014-docs.md
#, no-wrap
msgid "Definitive guide"
-msgstr ""
+msgstr "权威指南"
#. type: Plain text
#: ../src/internals/014-docs.md
msgid "The definitive guide, [yiisoft/docs/guide](https://github.com/yiisoft/docs/tree/master/guide/en) aims at covering usage of packages as a whole framework. Unlike package documentation, it isn't focused on a single package but is covering certain use-cases."
-msgstr ""
+msgstr "权威指南 [yiisoft/docs/guide](https://github.com/yiisoft/docs/tree/master/guide/en) 旨在涵盖作为整个框架的包的使用。与包文档不同,它不专注于单个包,而是涵盖某些用例。"
#. type: Plain text
#: ../src/internals/014-docs.md
msgid "The guide should follow [Microsoft style guide](https://learn.microsoft.com/en-us/style-guide/welcome/)."
-msgstr ""
+msgstr "指南应遵循 [Microsoft 风格指南](https://learn.microsoft.com/en-us/style-guide/welcome/)。"
#. type: Title ###
#: ../src/internals/014-docs.md
#, no-wrap
msgid "Translation"
-msgstr ""
+msgstr "翻译"
#. type: Plain text
#: ../src/internals/014-docs.md
#, no-wrap
msgid "The definitive guide uses [po4a](https://github.com/mquinson/po4a) in GitHub Action for translations. \n"
-msgstr ""
+msgstr "权威指南在 GitHub Action 中使用 [po4a](https://github.com/mquinson/po4a) 进行翻译。\n"
#. type: Plain text
#: ../src/internals/014-docs.md
msgid "Translation algorithm:"
-msgstr ""
+msgstr "翻译流程:"
#. type: Bullet: '- '
#: ../src/internals/014-docs.md
msgid "Install an application for working with `.po` translation files. For example, [Poedit](https://poedit.net/), [Lokalize](https://apps.kde.org/ru/lokalize/), [Gtranslator](https://wiki.gnome.org/Apps/Gtranslator) or another."
-msgstr ""
+msgstr "安装用于处理 `.po` 翻译文件的应用程序。例如,[Poedit](https://poedit.net/),[Lokalize](https://apps.kde.org/ru/lokalize/),[Gtranslator](https://wiki.gnome.org/Apps/Gtranslator) 或其他。"
#. type: Bullet: '- '
#: ../src/internals/014-docs.md
msgid "Find file what you want to translate in `_translations/guide/{lang}`. Note that if the source file is in a subfolder, the subfolder name is appended to the file name and separated by an underscore, for example, for translating `guide/en/concept/aliases.md` file find `_translations/guide/{lang}/concept_aliases.md.po` file."
-msgstr ""
+msgstr "在 `_translations/guide/{lang}` 中找到要翻译的文件。请注意,如果源文件在子文件夹中,则子文件夹名称会附加到文件名并用下划线分隔,例如,要翻译 `guide/en/concept/aliases.md` 文件,请找到 `_translations/guide/{lang}/concept_aliases.md.po` 文件。"
#. type: Bullet: '- '
#: ../src/internals/014-docs.md
msgid "Open the file with the `.po` extension in `Poedit` from the folder with the desired localization, for example `_translations/guide/ru/intro_what-is-yii.md.po`. If there is no localization yet, create an issue."
-msgstr ""
+msgstr "在 `Poedit` 中从所需本地化的文件夹中打开扩展名为 `.po` 的文件,例如 `_translations/guide/ru/intro_what-is-yii.md.po`。如果还没有本地化,请创建一个 issue。"
#. type: Bullet: '- '
#: ../src/internals/014-docs.md
msgid "Translate necessary strings and push the changes"
-msgstr ""
+msgstr "翻译必要的字符串并推送更改"
#. type: Bullet: '- '
#: ../src/internals/014-docs.md
msgid "Open a pull request to the main repository"
-msgstr ""
+msgstr "向主仓库打开一个 pull request"
#. type: Plain text
#: ../src/internals/014-docs.md
@@ -122,37 +122,39 @@ msgid ""
"> [!CAUTION]\n"
"> Do not change the translation in files in `/guide/{lang}` manually.\n"
msgstr ""
+"> [!CAUTION]\n"
+"> 不要手动更改 `/guide/{lang}` 中文件的翻译。\n"
#. type: Plain text
#: ../src/internals/014-docs.md
msgid "If you have changed English and want to update translations:"
-msgstr ""
+msgstr "如果您更改了英文并想更新翻译:"
#. type: Bullet: '- '
#: ../src/internals/014-docs.md
msgid "Pull updated branch after successful completion of workflow `Update docs translation` in GitHub Action"
-msgstr ""
+msgstr "在 GitHub Action 中成功完成工作流程 `Update docs translation` 后拉取更新的分支"
#. type: Bullet: '- '
#: ../src/internals/014-docs.md
msgid "Update translation in `.po` files by `Poedit`"
-msgstr ""
+msgstr "通过 `Poedit` 更新 `.po` 文件中的翻译"
#. type: Bullet: '- '
#: ../src/internals/014-docs.md
msgid "Push changes"
-msgstr ""
+msgstr "推送更改"
#. type: Title ##
#: ../src/internals/014-docs.md
#, no-wrap
msgid "Blocks"
-msgstr ""
+msgstr "块"
#. type: Plain text
#: ../src/internals/014-docs.md
msgid "Blocks are in the [GitHub Alerts format](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#alerts):"
-msgstr ""
+msgstr "块采用 [GitHub Alerts 格式](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#alerts):"
#. type: Fenced code block
#: ../src/internals/014-docs.md
@@ -177,7 +179,7 @@ msgstr ""
#. type: Plain text
#: ../src/internals/014-docs.md
msgid "When translating documentation, these Block indicators should not be translated. Keeps them intact as they are and only translate the block content. For translating the label for the block, each guide translation should have a `blocktypes.json` file containing the translations. The following shows an example for German:"
-msgstr ""
+msgstr "翻译文档时,这些块指示符不应翻译。保持它们原样,只翻译块内容。要翻译块的标签,每个指南翻译都应该有一个包含翻译的 `blocktypes.json` 文件。以下显示了德语的示例:"
#. type: Fenced code block (json)
#: ../src/internals/014-docs.md
@@ -201,7 +203,7 @@ msgstr ""
#. type: Plain text
#: ../src/internals/014-docs.md
msgid "PHPDoc mustn't be added if it doesn't add anything to what it describes. The following is a bad example:"
-msgstr ""
+msgstr "如果 PHPDoc 没有为其描述的内容添加任何内容,则不得添加。以下是一个不好的例子:"
#. type: Fenced code block (php)
#: ../src/internals/014-docs.md
@@ -241,17 +243,17 @@ msgstr ""
#. type: Plain text
#: ../src/internals/014-docs.md
msgid "PHPDoc, if present, should describe the purpose of the element it's added for."
-msgstr ""
+msgstr "PHPDoc(如果存在)应描述其添加的元素的目的。"
#. type: Plain text
#: ../src/internals/014-docs.md
msgid "The `@see` tags must explicitly refer to class methods, properties, and constants. This is necessary for the correct display of links in IDEs, as well as for the correct display of links in API documentation."
-msgstr ""
+msgstr "`@see` 标签必须明确引用类方法、属性和常量。这对于在 IDE 中正确显示链接以及在 API 文档中正确显示链接是必要的。"
#. type: Plain text
#: ../src/internals/014-docs.md
msgid "Example of incorrect code:"
-msgstr ""
+msgstr "错误代码示例:"
#. type: Fenced code block (php)
#: ../src/internals/014-docs.md
@@ -273,7 +275,7 @@ msgstr ""
#. type: Plain text
#: ../src/internals/014-docs.md
msgid "Example of a valid code:"
-msgstr ""
+msgstr "有效代码示例:"
#. type: Fenced code block (php)
#: ../src/internals/014-docs.md
@@ -296,12 +298,12 @@ msgstr ""
#: ../src/internals/014-docs.md
#, no-wrap
msgid "Readme checklist"
-msgstr ""
+msgstr "Readme 检查清单"
#. type: Plain text
#: ../src/internals/014-docs.md
msgid "Each package readme should be placed into `README.md` and contain the following:"
-msgstr ""
+msgstr "每个包的 readme 应放置在 `README.md` 中并包含以下内容:"
#. type: Bullet: '- '
#: ../src/internals/014-docs.md
@@ -311,49 +313,49 @@ msgstr ""
#. type: Bullet: '- '
#: ../src/internals/014-docs.md
msgid "[ ] Short description of the package. What does it do?"
-msgstr ""
+msgstr "[ ] 包的简短描述。它做什么?"
#. type: Bullet: '- '
#: ../src/internals/014-docs.md
msgid "[ ] Quality badges (build, code coverage)."
-msgstr ""
+msgstr "[ ] 质量徽章(构建、代码覆盖率)。"
#. type: Bullet: '- '
#: ../src/internals/014-docs.md
msgid "[ ] Screenshot (if applicable)."
-msgstr ""
+msgstr "[ ] 截图(如果适用)。"
#. type: Bullet: '- '
#: ../src/internals/014-docs.md
msgid "[ ] Requirements."
-msgstr ""
+msgstr "[ ] 要求。"
#. type: Bullet: '- '
#: ../src/internals/014-docs.md
msgid "[ ] Installation. Usually `composer require`."
-msgstr ""
+msgstr "[ ] 安装。通常是 `composer require`。"
#. type: Bullet: '- '
#: ../src/internals/014-docs.md
msgid "[ ] Getting started. One or two common usage examples are demonstrated."
-msgstr ""
+msgstr "[ ] 入门。演示一两个常见的使用示例。"
#. type: Bullet: '- '
#: ../src/internals/014-docs.md
msgid "[ ] Configuration."
-msgstr ""
+msgstr "[ ] 配置。"
#. type: Bullet: '- '
#: ../src/internals/014-docs.md
msgid "[ ] Contributing. It should contain a link to guidelines."
-msgstr ""
+msgstr "[ ] 贡献。它应该包含指南的链接。"
#. type: Bullet: '- '
#: ../src/internals/014-docs.md
msgid "[ ] Running tests."
-msgstr ""
+msgstr "[ ] 运行测试。"
#. type: Bullet: '- '
#: ../src/internals/014-docs.md
msgid "[ ] License."
-msgstr ""
+msgstr "[ ] 许可证。"
diff --git a/_translations/po/zh-CN/internals_015-phpstorm.md.po b/_translations/po/zh-CN/internals_015-phpstorm.md.po
index cb8b6278..d68fd61d 100644
--- a/_translations/po/zh-CN/internals_015-phpstorm.md.po
+++ b/_translations/po/zh-CN/internals_015-phpstorm.md.po
@@ -19,39 +19,39 @@ msgstr ""
#: ../src/en/internals/015-phpstorm.md
#, no-wrap
msgid "015 — PhpStorm metadata and attributes"
-msgstr ""
+msgstr "015 — PhpStorm 元数据和属性"
#. type: Title ##
#: ../src/en/internals/015-phpstorm.md
#, no-wrap
msgid "PhpStorm metadata"
-msgstr ""
+msgstr "PhpStorm 元数据"
#. type: Plain text
#: ../src/en/internals/015-phpstorm.md
msgid "[PhpStorm metadata](https://www.jetbrains.com/help/phpstorm/ide-advanced-metadata.html) helps the IDE to understand code better in cases when regular types and PHPDoc tags don't help."
-msgstr ""
+msgstr "[PhpStorm 元数据](https://www.jetbrains.com/help/phpstorm/ide-advanced-metadata.html) 帮助 IDE 在常规类型和 PHPDoc 标签无法提供帮助的情况下更好地理解代码。"
#. type: Plain text
#: ../src/en/internals/015-phpstorm.md
msgid "We use the following set of coding styles for metadata."
-msgstr ""
+msgstr "我们对元数据使用以下编码风格。"
#. type: Title ###
#: ../src/en/internals/015-phpstorm.md
#, no-wrap
msgid "Metadata location"
-msgstr ""
+msgstr "元数据位置"
#. type: Bullet: '- '
#: ../src/en/internals/015-phpstorm.md
msgid "Metadata should be placed in `/.phpstorm.meta.php` directory."
-msgstr ""
+msgstr "元数据应放置在 `/.phpstorm.meta.php` 目录中。"
#. type: Bullet: '- '
#: ../src/en/internals/015-phpstorm.md
msgid "Configuration should be split into files. Each file should be named after a class it configures."
-msgstr ""
+msgstr "配置应拆分为多个文件。每个文件应以其配置的类命名。"
#. type: Plain text
#: ../src/en/internals/015-phpstorm.md
@@ -60,17 +60,19 @@ msgid ""
"> [!NOTE]\n"
"> There is no support for subdirectories in PhpStorm yet.\n"
msgstr ""
+"> [!NOTE]\n"
+"> PhpStorm 目前还不支持子目录。\n"
#. type: Title ###
#: ../src/en/internals/015-phpstorm.md
#, no-wrap
msgid "Constants "
-msgstr ""
+msgstr "常量"
#. type: Plain text
#: ../src/en/internals/015-phpstorm.md
msgid "All constant dictionaries should be named as `{Class FQN}::{Group name}`. Group name should be short and written in capital letters. Use underscore as a word separator that's `\\Yiisoft\\Http\\Status::STATUSES`. For example:"
-msgstr ""
+msgstr "所有常量字典应命名为 `{类完全限定名}::{组名}`。组名应简短并使用大写字母。使用下划线作为单词分隔符,例如 `\\Yiisoft\\Http\\Status::STATUSES`。示例:"
#. type: Fenced code block (php)
#: ../src/en/internals/015-phpstorm.md
@@ -97,12 +99,12 @@ msgstr ""
#: ../src/en/internals/015-phpstorm.md
#, no-wrap
msgid "PhpStorm attributes"
-msgstr ""
+msgstr "PhpStorm 属性"
#. type: Plain text
#: ../src/en/internals/015-phpstorm.md
msgid "[PhpStorm attributes](https://github.com/JetBrains/phpstorm-attributes) CAN be used in code, but package `jetbrains/phpstorm-attributes` MUST be added as a dev dependency:"
-msgstr ""
+msgstr "[PhpStorm 属性](https://github.com/JetBrains/phpstorm-attributes) 可以在代码中使用,但必须将 `jetbrains/phpstorm-attributes` 包添加为开发依赖:"
#. type: Fenced code block (shell)
#: ../src/en/internals/015-phpstorm.md
@@ -114,12 +116,12 @@ msgstr ""
#: ../src/en/internals/015-phpstorm.md
#, no-wrap
msgid "Using with ComposerRequireChecker"
-msgstr ""
+msgstr "与 ComposerRequireChecker 一起使用"
#. type: Plain text
#: ../src/en/internals/015-phpstorm.md
msgid "When [ComposerRequireChecker](https://github.com/maglnet/ComposerRequireChecker) is also used within the same package, add involved attributes' class names to whitelist in config. For example:"
-msgstr ""
+msgstr "当在同一个包中也使用 [ComposerRequireChecker](https://github.com/maglnet/ComposerRequireChecker) 时,将涉及的属性类名添加到配置的白名单中。例如:"
#. type: Fenced code block (json)
#: ../src/en/internals/015-phpstorm.md
diff --git a/_translations/po/zh-CN/internals_016-security-workflow.md.po b/_translations/po/zh-CN/internals_016-security-workflow.md.po
index dfd5fa5f..f1fb970c 100644
--- a/_translations/po/zh-CN/internals_016-security-workflow.md.po
+++ b/_translations/po/zh-CN/internals_016-security-workflow.md.po
@@ -19,12 +19,12 @@ msgstr ""
#: ../src/internals/016-security-workflow.md
#, no-wrap
msgid "016 — Security workflow"
-msgstr ""
+msgstr "016 — 安全工作流程"
#. type: Plain text
#: ../src/internals/016-security-workflow.md
msgid "Security issues are typically sent via [a security form](https://www.yiiframework.com/security)."
-msgstr ""
+msgstr "安全问题通常通过 [安全表单](https://www.yiiframework.com/security) 发送。"
#. type: Plain text
#: ../src/internals/016-security-workflow.md
@@ -33,106 +33,108 @@ msgid ""
"If an issue is reported directly to a public page such as a repository issue or a forum topic, get the message\n"
"and delete the issue. Say thanks to the reporter and point to the security form for next time. \n"
msgstr ""
+"如果问题直接报告到公共页面(如仓库 issue 或论坛主题),请获取消息\n"
+"并删除该 issue。感谢报告者,并指出下次使用安全表单。\n"
#. type: Title ##
#: ../src/internals/016-security-workflow.md
#, no-wrap
msgid "Verify"
-msgstr ""
+msgstr "验证"
#. type: Plain text
#: ../src/internals/016-security-workflow.md
msgid "Verify that the issue is valid. Request more information if needed."
-msgstr ""
+msgstr "验证问题是否有效。如果需要,请求更多信息。"
#. type: Title ##
#: ../src/internals/016-security-workflow.md
#, no-wrap
msgid "Add security advisory"
-msgstr ""
+msgstr "添加安全公告"
#. type: Plain text
#: ../src/internals/016-security-workflow.md
msgid "Create a draft GitHub security advisory."
-msgstr ""
+msgstr "创建一个 GitHub 安全公告草稿。"
#. type: Title ###
#: ../src/internals/016-security-workflow.md
#, no-wrap
msgid "Find out severity"
-msgstr ""
+msgstr "确定严重程度"
#. type: Bullet: '1. '
#: ../src/internals/016-security-workflow.md
msgid "Get CVSS score using [NVD calculator](https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator)."
-msgstr ""
+msgstr "使用 [NVD 计算器](https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator) 获取 CVSS 分数。"
#. type: Bullet: '2. '
#: ../src/internals/016-security-workflow.md
msgid "Choose severity based on the [rating scale](https://www.first.org/cvss/specification-document#Qualitative-Severity-Rating-Scale)."
-msgstr ""
+msgstr "根据 [评级量表](https://www.first.org/cvss/specification-document#Qualitative-Severity-Rating-Scale) 选择严重程度。"
#. type: Title ###
#: ../src/internals/016-security-workflow.md
#, no-wrap
msgid "Give credit to the reporter"
-msgstr ""
+msgstr "给予报告者荣誉"
#. type: Plain text
#: ../src/internals/016-security-workflow.md
msgid "Ask the reporter if he wants a credit for finding the issue. If so, point to his GitHub account."
-msgstr ""
+msgstr "询问报告者是否希望因发现问题而获得荣誉。如果是,请指向其 GitHub 账户。"
#. type: Title ##
#: ../src/internals/016-security-workflow.md
#, no-wrap
msgid "Request a CVE number"
-msgstr ""
+msgstr "请求 CVE 编号"
#. type: Plain text
#: ../src/internals/016-security-workflow.md
msgid "When you're ready, request a CVE."
-msgstr ""
+msgstr "准备好后,请求一个 CVE。"
#. type: Title ##
#: ../src/internals/016-security-workflow.md
#, no-wrap
msgid "Prepare a patch"
-msgstr ""
+msgstr "准备补丁"
#. type: Plain text
#: ../src/internals/016-security-workflow.md
msgid "Prepare a pull request fixing the issue. GitHub allows doing it in a private fork."
-msgstr ""
+msgstr "准备一个修复问题的 pull request。GitHub 允许在私有 fork 中执行此操作。"
#. type: Title ##
#: ../src/internals/016-security-workflow.md
#, no-wrap
msgid "Wait till the CVE number is allocated "
-msgstr ""
+msgstr "等待 CVE 编号分配"
#. type: Plain text
#: ../src/internals/016-security-workflow.md
msgid "It usually takes several days."
-msgstr ""
+msgstr "通常需要几天时间。"
#. type: Title ##
#: ../src/internals/016-security-workflow.md
#, no-wrap
msgid "Release"
-msgstr ""
+msgstr "发布"
#. type: Bullet: '- '
#: ../src/internals/016-security-workflow.md
msgid "Merge the patch pull request right before tagging the next package release."
-msgstr ""
+msgstr "在标记下一个包发布之前合并补丁 pull request。"
#. type: Bullet: '- '
#: ../src/internals/016-security-workflow.md
msgid "Publish security advisory."
-msgstr ""
+msgstr "发布安全公告。"
#. type: Bullet: '- '
#: ../src/internals/016-security-workflow.md
msgid "Add CVE to [FriendsOfPHP/security-advisories](https://github.com/FriendsOfPHP/security-advisories). See [#488](https://github.com/FriendsOfPHP/security-advisories/pull/488) as an example."
-msgstr ""
+msgstr "将 CVE 添加到 [FriendsOfPHP/security-advisories](https://github.com/FriendsOfPHP/security-advisories)。参见 [#488](https://github.com/FriendsOfPHP/security-advisories/pull/488) 作为示例。"
diff --git a/_translations/po/zh-CN/internals_017-tags.md.po b/_translations/po/zh-CN/internals_017-tags.md.po
index 5c51f178..44917aa2 100644
--- a/_translations/po/zh-CN/internals_017-tags.md.po
+++ b/_translations/po/zh-CN/internals_017-tags.md.po
@@ -20,107 +20,107 @@ msgstr ""
#: ../src/en/internals/018-widgets.md
#, no-wrap
msgid "Immutability"
-msgstr ""
+msgstr "不可变性"
#. type: Title ###
#: ../src/en/internals/010-code-style.md ../src/en/internals/017-tags.md
#: ../src/en/internals/018-widgets.md
#, no-wrap
msgid "Names"
-msgstr ""
+msgstr "名称"
#. type: Title ##
#: ../src/en/internals/010-code-style.md ../src/en/internals/017-tags.md
#: ../src/en/internals/018-widgets.md
#, no-wrap
msgid "Methods"
-msgstr ""
+msgstr "方法"
#. type: Title #
#: ../src/en/internals/017-tags.md
#, no-wrap
msgid "017 - Tags"
-msgstr ""
+msgstr "017 - 标签"
#. type: Plain text
#: ../src/en/internals/017-tags.md
msgid "Unlike regular classes, tags are used in view templates, so syntax is important. It should be both easy to write, easy to read and not too verbose because similar constructs are meant to be used over and over again."
-msgstr ""
+msgstr "与常规类不同,标签用于视图模板,因此语法很重要。它应该既易于编写、易于阅读,又不过于冗长,因为类似的结构会被反复使用。"
#. type: Title ##
#: ../src/en/internals/017-tags.md ../src/en/internals/018-widgets.md
#, no-wrap
msgid "Class names"
-msgstr ""
+msgstr "类名"
#. type: Bullet: '- '
#: ../src/en/internals/017-tags.md
msgid "Tags aren't postfixed or prefixed unless it's an abstract base class."
-msgstr ""
+msgstr "标签不使用后缀或前缀,除非它是抽象基类。"
#. type: Bullet: '- '
#: ../src/en/internals/017-tags.md
msgid "If the tag represents a specification, use a name used in the specification."
-msgstr ""
+msgstr "如果标签表示规范,请使用规范中使用的名称。"
#. type: Title ##
#: ../src/en/internals/017-tags.md ../src/en/internals/018-widgets.md
#, no-wrap
msgid "Inheritance"
-msgstr ""
+msgstr "继承"
#. type: Plain text
#: ../src/en/internals/017-tags.md ../src/en/internals/018-widgets.md
msgid "Inheritance is allowed with some restrictions:"
-msgstr ""
+msgstr "允许继承,但有一些限制:"
#. type: Bullet: '- '
#: ../src/en/internals/017-tags.md ../src/en/internals/018-widgets.md
msgid "If a class isn't abstract, it should be final."
-msgstr ""
+msgstr "如果类不是抽象的,它应该是 final 的。"
#. type: Bullet: '- '
#: ../src/en/internals/017-tags.md ../src/en/internals/018-widgets.md
msgid "Hierarchy should be kept as linear as possible."
-msgstr ""
+msgstr "层次结构应尽可能保持线性。"
#. type: Plain text
#: ../src/en/internals/017-tags.md
msgid "Tags should:"
-msgstr ""
+msgstr "标签应该:"
#. type: Bullet: '- '
#: ../src/en/internals/017-tags.md ../src/en/internals/018-widgets.md
msgid "Have no state."
-msgstr ""
+msgstr "没有状态。"
#. type: Bullet: '- '
#: ../src/en/internals/017-tags.md
msgid "Be immutable. Every method that modifies a setting returns a clone with the setting changed."
-msgstr ""
+msgstr "是不可变的。每个修改设置的方法都会返回一个设置已更改的克隆。"
#. type: Bullet: '- '
#: ../src/en/internals/017-tags.md
msgid "Be free of side effects. Many calls of the same method with the same argument should give the same result."
-msgstr ""
+msgstr "没有副作用。使用相同参数多次调用同一方法应该给出相同的结果。"
#. type: Bullet: '- '
#: ../src/en/internals/017-tags.md ../src/en/internals/018-widgets.md
msgid "Unlike other classes, methods that return a clone of the object with some properties modified aren't prefixed."
-msgstr ""
+msgstr "与其他类不同,返回修改了某些属性的对象克隆的方法不使用前缀。"
#. type: Bullet: '- '
#: ../src/en/internals/017-tags.md ../src/en/internals/018-widgets.md
msgid "Keep method names as short as possible but don't hurt readability."
-msgstr ""
+msgstr "保持方法名称尽可能简短,但不要影响可读性。"
#. type: Title ###
#: ../src/en/internals/017-tags.md ../src/en/internals/018-widgets.md
#, no-wrap
msgid "Boolean flags"
-msgstr ""
+msgstr "布尔标志"
#. type: Plain text
#: ../src/en/internals/017-tags.md ../src/en/internals/018-widgets.md
msgid "The method that corresponds to the boolean attribute should be named after the attribute and accept a boolean flag argument."
-msgstr ""
+msgstr "对应于布尔属性的方法应以该属性命名,并接受一个布尔标志参数。"
diff --git a/_translations/po/zh-CN/internals_018-widgets.md.po b/_translations/po/zh-CN/internals_018-widgets.md.po
index 990056c3..b4b11487 100644
--- a/_translations/po/zh-CN/internals_018-widgets.md.po
+++ b/_translations/po/zh-CN/internals_018-widgets.md.po
@@ -93,24 +93,24 @@ msgstr ""
#: ../src/en/internals/018-widgets.md
#, no-wrap
msgid "018 - Widgets"
-msgstr ""
+msgstr "018 - 小部件"
#. type: Plain text
#: ../src/en/internals/018-widgets.md
msgid "Unlike regular classes, widgets are used in view templates, so syntax is important. It should be both easy to write, easy to read and not too verbose because similar constructs are meant to be used over and over again."
-msgstr ""
+msgstr "与常规类不同,小部件用于视图模板,因此语法很重要。它应该既易于编写、易于阅读,又不过于冗长,因为类似的结构会被反复使用。"
#. type: Plain text
#: ../src/en/internals/018-widgets.md
msgid "Widgets aren't postfixed or prefixed."
-msgstr ""
+msgstr "小部件不使用后缀或前缀。"
#. type: Plain text
#: ../src/en/internals/018-widgets.md
msgid "Widgets should:"
-msgstr ""
+msgstr "小部件应该:"
#. type: Bullet: '- '
#: ../src/en/internals/018-widgets.md
msgid "Be immutable."
-msgstr ""
+msgstr "是不可变的。"
diff --git a/_translations/po/zh-CN/internals_019-view-code-style.md.po b/_translations/po/zh-CN/internals_019-view-code-style.md.po
index df60894c..1d2f0a67 100644
--- a/_translations/po/zh-CN/internals_019-view-code-style.md.po
+++ b/_translations/po/zh-CN/internals_019-view-code-style.md.po
@@ -19,23 +19,23 @@ msgstr ""
#: ../src/en/internals/019-view-code-style.md
#, no-wrap
msgid "019 — View code style"
-msgstr ""
+msgstr "019 — 视图代码风格"
#. type: Plain text
#: ../src/en/internals/019-view-code-style.md
msgid "The PHP code in the view files shouldn't be complicated. The code must contain the logic responsible for formatting the data, but not the logic for requesting this data."
-msgstr ""
+msgstr "视图文件中的 PHP 代码不应该太复杂。代码必须包含负责格式化数据的逻辑,但不应包含请求数据的逻辑。"
#. type: Title ##
#: ../src/en/internals/019-view-code-style.md
#, no-wrap
msgid "Heading"
-msgstr ""
+msgstr "文件头部"
#. type: Plain text
#: ../src/en/internals/019-view-code-style.md
msgid "View file heading is used to place phpdoc describing variables available and to import classes:"
-msgstr ""
+msgstr "视图文件头部用于放置描述可用变量的 phpdoc 和导入类:"
#. type: Fenced code block (php)
#: ../src/en/internals/019-view-code-style.md
@@ -55,12 +55,12 @@ msgstr ""
#: ../src/en/internals/019-view-code-style.md
#, no-wrap
msgid "Control structures"
-msgstr ""
+msgstr "控制结构"
#. type: Plain text
#: ../src/en/internals/019-view-code-style.md
msgid "Alternative syntax for control structures such as `foreach` and `if` is preferred:"
-msgstr ""
+msgstr "优先使用控制结构(如 `foreach` 和 `if`)的替代语法:"
#. type: Fenced code block (php)
#: ../src/en/internals/019-view-code-style.md
@@ -76,12 +76,12 @@ msgstr ""
#: ../src/en/internals/019-view-code-style.md
#, no-wrap
msgid "Short echo"
-msgstr ""
+msgstr "短标签输出"
#. type: Plain text
#: ../src/en/internals/019-view-code-style.md
msgid "Short echo is preferred:"
-msgstr ""
+msgstr "优先使用短标签输出:"
#. type: Fenced code block (php)
#: ../src/en/internals/019-view-code-style.md
@@ -93,9 +93,9 @@ msgstr ""
#: ../src/en/internals/019-view-code-style.md
#, no-wrap
msgid "Class methods"
-msgstr ""
+msgstr "类方法"
#. type: Plain text
#: ../src/en/internals/019-view-code-style.md
msgid "All class methods used in view files must be public regardless if the view is rendered by the class itself."
-msgstr ""
+msgstr "视图文件中使用的所有类方法都必须是 public 的,无论视图是否由类本身渲染。"
diff --git a/_translations/po/zh-CN/internals_020-package-release.md.po b/_translations/po/zh-CN/internals_020-package-release.md.po
index 2453b1c3..4c7da20f 100644
--- a/_translations/po/zh-CN/internals_020-package-release.md.po
+++ b/_translations/po/zh-CN/internals_020-package-release.md.po
@@ -19,69 +19,69 @@ msgstr ""
#: ../src/en/internals/020-package-release.md
#, no-wrap
msgid "020 — Package release"
-msgstr ""
+msgstr "020 — 包发布"
#. type: Title ##
#: ../src/en/internals/020-package-release.md
#, no-wrap
msgid "Criteria"
-msgstr ""
+msgstr "标准"
#. type: Bullet: '- '
#: ../src/en/internals/020-package-release.md
msgid "No critical issues."
-msgstr ""
+msgstr "没有关键问题。"
#. type: Bullet: '- '
#: ../src/en/internals/020-package-release.md
msgid "Public API changes aren't likely. Some time passed w/o issues reported that may require API changes."
-msgstr ""
+msgstr "公共 API 不太可能更改。已经过了一段时间,没有报告可能需要 API 更改的问题。"
#. type: Bullet: '- '
#: ../src/en/internals/020-package-release.md
msgid "All dependencies are stable."
-msgstr ""
+msgstr "所有依赖项都是稳定的。"
#. type: Bullet: '- '
#: ../src/en/internals/020-package-release.md
msgid "Close to 100% test coverage with, ideally, a 100% MSI score."
-msgstr ""
+msgstr "接近 100% 的测试覆盖率,理想情况下 MSI 分数为 100%。"
#. type: Bullet: '- '
#: ../src/en/internals/020-package-release.md
msgid "README is alright."
-msgstr ""
+msgstr "README 没问题。"
#. type: Bullet: '- '
#: ../src/en/internals/020-package-release.md
msgid "Everything is type-hinted unless special cases."
-msgstr ""
+msgstr "除特殊情况外,所有内容都有类型提示。"
#. type: Bullet: '- '
#: ../src/en/internals/020-package-release.md
msgid "Psalm analysis passes on at least level 2."
-msgstr ""
+msgstr "Psalm 分析至少通过 2 级。"
#. type: Bullet: '- '
#: ../src/en/internals/020-package-release.md
msgid "phpdoc is alright."
-msgstr ""
+msgstr "phpdoc 没问题。"
#. type: Bullet: '- '
#: ../src/en/internals/020-package-release.md
msgid "Public API is alright."
-msgstr ""
+msgstr "公共 API 没问题。"
#. type: Title ##
#: ../src/en/internals/020-package-release.md
#, no-wrap
msgid "Release instruction"
-msgstr ""
+msgstr "发布说明"
#. type: Plain text
#: ../src/en/internals/020-package-release.md
msgid "Release a package via [Yii Development Tool](005-development-tool.md)."
-msgstr ""
+msgstr "通过 [Yii 开发工具](005-development-tool.md) 发布包。"
#. type: Plain text
#: ../src/en/internals/020-package-release.md
@@ -90,11 +90,13 @@ msgid ""
"1. Check that you can sign commits locally (see \n"
"[Signing commits](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits)).\n"
msgstr ""
+"1. 检查您是否可以在本地签署提交(参见\n"
+"[签署提交](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits))。\n"
#. type: Bullet: '2. '
#: ../src/en/internals/020-package-release.md
msgid "Pull last changes from the `master` branch:"
-msgstr ""
+msgstr "从 `master` 分支拉取最新更改:"
#. type: Fenced code block (shell)
#: ../src/en/internals/020-package-release.md
@@ -107,12 +109,12 @@ msgstr ""
#. type: Bullet: '3. '
#: ../src/en/internals/020-package-release.md
msgid "Check the package for compliance with the criteria above."
-msgstr ""
+msgstr "检查包是否符合上述标准。"
#. type: Bullet: '4. '
#: ../src/en/internals/020-package-release.md
msgid "Run `release/make` command:"
-msgstr ""
+msgstr "运行 `release/make` 命令:"
#. type: Fenced code block (shell)
#: ../src/en/internals/020-package-release.md
@@ -123,14 +125,14 @@ msgstr ""
#. type: Bullet: '5. '
#: ../src/en/internals/020-package-release.md
msgid "Select the version type (major, minor or path)."
-msgstr ""
+msgstr "选择版本类型(major、minor 或 patch)。"
#. type: Bullet: '6. '
#: ../src/en/internals/020-package-release.md
msgid "On the question \"Push commits and tags, and release on GitHub?\" check a diff. If the diff is alright, answer \"yes.\""
-msgstr ""
+msgstr "在问题“Push commits and tags, and release on GitHub?”上检查差异。如果差异没问题,回答 \"yes\"。"
#. type: Bullet: '7. '
#: ../src/en/internals/020-package-release.md
msgid "For major and minor releases, add a record with release notes on [Yii Framework News](https://www.yiiframework.com/news)."
-msgstr ""
+msgstr "对于主要和次要版本,在 [Yii Framework News](https://www.yiiframework.com/news) 上添加带有发布说明的记录。"
diff --git a/_translations/po/zh-CN/internals_021-changelog-upgrade.md.po b/_translations/po/zh-CN/internals_021-changelog-upgrade.md.po
index 477e7d49..469149c9 100644
--- a/_translations/po/zh-CN/internals_021-changelog-upgrade.md.po
+++ b/_translations/po/zh-CN/internals_021-changelog-upgrade.md.po
@@ -19,23 +19,23 @@ msgstr ""
#: ../src/internals/021-changelog-upgrade.md
#, no-wrap
msgid "021 — Changelog and upgrade"
-msgstr ""
+msgstr "021 — 变更日志和升级"
#. type: Plain text
#: ../src/internals/021-changelog-upgrade.md
msgid "For all released packages, we've a detailed changelog and upgrade guide."
-msgstr ""
+msgstr "对于所有已发布的包,我们都有详细的变更日志和升级指南。"
#. type: Title ##
#: ../src/internals/021-changelog-upgrade.md
#, no-wrap
msgid "Changelog"
-msgstr ""
+msgstr "变更日志"
#. type: Plain text
#: ../src/internals/021-changelog-upgrade.md
msgid "Changelog is written for each version released. The file name is `CHANGELOG.md`. The format is the following:"
-msgstr ""
+msgstr "每个发布的版本都会编写变更日志。文件名为 `CHANGELOG.md`。格式如下:"
#. type: Fenced code block (markdown)
#: ../src/internals/021-changelog-upgrade.md
@@ -59,53 +59,53 @@ msgstr ""
#. type: Plain text
#: ../src/internals/021-changelog-upgrade.md
msgid "There \"My package\" is the name of the package, `1.0.1` is the version released followed by release date. For each version, there are a number of lines listing the changes. \"Bug\" refers to a change type. The following types are used:"
-msgstr ""
+msgstr "其中“My package”是包的名称,`1.0.1` 是发布的版本,后面跟着发布日期。对于每个版本,都有多行列出变更内容。\"Bug\" 指的是变更类型。使用以下类型:"
#. type: Bullet: '- '
#: ../src/internals/021-changelog-upgrade.md
msgid "New — New features."
-msgstr ""
+msgstr "New — 新功能。"
#. type: Bullet: '- '
#: ../src/internals/021-changelog-upgrade.md
msgid "Chg — General changes."
-msgstr ""
+msgstr "Chg — 一般变更。"
#. type: Bullet: '- '
#: ../src/internals/021-changelog-upgrade.md
msgid "Enh — Existing feature enhancements."
-msgstr ""
+msgstr "Enh — 现有功能增强。"
#. type: Bullet: '- '
#: ../src/internals/021-changelog-upgrade.md
msgid "Bug — Bug fixes."
-msgstr ""
+msgstr "Bug — Bug 修复。"
#. type: Plain text
#: ../src/internals/021-changelog-upgrade.md
msgid "In the changelog file lines should be ordered as New, Chg, Enh, Bug."
-msgstr ""
+msgstr "在变更日志文件中,行应按 New、Chg、Enh、Bug 的顺序排列。"
#. type: Plain text
#: ../src/internals/021-changelog-upgrade.md
msgid "\"#42\" above is the number of issue or pull requests corresponding to the change. \"author1\" is the GitHub nickname of the code author. \"author2\" is an additional author. An author's nickname MUST be prefixed with `@`."
-msgstr ""
+msgstr "上面的“#42”是对应变更的 issue 或 pull request 编号。“author1”是代码作者的 GitHub 昵称。“author2”是额外的作者。作者的昵称必须以 `@` 为前缀。"
#. type: Title ##
#: ../src/internals/021-changelog-upgrade.md
#, no-wrap
msgid "Upgrade"
-msgstr ""
+msgstr "升级"
#. type: Plain text
#: ../src/internals/021-changelog-upgrade.md
msgid "Upgrade guide is created when there is a new major version that isn't compatible with the previous one. It describes steps necessary to upgrade application code."
-msgstr ""
+msgstr "当有新的主版本与之前的版本不兼容时,会创建升级指南。它描述了升级应用程序代码所需的步骤。"
#. type: Plain text
#: ../src/internals/021-changelog-upgrade.md
msgid "The file name is `UPGRADE.md`. The format is the following:"
-msgstr ""
+msgstr "文件名为 `UPGRADE.md`。格式如下:"
#. type: Fenced code block (markdown)
#: ../src/internals/021-changelog-upgrade.md
diff --git a/_translations/po/zh-CN/internals_022-config-groups.md.po b/_translations/po/zh-CN/internals_022-config-groups.md.po
index 750d41f1..f7da087b 100644
--- a/_translations/po/zh-CN/internals_022-config-groups.md.po
+++ b/_translations/po/zh-CN/internals_022-config-groups.md.po
@@ -20,225 +20,225 @@ msgstr ""
#: ../src/en/internals/022-config-groups.md
#, no-wrap
msgid "Events"
-msgstr ""
+msgstr "事件"
#. type: Title ##
#: ../src/en/guide/concept/configuration.md
#: ../src/en/internals/022-config-groups.md
#, no-wrap
msgid "Parameters"
-msgstr ""
+msgstr "参数"
#. type: Title ##
#: ../src/en/internals/003-roadmap.md ../src/en/internals/022-config-groups.md
#, no-wrap
msgid "Others"
-msgstr ""
+msgstr "其他"
#. type: Title #
#: ../src/en/internals/022-config-groups.md
#, no-wrap
msgid "022 — Config groups"
-msgstr ""
+msgstr "022 — 配置组"
#. type: Plain text
#: ../src/en/internals/022-config-groups.md
msgid "This document defines naming convention for the framework groups used with [yiisoft/config](https://github.com/yiisoft/config). Note that this isn't a naming convention for config files. These could be anything and are mapped to group names via `composer.json`."
-msgstr ""
+msgstr "本文档定义了与 [yiisoft/config](https://github.com/yiisoft/config) 一起使用的框架组的命名约定。请注意,这不是配置文件的命名约定。这些可以是任何内容,并通过 `composer.json` 映射到组名称。"
#. type: Title ##
#: ../src/en/internals/022-config-groups.md
#, no-wrap
msgid "Config group name postfixes"
-msgstr ""
+msgstr "配置组名称后缀"
#. type: Bullet: '- '
#: ../src/en/internals/022-config-groups.md
msgid "\"web\" postfix applies to web only that's classic server HTML generation, REST, RPC, etc."
-msgstr ""
+msgstr "“web”后缀仅适用于 web,即经典的服务器 HTML 生成、REST、RPC 等。"
#. type: Bullet: '- '
#: ../src/en/internals/022-config-groups.md
msgid "\"console\" postfix applies to console"
-msgstr ""
+msgstr "“console”后缀适用于控制台"
#. type: Bullet: '- '
#: ../src/en/internals/022-config-groups.md
msgid "If there's no postfix, it's \"common\" and applies to both web and console"
-msgstr ""
+msgstr "如果没有后缀,则为“common”,适用于 web 和控制台"
#. type: Bullet: '- '
#: ../src/en/internals/022-config-groups.md
msgid "\"web\" and \"console\" may override what's defined in \"common\""
-msgstr ""
+msgstr "“web”和“console”可以覆盖“common”中定义的内容"
#. type: Plain text
#: ../src/en/internals/022-config-groups.md
msgid "Application config parameters that are used in all configs."
-msgstr ""
+msgstr "在所有配置中使用的应用程序配置参数。"
#. type: Bullet: '- '
#: ../src/en/internals/022-config-groups.md
msgid "`params` — common parameters"
-msgstr ""
+msgstr "`params` — 通用参数"
#. type: Bullet: '- '
#: ../src/en/internals/022-config-groups.md
msgid "`params-web` — web application parameters"
-msgstr ""
+msgstr "`params-web` — web 应用程序参数"
#. type: Bullet: '- '
#: ../src/en/internals/022-config-groups.md
msgid "`params-console` — console application parameters"
-msgstr ""
+msgstr "`params-console` — 控制台应用程序参数"
#. type: Title ##
#: ../src/en/internals/022-config-groups.md
#, no-wrap
msgid "Container"
-msgstr ""
+msgstr "容器"
#. type: Plain text
#: ../src/en/internals/022-config-groups.md
msgid "Configuration for [yiisoft/di](https://github.com/yiisoft/di)."
-msgstr ""
+msgstr "[yiisoft/di](https://github.com/yiisoft/di) 的配置。"
#. type: Title ###
#: ../src/en/internals/022-config-groups.md
#, no-wrap
msgid "Definitions"
-msgstr ""
+msgstr "定义"
#. type: Bullet: '- '
#: ../src/en/internals/022-config-groups.md
msgid "`di` — common container definitions"
-msgstr ""
+msgstr "`di` — 通用容器定义"
#. type: Bullet: '- '
#: ../src/en/internals/022-config-groups.md
msgid "`di-web` — web container definitions"
-msgstr ""
+msgstr "`di-web` — web 容器定义"
#. type: Bullet: '- '
#: ../src/en/internals/022-config-groups.md
msgid "`di-console` — console container definitions"
-msgstr ""
+msgstr "`di-console` — 控制台容器定义"
#. type: Title ###
#: ../src/en/internals/022-config-groups.md
#, no-wrap
msgid "Providers"
-msgstr ""
+msgstr "提供者"
#. type: Bullet: '- '
#: ../src/en/internals/022-config-groups.md
msgid "`di-providers` — common container providers"
-msgstr ""
+msgstr "`di-providers` — 通用容器提供者"
#. type: Bullet: '- '
#: ../src/en/internals/022-config-groups.md
msgid "`di-providers-web` — web container providers"
-msgstr ""
+msgstr "`di-providers-web` — web 容器提供者"
#. type: Bullet: '- '
#: ../src/en/internals/022-config-groups.md
msgid "`di-providers-console` — console container providers"
-msgstr ""
+msgstr "`di-providers-console` — 控制台容器提供者"
#. type: Title ###
#: ../src/en/internals/022-config-groups.md
#, no-wrap
msgid "Delegates"
-msgstr ""
+msgstr "委托"
#. type: Bullet: '- '
#: ../src/en/internals/022-config-groups.md
msgid "`di-delegates` — common container delegates"
-msgstr ""
+msgstr "`di-delegates` — 通用容器委托"
#. type: Bullet: '- '
#: ../src/en/internals/022-config-groups.md
msgid "`di-delegates-web` — web container delegates"
-msgstr ""
+msgstr "`di-delegates-web` — web 容器委托"
#. type: Bullet: '- '
#: ../src/en/internals/022-config-groups.md
msgid "`di-delegates-console` — console container delegates"
-msgstr ""
+msgstr "`di-delegates-console` — 控制台容器委托"
#. type: Title ###
#: ../src/en/internals/022-config-groups.md
#, no-wrap
msgid "Tags"
-msgstr ""
+msgstr "标签"
#. type: Bullet: '- '
#: ../src/en/internals/022-config-groups.md
msgid "`di-tags` — common container tags"
-msgstr ""
+msgstr "`di-tags` — 通用容器标签"
#. type: Bullet: '- '
#: ../src/en/internals/022-config-groups.md
msgid "`di-tags-web` — web container tags"
-msgstr ""
+msgstr "`di-tags-web` — web 容器标签"
#. type: Bullet: '- '
#: ../src/en/internals/022-config-groups.md
msgid "`di-tags-console` — console container tags"
-msgstr ""
+msgstr "`di-tags-console` — 控制台容器标签"
#. type: Plain text
#: ../src/en/internals/022-config-groups.md
msgid "Configuration for [yiisoft/yii-event](https://github.com/yiisoft/yii-event)."
-msgstr ""
+msgstr "[yiisoft/yii-event](https://github.com/yiisoft/yii-event) 的配置。"
#. type: Bullet: '- '
#: ../src/en/internals/022-config-groups.md
msgid "`events` — common events"
-msgstr ""
+msgstr "`events` — 通用事件"
#. type: Bullet: '- '
#: ../src/en/internals/022-config-groups.md
msgid "`events-web` — web events"
-msgstr ""
+msgstr "`events-web` — web 事件"
#. type: Bullet: '- '
#: ../src/en/internals/022-config-groups.md
msgid "`events-console` — console events"
-msgstr ""
+msgstr "`events-console` — 控制台事件"
#. type: Title ##
#: ../src/en/internals/022-config-groups.md
#, no-wrap
msgid "Bootstrap"
-msgstr ""
+msgstr "引导"
#. type: Plain text
#: ../src/en/internals/022-config-groups.md
msgid "Application bootstrapping for [yiisoft/yii-runner](https://github.com/yiisoft/yii-runner)."
-msgstr ""
+msgstr "[yiisoft/yii-runner](https://github.com/yiisoft/yii-runner) 的应用程序引导。"
#. type: Bullet: '- '
#: ../src/en/internals/022-config-groups.md
msgid "`bootstrap` — common bootstrap"
-msgstr ""
+msgstr "`bootstrap` — 通用引导"
#. type: Bullet: '- '
#: ../src/en/internals/022-config-groups.md
msgid "`bootstrap-web` — web bootstrap"
-msgstr ""
+msgstr "`bootstrap-web` — web 引导"
#. type: Bullet: '- '
#: ../src/en/internals/022-config-groups.md
msgid "`bootstrap-console` — console bootstrap"
-msgstr ""
+msgstr "`bootstrap-console` — 控制台引导"
#. type: Bullet: '- '
#: ../src/en/internals/022-config-groups.md
msgid "`routes` — [yiisoft/router](https://github.com/yiisoft/router) routes"
-msgstr ""
+msgstr "`routes` — [yiisoft/router](https://github.com/yiisoft/router) 路由"
#. type: Bullet: '- '
#: ../src/en/internals/022-config-groups.md
msgid "`widgets` — [yiisoft/widget](https://github.com/yiisoft/widget) default widgets configuration"
-msgstr ""
+msgstr "`widgets` — [yiisoft/widget](https://github.com/yiisoft/widget) 默认小部件配置"
diff --git a/_translations/po/zh-CN/internals_index.md.po b/_translations/po/zh-CN/internals_index.md.po
index 98c8b19e..e983560f 100644
--- a/_translations/po/zh-CN/internals_index.md.po
+++ b/_translations/po/zh-CN/internals_index.md.po
@@ -19,130 +19,130 @@ msgstr ""
#: ../src/internals/index.md
#, no-wrap
msgid "Yii Framework Internals"
-msgstr ""
+msgstr "Yii 框架内部文档"
#. type: Plain text
#: ../src/internals/index.md
msgid "This section contains documentation for developers contributing to the Yii framework itself. It covers guidelines, workflows, and best practices for maintaining and developing Yii packages."
-msgstr ""
+msgstr "本节包含为 Yii 框架本身做出贡献的开发者的文档。它涵盖了维护和开发 Yii 包的指南、工作流程和最佳实践。"
#. type: Title ##
#: ../src/internals/index.md
#, no-wrap
msgid "Table of Contents"
-msgstr ""
+msgstr "目录"
#. type: Bullet: '- '
#: ../src/internals/index.md
msgid "[000 — Packages](000-packages.md) - Package structure and naming conventions"
-msgstr ""
+msgstr "[000 — 包](000-packages.md) - 包结构和命名约定"
#. type: Bullet: '- '
#: ../src/internals/index.md
msgid "[001 — Yii goal and values](001-yii-values.md) - Project goals and core values"
-msgstr ""
+msgstr "[001 — Yii 目标和价值观](001-yii-values.md) - 项目目标和核心价值观"
#. type: Bullet: '- '
#: ../src/internals/index.md
msgid "[002 — Issue workflow](002-issue-workflow.md) - How to handle issues"
-msgstr ""
+msgstr "[002 — Issue 工作流程](002-issue-workflow.md) - 如何处理 issue"
#. type: Bullet: '- '
#: ../src/internals/index.md
msgid "[003 — Roadmap](003-roadmap.md) - Development roadmap and future plans"
-msgstr ""
+msgstr "[003 — 路线图](003-roadmap.md) - 开发路线图和未来计划"
#. type: Bullet: '- '
#: ../src/internals/index.md
msgid "[004 — Namespaces](004-namespaces.md) - Namespace conventions"
-msgstr ""
+msgstr "[004 — 命名空间](004-namespaces.md) - 命名空间约定"
#. type: Bullet: '- '
#: ../src/internals/index.md
msgid "[005 — Yii development tool](005-development-tool.md) - Development tools for Yii packages"
-msgstr ""
+msgstr "[005 — Yii 开发工具](005-development-tool.md) - Yii 包的开发工具"
#. type: Bullet: '- '
#: ../src/internals/index.md
msgid "[006 — Git commit messages](006-git-commit-messages.md) - Commit message format"
-msgstr ""
+msgstr "[006 — Git 提交消息](006-git-commit-messages.md) - 提交消息格式"
#. type: Bullet: '- '
#: ../src/internals/index.md
msgid "[007 — Exceptions](007-exceptions.md) - Exception handling guidelines"
-msgstr ""
+msgstr "[007 — 异常](007-exceptions.md) - 异常处理指南"
#. type: Bullet: '- '
#: ../src/internals/index.md
msgid "[008 — Interfaces](008-interfaces.md) - Interface design principles"
-msgstr ""
+msgstr "[008 — 接口](008-interfaces.md) - 接口设计原则"
#. type: Bullet: '- '
#: ../src/internals/index.md
msgid "[009 — Design Decisions](009-design-decisions.md) - Architectural and design decisions"
-msgstr ""
+msgstr "[009 — 设计决策](009-design-decisions.md) - 架构和设计决策"
#. type: Bullet: '- '
#: ../src/internals/index.md
msgid "[010 — Code style](010-code-style.md) - PHP code style guidelines"
-msgstr ""
+msgstr "[010 — 代码风格](010-code-style.md) - PHP 代码风格指南"
#. type: Bullet: '- '
#: ../src/internals/index.md
msgid "[011 — Error correction](011-error-correction.md) - Error handling and correction"
-msgstr ""
+msgstr "[011 — 错误修正](011-error-correction.md) - 错误处理和修正"
#. type: Bullet: '- '
#: ../src/internals/index.md
msgid "[012 — Tests](012-tests.md) - Testing guidelines and practices"
-msgstr ""
+msgstr "[012 — 测试](012-tests.md) - 测试指南和实践"
#. type: Bullet: '- '
#: ../src/internals/index.md
msgid "[013 — Code review](013-code-review.md) - Code review process and guidelines"
-msgstr ""
+msgstr "[013 — 代码审查](013-code-review.md) - 代码审查流程和指南"
#. type: Bullet: '- '
#: ../src/internals/index.md
msgid "[014 — Documentation](014-docs.md) - Documentation writing guidelines"
-msgstr ""
+msgstr "[014 — 文档](014-docs.md) - 文档编写指南"
#. type: Bullet: '- '
#: ../src/internals/index.md
msgid "[015 — PhpStorm metadata and attributes](015-phpstorm.md) - PhpStorm integration"
-msgstr ""
+msgstr "[015 — PhpStorm 元数据和属性](015-phpstorm.md) - PhpStorm 集成"
#. type: Bullet: '- '
#: ../src/internals/index.md
msgid "[016 — Security workflow](016-security-workflow.md) - Security issue handling"
-msgstr ""
+msgstr "[016 — 安全工作流程](016-security-workflow.md) - 安全问题处理"
#. type: Bullet: '- '
#: ../src/internals/index.md
msgid "[017 — Tags](017-tags.md) - Git tagging conventions"
-msgstr ""
+msgstr "[017 — 标签](017-tags.md) - Git 标签约定"
#. type: Bullet: '- '
#: ../src/internals/index.md
msgid "[018 — Widgets](018-widgets.md) - Widget development guidelines"
-msgstr ""
+msgstr "[018 — 小部件](018-widgets.md) - 小部件开发指南"
#. type: Bullet: '- '
#: ../src/internals/index.md
msgid "[019 — View code style](019-view-code-style.md) - Code style for view templates"
-msgstr ""
+msgstr "[019 — 视图代码风格](019-view-code-style.md) - 视图模板的代码风格"
#. type: Bullet: '- '
#: ../src/internals/index.md
msgid "[020 — Package release](020-package-release.md) - Release process for packages"
-msgstr ""
+msgstr "[020 — 包发布](020-package-release.md) - 包的发布流程"
#. type: Bullet: '- '
#: ../src/internals/index.md
msgid "[021 — Changelog and upgrade](021-changelog-upgrade.md) - Maintaining changelogs and upgrade notes"
-msgstr ""
+msgstr "[021 — 变更日志和升级](021-changelog-upgrade.md) - 维护变更日志和升级说明"
#. type: Bullet: '- '
#: ../src/internals/index.md
msgid "[022 — Config groups](022-config-groups.md) - Configuration group organization"
-msgstr ""
+msgstr "[022 — 配置组](022-config-groups.md) - 配置组组织"
diff --git a/src/.vitepress/config.js b/src/.vitepress/config.js
index 119c78f9..2ea54add 100644
--- a/src/.vitepress/config.js
+++ b/src/.vitepress/config.js
@@ -1026,12 +1026,13 @@ export default {
}
},
'zh-CN': {
+ title: 'Yii3 文档',
label: '简体中文',
lang: 'zh-CN',
link: '/zh-CN/',
themeConfig: {
nav: [
- {text: '指南', link: '/zh-CN/guide/'},
+ {text: '权威指南', link: '/zh-CN/guide/'},
{text: '实用手册', link: '/zh-CN/cookbook/'},
{text: '内部文档', link: '/zh-CN/internals/'},
{text: '官网', link: 'https://www.yiiframework.com'}
@@ -1216,6 +1217,35 @@ export default {
footer: {
message: '基于 BSD-3-Clause 许可证 发布。',
copyright: `Copyright © 2008-${currentYear} Yii `
+ },
+ docFooter: {
+ prev: '上一页',
+ next: '下一页',
+ },
+ outline: {
+ label: '本页内容'
+ },
+ lastUpdated: {
+ text: '最后更新于'
+ },
+ search: {
+ options: {
+ translations: {
+ button: {
+ buttonText: '搜索',
+ buttonAriaLabel: '搜索'
+ },
+ modal: {
+ noResultsText: '无法找到相关结果',
+ resetButtonTitle: '清除查询条件',
+ footer: {
+ selectText: '选择',
+ navigateText: '切换',
+ closeText: '关闭'
+ }
+ }
+ }
+ }
}
}
}
diff --git a/src/zh-CN/cookbook/configuring-webservers/apache.md b/src/zh-CN/cookbook/configuring-webservers/apache.md
index ec1c81a2..f2beed18 100644
--- a/src/zh-CN/cookbook/configuring-webservers/apache.md
+++ b/src/zh-CN/cookbook/configuring-webservers/apache.md
@@ -1,55 +1,52 @@
-# Configuring web servers: Apache
+# 配置 Web 服务器:Apache
-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`.
+在 Apache 的 `httpd.conf` 文件或虚拟主机配置中使用以下配置。注意,你应该将 `path/to/app/public` 替换为
+`app/public` 的实际路径。
```apache
-# Set document root to be "app/public"
+# 将文档根目录设置为 "app/public"
DocumentRoot "path/to/app/public"
- # use mod_rewrite for pretty URL support
+ # 使用 mod_rewrite 支持美化 URL
RewriteEngine on
- # if $showScriptName is false in UrlManager, do not allow accessing URLs with script name
+ # 如果 UrlManager 中的 $showScriptName 为 false,则不允许访问带脚本名称的 URL
RewriteRule ^index.php/ - [L,R=404]
- # If a directory or a file exists, use the request directly
+ # 如果目录或文件存在,直接使用请求
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
- # Otherwise forward the request to index.php
+ # 否则将请求转发到 index.php
RewriteRule . index.php
SetEnv APP_ENV dev
- # ...other settings...
+ # ...其他设置...
```
-In case you have `AllowOverride All` you can add `.htaccess` file with the
-following configuration instead of using `httpd.conf`:
+如果你设置了 `AllowOverride All`,可以添加包含以下配置的 `.htaccess` 文件,而不是使用 `httpd.conf`:
```apache
-# use mod_rewrite for pretty URL support
+# 使用 mod_rewrite 支持美化 URL
RewriteEngine on
-# if $showScriptName is false in UrlManager, do not allow accessing URLs with script name
+# 如果 UrlManager 中的 $showScriptName 为 false,则不允许访问带脚本名称的 URL
RewriteRule ^index.php/ - [L,R=404]
-# If a directory or a file exists, use the request directly
+# 如果目录或文件存在,直接使用请求
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
-# Otherwise forward the request to index.php
+# 否则将请求转发到 index.php
RewriteRule . index.php
SetEnv APP_ENV dev
-# ...other settings...
+# ...其他设置...
```
-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`.
+在上面的配置中,请注意 `SetEnv` 的用法。由于 Yii3 应用程序模板使用环境变量,这是设置它们的一个可行位置。在生产环境中,请记得将
+`APP_ENV` 设置为 `prod`。
diff --git a/src/zh-CN/cookbook/configuring-webservers/general.md b/src/zh-CN/cookbook/configuring-webservers/general.md
index bec3a60f..895619f7 100644
--- a/src/zh-CN/cookbook/configuring-webservers/general.md
+++ b/src/zh-CN/cookbook/configuring-webservers/general.md
@@ -1,14 +1,13 @@
-# Configuring web servers: General
+# 配置 Web 服务器:通用
-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.
+在生产服务器上,如果你不使用 Docker,请配置你的 Web 服务器仅提供应用程序的公共文件。将 Web 服务器的文档根目录指向
+`app/public` 文件夹。
> [!IMPORTANT]
-> If you're running your Yii application behind a reverse proxy, you might need to configure
-> [Trusted proxies and headers](../../guide/security/trusted-request.md).
+> 如果你在反向代理后面运行 Yii 应用程序,可能需要配置
+> [受信任的代理和标头](../../guide/security/trusted-request.md)。
-## Specific server configurations
+## 特定服务器配置
- [Nginx](nginx.md)
- [Apache](apache.md)
diff --git a/src/zh-CN/cookbook/configuring-webservers/iis.md b/src/zh-CN/cookbook/configuring-webservers/iis.md
index 718ba6e5..28cda070 100644
--- a/src/zh-CN/cookbook/configuring-webservers/iis.md
+++ b/src/zh-CN/cookbook/configuring-webservers/iis.md
@@ -1,10 +1,8 @@
-# Configuring web servers: IIS
+# 配置 Web 服务器:IIS
-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:
+当你使用 [IIS](https://www.iis.net/) 时,在虚拟主机(网站)中托管应用程序,其中文档根目录指向
+`path/to/app/public` 文件夹,并配置网站运行 PHP。在该 `public` 文件夹中,放置一个名为 `web.config`
+的文件,路径为 `path/to/app/public/web.config`。使用以下内容:
```xml
@@ -29,10 +27,9 @@ following content:
```
-Also, the following list of Microsoft's official resources could be useful
-to configure PHP on IIS:
+此外,以下 Microsoft 官方资源列表可能对在 IIS 上配置 PHP 有所帮助:
-1. [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)
-2. [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)
+1. [如何设置你的第一个 IIS
+ 网站](https://support.microsoft.com/en-us/help/323972/how-to-set-up-your-first-iis-web-site)
+2. [在 IIS 上配置 PHP
+ 网站](https://docs.microsoft.com/en-us/iis/application-frameworks/scenario-build-a-php-website-on-iis/configure-a-php-website-on-iis)
diff --git a/src/zh-CN/cookbook/configuring-webservers/lighttpd.md b/src/zh-CN/cookbook/configuring-webservers/lighttpd.md
index 551300c6..77c6c554 100644
--- a/src/zh-CN/cookbook/configuring-webservers/lighttpd.md
+++ b/src/zh-CN/cookbook/configuring-webservers/lighttpd.md
@@ -1,6 +1,6 @@
-# Configuring web servers: lighttpd
+# 配置 Web 服务器:lighttpd
-To use [lighttpd](https://www.lighttpd.net/) >= 1.4.24, put `index.php` in the web root and add the following to the configuration:
+要使用 [lighttpd](https://www.lighttpd.net/) >= 1.4.24,将 `index.php` 放在 Web 根目录中,并将以下内容添加到配置中:
```
url.rewrite-if-not-file = ("(.*)" => "/index.php/$0")
diff --git a/src/zh-CN/cookbook/configuring-webservers/nginx-unit.md b/src/zh-CN/cookbook/configuring-webservers/nginx-unit.md
index 82beb7ab..1bce84a7 100644
--- a/src/zh-CN/cookbook/configuring-webservers/nginx-unit.md
+++ b/src/zh-CN/cookbook/configuring-webservers/nginx-unit.md
@@ -1,7 +1,7 @@
-# Configuring web servers: NGINX Unit
+# 配置 Web 服务器:NGINX Unit
-Run Yii-based apps using [NGINX Unit](https://unit.nginx.org/) with a PHP
-language module. Here is a sample configuration.
+使用带有 PHP 语言模块的 [NGINX Unit](https://unit.nginx.org/) 运行基于 Yii
+的应用程序。以下是一个示例配置。
```json
{
@@ -59,9 +59,8 @@ language module. Here is a sample configuration.
}
```
-You can also [set up](https://unit.nginx.org/configuration/#php) your PHP
-environment or supply a custom `php.ini` in the same configuration.
+你还可以在同一配置中 [设置](https://unit.nginx.org/configuration/#php) PHP 环境或提供自定义的
+`php.ini`。
-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`.
+在上面的配置中,请注意 `environment` 的用法。由于 Yii3 应用程序模板使用环境变量,这是设置它们的一个可行位置。在生产环境中,请记得将
+`APP_ENV` 设置为 `prod`。
diff --git a/src/zh-CN/cookbook/configuring-webservers/nginx.md b/src/zh-CN/cookbook/configuring-webservers/nginx.md
index 0e619aeb..7a0d7718 100644
--- a/src/zh-CN/cookbook/configuring-webservers/nginx.md
+++ b/src/zh-CN/cookbook/configuring-webservers/nginx.md
@@ -1,17 +1,16 @@
-# Configuring web servers: Nginx
+# 配置 Web 服务器:Nginx
-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.
+要使用 [Nginx](https://wiki.nginx.org/),请将 PHP 安装为 [FPM
+SAPI](https://secure.php.net/install.fpm)。使用以下 Nginx 配置,将
+`path/to/app/public` 替换为 `app/public` 的实际路径,将 `mysite.test` 替换为要提供服务的实际主机名。
```nginx
server {
charset utf-8;
client_max_body_size 128M;
- listen 80; ## listen for ipv4
- #listen [::]:80 default_server ipv6only=on; ## listen for ipv6
+ listen 80; ## 监听 ipv4
+ #listen [::]:80 default_server ipv6only=on; ## 监听 ipv6
server_name mysite.test;
root /path/to/app/public;
@@ -21,17 +20,17 @@ server {
error_log /path/to/basic/log/error.log;
location / {
- # Redirect everything that isn't a real file to index.php
+ # 将所有不是真实文件的请求重定向到 index.php
try_files $uri $uri/ /index.php$is_args$args;
}
- # uncomment to avoid processing of calls to non-existing static files by Yii
+ # 取消注释以避免 Yii 处理对不存在的静态文件的调用
#location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ {
# try_files $uri =404;
#}
#error_page 404 /404.html;
- # deny accessing php files for the /assets directory
+ # 拒绝访问 /assets 目录中的 php 文件
location ~ ^/assets/.*\.php$ {
deny all;
}
@@ -51,13 +50,9 @@ server {
}
```
-When you use this configuration, also set `cgi.fix_pathinfo=0` in the
-`php.ini` file to avoid many unnecessary system `stat()` calls.
+使用此配置时,还要在 `php.ini` 文件中设置 `cgi.fix_pathinfo=0`,以避免许多不必要的系统 `stat()` 调用。
-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.
+另外,请注意,当运行 HTTPS 服务器时,需要添加 `fastcgi_param HTTPS on;`,以便 Yii 可以检测连接是否安全。
-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`.
+在上面的配置中,请注意 `fastcgi_param APP_ENV` 的用法。由于 Yii3
+应用程序模板使用环境变量,这是设置它们的一个可行位置。在生产环境中,请记得将 `APP_ENV` 设置为 `prod`。
diff --git a/src/zh-CN/cookbook/deployment/docker-swarm-caddy.md b/src/zh-CN/cookbook/deployment/docker-swarm-caddy.md
index 09d1df94..e1144ce9 100644
--- a/src/zh-CN/cookbook/deployment/docker-swarm-caddy.md
+++ b/src/zh-CN/cookbook/deployment/docker-swarm-caddy.md
@@ -1,10 +1,9 @@
-# Deploying Yii applications to Docker Swarm and Caddy
+# 将 Yii 应用部署到 Docker Swarm 和 Caddy
-This guide walks you through deploying a Yii application to [Docker
-Swarm](https://docs.docker.com/engine/swarm/) starting from a blank server,
-using [Caddy](https://caddyserver.com/) as a reverse proxy and deploying
-from a container registry ([Forgejo](https://forgejo.org/) or
-[Gitea](https://about.gitea.com/)).
+本指南将引导你从空白服务器开始,使用 [Caddy](https://caddyserver.com/)
+作为反向代理,从容器注册表([Forgejo](https://forgejo.org/) 或
+[Gitea](https://about.gitea.com/))部署 Yii 应用程序到 [Docker
+Swarm](https://docs.docker.com/engine/swarm/)。
```mermaid
graph LR
@@ -19,43 +18,40 @@ graph LR
end
```
-## Prerequisites
+## 前提条件
-- A server with a fresh installation of a Linux distribution (Ubuntu 22.04
- LTS or later recommended)
-- A domain name pointing to your server's IP address
-- SSH access to your server
-- Basic knowledge of Docker and command-line tools
+- 一台全新安装 Linux 发行版的服务器(推荐 Ubuntu 22.04 LTS 或更高版本)
+- 指向服务器 IP 地址的域名
+- 对服务器的 SSH 访问权限
+- Docker 和命令行工具的基础知识
-## Server preparation
+## 服务器准备
-### Install Docker
+### 安装 Docker
-For installation instructions, see the [official Docker
-documentation](https://docs.docker.com/engine/install/ubuntu/).
+有关安装说明,请参阅[官方 Docker 文档](https://docs.docker.com/engine/install/ubuntu/)。
-### Initialize Docker Swarm
+### 初始化 Docker Swarm
-Initialize your server as a Docker Swarm manager:
+将服务器初始化为 Docker Swarm 管理器:
```bash
docker swarm init --advertise-addr
```
-Replace `` with your server's public IP address.
+将 `` 替换为服务器的公共 IP 地址。
-### Set up the reverse proxy network
+### 设置反向代理网络
-Create a dedicated overlay network for reverse proxy to communicate with
-your services:
+创建一个专用的覆盖网络,供反向代理与服务通信:
```bash
docker network create --driver=overlay reverse_proxy_public
```
-## Setting up Caddy as reverse proxy
+## 设置 Caddy 作为反向代理
-To deploy Caddy as reverse proxy create a file `caddy-stack.yml`:
+要将 Caddy 部署为反向代理,请创建文件 `caddy-stack.yml`:
```yaml
services:
@@ -78,15 +74,14 @@ networks:
external: true
```
-Deploy Caddy:
+部署 Caddy:
```bash
docker stack deploy -c caddy-stack.yml caddy
```
-Caddy automatically discovers services with Caddy labels and sets up HTTPS
-using Let's Encrypt. Yii3 application templates are using Caddy labels by
-default:
+Caddy 会自动发现带有 Caddy 标签的服务,并使用 Let's Encrypt 设置 HTTPS。Yii3 应用程序模板默认使用 Caddy
+标签:
```yaml
deploy:
@@ -99,14 +94,13 @@ deploy:
> Make sure your domain DNS records are configured and pointing to your server before deploying services with
> Caddy labels, as Let's Encrypt requires domain validation.
-## Setting up a container registry
+## 设置容器注册表
-You need a container registry to store your Docker images. Choose one of the
-following options.
+你需要一个容器注册表来存储 Docker 镜像。选择以下选项之一。
-### Option 1: Using Forgejo
+### 选项 1:使用 Forgejo
-To deploy Forgejo create a file `forgejo-stack.yml`:
+要部署 Forgejo,请创建文件 `forgejo-stack.yml`:
```yaml
services:
@@ -131,21 +125,19 @@ networks:
external: true
```
-Deploy Forgejo:
+部署 Forgejo:
```bash
docker stack deploy -c forgejo-stack.yml forgejo
```
-Replace `git.example.com` with your desired subdomain.
+将 `git.example.com` 替换为所需的子域名。
-After deployment, access Forgejo at `https://git.example.com` and complete
-the initial setup. Make sure to enable the container registry in the
-settings.
+部署后,访问 `https://git.example.com` 上的 Forgejo 并完成初始设置。确保在设置中启用容器注册表。
-### Option 2: Using Gitea
+### 选项 2:使用 Gitea
-To deploy Gitea create a file `gitea-stack.yml`:
+要部署 Gitea,请创建文件 `gitea-stack.yml`:
```yaml
services:
@@ -170,24 +162,22 @@ networks:
external: true
```
-Deploy Gitea:
+部署 Gitea:
```bash
docker stack deploy -c gitea-stack.yml gitea
```
-Replace `git.example.com` with your desired subdomain.
+将 `git.example.com` 替换为所需的子域名。
-After deployment, access Gitea at `https://git.example.com` and complete the
-initial setup. Make sure to enable the container registry in the settings.
+部署后,访问 `https://git.example.com` 上的 Gitea 并完成初始设置。确保在设置中启用容器注册表。
-## Configuring your Yii application
+## 配置 Yii 应用程序
-### Update the Makefile configuration
+### 更新 Makefile 配置
-The [Yii application template](https://github.com/yiisoft/app) includes a
-Makefile with deployment commands. Update the `docker/.env` file in your
-project:
+[Yii 应用程序模板](https://github.com/yiisoft/app)包含一个带有部署命令的 Makefile。更新项目中的
+`docker/.env` 文件:
```bash
STACK_NAME=myapp
@@ -203,15 +193,13 @@ IMAGE=git.example.com/username/myapp
IMAGE_TAG=latest
```
-Replace the values: - `STACK_NAME`: A unique name for your application stack
-- `PROD_HOST`: The domain name where your app will be accessible -
-`PROD_SSH`: SSH connection string to your server (format: `ssh://user@host`)
-- `IMAGE`: Full path to your container image in the registry - `IMAGE_TAG`:
-Image tag, typically `latest` or a version number
+替换以下值:- `STACK_NAME`:应用程序堆栈的唯一名称 - `PROD_HOST`:应用程序可访问的域名 - `PROD_SSH`:到服务器的
+SSH 连接字符串(格式:`ssh://user@host`)- `IMAGE`:注册表中容器镜像的完整路径 -
+`IMAGE_TAG`:镜像标签,通常为 `latest` 或版本号
-### Configure the production environment
+### 配置生产环境
-Update `docker/prod/.env` with your production environment variables:
+使用生产环境变量更新 `docker/prod/.env`:
```bash
APP_ENV=prod
@@ -228,11 +216,11 @@ DB_PASSWORD=secure_password_here
```
> [!WARNING]
-> Never commit sensitive credentials to version control. Use `docker/prod/override.env` for sensitive values and add it to `.gitignore`.
+> 切勿将敏感凭据提交到版本控制。对敏感值使用 `docker/prod/override.env` 并将其添加到 `.gitignore`。
-### Review the production Docker Compose configuration
+### 查看生产环境 Docker Compose 配置
-The default `docker/prod/compose.yml` includes:
+默认的 `docker/prod/compose.yml` 包括:
```yaml
services:
@@ -271,14 +259,14 @@ services:
caddy.reverse_proxy: "{{upstreams 80}}"
```
-This configuration:
-- Runs 2 replicas for high availability
-- Uses a rolling update strategy with automatic rollback on failure
-- Configures `labels` for automatic HTTPS on the reverse proxy
-- Disables obtaining of HTTPs certificates on the container itself
- since proxy communicates with the container via HTTP. That is `auto_https off`.
+此配置:
+- 运行 2 个副本以实现高可用性
+- 使用滚动更新策略,失败时自动回滚
+- 配置 `labels` 以在反向代理上自动启用 HTTPS
+- 禁用容器本身获取 HTTPS 证书
+ 因为代理通过 HTTP 与容器通信。即 `auto_https off`。
-If you need a database, add it to the stack:
+如果需要数据库,请将其添加到堆栈中:
```yaml
services:
@@ -311,57 +299,56 @@ secrets:
external: true
```
-Create the database password secret on the server:
+在服务器上创建数据库 password secret:
```bash
echo "your_secure_password" | docker secret create db_password -
```
-## Building and pushing the image
+## 构建并推送镜像
-### Set up Docker login on your local machine
+### 在本地机器上设置 Docker 登录
-Configure Docker to authenticate with your container registry:
+配置 Docker 以向容器注册表进行身份验证:
```bash
docker login git.example.com
```
-Enter your username and password when prompted.
+在提示时输入用户名和 password。
-### Build the production image
+### 构建生产镜像
-Use the Makefile to build your production image:
+使用 Makefile 构建生产镜像:
```bash
make prod-build
```
-This runs the command defined in the Makefile:
+这将运行 Makefile 中定义的命令:
```bash
docker build --file docker/Dockerfile --target prod --pull -t ${IMAGE}:${IMAGE_TAG} .
```
-The Dockerfile uses a multi-stage build: 1. Installs Composer dependencies
-in a builder stage 2. Creates a minimal production image with only the
-necessary files 3. Runs as a non-root user (`www-data`)
+Dockerfile 使用多阶段构建:1. 在构建器阶段安装 Composer 依赖项 2. 创建仅包含必要文件的最小生产镜像 3. 以非 root
+用户(`www-data`)身份运行
-### Push the image to the registry
+### 将镜像推送到注册表
-Push your built image to the container registry:
+将构建的镜像推送到容器注册表:
```bash
make prod-push
```
-This executes:
+这将执行:
```bash
docker push ${IMAGE}:${IMAGE_TAG}
```
-## Deploying to Docker Swarm
+## 部署到 Docker Swarm
### Configure SSH access
@@ -383,55 +370,54 @@ Host docker-web
EOF
```
-### Set up Docker context
+### 设置 Docker 上下文
-Create a Docker context for remote deployment:
+创建用于远程部署的 Docker 上下文:
```bash
docker context create swarm-prod --docker "host=ssh://docker-web"
```
-Alternatively, configure the `DOCKER_HOST` environment variable:
+或者,配置 `DOCKER_HOST` 环境变量:
```bash
export DOCKER_HOST=ssh://docker-web
```
-### Deploy the application
+### 部署应用程序
-Deploy your application stack to Docker Swarm:
+将应用程序堆栈部署到 Docker Swarm:
```bash
make prod-deploy
```
-This executes:
+这将执行:
```bash
docker -H ${PROD_SSH} stack deploy --prune --detach=false --with-registry-auth -c docker/compose.yml -c docker/prod/compose.yml ${STACK_NAME}
```
-The `--with-registry-auth` flag ensures the Swarm nodes can pull images from
-your private registry.
+`--with-registry-auth` 标志确保 Swarm 节点可以从私有注册表拉取镜像。
-### Verify the deployment
+### 验证部署
-Check the status of your services:
+检查服务状态:
```bash
docker -H ssh://docker-web service ls
docker -H ssh://docker-web service ps ${STACK_NAME}_app
```
-View logs:
+查看日志:
```bash
docker -H ssh://docker-web service logs ${STACK_NAME}_app
```
-## Monitoring and maintenance
+## 监控和维护
-### View service logs
+### 查看服务日志
```bash
# View all logs
@@ -444,20 +430,19 @@ docker -H ssh://docker-web service logs --tail 100 ${STACK_NAME}_app
docker -H ssh://docker-web service logs -t ${STACK_NAME}_app
```
-### Scale the application
+### 扩展应用程序
-Adjust the number of replicas:
+调整副本数量:
```bash
docker -H ssh://docker-web service scale ${STACK_NAME}_app=3
```
-Or update the `replicas` value in `docker/prod/compose.yml` and redeploy.
+或者更新 `docker/prod/compose.yml` 中的 `replicas` 值并重新部署。
-### Resource limits
+### 资源限制
-Add resource limits to prevent containers from consuming all server
-resources. Update `docker/prod/compose.yml`:
+添加资源限制以防止容器消耗所有服务器资源。更新 `docker/prod/compose.yml`:
```yaml
services:
@@ -473,20 +458,19 @@ services:
memory: 256M
```
-## Security considerations
+## 安全注意事项
-### Use Docker secrets for sensitive data
+### 对敏感数据使用 Docker secrets
-Instead of environment variables, use Docker secrets for sensitive
-information:
+对于敏感信息,使用 Docker secrets 而不是环境变量:
```bash
-# Create secrets
+# 创建 secrets
echo "database_password" | docker secret create db_password -
echo "api_key" | docker secret create api_key -
```
-Update `docker/prod/compose.yml`:
+更新 `docker/prod/compose.yml`:
```yaml
services:
@@ -502,11 +486,11 @@ secrets:
external: true
```
-Access secrets in your application at `/run/secrets/secret_name`.
+在应用程序中通过 `/run/secrets/secret_name` 访问 secrets。
-### Set up a firewall
+### 设置防火墙
-Configure UFW (Uncomplicated Firewall) on your server:
+在服务器上配置 UFW(简单防火墙):
```bash
# Allow SSH
@@ -526,65 +510,58 @@ sudo ufw allow 4789/udp
sudo ufw enable
```
-### Keep the system updated
+### 保持系统更新
-Regularly update your server and Docker:
+定期更新服务器和 Docker:
```bash
-# Update system packages
+# 更新系统包
sudo apt-get update && sudo apt-get upgrade -y
-# Update Docker images
+# 更新 Docker 镜像
docker -H ssh://docker-web service update --image ${IMAGE}:${IMAGE_TAG} ${STACK_NAME}_app
```
-## Troubleshooting
+## 故障排除
-### Service won't start
+### 服务无法启动
-Check service events and logs:
+检查服务事件和日志:
```bash
docker -H ssh://docker-web service ps ${STACK_NAME}_app --no-trunc
docker -H ssh://docker-web service logs ${STACK_NAME}_app
```
-Common issues: - **Image pull errors**: Verify registry authentication with
-`docker -H ssh://docker-web login` - **Port conflicts**: Ensure no other
-services are using ports 80/443 - **Resource constraints**: Check available
-resources with `docker -H ssh://docker-web node ls`
+常见问题:- **镜像拉取错误**:使用 `docker -H ssh://docker-web login` 验证注册表身份验证 -
+**端口冲突**:确保没有其他服务使用端口 80/443 - **资源约束**:使用 `docker -H ssh://docker-web node
+ls` 检查可用资源
-### SSL certificate issues
+### SSL 证书问题
-If Caddy can't obtain certificates: - Verify DNS is pointing to your server
-- Check that ports 80 and 443 are accessible from the internet - Ensure the
-email in the Let's Encrypt configuration is valid - Check logs: `docker -H
-ssh://docker-web service logs caddy`
+如果 Caddy 无法获取证书:- 验证 DNS 是否指向服务器 - 检查端口 80 和 443 是否可从互联网访问 - 确保 Let's
+Encrypt 配置中的电子邮件有效 - 检查日志:`docker -H ssh://docker-web service logs caddy`
-### Container registry connection issues
+### 容器注册表连接问题
-Test registry connectivity:
+测试注册表连接:
```bash
-# From your local machine
+# 从本地机器
docker pull git.example.com/username/myapp:latest
-# From the server
+# 从服务器
docker -H ssh://docker-web pull git.example.com/username/myapp:latest
```
-## Summary
+## 总结
-You've successfully deployed a Yii application to Docker Swarm with: - A
-container registry (Forgejo or Gitea) - Automatic HTTPS via Caddy -
-Zero-downtime deployments with rolling updates - High availability with
-multiple replicas
+你已成功将 Yii 应用程序部署到 Docker Swarm,包括:- 容器注册表(Forgejo 或 Gitea)- 通过 Caddy 自动启用
+HTTPS - 通过滚动更新实现零停机部署 - 通过多个副本实现高可用性
-The Makefile commands simplify the deployment workflow: - `make prod-build`
-- Build the production image - `make prod-push` - Push to the registry -
-`make prod-deploy` - Deploy to Docker Swarm
+Makefile 命令简化了部署工作流程:- `make prod-build` - 构建生产镜像 - `make prod-push` -
+推送到注册表 - `make prod-deploy` - 部署到 Docker Swarm
-For more information, see: - [Yii Application
-Template](https://github.com/yiisoft/app) - [Docker Swarm
-Documentation](https://docs.docker.com/engine/swarm/) - [Caddy Docker
+有关更多信息,请参阅:- [Yii 应用程序模板](https://github.com/yiisoft/app) - [Docker Swarm
+文档](https://docs.docker.com/engine/swarm/) - [Caddy Docker
Proxy](https://github.com/lucaslorentz/caddy-docker-proxy)
diff --git a/src/zh-CN/cookbook/deployment/docker-swarm-traefik.md b/src/zh-CN/cookbook/deployment/docker-swarm-traefik.md
index f6f0acfd..25eff942 100644
--- a/src/zh-CN/cookbook/deployment/docker-swarm-traefik.md
+++ b/src/zh-CN/cookbook/deployment/docker-swarm-traefik.md
@@ -1,10 +1,9 @@
-# Deploying Yii applications to Docker Swarm and Traefik
+# 将 Yii 应用部署到 Docker Swarm 和 Traefik
-This guide walks you through deploying a Yii application to [Docker
-Swarm](https://docs.docker.com/engine/swarm/) starting from a blank server,
-using [Traefik](https://traefik.io/traefik) as a reverse proxy and deploying
-from a container registry ([Forgejo](https://forgejo.org/) or
-[Gitea](https://about.gitea.com/)).
+本指南将引导你从空白服务器开始,使用 [Traefik](https://traefik.io/traefik)
+作为反向代理,从容器注册表([Forgejo](https://forgejo.org/) 或
+[Gitea](https://about.gitea.com/))部署 Yii 应用程序到 [Docker
+Swarm](https://docs.docker.com/engine/swarm/)。
```mermaid
graph LR
@@ -19,43 +18,40 @@ graph LR
end
```
-## Prerequisites
+## 前提条件
-- A server with a fresh installation of a Linux distribution (Ubuntu 22.04
- LTS or later recommended)
-- A domain name pointing to your server's IP address
-- SSH access to your server
-- Basic knowledge of Docker and command-line tools
+- 一台全新安装 Linux 发行版的服务器(推荐 Ubuntu 22.04 LTS 或更高版本)
+- 指向服务器 IP 地址的域名
+- 对服务器的 SSH 访问权限
+- Docker 和命令行工具的基础知识
-## Server preparation
+## 服务器准备
-### Install Docker
+### 安装 Docker
-For installation instructions, see the [official Docker
-documentation](https://docs.docker.com/engine/install/ubuntu/).
+有关安装说明,请参阅[官方 Docker 文档](https://docs.docker.com/engine/install/ubuntu/)。
-### Initialize Docker Swarm
+### 初始化 Docker Swarm
-Initialize your server as a Docker Swarm manager:
+将服务器初始化为 Docker Swarm 管理器:
```bash
docker swarm init --advertise-addr
```
-Replace `` with your server's public IP address.
+将 `` 替换为服务器的公共 IP 地址。
-### Set up the reverse proxy network
+### 设置反向代理网络
-Create a dedicated overlay network for reverse proxy to communicate with
-your services:
+创建一个专用的覆盖网络,供反向代理与服务通信:
```bash
docker network create --driver=overlay reverse_proxy_public
```
-## Setting up Traefik as reverse proxy
+## 设置 Traefik 作为反向代理
-To deploy Traefik as reverse proxy create a file `traefik-stack.yml`:
+要将 Traefik 部署为反向代理,请创建文件 `traefik-stack.yml`:
```yaml
services:
@@ -93,20 +89,19 @@ networks:
external: true
```
-Deploy Traefik:
+部署 Traefik:
```bash
docker stack deploy -c traefik-stack.yml traefik
```
-## Setting up a container registry
+## 设置容器注册表
-You need a container registry to store your Docker images. Choose one of the
-following options.
+你需要一个容器注册表来存储 Docker 镜像。选择以下选项之一。
-### Option 1: Using Forgejo
+### 选项 1:使用 Forgejo
-To deploy Forgejo create a file `forgejo-stack.yml`:
+要部署 Forgejo,请创建文件 `forgejo-stack.yml`:
```yaml
services:
@@ -134,21 +129,19 @@ networks:
external: true
```
-Deploy Forgejo:
+部署 Forgejo:
```bash
docker stack deploy -c forgejo-stack.yml forgejo
```
-Replace `git.example.com` with your desired subdomain.
+将 `git.example.com` 替换为所需的子域名。
-After deployment, access Forgejo at `https://git.example.com` and complete
-the initial setup. Make sure to enable the container registry in the
-settings.
+部署后,访问 `https://git.example.com` 上的 Forgejo 并完成初始设置。确保在设置中启用容器注册表。
-### Option 2: Using Gitea
+### 选项 2:使用 Gitea
-To deploy Gitea create a file `gitea-stack.yml`:
+要部署 Gitea,请创建文件 `gitea-stack.yml`:
```yaml
services:
@@ -176,24 +169,22 @@ networks:
external: true
```
-Deploy Gitea:
+部署 Gitea:
```bash
docker stack deploy -c gitea-stack.yml gitea
```
-Replace `git.example.com` with your desired subdomain.
+将 `git.example.com` 替换为所需的子域名。
-After deployment, access Gitea at `https://git.example.com` and complete the
-initial setup. Make sure to enable the container registry in the settings.
+部署后,访问 `https://git.example.com` 上的 Gitea 并完成初始设置。确保在设置中启用容器注册表。
-## Configuring your Yii application
+## 配置 Yii 应用程序
-### Update the Makefile configuration
+### 更新 Makefile 配置
-The [Yii application template](https://github.com/yiisoft/app) includes a
-Makefile with deployment commands. Update the `docker/.env` file in your
-project:
+[Yii 应用程序模板](https://github.com/yiisoft/app)包含一个带有部署命令的 Makefile。更新项目中的
+`docker/.env` 文件:
```bash
STACK_NAME=myapp
@@ -209,15 +200,13 @@ IMAGE=git.example.com/username/myapp
IMAGE_TAG=latest
```
-Replace the values: - `STACK_NAME`: A unique name for your application stack
-- `PROD_HOST`: The domain name where your app will be accessible -
-`PROD_SSH`: SSH connection string to your server (format: `ssh://user@host`)
-- `IMAGE`: Full path to your container image in the registry - `IMAGE_TAG`:
-Image tag, typically `latest` or a version number
+替换以下值:- `STACK_NAME`:应用程序堆栈的唯一名称 - `PROD_HOST`:应用程序可访问的域名 - `PROD_SSH`:到服务器的
+SSH 连接字符串(格式:`ssh://user@host`)- `IMAGE`:注册表中容器镜像的完整路径 -
+`IMAGE_TAG`:镜像标签,通常为 `latest` 或版本号
-### Configure the production environment
+### 配置生产环境
-Update `docker/prod/.env` with your production environment variables:
+使用生产环境变量更新 `docker/prod/.env`:
```bash
APP_ENV=prod
@@ -234,12 +223,12 @@ DB_PASSWORD=secure_password_here
```
> [!WARNING]
-> Never commit sensitive credentials to version control. Use `docker/prod/override.env` for sensitive values and add it to `.gitignore`.
+> 切勿将敏感凭据提交到版本控制。对敏感值使用 `docker/prod/override.env` 并将其添加到 `.gitignore`。
-### Review the production Docker Compose configuration
+### 查看生产环境 Docker Compose 配置
-When using Traefik, you'll need to modify the Yii application's
-`docker/prod/compose.yml` to use Traefik labels instead of Caddy labels:
+使用 Traefik 时,你需要修改 Yii 应用程序的 `docker/prod/compose.yml` 以使用 Traefik 标签而不是
+Caddy 标签:
```yaml
services:
@@ -281,14 +270,14 @@ services:
- "traefik.http.services.app.loadbalancer.server.port=80"
```
-This configuration:
-- Runs 2 replicas for high availability
-- Uses a rolling update strategy with automatic rollback on failure
-- Configures `labels` for automatic HTTPS on the reverse proxy
-- Disables obtaining of HTTPs certificates on the container itself
- since proxy communicates with the container via HTTP. That is `auto_https off`.
+此配置:
+- 运行 2 个副本以实现高可用性
+- 使用滚动更新策略,失败时自动回滚
+- 配置 `labels` 以在反向代理上自动启用 HTTPS
+- 禁用容器本身获取 HTTPS 证书
+ 因为代理通过 HTTP 与容器通信。即 `auto_https off`。
-If you need a database, add it to the stack:
+如果需要数据库,请将其添加到堆栈中:
```yaml
services:
@@ -321,57 +310,56 @@ secrets:
external: true
```
-Create the database password secret on the server:
+在服务器上创建数据库 password secret:
```bash
echo "your_secure_password" | docker secret create db_password -
```
-## Building and pushing the image
+## 构建并推送镜像
-### Set up Docker login on your local machine
+### 在本地机器上设置 Docker 登录
-Configure Docker to authenticate with your container registry:
+配置 Docker 以向容器注册表进行身份验证:
```bash
docker login git.example.com
```
-Enter your username and password when prompted.
+在提示时输入用户名和 password。
-### Build the production image
+### 构建生产镜像
-Use the Makefile to build your production image:
+使用 Makefile 构建生产镜像:
```bash
make prod-build
```
-This runs the command defined in the Makefile:
+这将运行 Makefile 中定义的命令:
```bash
docker build --file docker/Dockerfile --target prod --pull -t ${IMAGE}:${IMAGE_TAG} .
```
-The Dockerfile uses a multi-stage build: 1. Installs Composer dependencies
-in a builder stage 2. Creates a minimal production image with only the
-necessary files 3. Runs as a non-root user (`www-data`)
+Dockerfile 使用多阶段构建:1. 在构建器阶段安装 Composer 依赖项 2. 创建仅包含必要文件的最小生产镜像 3. 以非 root
+用户(`www-data`)身份运行
-### Push the image to the registry
+### 将镜像推送到注册表
-Push your built image to the container registry:
+将构建的镜像推送到容器注册表:
```bash
make prod-push
```
-This executes:
+这将执行:
```bash
docker push ${IMAGE}:${IMAGE_TAG}
```
-## Deploying to Docker Swarm
+## 部署到 Docker Swarm
### Configure SSH access
@@ -393,55 +381,54 @@ Host docker-web
EOF
```
-### Set up Docker context
+### 设置 Docker 上下文
-Create a Docker context for remote deployment:
+创建用于远程部署的 Docker 上下文:
```bash
docker context create swarm-prod --docker "host=ssh://docker-web"
```
-Alternatively, configure the `DOCKER_HOST` environment variable:
+或者,配置 `DOCKER_HOST` 环境变量:
```bash
export DOCKER_HOST=ssh://docker-web
```
-### Deploy the application
+### 部署应用程序
-Deploy your application stack to Docker Swarm:
+将应用程序堆栈部署到 Docker Swarm:
```bash
make prod-deploy
```
-This executes:
+这将执行:
```bash
docker -H ${PROD_SSH} stack deploy --prune --detach=false --with-registry-auth -c docker/compose.yml -c docker/prod/compose.yml ${STACK_NAME}
```
-The `--with-registry-auth` flag ensures the Swarm nodes can pull images from
-your private registry.
+`--with-registry-auth` 标志确保 Swarm 节点可以从私有注册表拉取镜像。
-### Verify the deployment
+### 验证部署
-Check the status of your services:
+检查服务状态:
```bash
docker -H ssh://docker-web service ls
docker -H ssh://docker-web service ps ${STACK_NAME}_app
```
-View logs:
+查看日志:
```bash
docker -H ssh://docker-web service logs ${STACK_NAME}_app
```
-## Monitoring and maintenance
+## 监控和维护
-### View service logs
+### 查看服务日志
```bash
# View all logs
@@ -454,20 +441,19 @@ docker -H ssh://docker-web service logs --tail 100 ${STACK_NAME}_app
docker -H ssh://docker-web service logs -t ${STACK_NAME}_app
```
-### Scale the application
+### 扩展应用程序
-Adjust the number of replicas:
+调整副本数量:
```bash
docker -H ssh://docker-web service scale ${STACK_NAME}_app=3
```
-Or update the `replicas` value in `docker/prod/compose.yml` and redeploy.
+或者更新 `docker/prod/compose.yml` 中的 `replicas` 值并重新部署。
-### Resource limits
+### 资源限制
-Add resource limits to prevent containers from consuming all server
-resources. Update `docker/prod/compose.yml`:
+添加资源限制以防止容器消耗所有服务器资源。更新 `docker/prod/compose.yml`:
```yaml
services:
@@ -483,20 +469,19 @@ services:
memory: 256M
```
-## Security considerations
+## 安全注意事项
-### Use Docker secrets for sensitive data
+### 对敏感数据使用 Docker secrets
-Instead of environment variables, use Docker secrets for sensitive
-information:
+对于敏感信息,使用 Docker secrets 而不是环境变量:
```bash
-# Create secrets
+# 创建 secrets
echo "database_password" | docker secret create db_password -
echo "api_key" | docker secret create api_key -
```
-Update `docker/prod/compose.yml`:
+更新 `docker/prod/compose.yml`:
```yaml
services:
@@ -512,11 +497,11 @@ secrets:
external: true
```
-Access secrets in your application at `/run/secrets/secret_name`.
+在应用程序中通过 `/run/secrets/secret_name` 访问 secrets。
-### Set up a firewall
+### 设置防火墙
-Configure UFW (Uncomplicated Firewall) on your server:
+在服务器上配置 UFW(简单防火墙):
```bash
# Allow SSH
@@ -536,65 +521,59 @@ sudo ufw allow 4789/udp
sudo ufw enable
```
-### Keep the system updated
+### 保持系统更新
-Regularly update your server and Docker:
+定期更新服务器和 Docker:
```bash
-# Update system packages
+# 更新系统包
sudo apt-get update && sudo apt-get upgrade -y
-# Update Docker images
+# 更新 Docker 镜像
docker -H ssh://docker-web service update --image ${IMAGE}:${IMAGE_TAG} ${STACK_NAME}_app
```
-## Troubleshooting
+## 故障排除
-### Service won't start
+### 服务无法启动
-Check service events and logs:
+检查服务事件和日志:
```bash
docker -H ssh://docker-web service ps ${STACK_NAME}_app --no-trunc
docker -H ssh://docker-web service logs ${STACK_NAME}_app
```
-Common issues: - **Image pull errors**: Verify registry authentication with
-`docker -H ssh://docker-web login` - **Port conflicts**: Ensure no other
-services are using ports 80/443 - **Resource constraints**: Check available
-resources with `docker -H ssh://docker-web node ls`
+常见问题:- **镜像拉取错误**:使用 `docker -H ssh://docker-web login` 验证注册表身份验证 -
+**端口冲突**:确保没有其他服务使用端口 80/443 - **资源约束**:使用 `docker -H ssh://docker-web node
+ls` 检查可用资源
-### SSL certificate issues
+### SSL 证书问题
-If Traefik can't obtain certificates: - Verify DNS is pointing to your
-server - Check that ports 80 and 443 are accessible from the internet -
-Ensure the email in the Let's Encrypt configuration is valid - Check logs:
-`docker -H ssh://docker-web service logs traefik_traefik`
+如果 Traefik 无法获取证书:- 验证 DNS 是否指向服务器 - 检查端口 80 和 443 是否可从互联网访问 - 确保 Let's
+Encrypt 配置中的电子邮件有效 - 检查日志:`docker -H ssh://docker-web service logs
+traefik_traefik`
-### Container registry connection issues
+### 容器注册表连接问题
-Test registry connectivity:
+测试注册表连接:
```bash
-# From your local machine
+# 从本地机器
docker pull git.example.com/username/myapp:latest
-# From the server
+# 从服务器
docker -H ssh://docker-web pull git.example.com/username/myapp:latest
```
-## Summary
+## 总结
-You've successfully deployed a Yii application to Docker Swarm with: - A
-container registry (Forgejo or Gitea) - Automatic HTTPS via Traefik -
-Zero-downtime deployments with rolling updates - High availability with
-multiple replicas
+你已成功将 Yii 应用程序部署到 Docker Swarm,包括:- 容器注册表(Forgejo 或 Gitea)- 通过 Traefik 自动启用
+HTTPS - 通过滚动更新实现零停机部署 - 通过多个副本实现高可用性
-The Makefile commands simplify the deployment workflow: - `make prod-build`
-- Build the production image - `make prod-push` - Push to the registry -
-`make prod-deploy` - Deploy to Docker Swarm
+Makefile 命令简化了部署工作流程:- `make prod-build` - 构建生产镜像 - `make prod-push` -
+推送到注册表 - `make prod-deploy` - 部署到 Docker Swarm
-For more information, see: - [Yii Application
-Template](https://github.com/yiisoft/app) - [Docker Swarm
-Documentation](https://docs.docker.com/engine/swarm/) - [Traefik
-Documentation](https://doc.traefik.io/traefik/)
+有关更多信息,请参阅:- [Yii 应用程序模板](https://github.com/yiisoft/app) - [Docker Swarm
+文档](https://docs.docker.com/engine/swarm/) - [Traefik
+文档](https://doc.traefik.io/traefik/)
diff --git a/src/zh-CN/cookbook/deployment/docker-swarm.md b/src/zh-CN/cookbook/deployment/docker-swarm.md
index 242ee4d3..5fef4e8c 100644
--- a/src/zh-CN/cookbook/deployment/docker-swarm.md
+++ b/src/zh-CN/cookbook/deployment/docker-swarm.md
@@ -1,4 +1,4 @@
-# Deploying Yii applications to Docker Swarm
+# 将 Yii 应用部署到 Docker Swarm
-- [Using Caddy](docker-swarm-caddy.md)
-- [Using Traefik](docker-swarm-traefik.md)
+- [使用 Caddy](docker-swarm-caddy.md)
+- [使用 Traefik](docker-swarm-traefik.md)
diff --git a/src/zh-CN/cookbook/disabling-csrf-protection.md b/src/zh-CN/cookbook/disabling-csrf-protection.md
index 9fa9f5fe..04d00e23 100644
--- a/src/zh-CN/cookbook/disabling-csrf-protection.md
+++ b/src/zh-CN/cookbook/disabling-csrf-protection.md
@@ -1,44 +1,32 @@
-# Disabling CSRF protection
+# 禁用 CSRF 保护
-## What is CSRF protection?
+## 什么是 CSRF 保护?
-Cross-Site Request Forgery (CSRF) protection is a security mechanism that
-prevents malicious websites from making unauthorized requests on behalf of
-authenticated users. Yii3 includes built-in CSRF protection through the
-`Yiisoft\Yii\Web\Middleware\Csrf` middleware.
+跨站请求伪造(CSRF)保护是一种安全机制,可防止恶意网站代表已认证用户发出未经授权的请求。Yii3 通过
+`Yiisoft\Yii\Web\Middleware\Csrf` 中间件提供内置的 CSRF 保护。
-For a comprehensive understanding of CSRF attacks and protection mechanisms,
-see the [Security best
-practices](../guide/security/best-practices.md#avoiding-csrf) section in the
-main guide.
+要全面了解 CSRF
+攻击和保护机制,请参阅主指南中的[安全最佳实践](../guide/security/best-practices.md#avoiding-csrf)部分。
-## When to disable CSRF protection
+## 何时禁用 CSRF 保护
-While CSRF protection should generally remain enabled for web applications,
-there are specific scenarios where you might need to disable it:
+虽然 Web 应用程序通常应保持启用 CSRF 保护,但在某些特定场景下你可能需要禁用它:
-### When external systems cannot provide CSRF tokens
+### 当外部系统无法提供 CSRF 令牌时
-When building APIs or handling automated requests from external systems,
-CSRF protection can interfere with legitimate requests since these systems
-cannot provide valid CSRF tokens:
+在构建 API 或处理来自外部系统的自动化请求时,CSRF 保护可能会干扰合法请求,因为这些系统无法提供有效的 CSRF 令牌:
-- **Third-party integrations**: External services cannot provide valid CSRF
- tokens
-- **Mobile applications**: Native mobile apps typically don't use cookies or
- sessions in the same way as web browsers
-- **Server-to-server communication**: API endpoints designed for
- machine-to-machine communication
-- **Payment processors**: PayPal, Stripe, and other payment systems send
- webhook notifications
-- **Version control systems**: GitHub, GitLab webhooks for CI/CD pipelines
-- **Social media platforms**: Twitter, Facebook webhook notifications
-- **Communication services**: Slack, Discord bot integrations
+- **第三方集成**:外部服务无法提供有效的 CSRF 令牌
+- **移动应用程序**:原生移动应用通常不像 Web 浏览器那样使用 cookie 或会话
+- **服务器到服务器通信**:为机器对机器通信设计的 API 端点
+- **支付处理器**:PayPal、Stripe 和其他支付系统发送 webhook 通知
+- **版本控制系统**:用于 CI/CD 流水线的 GitHub、GitLab webhook
+- **社交媒体平台**:Twitter、Facebook webhook 通知
+- **通信服务**:Slack、Discord 机器人集成
-## How to disable CSRF protection
+## 如何禁用 CSRF 保护
-First, you need to remove CSRF middleware from your main application
-middleware list in `config/web/di/application.php`:
+首先,你需要从 `config/web/di/application.php` 中的主应用程序中间件列表中删除 CSRF 中间件:
```php
return [
@@ -53,10 +41,8 @@ return [
CsrfTokenMiddleware::class, // <- Remove this line
```
-Now, if you need to leave CSRF on for specific routes or route groups, you
-can do so by adding the `CsrfMiddleware` middleware to the router
-configuration in `config/common/routes.php`. For a group that would be the
-following:
+现在,如果你需要为特定路由或路由组保留 CSRF 保护,可以通过在 `config/common/routes.php` 的路由器配置中添加
+`CsrfMiddleware` 中间件来实现。对于路由组,配置如下:
```php
return [
@@ -65,7 +51,7 @@ return [
->routes(
```
-For a single route, you can add the middleware directly to the route:
+对于单个路由,你可以直接将中间件添加到路由:
```php
Route::methods([Method::GET, Method::POST], '/say[/{test}]')
@@ -75,31 +61,29 @@ Route::methods([Method::GET, Method::POST], '/say[/{test}]')
```
-## Security considerations
+## 安全注意事项
-When disabling CSRF protection, keep these security considerations in mind:
+禁用 CSRF 保护时,请牢记以下安全注意事项:
-### Alternative authentication methods
+### 替代身份验证方法
-For API endpoints, implement proper authentication mechanisms:
+对于 API 端点,实施适当的身份验证机制:
-- **API keys**: Require API keys for authentication
-- **Bearer tokens**: Use JWT or similar token-based authentication
-- **OAuth 2.0**: Implement OAuth 2.0 for third-party access
-- **IP whitelisting**: Restrict access to known IP addresses for webhooks
+- **API 密钥**:要求使用 API 密钥进行身份验证
+- **Bearer 令牌**:使用 JWT 或类似的基于令牌的身份验证
+- **OAuth 2.0**:为第三方访问实施 OAuth 2.0
+- **IP 白名单**:将 webhook 的访问限制为已知的 IP 地址
-### Request validation
+### 请求验证
-Implement additional validation for requests without CSRF protection:
+为没有 CSRF 保护的请求实施额外的验证:
-- **Signature verification**: Verify webhook signatures (e.g., GitHub's
- X-Hub-Signature)
-- **Timestamp validation**: Check request timestamps to prevent replay
- attacks
-- **Rate limiting**: Implement rate limiting to prevent abuse
-- **Input validation**: Strictly validate all input parameters
+- **签名验证**:验证 webhook 签名(例如,GitHub 的 X-Hub-Signature)
+- **时间戳验证**:检查请求时间戳以防止重放攻击
+- **速率限制**:实施速率限制以防止滥用
+- **输入验证**:严格验证所有输入参数
-### Example: Webhook signature verification
+### 示例:Webhook 签名验证
```php
**Note**: Async functionality is not part of PSR interfaces, so this code depends on Guzzle explicitly.
+> **Note**:异步功能不是 PSR 接口的一部分,因此此代码明确依赖于 Guzzle。
```php
You can find the list of all adapters on [this page](https://docs.php-http.org/en/latest/clients.html#clients-adapters).
+> 你可以在[此页面](https://docs.php-http.org/en/latest/clients.html#clients-adapters)上找到所有适配器的列表。
-To install the packages, run the following command:
+要安装这些包,请运行以下命令:
```shell
composer require php-http/httplug php-http/guzzle7-adapter --prefer-dist
```
-## Configuration
+## 配置
-### Get and store the token
+### 获取并存储令牌
-Next, configure the application.
+接下来,配置应用程序。
-First, register at [Sentry](https://sentry.io) and create a project.
+首先,在 [Sentry](https://sentry.io) 注册并创建一个项目。
-Then, in the project settings on the “General Settings” tab, find the
-“Security Token” field and copy its value.
+然后,在项目设置的“常规设置”选项卡中,找到“安全令牌”字段并复制其值。
-Now put this token into the package configuration. By default, the config is located at `config/packages/yiisoft/yii-sentry/config/params.php`.
-Set the copied token as the value of the array element at `yiisoft/yii-sentry` => `options` => `dsn`. Example:
+现在将此令牌放入包配置中。默认情况下,配置位于 `config/packages/yiisoft/yii-sentry/config/params.php`。
+将复制的令牌设置为数组元素 `yiisoft/yii-sentry` => `options` => `dsn` 的值。示例:
```diff
'yiisoft/yii-sentry' => [
@@ -62,12 +56,11 @@ Set the copied token as the value of the array element at `yiisoft/yii-sentry` =
],
```
-### Configure the HTTP client
+### 配置 HTTP 客户端
-After installing the HTTP client, configure it.
+安装 HTTP 客户端后,对其进行配置。
-Create the file `config/common/sentry.php` and put the following code into
-it:
+创建文件 `config/common/sentry.php` 并将以下代码放入其中:
```php
hasHeader('Accept-Encoding')) {
}
```
-## Body
+## 正文
There are two methods to get body contents. The first is getting the body as
it is without parsing:
diff --git a/src/zh-CN/guide/runtime/response.md b/src/zh-CN/guide/runtime/response.md
index 58ae1a2f..59f99663 100644
--- a/src/zh-CN/guide/runtime/response.md
+++ b/src/zh-CN/guide/runtime/response.md
@@ -76,7 +76,7 @@ And, if needed, headers could be removed:
$response = $response->withoutHeader('Set-Cookie');
```
-## Body
+## 正文
Response body is an object implementing `Psr\Http\Message\StreamInterface`.
diff --git a/src/zh-CN/guide/security/best-practices.md b/src/zh-CN/guide/security/best-practices.md
index 8d232123..953bf864 100644
--- a/src/zh-CN/guide/security/best-practices.md
+++ b/src/zh-CN/guide/security/best-practices.md
@@ -265,7 +265,7 @@ Instead, PHP should be configured properly:
Note that you should keep the file up to date.
-## References
+## 参考资料
- [OWASP top 10](https://owasp.org/Top10/)
- [The Basics of Web Application
diff --git a/src/zh-CN/guide/structure/domain.md b/src/zh-CN/guide/structure/domain.md
index 6a35bb14..dc12aeb3 100644
--- a/src/zh-CN/guide/structure/domain.md
+++ b/src/zh-CN/guide/structure/domain.md
@@ -80,7 +80,7 @@ Entity, value object, aggregate, and domain events aren't services and
shouldn't be instantiated through DI container. Using `new` is the way to
go with these.
-## References
+## 参考资料
- [BoundedContext by Martin
Fowler](https://martinfowler.com/bliki/BoundedContext.html)
diff --git a/src/zh-CN/guide/tutorial/console-applications.md b/src/zh-CN/guide/tutorial/console-applications.md
index c486e235..6263cca0 100644
--- a/src/zh-CN/guide/tutorial/console-applications.md
+++ b/src/zh-CN/guide/tutorial/console-applications.md
@@ -79,7 +79,7 @@ After it's done, the command could be executed as
```
-## References
+## 参考资料
- [Symfony Console component
guide](https://symfony.com/doc/current/components/console.html)
diff --git a/src/zh-CN/guide/tutorial/using-yii-with-roadrunner.md b/src/zh-CN/guide/tutorial/using-yii-with-roadrunner.md
index 49c353ab..80531c6d 100644
--- a/src/zh-CN/guide/tutorial/using-yii-with-roadrunner.md
+++ b/src/zh-CN/guide/tutorial/using-yii-with-roadrunner.md
@@ -5,7 +5,7 @@ it as workers and each worker may handle multiple requests. Such an operation mo
[event loop](using-with-event-loop.md) and allows not re-initializing a framework for each request that improves
performance significantly.
-## Installation
+## 安装
RoadRunner works on Linux, macOS and Windows. The best way to install it is
to use a Composer:
@@ -22,7 +22,7 @@ After installation is done, run
That would download ready to use RoadRunner server `rr` binary.
-## Configuration
+## 配置
First, we need to configure the server itself. Create `/.rr.yaml` and add
the following config:
diff --git a/src/zh-CN/guide/tutorial/using-yii-with-swoole.md b/src/zh-CN/guide/tutorial/using-yii-with-swoole.md
index 6fd19ffc..807f0ae7 100644
--- a/src/zh-CN/guide/tutorial/using-yii-with-swoole.md
+++ b/src/zh-CN/guide/tutorial/using-yii-with-swoole.md
@@ -8,7 +8,7 @@ worker may handle multiple requests. Such an operation mode is often called
[event loop](using-with-event-loop.md) and allows not re-initializing a
framework for each request that improves performance significantly.
-## Installation
+## 安装
Swoole works on Linux and macOS and can be installed via pecl:
diff --git a/src/zh-CN/guide/views/asset.md b/src/zh-CN/guide/views/asset.md
index 95ecbd5a..60d2c29e 100644
--- a/src/zh-CN/guide/views/asset.md
+++ b/src/zh-CN/guide/views/asset.md
@@ -6,7 +6,7 @@ resources. Yii3 provides a comprehensive asset management system through the
`yiisoft/assets` package that handles dependencies, optimization, and
deployment of these resources.
-## Installation
+## 安装
The asset management functionality is provided by the `yiisoft/assets`
package:
@@ -635,7 +635,7 @@ final class MobileAsset extends AssetBundle
7. **Minimize HTTP requests**: Combine related assets when possible
8. **Optimize file sizes**: Compress and minify assets for production
-## Troubleshooting
+## 故障排除
### Common Issues
diff --git a/src/zh-CN/guide/views/view-injections.md b/src/zh-CN/guide/views/view-injections.md
index 5a7e5f03..693e03d3 100644
--- a/src/zh-CN/guide/views/view-injections.md
+++ b/src/zh-CN/guide/views/view-injections.md
@@ -13,7 +13,7 @@ package:
composer require yiisoft/yii-view-renderer
```
-## Configuration
+## 配置
In config `params.php`:
diff --git a/src/zh-CN/guide/views/view.md b/src/zh-CN/guide/views/view.md
index 3996ee78..14b88de4 100644
--- a/src/zh-CN/guide/views/view.md
+++ b/src/zh-CN/guide/views/view.md
@@ -21,7 +21,7 @@ views. Instead of using plain PHP templates, you can leverage one of the
template engines such as [Twig](template-engines.md) or
[Blade](https://github.com/lee-to/yii-blade).
-## Installation
+## 安装
For basic view functionality, you need the `yiisoft/view` package:
diff --git a/src/zh-CN/guide/views/widget.md b/src/zh-CN/guide/views/widget.md
index 9242128a..fd05ada5 100644
--- a/src/zh-CN/guide/views/widget.md
+++ b/src/zh-CN/guide/views/widget.md
@@ -5,7 +5,7 @@ HTML generation logic. They provide a clean way to create configurable UI
elements that can be used across different views and applications. Yii3
provides a flexible widget system through the `yiisoft/widget` package.
-## Installation
+## 安装
The widget functionality is provided by the `yiisoft/widget` package:
diff --git a/src/zh-CN/index.md b/src/zh-CN/index.md
index 2927cbb7..b69ee526 100644
--- a/src/zh-CN/index.md
+++ b/src/zh-CN/index.md
@@ -1,38 +1,35 @@
---
features:
-
- details: 'Yii gives you the maximum functionality by adding the least possible overhead.'
+ details: 'Yii 以最小的开销为您提供最大的功能。'
icon: ' '
- title: Fast
+ title: 快速
-
- details: 'Sane defaults and built-in tools helps you write solid and secure code.'
+ details: 合理的默认设置和内置工具帮助您编写稳固且安全的代码。
icon: ' '
- title: Secure
+ title: 安全
-
- details: 'Write more code in less time with simple, yet powerful APIs and code generation.'
+ details: '通过简单而强大的 API 和代码生成,在更短的时间内编写更多代码。'
icon: ' '
- title: Efficient
+ title: 高效
hero:
actions:
-
link: guide/intro/what-is-yii.html
- text: 'Get Started'
+ text: 开始使用
theme: brand
class: homeHero2
image:
alt: Yii
src: /images/yii_logo.svg
- name: 'Yii3 Framework'
- tagline: "A simple, powerful and fast framework. Meet the modern, definitive guide to Yii you've always wanted."
- text: Documentation
+ name: 'Yii3 框架'
+ tagline: '一个简单、强大且快速的框架。这是您一直想要的现代、权威的 Yii 指南。'
+ text: 文档
layout: home
---
-- [The Definitive Guide](guide/) — the comprehensive guide covering all
- aspects of the framework.
-- [Community Cookbook](cookbook/) — a collection of community-contributed
- tips, tricks, and solutions for common Yii development tasks.
-- [Internals](internals/) — documentation for developers contributing to the
- Yii framework itself, including guidelines, workflows, and best practices.
+- [权威指南](guide/) — 涵盖框架所有方面的综合指南。
+- [社区手册](cookbook/) — 社区贡献的技巧、窍门和常见 Yii 开发任务解决方案的集合。
+- [内部文档](internals/) — 为贡献 Yii 框架本身的开发者提供的文档,包括指南、工作流程和最佳实践。
diff --git a/src/zh-CN/internals/000-packages.md b/src/zh-CN/internals/000-packages.md
index b8f9434a..c72f51e1 100644
--- a/src/zh-CN/internals/000-packages.md
+++ b/src/zh-CN/internals/000-packages.md
@@ -1,42 +1,38 @@
-# 000 — Packages
+# 000 — 包
-Yii3 team divided the framework into several packages that conform to the
-following agreements.
+Yii3 团队将框架划分为几个符合以下约定的包。
-For all packages, the GitHub repository name exactly matches the Packagist
-package name.
+对于所有包,GitHub 仓库名称与 Packagist 包名称完全匹配。
-For a full list of packages and their building status, see [status page at
-yiiframework.com](https://www.yiiframework.com/status/3.0).
+有关包及其构建状态的完整列表,请参阅 [yiiframework.com
+的状态页面](https://www.yiiframework.com/status/3.0)。
-## Yii-specific packages (framework and extensions)
+## Yii 特定包(框架和扩展)
-- named `yiisoft/yii-something` or more specific: `yii-type-something` e.g.:
- - modules: `yii-module-users`, `yii-module-pages`
- - themes: `yii-theme-adminlte`, `yii-theme-hyde`
- - widgets: `yii-widget-datepicker`
+- 命名为 `yiisoft/yii-something` 或更具体的:`yii-type-something`,例如:
+ - 模块:`yii-module-users`,`yii-module-pages`
+ - 主题:`yii-theme-adminlte`,`yii-theme-hyde`
+ - 小部件:`yii-widget-datepicker`
- ...
-- titled as "Yii Framework ..."
-- may have any dependencies and Yii-specific code
+- 标题为“Yii Framework ...”
+- 可以有任何依赖项和 Yii 特定代码
-## General purpose packages (libraries)
+## 通用包(库)
-- you can use these independently of Yii Framework
-- named as `yiisoft/something` without yii-prefix
-- titled as "Yii ..."
-- must not have dependencies on any Yii-specific packages
-- should have as fewer dependencies as possible
+- 您可以独立于 Yii 框架使用这些
+- 命名为 `yiisoft/something`,不带 yii 前缀
+- 标题为“Yii ...”
+- 不得依赖任何 Yii 特定包
+- 应尽可能少的依赖项
-## Configs and defaults
+## 配置和默认值
-The following applies to both Yii-specific packages and general purpose
-packages:
+以下适用于 Yii 特定包和通用包:
-- Package may have `config` directory with Yii-specific defaults.
-- Package may have "config-plugin" in "extra" section of `composer.json`.
-- Package mustn't have dependencies in `require` section of `composer.json`
- that are used in `config` only.
-- You should namespace parameters with `vendor/package-name`:
+- 包可以有包含 Yii 特定默认值的 `config` 目录。
+- 包可以在 `composer.json` 的“extra”部分中有“config-plugin”。
+- 包不得在 `composer.json` 的 `require` 部分中有仅在 `config` 中使用的依赖项。
+- 您应该使用 `vendor/package-name` 命名空间参数:
```php
return [
@@ -47,38 +43,29 @@ return [
];
```
-## Versions
+## 版本
-All packages follow [SemVer](https://semver.org/) versioning:
+所有包都遵循 [SemVer](https://semver.org/) 版本控制:
-- `x.*.*` - incompatible API changes.
-- `*.x.*` - add functionality (backwards-compatible).
-- `*.*.x` - bug fixes (backwards-compatible).
+- `x.*.*` - 不兼容的 API 更改。
+- `*.x.*` - 添加功能(向后兼容)。
+- `*.*.x` - bug 修复(向后兼容)。
-The first stable version should be 1.0.0.
+第一个稳定版本应该是 1.0.0。
-Each package version number doesn't depend on any other package version or
-framework name/version, only on its own public contract. The framework as a
-whole has the "Yii3" name.
+每个包的版本号不依赖于任何其他包的版本或框架名称/版本,仅依赖于其自己的公共契约。整个框架的名称为 "Yii3"。
-It's alright to use packages with different major versions together, as long
-as they're compatible.
+只要兼容,一起使用不同主版本的包是可以的。
-## PHP versions support
+## PHP 版本支持
-The support of PHP versions supported for a package depends on [PHP versions
-life cycle](https://www.php.net/supported-versions.php).
+包支持的 PHP 版本取决于 [PHP 版本生命周期](https://www.php.net/supported-versions.php)。
-- Package versions with active support MUST support all PHP versions that
- have active support.
-- Both packages and application templates MUST have supported versions that
- receive bug and security fixes. These SHOULD correspond to PHP versions
- receiving security fixes.
-- Packages and application templates MIGHT have supported versions that work
- with unsupported PHP versions.
-- Bumping the minimal PHP version in a package or an application template is
- a minor change.
+- 具有活跃支持的包版本必须支持所有具有活跃支持的 PHP 版本。
+- 包和应用程序模板都必须有接收 bug 和安全修复的受支持版本。这些应该对应于接收安全修复的 PHP 版本。
+- 包和应用程序模板可能有与不受支持的 PHP 版本一起工作的受支持版本。
+- 提升包或应用程序模板中的最低 PHP 版本是一个次要更改。
## composer.json
-A logical OR operator in version ranges MUST use double pipe (`||`). For example: `"yiisoft/arrays": "^1.0 || ^2.0"`.
+版本范围中的逻辑 OR 运算符必须使用双管道(`||`)。例如:`"yiisoft/arrays": "^1.0 || ^2.0"`。
diff --git a/src/zh-CN/internals/001-yii-values.md b/src/zh-CN/internals/001-yii-values.md
index b69a77e2..59d928e6 100644
--- a/src/zh-CN/internals/001-yii-values.md
+++ b/src/zh-CN/internals/001-yii-values.md
@@ -1,82 +1,71 @@
-# 001 — Yii goal and values
+# 001 — Yii 目标和价值观
-## Goal
+## 目标
-The Yii project aims to build and support _practical_ and _helpful_ tools
-and community.
+Yii 项目旨在构建和支持 _practical_ 和 _helpful_ 的工具和社区。
-## Values
+## 价值观
-The values we express in our work support the goal. We try to
+我们在工作中表达的价值观支持这一目标。我们努力
-- Be practical
- - [High performance](#high-performance)
- - [Sensible defaults and
- flexibility](#sensible-defaults-and-flexibility)
- - [Be practice-oriented](#be-practice-oriented)
-- Be helpful
- - [Be simple](#be-simple)
- - [Be explicit](#be-explicit)
- - [Be consistent](#be-consistent)
+- 实用
+ - [高性能](#high-performance)
+ - [合理的默认值和灵活性](#sensible-defaults-and-flexibility)
+ - [以实践为导向](#be-practice-oriented)
+- 有帮助
+ - [保持简单](#be-simple)
+ - [明确表达](#be-explicit)
+ - [保持一致](#be-consistent)
-## Be practical
+## 实用
-### High performance
+### 高性能
-Performance is a necessary condition of practicality. Software shouldn't
-waste machine resources or human resources.
+性能是实用性的必要条件。软件不应浪费机器资源或人力资源。
-### Sensible defaults and flexibility
+### 合理的默认值和灵活性
-We prefer sensible defaults and conventions that users can customize. We
-seek a balance between flexibility, discipline and simplicity that meets
-common needs.
+我们更喜欢用户可以自定义的合理默认值和约定。我们寻求灵活性、纪律性和简单性之间的平衡,以满足常见需求。
-### Be practice-oriented
+### 以实践为导向
-We prefer practice to theory. For example:
+我们更喜欢实践而不是理论。例如:
-- Solutions for known use cases should avoid excess complexity by providing
- only necessary flexibility.
-- Standard implementations should take practical use into account.
-- Experience is at least as useful as theory in guiding design.
-- Context is critical in determining appropriateness.
+- 已知用例的解决方案应通过仅提供必要的灵活性来避免过度复杂性。
+- 标准实现应考虑实际使用。
+- 在指导设计方面,经验至少与理论一样有用。
+- 上下文对于确定适当性至关重要。
-## Be helpful
+## 有帮助
-This value guides technical decisions as well as community activity.
-Consideration of how software features help users should guide development.
-Community-wise, we value any helpful contribution, be it a pull request or
-an answer in the forum.
+这一价值观指导技术决策和社区活动。对软件功能如何帮助用户的考虑应该指导开发。在社区方面,我们重视任何有帮助的贡献,无论是 pull request
+还是论坛中的回答。
-When the other principles conflict, we choose a solution that's more helpful
-to the community.
+当其他原则发生冲突时,我们选择对社区更有帮助的解决方案。
-### Be simple
+### 保持简单
-Solutions should be simple and expressive:
+解决方案应该简单且富有表现力:
-- We use as much complexity as needed and no more.
-- We avoid ugly solutions unless there is no alternative.
-- Fewer rules are better than more rules.
+- 我们使用所需的复杂性,不多不少。
+- 除非别无选择,否则我们避免丑陋的解决方案。
+- 规则越少越好。
-### Be Explicit
+### 明确表达
-We prefer explicit, obvious solutions and code. Solutions should clearly
-express exactly what they do. For example:
+我们更喜欢明确、显而易见的解决方案和代码。解决方案应该清楚地表达它们的确切作用。例如:
-- A straightforward solution is better than an abstract one unless the
- abstraction has a practical purpose.
-- Loud fails are better than silent fails or masking errors.
-- Explicit casts are better than PHP type juggling, type hints are good.
-- No magic unless necessary.
+- 除非抽象有实际目的,否则直接的解决方案比抽象的解决方案更好。
+- 明确的失败比静默失败或掩盖错误更好。
+- 显式转换比 PHP 类型转换更好,类型提示很好。
+- 除非必要,否则不要使用魔术。
-### Be consistent
+### 保持一致
-We try to be consistent in:
+我们努力在以下方面保持一致:
-- Code style
-- Naming
-- Design
-- Structure
-- Values and goals
+- 代码风格
+- 命名
+- 设计
+- 结构
+- 价值观和目标
diff --git a/src/zh-CN/internals/002-issue-workflow.md b/src/zh-CN/internals/002-issue-workflow.md
index 58f8df1c..9f39b775 100644
--- a/src/zh-CN/internals/002-issue-workflow.md
+++ b/src/zh-CN/internals/002-issue-workflow.md
@@ -1,27 +1,25 @@
-# 002 — Issue workflow
+# 002 — Issue 工作流程
-The process of handing incoming issues is the following:
+处理传入 issue 的流程如下:
-
+
-## Roles
+## 角色
-We've many roles:
+我们有多个角色:
-- Process managers - initially triage issues and manage labels.
-- Decision makers - participate in discussions moving them to resolutions.
-- Bug hunters - verifying bugs.
-- Contributors - create code for pull requests.
-- Code reviewers - review pull requests.
+- 流程管理员 - 初步分类 issue 并管理标签。
+- 决策者 - 参与讨论并推动解决方案。
+- Bug 猎人 - 验证 bug。
+- 贡献者 - 为 pull request 创建代码。
+- 代码审查员 - 审查 pull request。
-A single person may take one or more roles in the issue-resolving process.
+一个人可以在 issue 解决过程中担任一个或多个角色。
-## Labels
+## 标签
-We label issues to mark many things: current status, issue type, component
-affected. Status labels speak for themselves.
+我们使用标签标记许多内容:当前状态、issue 类型、受影响的组件。状态标签不言自明。
-## Milestones
+## 里程碑
-Issues aren't assigned to milestones unless they're critical or there is a
-likely good pull request exists.
+除非 issue 是关键的或存在一个可能不错的 pull request,否则不会将其分配到里程碑。
diff --git a/src/zh-CN/internals/003-roadmap.md b/src/zh-CN/internals/003-roadmap.md
index 0531a352..f0f1dcc8 100644
--- a/src/zh-CN/internals/003-roadmap.md
+++ b/src/zh-CN/internals/003-roadmap.md
@@ -1,207 +1,184 @@
-# 003 — Roadmap
+# 003 — 路线图
-We want Yii 3 to:
+我们希望 Yii 3:
-- Not limit a developer to choosing architecture. Allow anything from
- "classic" MVC to DDD.
-- Be based on the best practices such as SOLID, GRASP, etc. and teach them
- to the community.
-- Keep the most good things from Yii 2.
-- Be more open to the global PHP community and infrastructure.
+- 不限制开发者选择架构。允许从“经典”MVC 到 DDD 的任何架构。
+- 基于 SOLID、GRASP 等最佳实践,并将它们教给社区。
+- 保留 Yii 2 中最好的东西。
+- 对全球 PHP 社区和基础设施更加开放。
-## PSRs compliance
+## PSR 合规性
-PSR compliance helps with customizability, the ability to use general PHP
-libraries and implement fewer wrappers. Here's the list of PSRs we want to
-implement.
+PSR 合规性有助于可定制性、使用通用 PHP 库的能力以及实现更少的包装器。以下是我们想要实现的 PSR 列表。
-### PSR-3 Logger
+### PSR-3 日志记录器
-Implemented as a [separate package that isn't dependent on a
-framework](https://github.com/yiisoft/log).
+实现为 [不依赖于框架的独立包](https://github.com/yiisoft/log)。
-- [x] Framework packages should depend on interface only.
-- [x] Split drivers into packages.
-- [x] Clean-up code.
-- [x] [Fix email target](https://github.com/yiisoft/log-target-email).
+- [x] 框架包应仅依赖于接口。
+- [x] 将驱动程序拆分为包。
+- [x] 清理代码。
+- [x] [修复电子邮件目标](https://github.com/yiisoft/log-target-email)。
-### PSR-4 Autoloading
+### PSR-4 自动加载
-- [x] Autoloading is fine already.
-- [x] Document on how it works.
+- [x] 自动加载已经很好了。
+- [x] 记录它的工作原理。
-### PSR-7 HTTP message
+### PSR-7 HTTP 消息
-- [x] Remove our own implementation. At least for now.
-- [x] Framework packages should depend on interfaces only.
+- [x] 删除我们自己的实现。至少目前如此。
+- [x] 框架包应仅依赖于接口。
-### PSR-11 Container
+### PSR-11 容器
-Implemented as a [separate package that isn't dependent on a
-framework](https://github.com/yiisoft/di).
+实现为 [不依赖于框架的独立包](https://github.com/yiisoft/di)。
-- [x] Framework packages shouldn't use container directly. One should be
- able to instantiate everything manually.
-- [x] Finish refactoring.
-- [x] Remove all framework-specific implementations from the package. Move
- to a framework.
-- [x] [Implement autoloader
- fallback](https://github.com/yiisoft/di/issues/88)
+- [x] 框架包不应直接使用容器。应该能够手动实例化所有内容。
+- [x] 完成重构。
+- [x] 从包中删除所有框架特定的实现。移至框架。
+- [x] [实现自动加载器回退](https://github.com/yiisoft/di/issues/88)
-### PSR-12 Code style
+### PSR-12 代码风格
-- [x] Make sure the code follows it.
-- [x] Automate fixing style before release.
+- [x] 确保代码遵循它。
+- [x] 在发布前自动修复风格。
-### PSR-14 Event dispatcher
+### PSR-14 事件调度器
-- [x] [Implement as a separate
- library](https://github.com/yiisoft/event-dispatcher).
-- [x] Use in other packages.
-- [x] Polish.
+- [x] [实现为独立库](https://github.com/yiisoft/event-dispatcher)。
+- [x] 在其他包中使用。
+- [x] 完善。
-### PSR-15 HTTP handlers
+### PSR-15 HTTP 处理器
-- [x] Rewrite HTTP flow to PSR-7 request-response + formatting response via
- emitter.
-- [x] Offer SAPI emitter out of the box.
-- [x] Make it possible to use alternative emitters such as RoadRunner.
-- [x] Support middleware.
-- [x] Implement filters as middleware:
- - [x] [Rate limiting](https://github.com/yiisoft/yii-web/issues/63)
- - [x] [Authentication](https://github.com/yiisoft/yii-web/issues/114)
-- [x] Re-implement router w/ middleware support for route groups.
-- [x] Filters should be middlewares.
+- [x] 将 HTTP 流程重写为 PSR-7 请求-响应 + 通过 Emitter 进行格式化响应。
+- [x] 开箱即用地提供 SAPI Emitter。
+- [x] 支持使用 RoadRunner 等替代的 Emitter 实现。
+- [x] 支持中间件。
+- [x] 将过滤器实现为中间件:
+ - [x] [速率限制](https://github.com/yiisoft/yii-web/issues/63)
+ - [x] [身份验证](https://github.com/yiisoft/yii-web/issues/114)
+- [x] 重新实现路由器,支持路由组的中间件。
+- [x] 过滤器应该是中间件。
-### PSR-16 Simple cache
+### PSR-16 简单缓存
-Implemented as a [separate package that isn't dependent on a
-framework](https://github.com/yiisoft/cache).
+实现为 [不依赖于框架的独立包](https://github.com/yiisoft/cache)。
-- [x] Framework packages should depend on interfaces only.
-- [x] Split drivers into packages.
-- [x] Clean-up code.
+- [x] 框架包应仅依赖于接口。
+- [x] 将驱动程序拆分为包。
+- [x] 清理代码。
-### PSR-17 HTTP factories
+### PSR-17 HTTP 工厂
-- [x] Use PSR factories.
+- [x] 使用 PSR 工厂。
-### PSR-18 HTTP client
+### PSR-18 HTTP 客户端
-- [x] Remove our own implementation. At least for now.
-- [x] Framework packages should depend on interfaces only.
+- [x] 删除我们自己的实现。至少目前如此。
+- [x] 框架包应仅依赖于接口。
-## Stricter types
+## 更严格的类型
-- [x] Make sure type hinting is used everywhere.
-- [x] Make sure types are as definitive as possible. Avoid varying types if
- possible.
+- [x] 确保在所有地方都使用类型提示。
+- [x] 确保类型尽可能明确。尽可能避免变化的类型。
-## Single application template
+## 单一应用程序模板
-- [x] Drop basic/advanced.
-- [x] Create a [single application template that works out of the
- box](https://github.com/yiisoft/app).
+- [x] 放弃 basic/advanced。
+- [x] 创建一个 [开箱即用的单一应用程序模板](https://github.com/yiisoft/app)。
-## Router
+## 路由器
-Implemented as a [separate package that isn't dependent on a
-framework](https://github.com/yiisoft/router).
+实现为 [不依赖于框架的独立包](https://github.com/yiisoft/router)。
-- [x] DSL for configuration.
-- [x] Ability to route to any callable.
-- [x] Named routes.
-- [x] Route groups w/ middleware support.
+- [x] 用于配置的 DSL。
+- [x] 能够路由到任何可调用对象。
+- [x] 命名路由。
+- [x] 支持中间件的路由组。
-## Best practices and SOLID compliance of all classes/packages
+## 所有类/包的最佳实践和 SOLID 合规性
-- [x] Make sure interfaces follow the "interface segregation" principle.
-- [x] Don't use public properties.
-- [x] Don't use `init()`.
-- [x] Don't inherit from `BaseObject` or `Component`. Remove these.
-- [x] No globals.
-- [x] No static calls except helpers that are final.
-- [x] Prefer throwing exceptions to fixing input.
+- [x] 确保接口遵循“接口隔离”原则。
+- [x] 不要使用公共属性。
+- [x] 不要使用 `init()`。
+- [x] 不要从 `BaseObject` 或 `Component` 继承。删除这些。
+- [x] 没有全局变量。
+- [x] 除了 final 的辅助函数外,没有静态调用。
+- [x] 优先抛出异常而不是修复输入。
-## Development toolkit
+## 开发工具包
-- [x] Release command line tool
-- [x] Development command line tool (symlinks packages into usable
- application)
+- [x] 发布命令行工具
+- [x] 开发命令行工具(将包符号链接到可用的应用程序)
-## Console
+## 控制台
-- [x] Separate web and console application
-- [x] Possibly eliminate base application (still needed)
-- [x] Create an interface for the console (using Symfony one)
-- [x] Implementation may be one of the popular ones (using Symfony one)
-- [x] Ensure application can add commands via config
+- [x] 分离 web 和控制台应用程序
+- [x] 可能消除基础应用程序(仍然需要)
+- [x] 为控制台创建接口(使用 Symfony 的)
+- [x] 实现可能是流行的之一(使用 Symfony 的)
+- [x] 确保应用程序可以通过配置添加命令
-## Documentation
+## 文档
-- [ ] Follow best practices.
-- [ ] Don't use the "MVC" term.
-- [ ] Upgrading from Yii 2.
+- [ ] 遵循最佳实践。
+- [ ] 不要使用“MVC”术语。
+- [ ] 从 Yii 2 升级。
## RBAC
-RBAC is implemented as [a framework-independent
-package](https://github.com/yiisoft/rbac).
+RBAC 实现为 [独立于框架的包](https://github.com/yiisoft/rbac)。
-- [x] Finish refactoring.
-- [x] Make sure it follows best practices.
-- [x] Split drivers into packages.
+- [x] 完成重构。
+- [x] 确保它遵循最佳实践。
+- [x] 将驱动程序拆分为包。
-## View
+## 视图
-View is implemented as [framework-independent
-package](https://github.com/yiisoft/view).
+视图实现为 [独立于框架的包](https://github.com/yiisoft/view)。
-- [x] Finish refactoring ([see
- issues](https://github.com/yiisoft/view/issues)).
-- [x] Port widgets.
-- [x] Rethink and implement active form widgets.
-- [x] Implement caching widgets.
+- [x] 完成重构([查看 issue](https://github.com/yiisoft/view/issues))。
+- [x] 移植小部件。
+- [x] 重新思考并实现活动表单小部件。
+- [x] 实现缓存小部件。
-## Data abstractions and grid
+## 数据抽象和网格
-- [x] Finish [data abstractions](https://github.com/yiisoft/data).
-- [x] Port sort, use data abstractions. Should be part of
- [yii-dataview](https://github.com/yiisoft/yii-dataview).
-- [x] Port paging, use data abstractions. Should be part of
- [yii-dataview](https://github.com/yiisoft/yii-dataview).
-- [x] Port grid, use data abstractions. Should be part of
- [yii-dataview](https://github.com/yiisoft/yii-dataview).
-- [x] Port list, use data abstractions. Should be part of
- [yii-dataview](https://github.com/yiisoft/yii-dataview).
+- [x] 完成 [数据抽象](https://github.com/yiisoft/data)。
+- [x] 移植排序,使用数据抽象。应该是
+ [yii-dataview](https://github.com/yiisoft/yii-dataview) 的一部分。
+- [x] 移植分页,使用数据抽象。应该是
+ [yii-dataview](https://github.com/yiisoft/yii-dataview) 的一部分。
+- [x] 移植网格,使用数据抽象。应该是
+ [yii-dataview](https://github.com/yiisoft/yii-dataview) 的一部分。
+- [x] 移植列表,使用数据抽象。应该是
+ [yii-dataview](https://github.com/yiisoft/yii-dataview) 的一部分。
-## Validators
+## 验证器
-- [x] Finish [the main package](https://github.com/yiisoft/validator)
- redesign
-- [x] Port necessary validators
+- [x] 完成 [主包](https://github.com/yiisoft/validator) 重新设计
+- [x] 移植必要的验证器
-## Debug toolbar
+## 调试工具栏
-- [x] Port debug toolbar.
+- [x] 移植调试工具栏。
## Gii
-- [x] Port Gii.
+- [x] 移植 Gii。
-## Infrastructure
+## 基础设施
-- [x] Cover [config](https://github.com/yiisoft/config) with tests.
-- [x] Release stable [config](https://github.com/yiisoft/config).
+- [x] 为 [config](https://github.com/yiisoft/config) 编写测试。
+- [x] 发布稳定的 [config](https://github.com/yiisoft/config)。
-## Others
+## 其他
-- [x] [Decide on
- namespaces](https://forum.yiiframework.com/t/lowercase-or-camelcase-namespaces/124983/52).
-- [x] [Clean up error
- handler](https://github.com/yiisoft/yii2/issues/14348). Make sure the
- error handler catches fatals and is using response.
-- [x] Make validators independent of models to allow reusing them in
- handlers.
-- [x] [Split
- IdentityInterface](https://github.com/yiisoft/yii2/issues/13825).
+- [x]
+ [决定命名空间](https://forum.yiiframework.com/t/lowercase-or-camelcase-namespaces/124983/52)。
+- [x]
+ [清理错误处理器](https://github.com/yiisoft/yii2/issues/14348)。确保错误处理器捕获致命错误并使用响应。
+- [x] 使验证器独立于模型,以允许在处理器中重用它们。
+- [x] [拆分 IdentityInterface](https://github.com/yiisoft/yii2/issues/13825)。
diff --git a/src/zh-CN/internals/004-namespaces.md b/src/zh-CN/internals/004-namespaces.md
index 8f623dbd..b93b68e4 100644
--- a/src/zh-CN/internals/004-namespaces.md
+++ b/src/zh-CN/internals/004-namespaces.md
@@ -1,14 +1,14 @@
-# 004 — Namespaces
+# 004 — 命名空间
-Package namespace rules are the following:
+包命名空间规则如下:
-1. PascalCase is used for namespace parts.
-2. Root vendor namespace is `Yiisoft`.
-3. Package name parts are used in namespace.
-4. Adjective is added to a noun and is a single part.
+1. 命名空间部分使用 PascalCase(帕斯卡命名法)。
+2. 根供应商命名空间是 `Yiisoft`。
+3. 包名称部分用于命名空间。
+4. 形容词添加到名词后,作为单个部分。
-Some examples:
+一些示例:
| Package | Namespace |
|----------------------------|---------------------------|
@@ -17,7 +17,6 @@ Some examples:
| yiisoft/db-mysql | Yiisoft\Db\Mysql |
| yiisoft/friendly-exception | Yiisoft\FriendlyException |
-## References
+## 参考资料
-- [International forum
- discussion](https://forum.yiiframework.com/t/use-yiisoft-as-a-root-namespace-instead-of-yii-for-yii-3-packages/125734)
+- [国际论坛讨论](https://forum.yiiframework.com/t/use-yiisoft-as-a-root-namespace-instead-of-yii-for-yii-3-packages/125734)
diff --git a/src/zh-CN/internals/005-development-tool.md b/src/zh-CN/internals/005-development-tool.md
index 961d7e7e..5791782e 100644
--- a/src/zh-CN/internals/005-development-tool.md
+++ b/src/zh-CN/internals/005-development-tool.md
@@ -1,9 +1,7 @@
-# 005 — Yii development tool
+# 005 — Yii 开发工具
-For Yii3, the number of packages increased significantly to achieve more
-reusability and independent releases. To ease development of the framework
-itself, we've created a special tool available from
-[yiisoft/yii-dev-tool](https://github.com/yiisoft/yii-dev-tool).
+对于 Yii3,为了实现更好的可重用性和独立发布,包的数量显著增加。为了简化框架本身的开发,我们创建了一个特殊的工具,可从
+[yiisoft/yii-dev-tool](https://github.com/yiisoft/yii-dev-tool) 获取。
```
$ ./yii-dev
@@ -33,19 +31,16 @@ Available commands:
update Update packages
```
-There are many commands available. The most important ones are `install` and
-`update`. What it does is:
+有许多可用的命令。最重要的是 `install` 和 `update`。它的作用是:
-1. Install/update all packages listed in
+1. 安装/更新
[`packages.php`](https://github.com/yiisoft/yii-dev-tool/blob/master/packages.php)
- or individual package from that list if specified.
-2. For every package installed check `vendor` directory for packages listed
- in `packages.php`. If there is any, replace the package directory with a
- symlink to another package source.
+ 中列出的所有包,或者如果指定了,则安装/更新该列表中的单个包。
+2. 对于每个已安装的包,检查 `vendor` 目录中是否有 `packages.php`
+ 中列出的包。如果有,则将包目录替换为指向另一个包源的符号链接。
-As a result, you will have many packages using each other, so there is no
-need to `git push` and `composer install` / `composer update` during
-development.
+因此,您将拥有许多相互使用的包,所以在开发过程中无需执行 `git push` 和 `composer install` / `composer
+update`。
-A [detailed example](https://github.com/yiisoft/yii-dev-tool#usage-example)
-of using the tool is available in its README.
+工具的 [详细使用示例](https://github.com/yiisoft/yii-dev-tool#usage-example) 可在其
+README 中找到。
diff --git a/src/zh-CN/internals/006-git-commit-messages.md b/src/zh-CN/internals/006-git-commit-messages.md
index 18a29f3c..b0847397 100644
--- a/src/zh-CN/internals/006-git-commit-messages.md
+++ b/src/zh-CN/internals/006-git-commit-messages.md
@@ -1,18 +1,17 @@
-# 006 — Git commit messages
+# 006 — Git 提交消息
-## Subject line
+## 主题行
-- Use `#123` to reference issue by number
-- Use imperative mood that's `Fix`, not `Fixed`
-- Don't add a period at the end
-- Use `[skip ci]` if there is no need to run unit tests
-- Start with a capital letter
-- Limit to 50 characters
+- 使用 `#123` 通过编号引用问题
+- 使用祈使语气,即 `Fix` 而不是 `Fixed`
+- 末尾不要添加句号
+- 如果不需要运行单元测试,使用 `[skip ci]`
+- 以大写字母开头
+- 限制在 50 个字符以内
-## Body
+## 正文
-Use the message body **if** you need an extra explanation. Explain why, not
-how.
+**如果**需要额外说明,使用消息正文。解释为什么,而不是如何做。
-- Limit line length to 72 characters
+- 限制行长度为 72 个字符
diff --git a/src/zh-CN/internals/007-exceptions.md b/src/zh-CN/internals/007-exceptions.md
index f40cf62e..cf8258b3 100644
--- a/src/zh-CN/internals/007-exceptions.md
+++ b/src/zh-CN/internals/007-exceptions.md
@@ -1,16 +1,12 @@
-# 007 — Exceptions
+# 007 — 异常
-- Throw exceptions instead of returning an error code.
-- Exception class name must be suffixed with `Exception`.
-- Use grammatically correct error messages including ending punctuation,
- that's most exceptions must end with a period.
-- `\InvalidArgumentException` must be used directly. There should be no
- exceptions inherited from it.
-- `\InvalidArgumentException` must never be caught.
+- 抛出异常而不是返回错误代码。
+- 异常类名必须以 `Exception` 作为后缀。
+- 使用语法正确的错误消息,包括结束标点符号,即大多数异常必须以句号结尾。
+- `\InvalidArgumentException` 必须直接使用。不应该有从它继承的异常。
+- `\InvalidArgumentException` 绝不能被捕获。
-## References
+## 参考资料
-- [International community discussion and
- poll](https://forum.yiiframework.com/t/naming-exceptions/126613/6)
-- [Russian community discussion and
- poll](https://yiiframework.ru/forum/viewtopic.php?f=39&t=51290)
+- [国际社区讨论和投票](https://forum.yiiframework.com/t/naming-exceptions/126613/6)
+- [俄罗斯社区讨论和投票](https://yiiframework.ru/forum/viewtopic.php?f=39&t=51290)
diff --git a/src/zh-CN/internals/008-interfaces.md b/src/zh-CN/internals/008-interfaces.md
index bfe91968..425a76ff 100644
--- a/src/zh-CN/internals/008-interfaces.md
+++ b/src/zh-CN/internals/008-interfaces.md
@@ -1,10 +1,8 @@
-# 008 — Interfaces
+# 008 — 接口
-- Interface name should be suffixed with `Interface`.
+- 接口名称应以 `Interface` 作为后缀。
-## References
+## 参考资料
-- [International community discussion and
- poll](https://forum.yiiframework.com/t/naming-interfaces/126612/5)
-- [Russian community discussion and
- poll](https://yiiframework.ru/forum/viewtopic.php?f=39&t=51289)
+- [国际社区讨论和投票](https://forum.yiiframework.com/t/naming-interfaces/126612/5)
+- [俄罗斯社区讨论和投票](https://yiiframework.ru/forum/viewtopic.php?f=39&t=51289)
diff --git a/src/zh-CN/internals/009-design-decisions.md b/src/zh-CN/internals/009-design-decisions.md
index a9e0f54b..25c6da6f 100644
--- a/src/zh-CN/internals/009-design-decisions.md
+++ b/src/zh-CN/internals/009-design-decisions.md
@@ -1,89 +1,65 @@
-# 009 — Design Decisions
+# 009 — 设计决策
-In this document, we list important design decisions taken during Yii3
-development.
+在本文档中,我们列出了 Yii3 开发过程中做出的重要设计决策。
-## Remove magic properties
+## 移除魔术属性
-Magic properties in Yii 2 were an interesting idea that allowed a developer
-to start with public property and then seamlessly migrate to using
-getter/setter called via magic methods without changing the code.
+Yii 2 中的魔术属性是一个有趣的想法,它允许开发者从公共属性开始,然后无缝迁移到通过魔术方法调用的 getter/setter,而无需更改代码。
-The main reason for removal in Yii 3 is that it resulted in using public
-properties everywhere, thus lack of encapsulation and code fragility.
+在 Yii 3 中移除它的主要原因是它导致到处使用公共属性,从而缺乏封装性和代码脆弱性。
-## Remove the service locator
+## 移除服务定位器
-Service locator both Yii 1 and Yii 2 was convenient but was also abused a
-lot. Although a dependency injection container was available in Yii 2,
-service locator was generally preferred to cause both a dependency on the
-service locator itself, high coupling, hard to test code.
+Yii 1 和 Yii 2 中的服务定位器很方便,但也被大量滥用。尽管 Yii 2
+中提供了依赖注入容器,但服务定位器通常更受欢迎,这导致了对服务定位器本身的依赖、高耦合和难以测试的代码。
-Yii 3 relies on dependency injection only lowering coupling significantly
-and making code way more testable.
+Yii 3 仅依赖依赖注入,显著降低了耦合度,使代码更易于测试。
-## Extract general packages
+## 提取通用包
-Yii 1 and Yii 2 were fully closed communities. All the code we had wasn't
-useful outside Yii, and most of the "external" code wasn't useful in Yii
-without wrappers. It was noted many times by communities external to Yii
-that many parts of Yii are well-designed and unique, and they'd use these if
-these were available as standalone packages.
+Yii 1 和 Yii 2 是完全封闭的社区。我们拥有的所有代码在 Yii 之外都没有用处,而大多数“外部”代码在没有包装器的情况下在 Yii
+中也没有用处。Yii 外部的社区多次指出,Yii 的许多部分设计良好且独特,如果这些部分作为独立包提供,他们会使用它们。
-As part of Yii 3 packages such as cache, RBAC, view, etc. were extracted
-into framework-independent packages. Benefits are:
+作为 Yii 3 的一部分,缓存、RBAC、视图等包被提取为独立于框架的包。好处是:
-- Increased usage and contribution
-- Yii team could delegate maintenance
-- Independent releases are possible
+- 增加使用和贡献
+- Yii 团队可以委托维护
+- 可以独立发布
-## Adopt PSRs
+## 采用 PSR
-The team adopted some PSRs in Yii 2, such as PSR-4 and PSR-2. Interfaces in
-general weren't, although Yii is part of PHP-FIG. Mainly because when Yii 2
-was released, these were either in the making or not adopted enough.
+团队在 Yii 2 中采用了一些 PSR,例如 PSR-4 和 PSR-2。尽管 Yii 是 PHP-FIG 的一部分,但通常没有采用接口。主要是因为当
+Yii 2 发布时,这些要么正在制定中,要么还没有被充分采用。
-Yii3 benefits from PSRs since there are nowadays many ready-to-use libraries
-that one can get via Composer: cache backends, middleware, loggers, DI
-containers, etc.
+Yii3 从 PSR 中受益,因为现在有许多可以通过 Composer 获得的即用型库:缓存后端、中间件、日志记录器、DI 容器等。
-By implementing PSRs in general packages, we allow these to be used in more
-projects, thus raising the contribution level.
+通过在通用包中实现 PSR,我们允许这些包在更多项目中使用,从而提高贡献水平。
-## Improve DI container
+## 改进 DI 容器
-The problem with the Yii 2 container was that it's tailored to be used with
-Yii 2 components. API isn't well-designed to be used with general PHP
-classes.
+Yii 2 容器的问题在于它是为与 Yii 2 组件一起使用而定制的。API 设计不适合与通用 PHP 类一起使用。
-In Yii3, we ensured that container can be used to conveniently configure any
-PHP class.
+在 Yii3 中,我们确保容器可以方便地配置任何 PHP 类。
-That should result in the absence of Yii-specific wrapper packages and more
-direct usages of Composer packages.
+这应该会导致不再需要 Yii 特定的包装器包,并更直接地使用 Composer 包。
-## Adopt strict types
+## 采用严格类型
-Strict types were introduced because:
+引入严格类型是因为:
-- PHP 7 is now mainstream
-- While they solve no significant Yii 2 problems, they help to avoid many
- day-to-day development issues
+- PHP 7 现在已成为主流
+- 虽然它们没有解决 Yii 2 的重大问题,但它们有助于避免许多日常开发问题
-## Adopt SemVer
+## 采用 SemVer
-Yii 2 has its own version policy. Problems:
+Yii 2 有自己的版本策略。问题:
-- It wasn't standard
-- Composer relies on SemVer
-- It's hard to support a framework built on top of packages if the
- versioning policy isn't strict
+- 它不是标准的
+- Composer 依赖于 SemVer
+- 如果版本策略不严格,很难支持建立在包之上的框架
-## Prevent validators mutating data
+## 防止验证器改变数据
-In Yii 1 and Yii 2, validators such as "date" were mutating data. It was
-confusing for a validation process not initially meant to mutate data it
-validates.
+在 Yii 1 和 Yii 2 中,诸如“date”之类的验证器会改变数据。对于最初不打算改变其验证的数据的验证过程来说,这令人困惑。
-[See related
-discussion](https://forum.yiiframework.com/t/saving-or-killing-non-validation-in-validators/126086).
+[查看相关讨论](https://forum.yiiframework.com/t/saving-or-killing-non-validation-in-validators/126086)。
diff --git a/src/zh-CN/internals/010-code-style.md b/src/zh-CN/internals/010-code-style.md
index ebc86f0c..741bbc47 100644
--- a/src/zh-CN/internals/010-code-style.md
+++ b/src/zh-CN/internals/010-code-style.md
@@ -1,50 +1,40 @@
-# 010 — Code style
+# 010 — 代码风格
-Code formatting used in Yii 3 packages is based on
-[PSR-1](https://www.php-fig.org/psr/psr-1/) and
-[PSR-12](https://www.php-fig.org/psr/psr-12/) with extra rules added on top
-of it.
+Yii 3 包中使用的代码格式基于 [PSR-1](https://www.php-fig.org/psr/psr-1/) 和
+[PSR-12](https://www.php-fig.org/psr/psr-12/),并在此基础上添加了额外的规则。
## Names
-- Use English only.
-- Use camelCase notation, including abbreviations (e.g., `enableIdn`).
-- Use the shortest possible, but an explanatory name.
-- Never trim or abbreviate a name.
-- Postfix classes, interfaces, traits and variables, which is a
- [collection](https://en.wikipedia.org/wiki/Collection_(abstract_data_type)),
- with `Collection`.
-- Postfix middleware classes with `Middleware`.
+- 仅使用英语。
+- 使用驼峰命名法,包括缩写(例如,`enableIdn`)。
+- 使用尽可能短但具有解释性的名称。
+- 永远不要修剪或缩写名称。
+- 对于 [集合](https://en.wikipedia.org/wiki/Collection_(abstract_data_type))
+ 的类、接口、trait 和变量,使用 `Collection` 后缀。
+- 对中间件类使用 `Middleware` 后缀。
-## Types
+## 类型
-- Declare [argument and return
- types](https://www.php.net/manual/en/migration70.new-features.php) where
- possible.
-- [Use types for properties](https://wiki.php.net/rfc/typed_properties_v2).
-- Use strict typing. Avoid mixed and union types where possible except
- compatible types such as `string|Stringable`.
+- 尽可能声明
+ [参数和返回类型](https://www.php.net/manual/en/migration70.new-features.php)。
+- [为属性使用类型](https://wiki.php.net/rfc/typed_properties_v2)。
+- 使用严格类型。尽可能避免混合类型和联合类型,除非是兼容类型,如 `string|Stringable`。
-## Comments
+## 注释
-Inline comments are to be avoided unless code couldn't be understood without
-them. A good example is a workaround for a bug in a certain PHP version.
+除非没有注释就无法理解代码,否则应避免内联注释。一个好的例子是针对某个 PHP 版本中的 bug 的解决方法。
-Method comment is necessary except it adds nothing to what method name and
-signature already has.
+方法注释是必要的,除非它没有为方法名称和签名已有的内容添加任何内容。
-Class comment should describe the purpose of the class.
+类注释应描述类的目的。
-[See
-PHPDoc](https://github.com/yiisoft/docs/blob/master/014-docs.md#phpdoc).
+[查看 PHPDoc](https://github.com/yiisoft/docs/blob/master/014-docs.md#phpdoc)。
-## Formatting
+## 格式化
-### No alignment
+### 不对齐
-Property, variable and constant value assignments shouldn't be aligned. The
-same applies to phpdoc tags. The reason is that aligned statements often
-cause larger diff and even conflicts.
+属性、变量和常量值赋值不应对齐。phpdoc 标签也是如此。原因是对齐的语句通常会导致更大的差异甚至冲突。
```php
final class X
@@ -67,11 +57,9 @@ final class X
}
```
-### Chain calls
+### 链式调用
-Chained calls should be formatted for better readability. If it's a long
-chain that doesn't fit the line length of 120 characters, then each call
-should on a new line:
+链式调用应格式化以提高可读性。如果是不适合 120 个字符行长度的长链,则每个调用应在新行上:
```php
$object
@@ -82,52 +70,52 @@ $object
->withDeadline($deadline);
```
-If it's a short chain, it's alright for it to be on a single line:
+如果是短链,可以在单行上:
```php
$object = $object->withName('test');
```
-## Strings
+## 字符串
-- When no variables involved, use `'Hello!'`
-- To get variables into string prefer `"Hello, $username!"`
+- 当不涉及变量时,使用 `'Hello!'`
+- 要将变量放入字符串,首选 `"Hello, $username!"`
-## Classes and interfaces
+## 类和接口
-### Final by default
+### 默认为 final
-Classes should be `final` by default.
+类默认应该是 `final` 的。
-### Private by default
+### 默认为 private
-Constants, properties and methods should be private by default.
+常量、属性和方法默认应该是 private 的。
-### Composition over inheritance
+### 组合优于继承
-Prefer [composition to inheritance](guide/en/concept/di-container.md).
+优先使用[组合而不是继承](guide/en/concept/di-container.md)。
-### Property, constant and method order
+### 属性、常量和方法顺序
-Order should be the following:
+顺序应该如下:
-- Constants
-- Properties
-- Methods
+- 常量
+- 属性
+- 方法
-Within each category, items should be sorted by visibility:
+在每个类别中,项目应按可见性排序:
- public
- protected
- private
-### Abstract classes
+### 抽象类
-Abstract classes *shouldn't* be prefixed or postfixed with `Abstract`.
+抽象类*不应该*使用 `Abstract` 前缀或后缀。
-#### Immutable methods
+#### 不可变方法
-Immutable method convention is the following:
+不可变方法约定如下:
```php
public function withName(string $name): self
@@ -138,13 +126,12 @@ public function withName(string $name): self
}
```
-1. Cloned object name is `$new`.
-2. Return type is `self`.
+1. 克隆对象名称为 `$new`。
+2. 返回类型为 `self`。
-#### Boolean check methods
+#### 布尔检查方法
-Methods that are there to check if something is true should be named like
-the following:
+用于检查某事是否为真的方法应命名如下:
```php
public function isDeleted(): bool;
@@ -152,25 +139,24 @@ public function hasName(): bool;
public function canDoIt(): bool;
```
-#### Flags in methods
+#### 方法中的标志
-Boolean flags in methods are better to be avoided. It's a sign the method
-may be doing too much, and there should be two methods instead of one.
+最好避免在方法中使用布尔标志。这表明该方法可能做得太多,应该有两个方法而不是一个。
```php
public function login(bool $refreshPage = true): void;
```
-It is better to be two methods:
+最好是两个方法:
```php
public function login(): void;
public function refreshPage(): void;
```
-## Variables
+## 变量
-Add an underscore (`_`) prefix for unused variables. For example:
+为未使用的变量添加下划线(`_`)前缀。例如:
```php
foreach ($items as $key => $_value) {
@@ -178,9 +164,9 @@ foreach ($items as $key => $_value) {
}
```
-## Imports
+## 导入
-Prefer importing classes and functions to using fully qualified names:
+优先导入类和函数,而不是使用完全限定名称:
```php
use Yiisoft\Arrays\ArrayHelper;
@@ -191,9 +177,9 @@ use Yiisoft\Validator\Result;
use function is_iterable;
```
-## Additional conventions
+## 其他约定
-- [Namespaces](004-namespaces.md)
-- [Exceptions](007-exceptions.md)
-- [Interfaces](008-interfaces.md)
+- [命名空间](004-namespaces.md)
+- [异常](007-exceptions.md)
+- [接口](008-interfaces.md)
diff --git a/src/zh-CN/internals/011-error-correction.md b/src/zh-CN/internals/011-error-correction.md
index 8e2f2b46..556818f6 100644
--- a/src/zh-CN/internals/011-error-correction.md
+++ b/src/zh-CN/internals/011-error-correction.md
@@ -1,5 +1,3 @@
-# 011 — Error correction
+# 011 — 错误修正
-If it's unambiguous within a class what the developer who incorrectly used
-the class meant, it's OK to correct the error. Otherwise, the error MUST
-NOT be corrected.
+如果在类中可以明确判断开发者错误使用该类的意图,则可以修正错误。否则,不得修正错误。
diff --git a/src/zh-CN/internals/012-tests.md b/src/zh-CN/internals/012-tests.md
index e09aa6d2..28d5a91e 100644
--- a/src/zh-CN/internals/012-tests.md
+++ b/src/zh-CN/internals/012-tests.md
@@ -1,18 +1,13 @@
-# 012 — Tests
+# 012 — 测试
-For each package, we're adding unit-tests that are run via
-[PHPUnit](https://phpunit.de/). When designing tests, the following
-guidelines should be taken into account.
+对于每个包,我们都添加了通过 [PHPUnit](https://phpunit.de/) 运行的单元测试。在设计测试时,应考虑以下准则。
-- Test class should be marked as `final` by default.
-- `@test` annotation must not be used, prefix methods with `test`.
-- The test method name must reflect the purpose of the test.
-- "should" must not be used in the test method name.
-- If necessary, the test method phpdoc may describe the desired behavior.
-- The test must follow AAA: first arrange the necessary preconditions, then
- act, then assert expected results.
-- There must be one test case per test method that's a single AAA.
-- Test must use public API. Private properties or methods shouldn't be
- accessed, assumptions on internals of the class tested shouldn't be made.
-- Tests shouldn't rely on composer-config-plugin and DI container unless
- necessary.
+- 测试类默认应标记为 `final`。
+- 不得使用 `@test` 注解,方法应以 `test` 为前缀。
+- 测试方法名称必须反映测试的目的。
+- 测试方法名称中不得使用“should”。
+- 如有必要,测试方法的 phpdoc 可以描述期望的行为。
+- 测试必须遵循 AAA 模式:首先安排(Arrange)必要的前置条件,然后执行(Act),最后断言(Assert)预期结果。
+- 每个测试方法必须只有一个测试用例,即单个 AAA。
+- 测试必须使用公共 API。不应访问私有属性或方法,不应对被测试类的内部实现做出假设。
+- 除非必要,测试不应依赖 composer-config-plugin 和 DI 容器。
diff --git a/src/zh-CN/internals/013-code-review.md b/src/zh-CN/internals/013-code-review.md
index a363f954..76923499 100644
--- a/src/zh-CN/internals/013-code-review.md
+++ b/src/zh-CN/internals/013-code-review.md
@@ -1,33 +1,29 @@
-# 013 — Code review
+# 013 — 代码审查
-Code reviews are essential for the success of the project and are as
-important as contributing code.
+代码审查对项目的成功至关重要,与贡献代码同样重要。
-Reviews are handled via GitHub pull requests. When the request is ready for
-review, the "status: code review" label is added to it.
+审查通过 GitHub pull request 处理。当请求准备好审查时,会添加“status: code review”标签。
-[A full list of pull requests that need
-review](https://github.com/search?q=org%3Ayiisoft+label%3A"status%3Acode+review"&state=open&type=Issues)
-is available at GitHub.
+[需要审查的 pull request
+完整列表](https://github.com/search?q=org%3Ayiisoft+label%3A"status%3Acode+review"&state=open&type=Issues)
+可在 GitHub 上查看。
-## Guidelines
+## 指南
-- Check out the pull request branch, open the project in the IDE, get a big
- picture.
-- Does the pull request make sense overall?
-- Run tests and/or application using code from the pull request. Are these
- OK?
-- Read all lines of code in the pull request.
-- Could it be done simpler?
-- Are there security issues?
-- Are there performance issues?
-- When leaving comments, be polite.
-- Avoid code-formatting comments.
+- 检出 pull request 分支,在 IDE 中打开项目,了解全局。
+- pull request 整体上是否合理?
+- 使用 pull request 中的代码运行测试和/或应用程序。这些是否正常?
+- 阅读 pull request 中的所有代码行。
+- 能否做得更简单?
+- 是否存在安全问题?
+- 是否存在性能问题?
+- 留下评论时,要有礼貌。
+- 避免代码格式化方面的评论。
-## Mandatory parts
+## 必需部分
-- [ ] Tests that fail without code and pass with code.
-- [ ] Type hints.
+- [ ] 没有代码时失败、有代码时通过的测试。
+- [ ] 类型提示。
- [ ] `declare(strict_types=1)`.
-- [ ] Documentation: phpdoc, yiisoft/docs.
-- [ ] Changelog entry (if package is stable).
+- [ ] 文档:phpdoc,yiisoft/docs。
+- [ ] 变更日志条目(如果包是稳定的)。
diff --git a/src/zh-CN/internals/014-docs.md b/src/zh-CN/internals/014-docs.md
index 7a1c3d96..de7c6f59 100644
--- a/src/zh-CN/internals/014-docs.md
+++ b/src/zh-CN/internals/014-docs.md
@@ -1,71 +1,60 @@
-# 014 — Documentation
+# 014 — 文档
-Documentation is one of the most important parts of Yii.
+文档是 Yii 最重要的部分之一。
-## Package documentation
+## 包文档
-Documentation for a package could either be in `README.md` or
-`docs/{language}/{type}` where `{language}` is a language code and `{type}`
-could be "guide," "cookbook" or something else. Usually `docs` is there if
-the package usage or configuration isn't trivial or there's a need for
-translation.
+包的文档可以在 `README.md` 中,也可以在 `docs/{language}/{type}` 中,其中 `{language}`
+是语言代码,`{type}` 可以是“guide”、“cookbook”或其他内容。通常,如果包的使用或配置不简单,或者需要翻译,就会有 `docs`。
-Some indicators that it's time to create `docs`:
+以下是创建 `docs` 的一些指标:
-1. There is a need for translation.
-2. Many topics exist. Each of these is big by itself.
+1. 需要翻译。
+2. 存在许多主题。每个主题本身都很大。
-If the total length of readme is less than about 200 lines, it's fine to
-keep documentation in the readme.
+如果 readme 的总长度少于约 200 行,则可以将文档保留在 readme 中。
-## Definitive guide
+## 权威指南
-The definitive guide,
+权威指南
[yiisoft/docs/guide](https://github.com/yiisoft/docs/tree/master/guide/en)
-aims at covering usage of packages as a whole framework. Unlike package
-documentation, it isn't focused on a single package but is covering certain
-use-cases.
-
-The guide should follow [Microsoft style
-guide](https://learn.microsoft.com/en-us/style-guide/welcome/).
-
-### Translation
-
-The definitive guide uses [po4a](https://github.com/mquinson/po4a) in GitHub Action for translations.
-
-Translation algorithm:
-
-- Install an application for working with `.po` translation files. For
- example, [Poedit](https://poedit.net/),
- [Lokalize](https://apps.kde.org/ru/lokalize/),
- [Gtranslator](https://wiki.gnome.org/Apps/Gtranslator) or another.
-- Find file what you want to translate in `_translations/guide/{lang}`. Note
- that if the source file is in a subfolder, the subfolder name is appended
- to the file name and separated by an underscore, for example, for
- translating `guide/en/concept/aliases.md` file find
- `_translations/guide/{lang}/concept_aliases.md.po` file.
-- Open the file with the `.po` extension in `Poedit` from the folder with
- the desired localization, for example
- `_translations/guide/ru/intro_what-is-yii.md.po`. If there is no
- localization yet, create an issue.
-- Translate necessary strings and push the changes
-- Open a pull request to the main repository
+旨在涵盖作为整个框架的包的使用。与包文档不同,它不专注于单个包,而是涵盖某些用例。
+
+指南应遵循 [Microsoft
+风格指南](https://learn.microsoft.com/en-us/style-guide/welcome/)。
+
+### 翻译
+
+权威指南在 GitHub Action 中使用 [po4a](https://github.com/mquinson/po4a) 进行翻译。
+
+翻译流程:
+
+- 安装用于处理 `.po`
+ 翻译文件的应用程序。例如,[Poedit](https://poedit.net/),[Lokalize](https://apps.kde.org/ru/lokalize/),[Gtranslator](https://wiki.gnome.org/Apps/Gtranslator)
+ 或其他。
+- 在 `_translations/guide/{lang}`
+ 中找到要翻译的文件。请注意,如果源文件在子文件夹中,则子文件夹名称会附加到文件名并用下划线分隔,例如,要翻译
+ `guide/en/concept/aliases.md` 文件,请找到
+ `_translations/guide/{lang}/concept_aliases.md.po` 文件。
+- 在 `Poedit` 中从所需本地化的文件夹中打开扩展名为 `.po` 的文件,例如
+ `_translations/guide/ru/intro_what-is-yii.md.po`。如果还没有本地化,请创建一个 issue。
+- 翻译必要的字符串并推送更改
+- 向主仓库打开一个 pull request
> [!CAUTION]
-> Do not change the translation in files in `/guide/{lang}` manually.
+> 不要手动更改 `/guide/{lang}` 中文件的翻译。
-If you have changed English and want to update translations:
+如果您更改了英文并想更新翻译:
-- Open a pull request to the main repository
-- Pull updated branch after successful completion of workflow `Update docs
- translation` in GitHub Action
-- Update translation in `.po` files by `Poedit`
-- Push changes
+- 向主仓库打开一个 pull request
+- 在 GitHub Action 中成功完成工作流程 `Update docs translation` 后拉取更新的分支
+- 通过 `Poedit` 更新 `.po` 文件中的翻译
+- 推送更改
-## Blocks
+## 块
-Blocks are in the [GitHub Alerts
-format](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#alerts):
+块采用 [GitHub Alerts
+格式](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#alerts):
```
> [!NOTE]
@@ -84,11 +73,8 @@ format](https://docs.github.com/en/get-started/writing-on-github/getting-started
> Advises about risks or negative outcomes of certain actions.
```
-When translating documentation, these Block indicators should not be
-translated. Keeps them intact as they are and only translate the block
-content. For translating the label for the block, each guide translation
-should have a `blocktypes.json` file containing the translations. The
-following shows an example for German:
+翻译文档时,这些块指示符不应翻译。保持它们原样,只翻译块内容。要翻译块的标签,每个指南翻译都应该有一个包含翻译的 `blocktypes.json`
+文件。以下显示了德语的示例:
```json
{
@@ -102,8 +88,7 @@ following shows an example for German:
## PHPDoc
-PHPDoc mustn't be added if it doesn't add anything to what it describes. The
-following is a bad example:
+如果 PHPDoc 没有为其描述的内容添加任何内容,则不得添加。以下是一个不好的例子:
```php
use Psr\Log\LoggerInterface;
@@ -137,14 +122,11 @@ final class MyService extends MyServiceBase
}
```
-PHPDoc, if present, should describe the purpose of the element it's added
-for.
+PHPDoc(如果存在)应描述其添加的元素的目的。
-The `@see` tags must explicitly refer to class methods, properties, and
-constants. This is necessary for the correct display of links in IDEs, as
-well as for the correct display of links in API documentation.
+`@see` 标签必须明确引用类方法、属性和常量。这对于在 IDE 中正确显示链接以及在 API 文档中正确显示链接是必要的。
-Example of incorrect code:
+错误代码示例:
```php
/**
@@ -160,7 +142,7 @@ final class Example
}
```
-Example of a valid code:
+有效代码示例:
```php
/**
@@ -176,19 +158,18 @@ final class Example
}
```
-## Readme checklist
+## Readme 检查清单
-Each package readme should be placed into `README.md` and contain the
-following:
+每个包的 readme 应放置在 `README.md` 中并包含以下内容:
- [ ] Logo.
-- [ ] Short description of the package. What does it do?
-- [ ] Quality badges (build, code coverage).
-- [ ] Screenshot (if applicable).
-- [ ] Requirements.
-- [ ] Installation. Usually `composer require`.
-- [ ] Getting started. One or two common usage examples are demonstrated.
-- [ ] Configuration.
-- [ ] Contributing. It should contain a link to guidelines.
-- [ ] Running tests.
-- [ ] License.
+- [ ] 包的简短描述。它做什么?
+- [ ] 质量徽章(构建、代码覆盖率)。
+- [ ] 截图(如果适用)。
+- [ ] 要求。
+- [ ] 安装。通常是 `composer require`。
+- [ ] 入门。演示一两个常见的使用示例。
+- [ ] 配置。
+- [ ] 贡献。它应该包含指南的链接。
+- [ ] 运行测试。
+- [ ] 许可证。
diff --git a/src/zh-CN/internals/015-phpstorm.md b/src/zh-CN/internals/015-phpstorm.md
index 7995ffc6..a79634f3 100644
--- a/src/zh-CN/internals/015-phpstorm.md
+++ b/src/zh-CN/internals/015-phpstorm.md
@@ -1,29 +1,25 @@
-# 015 — PhpStorm metadata and attributes
+# 015 — PhpStorm 元数据和属性
-## PhpStorm metadata
+## PhpStorm 元数据
[PhpStorm
-metadata](https://www.jetbrains.com/help/phpstorm/ide-advanced-metadata.html)
-helps the IDE to understand code better in cases when regular types and
-PHPDoc tags don't help.
+元数据](https://www.jetbrains.com/help/phpstorm/ide-advanced-metadata.html) 帮助
+IDE 在常规类型和 PHPDoc 标签无法提供帮助的情况下更好地理解代码。
-We use the following set of coding styles for metadata.
+我们对元数据使用以下编码风格。
-### Metadata location
+### 元数据位置
-- Metadata should be placed in `/.phpstorm.meta.php` directory.
-- Configuration should be split into files. Each file should be named after
- a class it configures.
+- 元数据应放置在 `/.phpstorm.meta.php` 目录中。
+- 配置应拆分为多个文件。每个文件应以其配置的类命名。
> [!NOTE]
-> There is no support for subdirectories in PhpStorm yet.
+> PhpStorm 目前还不支持子目录。
-### Constants
+### 常量
-All constant dictionaries should be named as `{Class FQN}::{Group
-name}`. Group name should be short and written in capital letters. Use
-underscore as a word separator that's `\Yiisoft\Http\Status::STATUSES`. For
-example:
+所有常量字典应命名为 `{类完全限定名}::{组名}`。组名应简短并使用大写字母。使用下划线作为单词分隔符,例如
+`\Yiisoft\Http\Status::STATUSES`。示例:
```php
expectedReturnValues(
@@ -43,22 +39,20 @@ registerArgumentsSet(
);
```
-## PhpStorm attributes
+## PhpStorm 属性
-[PhpStorm attributes](https://github.com/JetBrains/phpstorm-attributes) CAN
-be used in code, but package `jetbrains/phpstorm-attributes` MUST be added
-as a dev dependency:
+[PhpStorm 属性](https://github.com/JetBrains/phpstorm-attributes)
+可以在代码中使用,但必须将 `jetbrains/phpstorm-attributes` 包添加为开发依赖:
```shell
composer require --dev jetbrains/phpstorm-attributes
```
-### Using with ComposerRequireChecker
+### 与 ComposerRequireChecker 一起使用
-When
+当在同一个包中也使用
[ComposerRequireChecker](https://github.com/maglnet/ComposerRequireChecker)
-is also used within the same package, add involved attributes' class names
-to whitelist in config. For example:
+时,将涉及的属性类名添加到配置的白名单中。例如:
```json
{
diff --git a/src/zh-CN/internals/016-security-workflow.md b/src/zh-CN/internals/016-security-workflow.md
index 64e3184d..6c95ed2b 100644
--- a/src/zh-CN/internals/016-security-workflow.md
+++ b/src/zh-CN/internals/016-security-workflow.md
@@ -1,50 +1,46 @@
-# 016 — Security workflow
+# 016 — 安全工作流程
-Security issues are typically sent via [a security
-form](https://www.yiiframework.com/security).
+安全问题通常通过 [安全表单](https://www.yiiframework.com/security) 发送。
-If an issue is reported directly to a public page such as a repository issue or a forum topic, get the message
-and delete the issue. Say thanks to the reporter and point to the security form for next time.
+如果问题直接报告到公共页面(如仓库 issue 或论坛主题),请获取消息
+并删除该 issue。感谢报告者,并指出下次使用安全表单。
-## Verify
+## 验证
-Verify that the issue is valid. Request more information if needed.
+验证问题是否有效。如果需要,请求更多信息。
-## Add security advisory
+## 添加安全公告
-Create a draft GitHub security advisory.
+创建一个 GitHub 安全公告草稿。
-### Find out severity
+### 确定严重程度
-1. Get CVSS score using [NVD
- calculator](https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator).
-2. Choose severity based on the [rating
- scale](https://www.first.org/cvss/specification-document#Qualitative-Severity-Rating-Scale).
+1. 使用 [NVD 计算器](https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator) 获取
+ CVSS 分数。
+2. 根据
+ [评级量表](https://www.first.org/cvss/specification-document#Qualitative-Severity-Rating-Scale)
+ 选择严重程度。
-### Give credit to the reporter
+### 给予报告者荣誉
-Ask the reporter if he wants a credit for finding the issue. If so, point to
-his GitHub account.
+询问报告者是否希望因发现问题而获得荣誉。如果是,请指向其 GitHub 账户。
-## Request a CVE number
+## 请求 CVE 编号
-When you're ready, request a CVE.
+准备好后,请求一个 CVE。
-## Prepare a patch
+## 准备补丁
-Prepare a pull request fixing the issue. GitHub allows doing it in a private
-fork.
+准备一个修复问题的 pull request。GitHub 允许在私有 fork 中执行此操作。
-## Wait till the CVE number is allocated
+## 等待 CVE 编号分配
-It usually takes several days.
+通常需要几天时间。
-## Release
+## 发布
-- Merge the patch pull request right before tagging the next package
- release.
-- Publish security advisory.
-- Add CVE to
- [FriendsOfPHP/security-advisories](https://github.com/FriendsOfPHP/security-advisories).
- See [#488](https://github.com/FriendsOfPHP/security-advisories/pull/488)
- as an example.
+- 在标记下一个包发布之前合并补丁 pull request。
+- 发布安全公告。
+- 将 CVE 添加到
+ [FriendsOfPHP/security-advisories](https://github.com/FriendsOfPHP/security-advisories)。参见
+ [#488](https://github.com/FriendsOfPHP/security-advisories/pull/488) 作为示例。
diff --git a/src/zh-CN/internals/017-tags.md b/src/zh-CN/internals/017-tags.md
index 637e1805..516d4c30 100644
--- a/src/zh-CN/internals/017-tags.md
+++ b/src/zh-CN/internals/017-tags.md
@@ -1,43 +1,35 @@
-# 017 - Tags
+# 017 - 标签
-Unlike regular classes, tags are used in view templates, so syntax is
-important. It should be both easy to write, easy to read and not too
-verbose because similar constructs are meant to be used over and over again.
+与常规类不同,标签用于视图模板,因此语法很重要。它应该既易于编写、易于阅读,又不过于冗长,因为类似的结构会被反复使用。
-## Class names
+## 类名
-- Tags aren't postfixed or prefixed unless it's an abstract base class.
-- If the tag represents a specification, use a name used in the
- specification.
+- 标签不使用后缀或前缀,除非它是抽象基类。
+- 如果标签表示规范,请使用规范中使用的名称。
-## Inheritance
+## 继承
-Inheritance is allowed with some restrictions:
+允许继承,但有一些限制:
-- If a class isn't abstract, it should be final.
-- Hierarchy should be kept as linear as possible.
+- 如果类不是抽象的,它应该是 final 的。
+- 层次结构应尽可能保持线性。
-## Immutability
+## 不可变性
-Tags should:
+标签应该:
-- Have no state.
-- Be immutable. Every method that modifies a setting returns a clone with
- the setting changed.
-- Be free of side effects. Many calls of the same method with the same
- argument should give the same result.
+- 没有状态。
+- 是不可变的。每个修改设置的方法都会返回一个设置已更改的克隆。
+- 没有副作用。使用相同参数多次调用同一方法应该给出相同的结果。
-## Methods
+## 方法
### Names
-- Unlike other classes, methods that return a clone of the object with some
- properties modified aren't prefixed.
-- Keep method names as short as possible but don't hurt readability.
-- If the tag represents a specification, use a name used in the
- specification.
+- 与其他类不同,返回修改了某些属性的对象克隆的方法不使用前缀。
+- 保持方法名称尽可能简短,但不要影响可读性。
+- 如果标签表示规范,请使用规范中使用的名称。
-### Boolean flags
+### 布尔标志
-The method that corresponds to the boolean attribute should be named after
-the attribute and accept a boolean flag argument.
+对应于布尔属性的方法应以该属性命名,并接受一个布尔标志参数。
diff --git a/src/zh-CN/internals/018-widgets.md b/src/zh-CN/internals/018-widgets.md
index 4fb6bec2..71b72a72 100644
--- a/src/zh-CN/internals/018-widgets.md
+++ b/src/zh-CN/internals/018-widgets.md
@@ -1,36 +1,32 @@
-# 018 - Widgets
+# 018 - 小部件
-Unlike regular classes, widgets are used in view templates, so syntax is
-important. It should be both easy to write, easy to read and not too
-verbose because similar constructs are meant to be used over and over again.
+与常规类不同,小部件用于视图模板,因此语法很重要。它应该既易于编写、易于阅读,又不过于冗长,因为类似的结构会被反复使用。
-## Class names
+## 类名
-Widgets aren't postfixed or prefixed.
+小部件不使用后缀或前缀。
-## Inheritance
+## 继承
-Inheritance is allowed with some restrictions:
+允许继承,但有一些限制:
-- If a class isn't abstract, it should be final.
-- Hierarchy should be kept as linear as possible.
+- 如果类不是抽象的,它应该是 final 的。
+- 层次结构应尽可能保持线性。
-## Immutability
+## 不可变性
-Widgets should:
+小部件应该:
-- Have no state.
-- Be immutable.
+- 没有状态。
+- 是不可变的。
-## Methods
+## 方法
### Names
-- Unlike other classes, methods that return a clone of the object with some
- properties modified aren't prefixed.
-- Keep method names as short as possible but don't hurt readability.
+- 与其他类不同,返回修改了某些属性的对象克隆的方法不使用前缀。
+- 保持方法名称尽可能简短,但不要影响可读性。
-### Boolean flags
+### 布尔标志
-The method that corresponds to the boolean attribute should be named after
-the attribute and accept a boolean flag argument.
+对应于布尔属性的方法应以该属性命名,并接受一个布尔标志参数。
diff --git a/src/zh-CN/internals/019-view-code-style.md b/src/zh-CN/internals/019-view-code-style.md
index c5a19173..8dad7682 100644
--- a/src/zh-CN/internals/019-view-code-style.md
+++ b/src/zh-CN/internals/019-view-code-style.md
@@ -1,13 +1,10 @@
-# 019 — View code style
+# 019 — 视图代码风格
-The PHP code in the view files shouldn't be complicated. The code must
-contain the logic responsible for formatting the data, but not the logic for
-requesting this data.
+视图文件中的 PHP 代码不应该太复杂。代码必须包含负责格式化数据的逻辑,但不应包含请求数据的逻辑。
-## Heading
+## 文件头部
-View file heading is used to place phpdoc describing variables available and
-to import classes:
+视图文件头部用于放置描述可用变量的 phpdoc 和导入类:
```php
@@ -32,15 +28,14 @@ preferred:
```
-## Short echo
+## 短标签输出
-Short echo is preferred:
+优先使用短标签输出:
```php
= Html::encode($name) ?>
```
-## Class methods
+## 类方法
-All class methods used in view files must be public regardless if the view
-is rendered by the class itself.
+视图文件中使用的所有类方法都必须是 public 的,无论视图是否由类本身渲染。
diff --git a/src/zh-CN/internals/020-package-release.md b/src/zh-CN/internals/020-package-release.md
index de037e15..6157b4f0 100644
--- a/src/zh-CN/internals/020-package-release.md
+++ b/src/zh-CN/internals/020-package-release.md
@@ -1,44 +1,42 @@
-# 020 — Package release
+# 020 — 包发布
-## Criteria
+## 标准
-- No critical issues.
-- Public API changes aren't likely. Some time passed w/o issues reported
- that may require API changes.
-- All dependencies are stable.
-- Close to 100% test coverage with, ideally, a 100% MSI score.
-- README is alright.
-- Everything is type-hinted unless special cases.
-- Psalm analysis passes on at least level 2.
-- phpdoc is alright.
-- Public API is alright.
+- 没有关键问题。
+- 公共 API 不太可能更改。已经过了一段时间,没有报告可能需要 API 更改的问题。
+- 所有依赖项都是稳定的。
+- 接近 100% 的测试覆盖率,理想情况下 MSI 分数为 100%。
+- README 没问题。
+- 除特殊情况外,所有内容都有类型提示。
+- Psalm 分析至少通过 2 级。
+- phpdoc 没问题。
+- 公共 API 没问题。
-## Release instruction
+## 发布说明
-Release a package via [Yii Development Tool](005-development-tool.md).
+通过 [Yii 开发工具](005-development-tool.md) 发布包。
-1. Check that you can sign commits locally (see
-[Signing commits](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits)).
+1. 检查您是否可以在本地签署提交(参见
+[签署提交](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits))。
-2. Pull last changes from the `master` branch:
+2. 从 `master` 分支拉取最新更改:
```shell
./yii-dev git/checkout master package-name
./yii-dev git/pull package-name
```
-3. Check the package for compliance with the criteria above.
+3. 检查包是否符合上述标准。
-4. Run `release/make` command:
+4. 运行 `release/make` 命令:
```shell
./yii-dev release/make package-name
```
-5. Select the version type (major, minor or path).
+5. 选择版本类型(major、minor 或 patch)。
-6. On the question "Push commits and tags, and release on GitHub?" check a
- diff. If the diff is alright, answer "yes."
+6. 在问题“Push commits and tags, and release on GitHub?”上检查差异。如果差异没问题,回答 "yes"。
-7. For major and minor releases, add a record with release notes on [Yii
- Framework News](https://www.yiiframework.com/news).
+7. 对于主要和次要版本,在 [Yii Framework News](https://www.yiiframework.com/news)
+ 上添加带有发布说明的记录。
diff --git a/src/zh-CN/internals/021-changelog-upgrade.md b/src/zh-CN/internals/021-changelog-upgrade.md
index ee291e73..8c4eba95 100644
--- a/src/zh-CN/internals/021-changelog-upgrade.md
+++ b/src/zh-CN/internals/021-changelog-upgrade.md
@@ -1,11 +1,10 @@
-# 021 — Changelog and upgrade
+# 021 — 变更日志和升级
-For all released packages, we've a detailed changelog and upgrade guide.
+对于所有已发布的包,我们都有详细的变更日志和升级指南。
-## Changelog
+## 变更日志
-Changelog is written for each version released. The file name is
-`CHANGELOG.md`. The format is the following:
+每个发布的版本都会编写变更日志。文件名为 `CHANGELOG.md`。格式如下:
```markdown
# My package Change Log
@@ -23,29 +22,24 @@ Changelog is written for each version released. The file name is
- Initial release.
```
-There "My package" is the name of the package, `1.0.1` is the version
-released followed by release date. For each version, there are a number of
-lines listing the changes. "Bug" refers to a change type. The following
-types are used:
+其中“My package”是包的名称,`1.0.1` 是发布的版本,后面跟着发布日期。对于每个版本,都有多行列出变更内容。"Bug"
+指的是变更类型。使用以下类型:
-- New — New features.
-- Chg — General changes.
-- Enh — Existing feature enhancements.
-- Bug — Bug fixes.
+- New — 新功能。
+- Chg — 一般变更。
+- Enh — 现有功能增强。
+- Bug — Bug 修复。
-In the changelog file lines should be ordered as New, Chg, Enh, Bug.
+在变更日志文件中,行应按 New、Chg、Enh、Bug 的顺序排列。
-"#42" above is the number of issue or pull requests corresponding to the
-change. "author1" is the GitHub nickname of the code author. "author2" is an
-additional author. An author's nickname MUST be prefixed with `@`.
+上面的“#42”是对应变更的 issue 或 pull request 编号。“author1”是代码作者的 GitHub
+昵称。“author2”是额外的作者。作者的昵称必须以 `@` 为前缀。
-## Upgrade
+## 升级
-Upgrade guide is created when there is a new major version that isn't
-compatible with the previous one. It describes steps necessary to upgrade
-application code.
+当有新的主版本与之前的版本不兼容时,会创建升级指南。它描述了升级应用程序代码所需的步骤。
-The file name is `UPGRADE.md`. The format is the following:
+文件名为 `UPGRADE.md`。格式如下:
```markdown
# Upgrading Instructions for my package
diff --git a/src/zh-CN/internals/022-config-groups.md b/src/zh-CN/internals/022-config-groups.md
index 8193bf82..20c91ce7 100644
--- a/src/zh-CN/internals/022-config-groups.md
+++ b/src/zh-CN/internals/022-config-groups.md
@@ -1,73 +1,68 @@
-# 022 — Config groups
+# 022 — 配置组
-This document defines naming convention for the framework groups used with
-[yiisoft/config](https://github.com/yiisoft/config). Note that this isn't a
-naming convention for config files. These could be anything and are mapped
-to group names via `composer.json`.
+本文档定义了与 [yiisoft/config](https://github.com/yiisoft/config)
+一起使用的框架组的命名约定。请注意,这不是配置文件的命名约定。这些可以是任何内容,并通过 `composer.json` 映射到组名称。
-## Config group name postfixes
+## 配置组名称后缀
-- "web" postfix applies to web only that's classic server HTML generation,
- REST, RPC, etc.
-- "console" postfix applies to console
-- If there's no postfix, it's "common" and applies to both web and console
-- "web" and "console" may override what's defined in "common"
+- “web”后缀仅适用于 web,即经典的服务器 HTML 生成、REST、RPC 等。
+- “console”后缀适用于控制台
+- 如果没有后缀,则为“common”,适用于 web 和控制台
+- “web”和“console”可以覆盖“common”中定义的内容
-## Parameters
+## 参数
-Application config parameters that are used in all configs.
+在所有配置中使用的应用程序配置参数。
-- `params` — common parameters
-- `params-web` — web application parameters
-- `params-console` — console application parameters
+- `params` — 通用参数
+- `params-web` — web 应用程序参数
+- `params-console` — 控制台应用程序参数
-## Container
+## 容器
-Configuration for [yiisoft/di](https://github.com/yiisoft/di).
+[yiisoft/di](https://github.com/yiisoft/di) 的配置。
-### Definitions
+### 定义
-- `di` — common container definitions
-- `di-web` — web container definitions
-- `di-console` — console container definitions
+- `di` — 通用容器定义
+- `di-web` — web 容器定义
+- `di-console` — 控制台容器定义
-### Providers
+### 提供者
-- `di-providers` — common container providers
-- `di-providers-web` — web container providers
-- `di-providers-console` — console container providers
+- `di-providers` — 通用容器提供者
+- `di-providers-web` — web 容器提供者
+- `di-providers-console` — 控制台容器提供者
-### Delegates
+### 委托
-- `di-delegates` — common container delegates
-- `di-delegates-web` — web container delegates
-- `di-delegates-console` — console container delegates
+- `di-delegates` — 通用容器委托
+- `di-delegates-web` — web 容器委托
+- `di-delegates-console` — 控制台容器委托
-### Tags
+### 标签
-- `di-tags` — common container tags
-- `di-tags-web` — web container tags
-- `di-tags-console` — console container tags
+- `di-tags` — 通用容器标签
+- `di-tags-web` — web 容器标签
+- `di-tags-console` — 控制台容器标签
-## Events
+## 事件
-Configuration for [yiisoft/yii-event](https://github.com/yiisoft/yii-event).
+[yiisoft/yii-event](https://github.com/yiisoft/yii-event) 的配置。
-- `events` — common events
-- `events-web` — web events
-- `events-console` — console events
+- `events` — 通用事件
+- `events-web` — web 事件
+- `events-console` — 控制台事件
-## Bootstrap
+## 引导
-Application bootstrapping for
-[yiisoft/yii-runner](https://github.com/yiisoft/yii-runner).
+[yiisoft/yii-runner](https://github.com/yiisoft/yii-runner) 的应用程序引导。
-- `bootstrap` — common bootstrap
-- `bootstrap-web` — web bootstrap
-- `bootstrap-console` — console bootstrap
+- `bootstrap` — 通用引导
+- `bootstrap-web` — web 引导
+- `bootstrap-console` — 控制台引导
-## Others
+## 其他
-- `routes` — [yiisoft/router](https://github.com/yiisoft/router) routes
-- `widgets` — [yiisoft/widget](https://github.com/yiisoft/widget) default
- widgets configuration
+- `routes` — [yiisoft/router](https://github.com/yiisoft/router) 路由
+- `widgets` — [yiisoft/widget](https://github.com/yiisoft/widget) 默认小部件配置
diff --git a/src/zh-CN/internals/index.md b/src/zh-CN/internals/index.md
index e512a121..fdef6475 100644
--- a/src/zh-CN/internals/index.md
+++ b/src/zh-CN/internals/index.md
@@ -1,44 +1,29 @@
-# Yii Framework Internals
+# Yii 框架内部文档
-This section contains documentation for developers contributing to the Yii
-framework itself. It covers guidelines, workflows, and best practices for
-maintaining and developing Yii packages.
+本节包含为 Yii 框架本身做出贡献的开发者的文档。它涵盖了维护和开发 Yii 包的指南、工作流程和最佳实践。
-## Table of Contents
+## 目录
-- [000 — Packages](000-packages.md) - Package structure and naming
- conventions
-- [001 — Yii goal and values](001-yii-values.md) - Project goals and core
- values
-- [002 — Issue workflow](002-issue-workflow.md) - How to handle issues
-- [003 — Roadmap](003-roadmap.md) - Development roadmap and future plans
-- [004 — Namespaces](004-namespaces.md) - Namespace conventions
-- [005 — Yii development tool](005-development-tool.md) - Development tools
- for Yii packages
-- [006 — Git commit messages](006-git-commit-messages.md) - Commit message
- format
-- [007 — Exceptions](007-exceptions.md) - Exception handling guidelines
-- [008 — Interfaces](008-interfaces.md) - Interface design principles
-- [009 — Design Decisions](009-design-decisions.md) - Architectural and
- design decisions
-- [010 — Code style](010-code-style.md) - PHP code style guidelines
-- [011 — Error correction](011-error-correction.md) - Error handling and
- correction
-- [012 — Tests](012-tests.md) - Testing guidelines and practices
-- [013 — Code review](013-code-review.md) - Code review process and
- guidelines
-- [014 — Documentation](014-docs.md) - Documentation writing guidelines
-- [015 — PhpStorm metadata and attributes](015-phpstorm.md) - PhpStorm
- integration
-- [016 — Security workflow](016-security-workflow.md) - Security issue
- handling
-- [017 — Tags](017-tags.md) - Git tagging conventions
-- [018 — Widgets](018-widgets.md) - Widget development guidelines
-- [019 — View code style](019-view-code-style.md) - Code style for view
- templates
-- [020 — Package release](020-package-release.md) - Release process for
- packages
-- [021 — Changelog and upgrade](021-changelog-upgrade.md) - Maintaining
- changelogs and upgrade notes
-- [022 — Config groups](022-config-groups.md) - Configuration group
- organization
+- [000 — 包](000-packages.md) - 包结构和命名约定
+- [001 — Yii 目标和价值观](001-yii-values.md) - 项目目标和核心价值观
+- [002 — Issue 工作流程](002-issue-workflow.md) - 如何处理 issue
+- [003 — 路线图](003-roadmap.md) - 开发路线图和未来计划
+- [004 — 命名空间](004-namespaces.md) - 命名空间约定
+- [005 — Yii 开发工具](005-development-tool.md) - Yii 包的开发工具
+- [006 — Git 提交消息](006-git-commit-messages.md) - 提交消息格式
+- [007 — 异常](007-exceptions.md) - 异常处理指南
+- [008 — 接口](008-interfaces.md) - 接口设计原则
+- [009 — 设计决策](009-design-decisions.md) - 架构和设计决策
+- [010 — 代码风格](010-code-style.md) - PHP 代码风格指南
+- [011 — 错误修正](011-error-correction.md) - 错误处理和修正
+- [012 — 测试](012-tests.md) - 测试指南和实践
+- [013 — 代码审查](013-code-review.md) - 代码审查流程和指南
+- [014 — 文档](014-docs.md) - 文档编写指南
+- [015 — PhpStorm 元数据和属性](015-phpstorm.md) - PhpStorm 集成
+- [016 — 安全工作流程](016-security-workflow.md) - 安全问题处理
+- [017 — 标签](017-tags.md) - Git 标签约定
+- [018 — 小部件](018-widgets.md) - 小部件开发指南
+- [019 — 视图代码风格](019-view-code-style.md) - 视图模板的代码风格
+- [020 — 包发布](020-package-release.md) - 包的发布流程
+- [021 — 变更日志和升级](021-changelog-upgrade.md) - 维护变更日志和升级说明
+- [022 — 配置组](022-config-groups.md) - 配置组组织