Browse Source

Merge pull request #7690 from EMQ-YangM/log_config_i18n_support

feat(emqx_conf_schema): log config add i18n support
Yang Miao 3 years ago
parent
commit
249ef5ad34

+ 305 - 104
apps/emqx_conf/i18n/emqx_conf_schema.conf

@@ -806,121 +806,121 @@ Ensure that the number of completed transactions is less than the <code>max_hist
     log_file_handlers {
     log_file_handlers {
                    desc {
                    desc {
                          en: """Key-value list of file-based log handlers."""
                          en: """Key-value list of file-based log handlers."""
-                         zh: """"""
+                         zh: """基于文件的日志处理进程的键值列表。"""
                         }
                         }
                    label: {
                    label: {
-                           en: ""
-                           zh: ""
+                           en: "Log Handlers Key Val List"
+                           zh: "日志处理进程键值列表"
                           }
                           }
                   }
                   }
 
 
     log_error_logger {
     log_error_logger {
                    desc {
                    desc {
                          en: """Deprecated."""
                          en: """Deprecated."""
-                         zh: """"""
+                         zh: """该配置已弃用。"""
                         }
                         }
                    label: {
                    label: {
-                           en: ""
-                           zh: ""
+                           en: "Deprecate"
+                           zh: "配置已弃用"
                           }
                           }
                   }
                   }
 
 
     console_handler_enable {
     console_handler_enable {
                    desc {
                    desc {
                          en: """Enable this log handler."""
                          en: """Enable this log handler."""
-                         zh: """"""
+                         zh: """启用此日志处理进程。"""
                         }
                         }
                    label: {
                    label: {
-                           en: ""
-                           zh: ""
+                           en: "Enable Log Handler"
+                           zh: "启用日志处理进程"
                           }
                           }
                   }
                   }
 
 
     console_handler_level {
     console_handler_level {
                    desc {
                    desc {
                          en: """Global log level. This includes the primary log level and all log handlers."""
                          en: """Global log level. This includes the primary log level and all log handlers."""
-                         zh: """"""
+                         zh: """全局日志级别。 这包括主日志级别和所有日志处理进程。"""
                         }
                         }
                    label: {
                    label: {
-                           en: ""
-                           zh: ""
+                           en: "Global Log Level"
+                           zh: "全局日志级别"
                           }
                           }
                   }
                   }
 
 
     console_handler_time_offset {
     console_handler_time_offset {
                    desc {
                    desc {
                          en: """The time offset to be used when formatting the timestamp."""
                          en: """The time offset to be used when formatting the timestamp."""
-                         zh: """"""
+                         zh: """格式化时间戳时,使用的时间偏移量。"""
                         }
                         }
                    label: {
                    label: {
-                           en: ""
-                           zh: ""
+                           en: "Time Offset"
+                           zh: "时间偏移量"
                           }
                           }
                   }
                   }
 
 
     console_handler_chars_limit {
     console_handler_chars_limit {
                    desc {
                    desc {
                          en: """Set the maximum length of a single log message. If this length is exceeded, the log message will be truncated."""
                          en: """Set the maximum length of a single log message. If this length is exceeded, the log message will be truncated."""
-                         zh: """"""
+                         zh: """设置单个日志消息的最大长度。 如果超过此长度,则日志消息将被截断。"""
                         }
                         }
                    label: {
                    label: {
-                           en: ""
-                           zh: ""
+                           en: "Single Log Max Length"
+                           zh: "单个日志最大长度"
                           }
                           }
                   }
                   }
 
 
     console_handler_formatter {
     console_handler_formatter {
                    desc {
                    desc {
                          en: """Choose log format. <code>text</code> for free text, and <code>json</code> for structured logging."""
                          en: """Choose log format. <code>text</code> for free text, and <code>json</code> for structured logging."""
-                         zh: """"""
+                         zh: """选择日志格式。 <code>text</code> 用于自由文本,<code>json</code> 用于结构化日志记录。"""
                         }
                         }
                    label: {
                    label: {
-                           en: ""
-                           zh: ""
+                           en: "Log Format"
+                           zh: "日志格式"
                           }
                           }
                   }
                   }
 
 
     console_handler_single_line {
     console_handler_single_line {
                    desc {
                    desc {
                          en: """Print logs in a single line if set to true. Otherwise, log messages may span multiple lines."""
                          en: """Print logs in a single line if set to true. Otherwise, log messages may span multiple lines."""
-                         zh: """"""
+                         zh: """如果设置为 true,则在一行中打印日志。 否则,日志消息可能跨越多行。"""
                         }
                         }
                    label: {
                    label: {
-                           en: ""
-                           zh: ""
+                           en: "Single Line Mode"
+                           zh: "单行模式"
                           }
                           }
                   }
                   }
 
 
     console_handler_sync_mode_qlen {
     console_handler_sync_mode_qlen {
                    desc {
                    desc {
                          en: """As long as the number of buffered log events is lower than this value, all log events are handled asynchronously."""
                          en: """As long as the number of buffered log events is lower than this value, all log events are handled asynchronously."""
-                         zh: """"""
+                         zh: """只要缓冲的日志事件的数量低于这个值,所有的日志事件都会被异步处理。"""
                         }
                         }
                    label: {
                    label: {
-                           en: ""
-                           zh: ""
+                           en: "Sync Mode Max Log Events"
+                           zh: "异步模式最大事件数"
                           }
                           }
                   }
                   }
 
 
     console_handler_drop_mode_qlen {
     console_handler_drop_mode_qlen {
                    desc {
                    desc {
                          en: """When the number of buffered log events is larger than this value, the new log events are dropped.<br/>When drop mode is activated or deactivated, a message is printed in the logs."""
                          en: """When the number of buffered log events is larger than this value, the new log events are dropped.<br/>When drop mode is activated or deactivated, a message is printed in the logs."""
-                         zh: """"""
+                         zh: """当缓冲的日志事件数大于此值时,新的日志事件将被丢弃。<br/>启用或停用丢弃模式时,会在日志中打印一条消息。"""
                         }
                         }
                    label: {
                    label: {
-                           en: ""
-                           zh: ""
+                           en: "Drop Mode Max Log Events"
+                           zh: "缓存最大日志事件数"
                           }
                           }
                   }
                   }
 
 
     console_handler_flush_qlen {
     console_handler_flush_qlen {
                    desc {
                    desc {
                          en: """If the number of buffered log events grows larger than this threshold, a flush (delete) operation takes place. To flush events, the handler discards the buffered log messages without logging."""
                          en: """If the number of buffered log events grows larger than this threshold, a flush (delete) operation takes place. To flush events, the handler discards the buffered log messages without logging."""
-                         zh: """"""
+                         zh: """如果缓冲日志事件的数量增长大于此阈值,则会发生刷新(删除)操作。 为了完成刷新事件,处理进程丢弃缓冲的日志消息。"""
                         }
                         }
                    label: {
                    label: {
-                           en: ""
-                           zh: ""
+                           en: "Flush Threshold"
+                           zh: "刷新阈值"
                           }
                           }
                   }
                   }
 
 
