You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "smileby (via GitHub)" <gi...@apache.org> on 2024/01/12 05:59:32 UTC

[PR] docs: add Chinese translation for the new brotil plugin [apisix]

smileby opened a new pull request, #10814:
URL: https://github.com/apache/apisix/pull/10814

   ### Description
   
   add Chinese translation for the new brotil plugin
   
   Fixes #10811 
   
   ### Checklist
   
   - [X] I have explained the need for this PR and the problem it solves
   - [X] I have explained the changes or the new features added to this PR
   - [ ] I have added tests corresponding to this change
   - [X] I have updated the documentation to reflect this change
   - [ ] I have verified that this change is backward compatible (If not, please discuss on the [APISIX mailing list](https://github.com/apache/apisix/tree/master#community) first)
   
   <!--
   
   Note
   
   1. Mark the PR as draft until it's ready to be reviewed.
   2. Always add/update tests for any changes unless you have a good reason.
   3. Always update the documentation to reflect the changes made in the PR.
   4. Make a new commit to resolve conversations instead of `push -f`.
   5. To resolve merge conflicts, merge master instead of rebasing.
   6. Use "request review" to notify the reviewer after making changes.
   7. Only a reviewer can mark a conversation as resolved.
   
   -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] docs: add Chinese translation for the new brotil plugin [apisix]

Posted by "smileby (via GitHub)" <gi...@apache.org>.
smileby commented on code in PR #10814:
URL: https://github.com/apache/apisix/pull/10814#discussion_r1449886812


##########
docs/zh/latest/plugins/brotli.md:
##########
@@ -0,0 +1,123 @@
+---
+title: brotli
+keywords:
+  - Apache APISIX
+  - API 网关
+  - Plugin
+  - brotli
+description: 这个文档包含有关 Apache APISIX brotli 插件的相关信息。
+---
+
+<!--
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+-->
+
+## 描述
+
+`brotli` 插件可以动态的设置 Nginx 中的 [brotli](https://github.com/google/ngx_brotli) 的行为。
+
+## 前提条件
+
+该插件依赖 brotli 共享库。
+
+如下是构建和安装 brotli 共享库的示例脚本:
+
+``` shell
+wget https://github.com/google/brotli/archive/refs/tags/v1.1.0.zip
+unzip v1.1.0.zip
+cd brotli-1.1.0 && mkdir build && cd build
+cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local/brotli ..
+sudo cmake --build . --config Release --target install
+sudo sh -c "echo /usr/local/brotli/lib >> /etc/ld.so.conf.d/brotli.conf"
+sudo ldconfig
+```
+
+## 属性
+
+| 名称           | 类型                   | 必选项   | 默认值           | 有效值 | 描述                                                                                                                            |
+|--------------|----------------------|-------|---------------|--------------|-------------------------------------------------------------------------------------------------------------------------------|
+| types        | array[string] or "*" | False | ["text/html"] |              | 动态设置 `brotli_types` 指令。特殊值 `"*"` 用于匹配任意的 MIME 类型                                                                              |
+| min_length   | integer              | False | 20            | >= 1         | 动态设置 `brotli_min_length` 指令。指定进行压缩的文件最小的长度                                                                                    |
+| comp_level   | integer              | False | 6             | [0, 11]      | 动态设置 `brotli_comp_level` 指令                                                                                                   |
+| mode         | integer              | False | 0             | [0, 2]       | 动态设置 `brotli decompress mode`,更多信息参考 [RFC 7932](https://tools.ietf.org/html/rfc7932)                                          |
+| lgwin        | integer              | False | 19            | [0, 10-24]   | 动态设置 `Brotli滑动窗口大小`,`lgwin` 是滑动窗口大小的以 2 为底的对数,将其设置为 0 会让压缩器自行决定最佳值,更多信息请参考 [RFC 7932](https://tools.ietf.org/html/rfc7932)    |

Review Comment:
   There is no need for translation here, right?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] docs: add Chinese translation for the new brotil plugin [apisix]

Posted by "kayx23 (via GitHub)" <gi...@apache.org>.
kayx23 commented on code in PR #10814:
URL: https://github.com/apache/apisix/pull/10814#discussion_r1449938468


##########
docs/zh/latest/plugins/brotli.md:
##########
@@ -0,0 +1,123 @@
+---
+title: brotli
+keywords:
+  - Apache APISIX
+  - API 网关
+  - Plugin
+  - brotli
+description: 这个文档包含有关 Apache APISIX brotli 插件的相关信息。
+---
+
+<!--
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+-->
+
+## 描述
+
+`brotli` 插件可以动态的设置 Nginx 中的 [brotli](https://github.com/google/ngx_brotli) 的行为。
+
+## 前提条件
+
+该插件依赖 brotli 共享库。
+
+如下是构建和安装 brotli 共享库的示例脚本:
+
+``` shell
+wget https://github.com/google/brotli/archive/refs/tags/v1.1.0.zip
+unzip v1.1.0.zip
+cd brotli-1.1.0 && mkdir build && cd build
+cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local/brotli ..
+sudo cmake --build . --config Release --target install
+sudo sh -c "echo /usr/local/brotli/lib >> /etc/ld.so.conf.d/brotli.conf"
+sudo ldconfig
+```
+
+## 属性
+
+| 名称           | 类型                   | 必选项   | 默认值           | 有效值 | 描述                                                                                                                            |
+|--------------|----------------------|-------|---------------|--------------|-------------------------------------------------------------------------------------------------------------------------------|
+| types        | array[string] or "*" | False | ["text/html"] |              | 动态设置 `brotli_types` 指令。特殊值 `"*"` 用于匹配任意的 MIME 类型                                                                              |
+| min_length   | integer              | False | 20            | >= 1         | 动态设置 `brotli_min_length` 指令。指定进行压缩的文件最小的长度                                                                                    |
+| comp_level   | integer              | False | 6             | [0, 11]      | 动态设置 `brotli_comp_level` 指令                                                                                                   |
+| mode         | integer              | False | 0             | [0, 2]       | 动态设置 `brotli decompress mode`,更多信息参考 [RFC 7932](https://tools.ietf.org/html/rfc7932)                                          |
+| lgwin        | integer              | False | 19            | [0, 10-24]   | 动态设置 `Brotli滑动窗口大小`,`lgwin` 是滑动窗口大小的以 2 为底的对数,将其设置为 0 会让压缩器自行决定最佳值,更多信息请参考 [RFC 7932](https://tools.ietf.org/html/rfc7932)    |

Review Comment:
   > I plan to change it to this
   > 
   > ```
   > 动态设置 `brotli_min_length` 指令。
   > 动态设置 `brotli_comp_level` 指令。
   > 动态设置 `brotli decompress mode`,更多信息参考 [RFC 7932](https://tools.ietf.org/html/rfc7932) 
   > 动态设置 `brotli sliding window size`,`lgwin` 是滑动窗口大小的以 2 为底的对数,将其设置为 0 会让压缩器自行决定最佳值,更多信息请参考 [RFC 7932](https://tools.ietf.org/html/rfc7932) 
   > 动态设置 `brotli input block size`,`lgblock` 是最大输入块大小的以 2 为底的对数,将其设置为 0 会让压缩器自行决定最佳值,更多信息请参考 [RFC 7932](https://tools.ietf.org/html/rfc7932)
   > ```
   
   @smileby I'm good with this too.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] docs: add Chinese translation for the new brotil plugin [apisix]

Posted by "kayx23 (via GitHub)" <gi...@apache.org>.
kayx23 commented on code in PR #10814:
URL: https://github.com/apache/apisix/pull/10814#discussion_r1449935647


##########
docs/zh/latest/plugins/brotli.md:
##########
@@ -0,0 +1,123 @@
+---
+title: brotli
+keywords:
+  - Apache APISIX
+  - API 网关
+  - Plugin
+  - brotli
+description: 这个文档包含有关 Apache APISIX brotli 插件的相关信息。
+---
+
+<!--
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+-->
+
+## 描述
+
+`brotli` 插件可以动态的设置 Nginx 中的 [brotli](https://github.com/google/ngx_brotli) 的行为。
+
+## 前提条件
+
+该插件依赖 brotli 共享库。
+
+如下是构建和安装 brotli 共享库的示例脚本:
+
+``` shell
+wget https://github.com/google/brotli/archive/refs/tags/v1.1.0.zip
+unzip v1.1.0.zip
+cd brotli-1.1.0 && mkdir build && cd build
+cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local/brotli ..
+sudo cmake --build . --config Release --target install
+sudo sh -c "echo /usr/local/brotli/lib >> /etc/ld.so.conf.d/brotli.conf"
+sudo ldconfig
+```
+
+## 属性
+
+| 名称           | 类型                   | 必选项   | 默认值           | 有效值 | 描述                                                                                                                            |
+|--------------|----------------------|-------|---------------|--------------|-------------------------------------------------------------------------------------------------------------------------------|
+| types        | array[string] or "*" | False | ["text/html"] |              | 动态设置 `brotli_types` 指令。特殊值 `"*"` 用于匹配任意的 MIME 类型                                                                              |
+| min_length   | integer              | False | 20            | >= 1         | 动态设置 `brotli_min_length` 指令。指定进行压缩的文件最小的长度                                                                                    |
+| comp_level   | integer              | False | 6             | [0, 11]      | 动态设置 `brotli_comp_level` 指令                                                                                                   |
+| mode         | integer              | False | 0             | [0, 2]       | 动态设置 `brotli decompress mode`,更多信息参考 [RFC 7932](https://tools.ietf.org/html/rfc7932)                                          |
+| lgwin        | integer              | False | 19            | [0, 10-24]   | 动态设置 `Brotli滑动窗口大小`,`lgwin` 是滑动窗口大小的以 2 为底的对数,将其设置为 0 会让压缩器自行决定最佳值,更多信息请参考 [RFC 7932](https://tools.ietf.org/html/rfc7932)    |

Review Comment:
   I don't expect anything wrapped in inline code to be translated.
   
   However in this case, the original was `brotli input block size`, which, I don't know why it was inline coded initially. I think it actually makes sense to update the English doc to remove the inline code style for these phrases.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] docs: add Chinese translation for the new brotil plugin [apisix]

Posted by "kayx23 (via GitHub)" <gi...@apache.org>.
kayx23 commented on code in PR #10814:
URL: https://github.com/apache/apisix/pull/10814#discussion_r1449881546


##########
docs/zh/latest/plugins/brotli.md:
##########
@@ -0,0 +1,123 @@
+---
+title: brotli
+keywords:
+  - Apache APISIX
+  - API 网关
+  - Plugin
+  - brotli
+description: 这个文档包含有关 Apache APISIX brotli 插件的相关信息。
+---
+
+<!--
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+-->
+
+## 描述
+
+`brotli` 插件可以动态的设置 Nginx 中的 [brotli](https://github.com/google/ngx_brotli) 的行为。
+
+## 前提条件
+
+该插件依赖 brotli 共享库。
+
+如下是构建和安装 brotli 共享库的示例脚本:
+
+``` shell
+wget https://github.com/google/brotli/archive/refs/tags/v1.1.0.zip
+unzip v1.1.0.zip
+cd brotli-1.1.0 && mkdir build && cd build
+cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local/brotli ..
+sudo cmake --build . --config Release --target install
+sudo sh -c "echo /usr/local/brotli/lib >> /etc/ld.so.conf.d/brotli.conf"
+sudo ldconfig
+```
+
+## 属性
+
+| 名称           | 类型                   | 必选项   | 默认值           | 有效值 | 描述                                                                                                                            |
+|--------------|----------------------|-------|---------------|--------------|-------------------------------------------------------------------------------------------------------------------------------|
+| types        | array[string] or "*" | False | ["text/html"] |              | 动态设置 `brotli_types` 指令。特殊值 `"*"` 用于匹配任意的 MIME 类型                                                                              |
+| min_length   | integer              | False | 20            | >= 1         | 动态设置 `brotli_min_length` 指令。指定进行压缩的文件最小的长度                                                                                    |
+| comp_level   | integer              | False | 6             | [0, 11]      | 动态设置 `brotli_comp_level` 指令                                                                                                   |
+| mode         | integer              | False | 0             | [0, 2]       | 动态设置 `brotli decompress mode`,更多信息参考 [RFC 7932](https://tools.ietf.org/html/rfc7932)                                          |
+| lgwin        | integer              | False | 19            | [0, 10-24]   | 动态设置 `Brotli滑动窗口大小`,`lgwin` 是滑动窗口大小的以 2 为底的对数,将其设置为 0 会让压缩器自行决定最佳值,更多信息请参考 [RFC 7932](https://tools.ietf.org/html/rfc7932)    |

Review Comment:
   ![image](https://github.com/apache/apisix/assets/39619599/be911a7d-fbb6-4122-8433-fa78658dca57)
   
   mistakenly google translated?



##########
docs/zh/latest/plugins/brotli.md:
##########
@@ -0,0 +1,123 @@
+---
+title: brotli
+keywords:
+  - Apache APISIX
+  - API 网关
+  - Plugin
+  - brotli
+description: 这个文档包含有关 Apache APISIX brotli 插件的相关信息。
+---
+
+<!--
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+-->
+
+## 描述
+
+`brotli` 插件可以动态的设置 Nginx 中的 [brotli](https://github.com/google/ngx_brotli) 的行为。
+
+## 前提条件
+
+该插件依赖 brotli 共享库。
+
+如下是构建和安装 brotli 共享库的示例脚本:
+
+``` shell
+wget https://github.com/google/brotli/archive/refs/tags/v1.1.0.zip
+unzip v1.1.0.zip
+cd brotli-1.1.0 && mkdir build && cd build
+cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local/brotli ..
+sudo cmake --build . --config Release --target install
+sudo sh -c "echo /usr/local/brotli/lib >> /etc/ld.so.conf.d/brotli.conf"
+sudo ldconfig
+```
+
+## 属性
+
+| 名称           | 类型                   | 必选项   | 默认值           | 有效值 | 描述                                                                                                                            |
+|--------------|----------------------|-------|---------------|--------------|-------------------------------------------------------------------------------------------------------------------------------|
+| types        | array[string] or "*" | False | ["text/html"] |              | 动态设置 `brotli_types` 指令。特殊值 `"*"` 用于匹配任意的 MIME 类型                                                                              |
+| min_length   | integer              | False | 20            | >= 1         | 动态设置 `brotli_min_length` 指令。指定进行压缩的文件最小的长度                                                                                    |
+| comp_level   | integer              | False | 6             | [0, 11]      | 动态设置 `brotli_comp_level` 指令                                                                                                   |
+| mode         | integer              | False | 0             | [0, 2]       | 动态设置 `brotli decompress mode`,更多信息参考 [RFC 7932](https://tools.ietf.org/html/rfc7932)                                          |
+| lgwin        | integer              | False | 19            | [0, 10-24]   | 动态设置 `Brotli滑动窗口大小`,`lgwin` 是滑动窗口大小的以 2 为底的对数,将其设置为 0 会让压缩器自行决定最佳值,更多信息请参考 [RFC 7932](https://tools.ietf.org/html/rfc7932)    |
+| lgblock      | integer              | False | 0             | [0, 16-24]   | 动态设置 `Brotli输入块大小`,`lgblock` 是最大输入块大小的以 2 为底的对数,将其设置为 0 会让压缩器自行决定最佳值,更多信息请参考 [RFC 7932](https://tools.ietf.org/html/rfc7932)	 |
+| http_version | number               | False | 1.1           | 1.1, 1.0     | 与 `gzip_http_version` 指令类似,用于识别 http 的协议版本                                                                                    |
+| vary         | boolean              | False | false         |              | 与 `gzip_vary` 指令类似,用于启用或禁用 `Vary: Accept-Encoding` 响应头                                                                        |
+
+## 启用插件
+
+如下示例中,在指定的路由上启用 `brotli` 插件

Review Comment:
   ```suggestion
   如下示例中,在指定的路由上启用 `brotli` 插件:
   ```



##########
docs/zh/latest/plugins/brotli.md:
##########
@@ -0,0 +1,123 @@
+---
+title: brotli
+keywords:
+  - Apache APISIX
+  - API 网关
+  - Plugin
+  - brotli
+description: 这个文档包含有关 Apache APISIX brotli 插件的相关信息。
+---
+
+<!--
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+-->
+
+## 描述
+
+`brotli` 插件可以动态的设置 Nginx 中的 [brotli](https://github.com/google/ngx_brotli) 的行为。
+
+## 前提条件
+
+该插件依赖 brotli 共享库。
+
+如下是构建和安装 brotli 共享库的示例脚本:
+
+``` shell
+wget https://github.com/google/brotli/archive/refs/tags/v1.1.0.zip
+unzip v1.1.0.zip
+cd brotli-1.1.0 && mkdir build && cd build
+cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local/brotli ..
+sudo cmake --build . --config Release --target install
+sudo sh -c "echo /usr/local/brotli/lib >> /etc/ld.so.conf.d/brotli.conf"
+sudo ldconfig
+```
+
+## 属性
+
+| 名称           | 类型                   | 必选项   | 默认值           | 有效值 | 描述                                                                                                                            |
+|--------------|----------------------|-------|---------------|--------------|-------------------------------------------------------------------------------------------------------------------------------|
+| types        | array[string] or "*" | False | ["text/html"] |              | 动态设置 `brotli_types` 指令。特殊值 `"*"` 用于匹配任意的 MIME 类型                                                                              |
+| min_length   | integer              | False | 20            | >= 1         | 动态设置 `brotli_min_length` 指令。指定进行压缩的文件最小的长度                                                                                    |
+| comp_level   | integer              | False | 6             | [0, 11]      | 动态设置 `brotli_comp_level` 指令                                                                                                   |
+| mode         | integer              | False | 0             | [0, 2]       | 动态设置 `brotli decompress mode`,更多信息参考 [RFC 7932](https://tools.ietf.org/html/rfc7932)                                          |
+| lgwin        | integer              | False | 19            | [0, 10-24]   | 动态设置 `Brotli滑动窗口大小`,`lgwin` 是滑动窗口大小的以 2 为底的对数,将其设置为 0 会让压缩器自行决定最佳值,更多信息请参考 [RFC 7932](https://tools.ietf.org/html/rfc7932)    |
+| lgblock      | integer              | False | 0             | [0, 16-24]   | 动态设置 `Brotli输入块大小`,`lgblock` 是最大输入块大小的以 2 为底的对数,将其设置为 0 会让压缩器自行决定最佳值,更多信息请参考 [RFC 7932](https://tools.ietf.org/html/rfc7932)	 |
+| http_version | number               | False | 1.1           | 1.1, 1.0     | 与 `gzip_http_version` 指令类似,用于识别 http 的协议版本                                                                                    |
+| vary         | boolean              | False | false         |              | 与 `gzip_vary` 指令类似,用于启用或禁用 `Vary: Accept-Encoding` 响应头                                                                        |
+
+## 启用插件
+
+如下示例中,在指定的路由上启用 `brotli` 插件
+
+```shell
+curl -i http://127.0.0.1:9180/apisix/admin/routes/1  -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
+{
+    "uri": "/",
+    "plugins": {
+        "brotli": {
+        }
+    },
+    "upstream": {
+        "type": "roundrobin",
+        "nodes": {
+            "httpbin.org": 1
+        }
+    }
+}'
+```
+
+## 使用示例
+
+通过上述命令启用插件后,可以通过以下方法测试插件。

Review Comment:
   ```suggestion
   通过上述命令启用插件后,可以通过以下方法测试插件:
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] docs: add Chinese translation for the new brotil plugin [apisix]

Posted by "smileby (via GitHub)" <gi...@apache.org>.
smileby commented on code in PR #10814:
URL: https://github.com/apache/apisix/pull/10814#discussion_r1449934592


##########
docs/zh/latest/plugins/brotli.md:
##########
@@ -0,0 +1,123 @@
+---
+title: brotli
+keywords:
+  - Apache APISIX
+  - API 网关
+  - Plugin
+  - brotli
+description: 这个文档包含有关 Apache APISIX brotli 插件的相关信息。
+---
+
+<!--
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+-->
+
+## 描述
+
+`brotli` 插件可以动态的设置 Nginx 中的 [brotli](https://github.com/google/ngx_brotli) 的行为。
+
+## 前提条件
+
+该插件依赖 brotli 共享库。
+
+如下是构建和安装 brotli 共享库的示例脚本:
+
+``` shell
+wget https://github.com/google/brotli/archive/refs/tags/v1.1.0.zip
+unzip v1.1.0.zip
+cd brotli-1.1.0 && mkdir build && cd build
+cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local/brotli ..
+sudo cmake --build . --config Release --target install
+sudo sh -c "echo /usr/local/brotli/lib >> /etc/ld.so.conf.d/brotli.conf"
+sudo ldconfig
+```
+
+## 属性
+
+| 名称           | 类型                   | 必选项   | 默认值           | 有效值 | 描述                                                                                                                            |
+|--------------|----------------------|-------|---------------|--------------|-------------------------------------------------------------------------------------------------------------------------------|
+| types        | array[string] or "*" | False | ["text/html"] |              | 动态设置 `brotli_types` 指令。特殊值 `"*"` 用于匹配任意的 MIME 类型                                                                              |
+| min_length   | integer              | False | 20            | >= 1         | 动态设置 `brotli_min_length` 指令。指定进行压缩的文件最小的长度                                                                                    |
+| comp_level   | integer              | False | 6             | [0, 11]      | 动态设置 `brotli_comp_level` 指令                                                                                                   |
+| mode         | integer              | False | 0             | [0, 2]       | 动态设置 `brotli decompress mode`,更多信息参考 [RFC 7932](https://tools.ietf.org/html/rfc7932)                                          |
+| lgwin        | integer              | False | 19            | [0, 10-24]   | 动态设置 `Brotli滑动窗口大小`,`lgwin` 是滑动窗口大小的以 2 为底的对数,将其设置为 0 会让压缩器自行决定最佳值,更多信息请参考 [RFC 7932](https://tools.ietf.org/html/rfc7932)    |

Review Comment:
   > ![image](https://private-user-images.githubusercontent.com/39619599/296143885-be911a7d-fbb6-4122-8433-fa78658dca57.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MDUwNDMwMDcsIm5iZiI6MTcwNTA0MjcwNywicGF0aCI6Ii8zOTYxOTU5OS8yOTYxNDM4ODUtYmU5MTFhN2QtZmJiNi00MTIyLTg0MzMtZmE3ODY1OGRjYTU3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDAxMTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwMTEyVDA2NTgyN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTY5MDc5MzgyM2ViYTNlMTU1NWU3OWU0YzMwMDBmN2VlMTg4ZWFhZGY4NmQ1NzcxYjliYzI2MWU1ZWM4YWE2MDImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.Rta2etRcv3NpTdmeD1UF_3vcjWi78b7TOCxi02FZ23M)
   > 
   > mistakenly google translated?
   
   I plan to change it to this
   
   ```text
   动态设置 `brotli_min_length` 指令。
   动态设置 `brotli_comp_level` 指令。
   动态设置 `brotli decompress mode`,更多信息参考 [RFC 7932](https://tools.ietf.org/html/rfc7932) 
   动态设置 `brotli sliding window size`,`lgwin` 是滑动窗口大小的以 2 为底的对数,将其设置为 0 会让压缩器自行决定最佳值,更多信息请参考 [RFC 7932](https://tools.ietf.org/html/rfc7932) 
   动态设置 `brotli input block size`,`lgblock` 是最大输入块大小的以 2 为底的对数,将其设置为 0 会让压缩器自行决定最佳值,更多信息请参考 [RFC 7932](https://tools.ietf.org/html/rfc7932)
   ```
   
   do you have a better idea



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] docs: add Chinese translation for the new brotil plugin [apisix]

Posted by "smileby (via GitHub)" <gi...@apache.org>.
smileby commented on code in PR #10814:
URL: https://github.com/apache/apisix/pull/10814#discussion_r1450016089


##########
docs/zh/latest/plugins/brotli.md:
##########
@@ -0,0 +1,123 @@
+---
+title: brotli
+keywords:
+  - Apache APISIX
+  - API 网关
+  - Plugin
+  - brotli
+description: 这个文档包含有关 Apache APISIX brotli 插件的相关信息。
+---
+
+<!--
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+-->
+
+## 描述
+
+`brotli` 插件可以动态的设置 Nginx 中的 [brotli](https://github.com/google/ngx_brotli) 的行为。
+
+## 前提条件
+
+该插件依赖 brotli 共享库。
+
+如下是构建和安装 brotli 共享库的示例脚本:
+
+``` shell
+wget https://github.com/google/brotli/archive/refs/tags/v1.1.0.zip
+unzip v1.1.0.zip
+cd brotli-1.1.0 && mkdir build && cd build
+cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local/brotli ..
+sudo cmake --build . --config Release --target install
+sudo sh -c "echo /usr/local/brotli/lib >> /etc/ld.so.conf.d/brotli.conf"
+sudo ldconfig
+```
+
+## 属性
+
+| 名称           | 类型                   | 必选项   | 默认值           | 有效值 | 描述                                                                                                                            |
+|--------------|----------------------|-------|---------------|--------------|-------------------------------------------------------------------------------------------------------------------------------|
+| types        | array[string] or "*" | False | ["text/html"] |              | 动态设置 `brotli_types` 指令。特殊值 `"*"` 用于匹配任意的 MIME 类型                                                                              |
+| min_length   | integer              | False | 20            | >= 1         | 动态设置 `brotli_min_length` 指令。指定进行压缩的文件最小的长度                                                                                    |
+| comp_level   | integer              | False | 6             | [0, 11]      | 动态设置 `brotli_comp_level` 指令                                                                                                   |
+| mode         | integer              | False | 0             | [0, 2]       | 动态设置 `brotli decompress mode`,更多信息参考 [RFC 7932](https://tools.ietf.org/html/rfc7932)                                          |
+| lgwin        | integer              | False | 19            | [0, 10-24]   | 动态设置 `Brotli滑动窗口大小`,`lgwin` 是滑动窗口大小的以 2 为底的对数,将其设置为 0 会让压缩器自行决定最佳值,更多信息请参考 [RFC 7932](https://tools.ietf.org/html/rfc7932)    |

Review Comment:
   > > I plan to change it to this
   > > ```
   > > 动态设置 `brotli_min_length` 指令。
   > > 动态设置 `brotli_comp_level` 指令。
   > > 动态设置 `brotli decompress mode`,更多信息参考 [RFC 7932](https://tools.ietf.org/html/rfc7932) 
   > > 动态设置 `brotli sliding window size`,`lgwin` 是滑动窗口大小的以 2 为底的对数,将其设置为 0 会让压缩器自行决定最佳值,更多信息请参考 [RFC 7932](https://tools.ietf.org/html/rfc7932) 
   > > 动态设置 `brotli input block size`,`lgblock` 是最大输入块大小的以 2 为底的对数,将其设置为 0 会让压缩器自行决定最佳值,更多信息请参考 [RFC 7932](https://tools.ietf.org/html/rfc7932)
   > > ```
   > 
   > @smileby I'm good with this too.
   
   This is it for now. If you have any objections later, I can fix it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] docs: add Chinese translation for the new brotil plugin [apisix]

Posted by "monkeyDluffy6017 (via GitHub)" <gi...@apache.org>.
monkeyDluffy6017 merged PR #10814:
URL: https://github.com/apache/apisix/pull/10814


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org