@@ -929,143 +929,145 @@ Ensure that the number of completed transactions is less than the <code>max_hist
                          en: """Type of supervisor reports that are logged.
                          en: """Type of supervisor reports that are logged.
  - `error`: only log errors in the Erlang processes.
  - `error`: only log errors in the Erlang processes.
  - `progress`: log process startup."""
  - `progress`: log process startup."""
-                         zh: """"""
+                         zh: """ supervisor 报告的类型。
+  - `error`:仅记录 Erlang 进程中的错误。
+  - `progress`:记录进程启动。"""
                         }
                         }
                    label: {
                    label: {
-                           en: ""
-                           zh: ""
+                           en: "Report Type"
+                           zh: "报告类型"
                           }
                           }
                   }
                   }
 
 
     console_handler_max_depth {
     console_handler_max_depth {
                    desc {
                    desc {
                          en: """Maximum depth for Erlang term log formatting and Erlang process message queue inspection."""
                          en: """Maximum depth for Erlang term log formatting and Erlang process message queue inspection."""
-                         zh: """"""
+                         zh: """Erlang 内部格式日志格式化和 Erlang 进程消息队列检查的最大深度。"""
                         }
                         }
                    label: {
                    label: {
-                           en: ""
-                           zh: ""
+                           en: "Max Depth"
+                           zh: "最大深度"
                           }
                           }
                   }
                   }
 
 
     log_file_handler_file {
     log_file_handler_file {
                    desc {
                    desc {
                          en: """Name the log file."""
                          en: """Name the log file."""
-                         zh: """"""
+                         zh: """日志文件名字。"""
                         }
                         }
                    label: {
                    label: {
-                           en: ""
-                           zh: ""
+                           en: "Log File Name"
+                           zh: "日志文件名字"
                           }
                           }
                   }
                   }
 
 
     log_file_handler_max_size {
     log_file_handler_max_size {
                    desc {
                    desc {
                          en: """This parameter controls log file rotation. The value `infinity` means the log file will grow indefinitely, otherwise the log file will be rotated once it reaches `max_size` in bytes."""
                          en: """This parameter controls log file rotation. The value `infinity` means the log file will grow indefinitely, otherwise the log file will be rotated once it reaches `max_size` in bytes."""
-                         zh: """"""
+                         zh: """此参数控制日志文件轮换。 `infinity` 意味着日志文件将无限增长,否则日志文件将在达到 `max_size`(以字节为单位)时进行轮换。"""
                         }
                         }
                    label: {
                    label: {
-                           en: ""
-                           zh: ""
+                           en: "Rotation Size"
+                           zh: "日志文件轮换大小"
                           }
                           }
                   }
                   }
 
 
     log_file_handler_enable {
     log_file_handler_enable {
                    desc {
                    desc {
                          en: """Enable this log handler."""
                          en: """Enable this log handler."""
-                         zh: """"""
+                         zh: """启用此日志处理进程。"""
                         }
                         }
                    label: {
                    label: {
-                           en: ""
-                           zh: ""
+                           en: "Enable Log Handler"
+                           zh: "启用此日志处理进程"
                           }
                           }
                   }
                   }
 
 
     log_file_handler_level {
     log_file_handler_level {
                    desc {
                    desc {
                          en: """Global log level. This includes the primary log level and all log handlers."""
                          en: """Global log level. This includes the primary log level and all log handlers."""
-                         zh: """"""
+                         zh: """全局日志级别。 这包括主日志级别和所有日志处理进程。"""
                         }
                         }
                    label: {
                    label: {
-                           en: ""
-                           zh: ""
+                           en: "Global Level"
+                           zh: "全局日志级别"
                           }
                           }
                   }
                   }
 
 
     log_file_handler_time_offset {
     log_file_handler_time_offset {
                    desc {
                    desc {
                          en: """The time offset to be used when formatting the timestamp."""
                          en: """The time offset to be used when formatting the timestamp."""
-                         zh: """"""
+                         zh: """格式化时间戳时要使用的时间偏移量。"""
                         }
                         }
                    label: {
                    label: {
-                           en: ""
-                           zh: ""
+                           en: "Time Offset"
+                           zh: "时间偏移"
                           }
                           }
                   }
                   }
 
 
     log_file_handler_chars_limit {
     log_file_handler_chars_limit {
                    desc {
                    desc {
                          en: """Set the maximum length of a single log message. If this length is exceeded, the log message will be truncated."""
                          en: """Set the maximum length of a single log message. If this length is exceeded, the log message will be truncated."""
-                         zh: """"""
+                         zh: """设置单个日志消息的最大长度。 如果超过此长度,则日志消息将被截断。"""
                         }
                         }
                    label: {
                    label: {
-                           en: ""
-                           zh: ""
+                           en: "Single Log Max Length"
+                           zh: "单个日志消息最大长度"
                           }
                           }
                   }
                   }
 
 
     log_file_handler_formatter {
     log_file_handler_formatter {
                    desc {
                    desc {
                          en: """Choose log format. <code>text</code> for free text, and <code>json</code> for structured logging."""
                          en: """Choose log format. <code>text</code> for free text, and <code>json</code> for structured logging."""
-                         zh: """"""
+                         zh: """选择日志格式。 <code>text</code> 用于自由文本,<code>json</code> 用于结构化日志记录。"""
                         }
                         }
                    label: {
                    label: {
-                           en: ""
-                           zh: ""
+                           en: "Log Format"
+                           zh: "日志格式"
                           }
                           }
                   }
                   }
 
 
     log_file_handler_single_line {
     log_file_handler_single_line {
                    desc {
                    desc {
                          en: """Print logs in a single line if set to true. Otherwise, log messages may span multiple lines."""
                          en: """Print logs in a single line if set to true. Otherwise, log messages may span multiple lines."""
-                         zh: """"""
+                         zh: """如果设置为 true,则在一行中打印日志。 否则,日志消息可能跨越多行。"""
                         }
                         }
                    label: {
                    label: {
-                           en: ""
-                           zh: ""
+                           en: "Single Line Mode"
+                           zh: "单行模式"
                           }
                           }
                   }
                   }
 
 
     log_file_handler_sync_mode_qlen {
     log_file_handler_sync_mode_qlen {
                    desc {
                    desc {
                          en: """As long as the number of buffered log events is lower than this value, all log events are handled asynchronously."""
                          en: """As long as the number of buffered log events is lower than this value, all log events are handled asynchronously."""
-                         zh: """"""
+                         zh: """只要缓冲的日志事件的数量低于这个值,所有的日志事件都会被异步处理。"""
                         }
                         }
                    label: {
                    label: {
-                           en: ""
-                           zh: ""
+                           en: "Sync Mode Max Log Events"
+                           zh: "异步模式最大事件数"
                           }
                           }
                   }
                   }
 
 
     log_file_handler_drop_mode_qlen {
     log_file_handler_drop_mode_qlen {
                    desc {
                    desc {
                          en: """When the number of buffered log events is larger than this value, the new log events are dropped.<br/>When drop mode is activated or deactivated, a message is printed in the logs."""
                          en: """When the number of buffered log events is larger than this value, the new log events are dropped.<br/>When drop mode is activated or deactivated, a message is printed in the logs."""
-                         zh: """"""
+                         zh: """当缓冲的日志事件数大于此值时,新的日志事件将被丢弃。<br/>启用或停用丢弃模式时,会在日志中打印一条消息。"""
                         }
                         }
                    label: {
                    label: {
-                           en: ""
-                           zh: ""
+                           en: "Drop Mode Max Log Events"
+                           zh: "缓存最大日志事件数"
                           }
                           }
                   }
                   }
 
 
     log_file_handler_flush_qlen {
     log_file_handler_flush_qlen {
                    desc {
                    desc {
                          en: """If the number of buffered log events grows larger than this threshold, a flush (delete) operation takes place. To flush events, the handler discards the buffered log messages without logging."""
                          en: """If the number of buffered log events grows larger than this threshold, a flush (delete) operation takes place. To flush events, the handler discards the buffered log messages without logging."""
-                         zh: """"""
+                         zh: """如果缓冲日志事件的数量增长大于此阈值,则会发生刷新(删除)操作。 为了完成刷新事件,处理进程丢弃缓冲的日志消息。"""
                         }
                         }
                    label: {
                    label: {
-                           en: ""
-                           zh: ""
+                           en: "Flush Threshold"
+                           zh: "刷新阈值"
                           }
                           }
                   }
                   }
 
 
@@ -1074,6 +1076,139 @@ Ensure that the number of completed transactions is less than the <code>max_hist
                          en: """Type of supervisor reports that are logged.
                          en: """Type of supervisor reports that are logged.
  - `error`: only log errors in the Erlang processes.
  - `error`: only log errors in the Erlang processes.
  - `progress`: log process startup."""
  - `progress`: log process startup."""
+                         zh: """ supervisor 报告的类型。
+  - `error`:仅记录 Erlang 进程中的错误。
+  - `progress`:记录进程启动。"""
+                        }
+                   label: {
+                           en: "Report Type"
+                           zh: "报告类型"
+                          }
+                  }
+
+    log_file_handler_max_depth {
+                   desc {
+                         en: """Maximum depth for Erlang term log formatting and Erlang process message queue inspection."""
+                         zh: """Erlang 内部格式日志格式化和 Erlang 进程消息队列检查的最大深度。"""
+                        }
+                   label: {
+                           en: "Max Depth"
+                           zh: "最大深度"
+                          }
+                  }
+
+    log_rotation_enable {
+                   desc {
+                         en: """Enable log rotation feature."""
+                         zh: """启用日志轮换功能。"""
+                        }
+                   label: {
+                           en: "Rotation Enable"
+                           zh: "日志轮换"
+                          }
+                  }
+
+    log_rotation_count {
+                   desc {
+                         en: """Maximum number of log files."""
+                         zh: """最大日志文件数。"""
+                        }
+                   label: {
+                           en: "Max Log Files Number"
+                           zh: "最大日志文件数"
+                          }
+                  }
+
+    log_overload_kill_enable {
+                   desc {
+                         en: """Enable log handler overload kill feature."""
+                         zh: """启用日志处理进程过载终止功能。"""
+                        }
+                   label: {
+                           en: "Log Handler Overload Kill"
+                           zh: "日志处理进程过载终止"
+                          }
+                  }
+
+    log_overload_kill_mem_size {
+                   desc {
+                         en: """Maximum memory size that the handler process is allowed to use."""
+                         zh: """处理进程进程允许使用的最大内存。"""
+                        }
+                   label: {
+                           en: "Handler Allowed Max Memory Size"
+                           zh: "理进程进程允许使用的最大内存"
+                          }
+                  }
+
+    log_overload_kill_qlen {
+                   desc {
+                         en: """Maximum allowed queue length."""
+                         zh: """允许的最大队列长度。"""
+                        }
+                   label: {
+                           en: "Max Queue Length"
+                           zh: "最大队列长度"
+                          }
+                  }
+
+    log_overload_kill_restart_after {
+                   desc {
+                         en: """If the handler is terminated, it restarts automatically after a delay specified in milliseconds. The value `infinity` prevents restarts."""
+                         zh: """如果处理进程终止,它会在以毫秒为单位指定的延迟后自动重新启动。 `infinity` 防止重新启动。"""
+                        }
+                   label: {
+                           en: "Handler Restart Delay"
+                           zh: "处理进程重启延迟"
+                          }
+                  }
+
+    log_burst_limit_enable {
+                   desc {
+                         en: """Enable log burst control feature."""
+                         zh: """启用日志突发控制功能。"""
+                        }
+                   label: {
+                           en: "Enable Burst"
+                           zh: "启用日志突发控制"
+                          }
+                  }
+
+    log_burst_limit_max_count {
+                   desc {
+                         en: """Maximum number of log events to handle within a `window_time` interval. After the limit is reached, successive events are dropped until the end of the `window_time`."""
+                         zh: """在 `window_time` 间隔内处理的最大日志事件数。 达到限制后,将丢弃连续事件,直到 `window_time` 结束。"""
+                        }
+                   label: {
+                           en: "Events Number"
+                           zh: "日志事件数"
+                          }
+                  }
+
+    log_burst_limit_window_time {
+                   desc {
+                         en: """See `max_count`."""
+                         zh: """参考 `max_count`。"""
+                        }
+                   label: {
+                           en: "Window Time"
+                           zh: "Window Time"
+                          }
+                  }
+
+    authorization {
+                   desc {
+                         en: """
+Authorization a.k.a. ACL.<br>
+In EMQX, MQTT client access control is extremely flexible.<br>
+An out-of-the-box set of authorization data sources are supported.
+For example,<br>
+'file' source is to support concise and yet generic ACL rules in a file;<br>
+'built_in_database' source can be used to store per-client customizable rule sets,
+natively in the EMQX node;<br>
+'http' source to make EMQX call an external HTTP API to make the decision;<br>
+'PostgreSQL' etc. to look up clients or rules from external databases;<br>
+"""
                          zh: """"""
                          zh: """"""
                         }
                         }
                    label: {
                    label: {
@@ -1082,9 +1217,9 @@ Ensure that the number of completed transactions is less than the <code>max_hist
                           }
                           }
                   }
                   }
 
 
-    log_file_handler_max_depth {
+    desc_cluster {
                    desc {
                    desc {
-                         en: """Maximum depth for Erlang term log formatting and Erlang process message queue inspection."""
+                         en: """EMQX nodes can form a cluster to scale up the total capacity.<br>Here holds the configs to instruct how individual nodes can discover each other."""
                          zh: """"""
                          zh: """"""
                         }
                         }
                    label: {
                    label: {
@@ -1093,9 +1228,9 @@ Ensure that the number of completed transactions is less than the <code>max_hist
                           }
                           }
                   }
                   }
 
 
-    log_rotation_enable {
+    desc_cluster_static {
                    desc {
                    desc {
-                         en: """Enable log rotation feature."""
+                         en: """Service discovery via static nodes. The new node joins the cluster by connecting to one of the bootstrap nodes."""
                          zh: """"""
                          zh: """"""
                         }
                         }
                    label: {
                    label: {
@@ -1104,9 +1239,9 @@ Ensure that the number of completed transactions is less than the <code>max_hist
                           }
                           }
                   }
                   }
 
 
-    log_rotation_count {
+    desc_cluster_mcast {
                    desc {
                    desc {
-                         en: """Maximum number of log files."""
+                         en: """Service discovery via UDP multicast."""
                          zh: """"""
                          zh: """"""
                         }
                         }
                    label: {
                    label: {
@@ -1115,9 +1250,9 @@ Ensure that the number of completed transactions is less than the <code>max_hist
                           }
                           }
                   }
                   }
 
 
-    log_overload_kill_enable {
+    desc_cluster_dns {
                    desc {
                    desc {
-                         en: """Enable log handler overload kill feature."""
+                         en: """Service discovery via DNS SRV records."""
                          zh: """"""
                          zh: """"""
                         }
                         }
                    label: {
                    label: {
@@ -1126,9 +1261,9 @@ Ensure that the number of completed transactions is less than the <code>max_hist
                           }
                           }
                   }
                   }
 
 
-    log_overload_kill_mem_size {
+    desc_cluster_etcd {
                    desc {
                    desc {
-                         en: """Maximum memory size that the handler process is allowed to use."""
+                         en: """Service discovery using 'etcd' service."""
                          zh: """"""
                          zh: """"""
                         }
                         }
                    label: {
                    label: {
@@ -1137,9 +1272,9 @@ Ensure that the number of completed transactions is less than the <code>max_hist
                           }
                           }
                   }
                   }
 
 
-    log_overload_kill_qlen {
+    desc_cluster_k8s {
                    desc {
                    desc {
-                         en: """Maximum allowed queue length."""
+                         en: """Service discovery via Kubernetes API server."""
                          zh: """"""
                          zh: """"""
                         }
                         }
                    label: {
                    label: {
@@ -1148,9 +1283,9 @@ Ensure that the number of completed transactions is less than the <code>max_hist
                           }
                           }
                   }
                   }
 
 
-    log_overload_kill_restart_after {
+    desc_node {
                    desc {
                    desc {
-                         en: """If the handler is terminated, it restarts automatically after a delay specified in milliseconds. The value `infinity` prevents restarts."""
+                         en: """Node name, cookie, config & data directories and the Erlang virtual machine (BEAM) boot parameters."""
                          zh: """"""
                          zh: """"""
                         }
                         }
                    label: {
                    label: {
@@ -1159,9 +1294,9 @@ Ensure that the number of completed transactions is less than the <code>max_hist
                           }
                           }
                   }
                   }
 
 
-    log_burst_limit_enable {
+    desc_db {
                    desc {
                    desc {
-                         en: """Enable log burst control feature."""
+                         en: """Settings for the embedded database."""
                          zh: """"""
                          zh: """"""
                         }
                         }
                    label: {
                    label: {
@@ -1170,9 +1305,9 @@ Ensure that the number of completed transactions is less than the <code>max_hist
                           }
                           }
                   }
                   }
 
 
-    log_burst_limit_max_count {
+    desc_cluster_call {
                    desc {
                    desc {
-                         en: """Maximum number of log events to handle within a `window_time` interval. After the limit is reached, successive events are dropped until the end of the `window_time`."""
+                         en: """Options for the 'cluster call' feature that allows to execute a callback on all nodes in the cluster."""
                          zh: """"""
                          zh: """"""
                         }
                         }
                    label: {
                    label: {
@@ -1181,9 +1316,9 @@ Ensure that the number of completed transactions is less than the <code>max_hist
                           }
                           }
                   }
                   }
 
 
-    log_burst_limit_window_time {
+    desc_rpc {
                    desc {
                    desc {
-                         en: """See `max_count`."""
+                         en: """EMQX uses a library called <code>gen_rpc</code> for inter-broker communication.<br/>Most of the time the default config should work, but in case you need to do performance fine-tuning or experiment a bit, this is where to look."""
                          zh: """"""
                          zh: """"""
                         }
                         }
                    label: {
                    label: {
@@ -1192,19 +1327,85 @@ Ensure that the number of completed transactions is less than the <code>max_hist
                           }
                           }
                   }
                   }
 
 
-    authorization {
+    desc_log {
                    desc {
                    desc {
-                         en: """
-Authorization a.k.a. ACL.<br>
-In EMQX, MQTT client access control is extremely flexible.<br>
-An out-of-the-box set of authorization data sources are supported.
-For example,<br>
-'file' source is to support concise and yet generic ACL rules in a file;<br>
-'built_in_database' source can be used to store per-client customizable rule sets,
-natively in the EMQX node;<br>
-'http' source to make EMQX call an external HTTP API to make the decision;<br>
-'PostgreSQL' etc. to look up clients or rules from external databases;<br>
-"""
+                         en: """EMQX logging supports multiple sinks for the log events. Each sink is represented by a _log handler_, which can be configured independently."""
+                         zh: """EMQX 日志记录支持日志事件的多个接收器。 每个接收器由一个_log handler_表示,可以独立配置。"""
+                        }
+                   label: {
+                           en: "Log"
+                           zh: "日志"
+                          }
+                  }
+
+    desc_console_handler {
+                   desc {
+                         en: """Log handler that prints log events to the EMQX console."""
+                         zh: """日志处理进程将日志事件打印到 EMQX 控制台。"""
+                        }
+                   label: {
+                           en: "Console Log Handler"
+                           zh: "控制台日志处理进程"
+                          }
+                  }
+
+    desc_log_file_handler {
+                   desc {
+                         en: """Log handler that prints log events to files."""
+                         zh: """日志处理进程将日志事件打印到文件。"""
+                        }
+                   label: {
+                           en: "Files Log Handler"
+                           zh: "文件日志处理进程"
+                          }
+                  }
+
+    desc_log_rotation {
+                   desc {
+                         en: """By default, the logs are stored in `./log` directory (for installation from zip file) or in `/var/log/emqx` (for binary installation).<br/>This section of the configuration controls the number of files kept for each log handler."""
+                         zh: """默认情况下,日志存储在 `./log` 目录(用于从 zip 文件安装)或 `/var/log/emqx`(用于二进制安装)。<br/>这部分配置,控制每个日志处理进程保留的文件数量。"""
+                        }
+                   label: {
+                           en: "Log Rotation"
+                           zh: "日志轮换"
+                          }
+                  }
+
+    desc_log_overload_kill {
+                   desc {
+                         en: """Log overload kill features an overload protection that activates when the log handlers use too much memory or have too many buffered log messages.<br/>When the overload is detected, the log handler is terminated and restarted after a cooldown period."""
+                         zh: """日志过载终止,具有过载保护功能。当日志处理进程使用过多内存,或者缓存的日志消息过多时该功能被激活。<br/>检测到过载时,日志处理进程将终止,并在冷却期后重新启动。"""
+                        }
+                   label: {
+                           en: "Log Overload Kill"
+                           zh: "日志过载保护"
+                          }
+                  }
+
+    desc_log_burst_limit {
+                   desc {
+                         en: """Large bursts of log events produced in a short time can potentially cause problems, such as:
+ - Log files grow very large
+ - Log files are rotated too quickly, and useful information gets overwritten
+ - Overall performance impact on the system
+
+Log burst limit feature can temporarily disable logging to avoid these issues."""
+                         zh: """短时间内产生的大量日志事件可能会导致问题,例如:
+  - 日志文件变得非常大
+  - 日志文件轮换过快,有用信息被覆盖
+  - 对系统的整体性能影响
+
+日志突发限制功能可以暂时禁用日志记录以避免这些问题。"""
+                        }
+                   label: {
+                           en: "Log Burst Limit"
+                           zh: "日志突发限制"
+                          }
+                  }
+
+    desc_authorization {
+                   desc {
+                         en: """Settings that control client authorization."""
                          zh: """"""
                          zh: """"""
                         }
                         }
                    label: {
                    label: {

+ 41 - 78
apps/emqx_conf/src/emqx_conf_schema.erl

@@ -661,12 +661,12 @@ fields("log") ->
     [ {"console_handler", ref("console_handler")}
     [ {"console_handler", ref("console_handler")}
     , {"file_handlers",
     , {"file_handlers",
        sc(map(name, ref("log_file_handler")),
        sc(map(name, ref("log_file_handler")),
-          #{desc => "Key-value list of file-based log handlers."})}
+          #{desc => ?DESC("log_file_handlers")})}
     , {"error_logger",
     , {"error_logger",
        sc(atom(),
        sc(atom(),
           #{mapping => "kernel.error_logger",
           #{mapping => "kernel.error_logger",
             default => silent,
             default => silent,
-            desc => "Deprecated."
+            desc => ?DESC("log_error_logger")
            })}
            })}
     ];
     ];
 
 
@@ -676,7 +676,7 @@ fields("console_handler") ->
 fields("log_file_handler") ->
 fields("log_file_handler") ->
     [ {"file",
     [ {"file",
        sc(file(),
        sc(file(),
-          #{ desc => "Name the log file."
+          #{ desc => ?DESC("log_file_handler_file")
            })}
            })}
     , {"rotation",
     , {"rotation",
        sc(ref("log_rotation"),
        sc(ref("log_rotation"),
@@ -684,9 +684,7 @@ fields("log_file_handler") ->
     , {"max_size",
     , {"max_size",
        sc(hoconsc:union([infinity, emqx_schema:bytesize()]),
        sc(hoconsc:union([infinity, emqx_schema:bytesize()]),
           #{ default => "10MB"
           #{ default => "10MB"
-           , desc => "This parameter controls log file rotation. "
-                     "The value `infinity` means the log file will grow indefinitely, "
-                     "otherwise the log file will be rotated once it reaches `max_size` in bytes."
+           , desc => ?DESC("log_file_handler_max_size")
            })}
            })}
     ] ++ log_handler_common_confs();
     ] ++ log_handler_common_confs();
 
 
@@ -694,12 +692,12 @@ fields("log_rotation") ->
     [ {"enable",
     [ {"enable",
        sc(boolean(),
        sc(boolean(),
           #{ default => true
           #{ default => true
-           , desc => "Enable log rotation feature."
+           , desc => ?DESC("log_rotation_enable")
            })}
            })}
     , {"count",
     , {"count",
        sc(range(1, 2048),
        sc(range(1, 2048),
           #{ default => 10
           #{ default => 10
-           , desc => "Maximum number of log files."
+           , desc => ?DESC("log_rotation_count")
            })}
            })}
     ];
     ];
 
 
@@ -707,23 +705,22 @@ fields("log_overload_kill") ->
     [ {"enable",
     [ {"enable",
        sc(boolean(),
        sc(boolean(),
           #{ default => true
           #{ default => true
-           , desc => "Enable log handler overload kill feature."
+           , desc => ?DESC("log_overload_kill_enable")
            })}
            })}
     , {"mem_size",
     , {"mem_size",
        sc(emqx_schema:bytesize(),
        sc(emqx_schema:bytesize(),
           #{ default => "30MB"
           #{ default => "30MB"
-           , desc => "Maximum memory size that the handler process is allowed to use."
+           , desc => ?DESC("log_overload_kill_mem_size")
            })}
            })}
     , {"qlen",
     , {"qlen",
        sc(integer(),
        sc(integer(),
           #{ default => 20000
           #{ default => 20000
-           , desc => "Maximum allowed queue length."
+           , desc => ?DESC("log_overload_kill_qlen")
            })}
            })}
     , {"restart_after",
     , {"restart_after",
        sc(hoconsc:union([emqx_schema:duration(), infinity]),
        sc(hoconsc:union([emqx_schema:duration(), infinity]),
           #{ default => "5s"
           #{ default => "5s"
-           , desc => "If the handler is terminated, it restarts automatically after a "
-                     "delay specified in milliseconds. The value `infinity` prevents restarts."
+           , desc => ?DESC("log_overload_kill_restart_after")
            })}
            })}
     ];
     ];
 
 
@@ -731,19 +728,17 @@ fields("log_burst_limit") ->
     [ {"enable",
     [ {"enable",
        sc(boolean(),
        sc(boolean(),
           #{ default => true
           #{ default => true
-           , desc => "Enable log burst control feature."
+           , desc => ?DESC("log_burst_limit_enable")
            })}
            })}
     , {"max_count",
     , {"max_count",
        sc(integer(),
        sc(integer(),
           #{ default => 10000
           #{ default => 10000
-           , desc => "Maximum number of log events to handle within a `window_time` interval. "
-                     "After the limit is reached, successive events are dropped "
-                     "until the end of the `window_time`."
+           , desc => ?DESC("log_burst_limit_max_count")
            })}
            })}
     , {"window_time",
     , {"window_time",
        sc(emqx_schema:duration(),
        sc(emqx_schema:duration(),
           #{ default => "1s"
           #{ default => "1s"
-           , desc => "See `max_count`."
+           , desc => ?DESC("log_burst_limit_window_time")
            })}
            })}
     ];
     ];
 
 
@@ -751,59 +746,40 @@ fields("authorization") ->
     emqx_schema:fields("authorization") ++
     emqx_schema:fields("authorization") ++
     emqx_authz_schema:fields("authorization").
     emqx_authz_schema:fields("authorization").
 
 
-
 desc("cluster") ->
 desc("cluster") ->
-    "EMQX nodes can form a cluster to scale up the total capacity.<br>"
-    "Here holds the configs to instruct how individual nodes "
-    "can discover each other.";
+    ?DESC("desc_cluster");
 desc(cluster_static) ->
 desc(cluster_static) ->
-     "Service discovery via static nodes. The new node joins the cluster by "
-     "connecting to one of the bootstrap nodes.";
+    ?DESC("desc_cluster_static");
 desc(cluster_mcast) ->
 desc(cluster_mcast) ->
-    "Service discovery via UDP multicast.";
+    ?DESC("desc_cluster_mcast");
 desc(cluster_dns) ->
 desc(cluster_dns) ->
-     "Service discovery via DNS SRV records.";
+    ?DESC("desc_cluster_dns");
 desc(cluster_etcd) ->
 desc(cluster_etcd) ->
-    "Service discovery using 'etcd' service.";
+    ?DESC("desc_cluster_etcd");
 desc(cluster_k8s) ->
 desc(cluster_k8s) ->
-    "Service discovery via Kubernetes API server.";
+    ?DESC("desc_cluster_k8s");
 desc("node") ->
 desc("node") ->
-    "Node name, cookie, config & data directories "
-    "and the Erlang virtual machine (BEAM) boot parameters.";
+    ?DESC("desc_node");
 desc("db") ->
 desc("db") ->
-    "Settings for the embedded database.";
+    ?DESC("desc_db");
 desc("cluster_call") ->
 desc("cluster_call") ->
-    "Options for the 'cluster call' feature that allows to execute a callback "
-    "on all nodes in the cluster.";
+    ?DESC("desc_cluster_call");
 desc("rpc") ->
 desc("rpc") ->
-    "EMQX uses a library called <code>gen_rpc</code> for "
-    "inter-broker communication.<br/>Most of the time the default config "
-    "should work, but in case you need to do performance "
-    "fine-tuning or experiment a bit, this is where to look.";
+    ?DESC("desc_rpc");
 desc("log") ->
 desc("log") ->
-    "EMQX logging supports multiple sinks for the log events."
-    " Each sink is represented by a _log handler_, which can be configured independently.";
+    ?DESC("desc_log");
 desc("console_handler") ->
 desc("console_handler") ->
-    "Log handler that prints log events to the EMQX console.";
+    ?DESC("desc_console_handler");
 desc("log_file_handler") ->
 desc("log_file_handler") ->
-    "Log handler that prints log events to files.";
+    ?DESC("desc_log_file_handler");
 desc("log_rotation") ->
 desc("log_rotation") ->
-    "By default, the logs are stored in `./log` directory (for installation from zip file)"
-    " or in `/var/log/emqx` (for binary installation).<br/>"
-    "This section of the configuration controls the number of files kept for each log handler.";
+    ?DESC("desc_log_rotation");
 desc("log_overload_kill") ->
 desc("log_overload_kill") ->
-    "Log overload kill features an overload protection that activates when"
-    " the log handlers use too much memory or have too many buffered log messages.<br/>"
-    "When the overload is detected, the log handler is terminated and restarted after a"
-    " cooldown period.";
+    ?DESC("desc_log_overload_kill");
 desc("log_burst_limit") ->
 desc("log_burst_limit") ->
-    "Large bursts of log events produced in a short time can potentially cause problems, such as:\n"
-     " - Log files grow very large\n"
-     " - Log files are rotated too quickly, and useful information gets overwritten\n"
-     " - Overall performance impact on the system\n\n"
-    "Log burst limit feature can temporarily disable logging to avoid these issues.";
+    ?DESC("desc_log_burst_limit");
 desc("authorization") ->
 desc("authorization") ->
-    "Settings that control client authorization.";
+    ?DESC("desc_authorization");
 desc(_) ->
 desc(_) ->
     undefined.
     undefined.
 
 
@@ -913,57 +889,47 @@ log_handler_common_confs() ->
     [ {"enable",
     [ {"enable",
        sc(boolean(),
        sc(boolean(),
           #{ default => false
           #{ default => false
-           , desc => "Enable this log handler."
+           , desc => ?DESC("log_file_handler_enable")
            })}
            })}
     , {"level",
     , {"level",
        sc(log_level(),
        sc(log_level(),
           #{ default => warning
           #{ default => warning
-           , desc => "Global log level. This includes the primary log level "
-                     "and all log handlers."
+           , desc => ?DESC("log_file_handler_level")
            })}
            })}
     , {"time_offset",
     , {"time_offset",
        sc(string(),
        sc(string(),
           #{ default => "system"
           #{ default => "system"
-           , desc => "The time offset to be used when formatting the timestamp."
+           , desc => ?DESC("log_file_handler_time_offset")
            })}
            })}
     , {"chars_limit",
     , {"chars_limit",
        sc(hoconsc:union([unlimited, range(1, inf)]),
        sc(hoconsc:union([unlimited, range(1, inf)]),
           #{ default => unlimited
           #{ default => unlimited
-           , desc => "Set the maximum length of a single log message. "
-                     "If this length is exceeded, the log message will be truncated."
+           , desc => ?DESC("log_file_handler_chars_limit")
            })}
            })}
     , {"formatter",
     , {"formatter",
        sc(hoconsc:enum([text, json]),
        sc(hoconsc:enum([text, json]),
           #{ default => text
           #{ default => text
-           , desc => "Choose log format. <code>text</code> for free text, and "
-                     "<code>json</code> for structured logging."
+           , desc => ?DESC("log_file_handler_formatter")
            })}
            })}
     , {"single_line",
     , {"single_line",
        sc(boolean(),
        sc(boolean(),
           #{ default => true
           #{ default => true
-           , desc => "Print logs in a single line if set to true. "
-                     "Otherwise, log messages may span multiple lines."
+           , desc => ?DESC("log_file_handler_single_line")
            })}
            })}
     , {"sync_mode_qlen",
     , {"sync_mode_qlen",
        sc(integer(),
        sc(integer(),
           #{ default => 100
           #{ default => 100
-           , desc => "As long as the number of buffered log events is lower than this value, "
-                     "all log events are handled asynchronously."
+           , desc => ?DESC("log_file_handler_sync_mode_qlen")
            })}
            })}
     , {"drop_mode_qlen",
     , {"drop_mode_qlen",
        sc(integer(),
        sc(integer(),
           #{ default => 3000
           #{ default => 3000
-           , desc => "When the number of buffered log events is larger than this value, "
-                     "the new log events are dropped.<br/>"
-                     "When drop mode is activated or deactivated, a message is printed in "
-                     "the logs."
+           , desc => ?DESC("log_file_handler_drop_mode_qlen")
            })}
            })}
     , {"flush_qlen",
     , {"flush_qlen",
        sc(integer(),
        sc(integer(),
           #{ default => 8000
           #{ default => 8000
-           , desc => "If the number of buffered log events grows larger than this threshold, "
-                     "a flush (delete) operation takes place. "
-                     "To flush events, the handler discards the buffered log messages without logging."
+           , desc => ?DESC("log_file_handler_flush_qlen")
            })}
            })}
     , {"overload_kill",
     , {"overload_kill",
        sc(ref("log_overload_kill"), #{})}
        sc(ref("log_overload_kill"), #{})}
@@ -972,15 +938,12 @@ log_handler_common_confs() ->
     , {"supervisor_reports",
     , {"supervisor_reports",
        sc(hoconsc:enum([error, progress]),
        sc(hoconsc:enum([error, progress]),
           #{ default => error
           #{ default => error
-           , desc => "Type of supervisor reports that are logged.\n"
-                     " - `error`: only log errors in the Erlang processes.\n"
-                     " - `progress`: log process startup."
+           , desc => ?DESC("log_file_handler_supervisor_reports")
            })}
            })}
     , {"max_depth",
     , {"max_depth",
        sc(hoconsc:union([unlimited, non_neg_integer()]),
        sc(hoconsc:union([unlimited, non_neg_integer()]),
           #{ default => 100
           #{ default => 100
-           , desc => "Maximum depth for Erlang term log formatting "
-                     "and Erlang process message queue inspection."
+           , desc => ?DESC("log_file_handler_max_depth")
            })}
            })}
     ].
     ].
 
 

+ 1 - 1
apps/emqx_connector/i18n/emqx_connector_schema_lib.conf

@@ -3,7 +3,7 @@ emqx_connector_schema_lib {
     ssl {
     ssl {
         desc {
         desc {
           en: "SSL connection settings."
           en: "SSL connection settings."
-          zh: "SSL 连接设置。"
+          zh: "启用 SSL 连接。"
         }
         }
         label: {
         label: {
               en: "Enable SSL"
               en: "Enable SSL"