Selaa lähdekoodia

Merge pull request #10262 from zmstone/0328-move-i18n-files-to-one-dir

0328 move i18n files to one dir
Zaiming (Stone) Shi 2 vuotta sitten
vanhempi
commit
082dfc02c9
97 muutettua tiedostoa jossa 56 lisäystä ja 131 poistoa
  1. 1 1
      Makefile
  2. 17 17
      apps/emqx_gateway/src/emqx_gateway_schema.erl
  3. 1 1
      lib-ee/emqx_ee_bridge/src/emqx_ee_bridge_kafka.erl
  4. 0 0
      rel/i18n/emqx_authn_api.hocon
  5. 0 0
      rel/i18n/emqx_authn_http.hocon
  6. 0 0
      rel/i18n/emqx_authn_jwt.hocon
  7. 0 0
      rel/i18n/emqx_authn_mnesia.hocon
  8. 0 0
      rel/i18n/emqx_authn_mongodb.hocon
  9. 0 0
      rel/i18n/emqx_authn_mysql.hocon
  10. 0 0
      rel/i18n/emqx_authn_pgsql.hocon
  11. 0 0
      rel/i18n/emqx_authn_redis.hocon
  12. 0 0
      rel/i18n/emqx_authn_schema.hocon
  13. 0 0
      rel/i18n/emqx_authn_user_import_api.hocon
  14. 0 0
      rel/i18n/emqx_authz_api_cache.hocon
  15. 0 0
      rel/i18n/emqx_authz_api_mnesia.hocon
  16. 0 0
      rel/i18n/emqx_authz_api_schema.hocon
  17. 0 0
      rel/i18n/emqx_authz_api_settings.hocon
  18. 0 0
      rel/i18n/emqx_authz_api_sources.hocon
  19. 0 0
      rel/i18n/emqx_authz_schema.hocon
  20. 0 0
      rel/i18n/emqx_auto_subscribe_api.hocon
  21. 0 0
      rel/i18n/emqx_auto_subscribe_schema.hocon
  22. 0 0
      rel/i18n/emqx_bridge_api.hocon
  23. 0 0
      rel/i18n/emqx_bridge_mqtt_schema.hocon
  24. 0 0
      rel/i18n/emqx_bridge_schema.hocon
  25. 0 0
      rel/i18n/emqx_bridge_webhook_schema.hocon
  26. 0 0
      rel/i18n/emqx_coap_api.hocon
  27. 0 0
      rel/i18n/emqx_conf_schema.hocon
  28. 0 0
      rel/i18n/emqx_connector_api.hocon
  29. 0 0
      rel/i18n/emqx_connector_http.hocon
  30. 0 0
      rel/i18n/emqx_connector_ldap.hocon
  31. 0 0
      rel/i18n/emqx_connector_mongo.hocon
  32. 0 0
      rel/i18n/emqx_connector_mqtt.hocon
  33. 0 0
      rel/i18n/emqx_connector_mqtt_schema.hocon
  34. 0 0
      rel/i18n/emqx_connector_mysql.hocon
  35. 0 0
      rel/i18n/emqx_connector_pgsql.hocon
  36. 0 0
      rel/i18n/emqx_connector_redis.hocon
  37. 0 0
      rel/i18n/emqx_connector_schema_lib.hocon
  38. 0 0
      rel/i18n/emqx_dashboard_api.hocon
  39. 0 0
      rel/i18n/emqx_dashboard_schema.hocon
  40. 0 0
      rel/i18n/emqx_delayed_api.hocon
  41. 0 0
      rel/i18n/emqx_ee_bridge_cassa.hocon
  42. 2 4
      lib-ee/emqx_ee_bridge/i18n/emqx_ee_bridge_clickhouse.conf
  43. 0 0
      rel/i18n/emqx_ee_bridge_dynamo.hocon
  44. 0 0
      rel/i18n/emqx_ee_bridge_gcp_pubsub.hocon
  45. 0 0
      rel/i18n/emqx_ee_bridge_hstreamdb.hocon
  46. 0 0
      rel/i18n/emqx_ee_bridge_influxdb.hocon
  47. 2 2
      lib-ee/emqx_ee_bridge/i18n/emqx_ee_bridge_kafka.conf
  48. 0 0
      rel/i18n/emqx_ee_bridge_mongodb.hocon
  49. 0 0
      rel/i18n/emqx_ee_bridge_mysql.hocon
  50. 0 0
      rel/i18n/emqx_ee_bridge_pgsql.hocon
  51. 0 0
      rel/i18n/emqx_ee_bridge_redis.hocon
  52. 0 0
      rel/i18n/emqx_ee_bridge_rocketmq.hocon
  53. 2 4
      lib-ee/emqx_ee_bridge/i18n/emqx_ee_bridge_tdengine.conf
  54. 0 0
      rel/i18n/emqx_ee_connector_cassa.hocon
  55. 0 1
      lib-ee/emqx_ee_connector/i18n/emqx_ee_connector_clickhouse.conf
  56. 2 2
      lib-ee/emqx_ee_connector/i18n/emqx_ee_connector_dynamo.conf
  57. 0 0
      rel/i18n/emqx_ee_connector_hstreamdb.hocon
  58. 0 0
      rel/i18n/emqx_ee_connector_influxdb.hocon
  59. 4 8
      lib-ee/emqx_ee_connector/i18n/emqx_ee_connector_rocketmq.conf
  60. 4 8
      lib-ee/emqx_ee_connector/i18n/emqx_ee_connector_tdengine.conf
  61. 0 0
      rel/i18n/emqx_exhook_api.hocon
  62. 0 0
      rel/i18n/emqx_exhook_schema.hocon
  63. 0 0
      rel/i18n/emqx_gateway_api.hocon
  64. 0 0
      rel/i18n/emqx_gateway_api_authn.hocon
  65. 0 0
      rel/i18n/emqx_gateway_api_clients.hocon
  66. 0 0
      rel/i18n/emqx_gateway_api_listeners.hocon
  67. 4 32
      apps/emqx_gateway/i18n/emqx_gateway_schema_i18n.conf
  68. 0 0
      rel/i18n/emqx_license_http_api.hocon
  69. 0 0
      rel/i18n/emqx_license_schema.hocon
  70. 0 0
      rel/i18n/emqx_limiter_schema.hocon
  71. 0 0
      rel/i18n/emqx_lwm2m_api.hocon
  72. 0 0
      rel/i18n/emqx_mgmt_api_alarms.hocon
  73. 0 0
      rel/i18n/emqx_mgmt_api_banned.hocon
  74. 0 0
      rel/i18n/emqx_mgmt_api_key_schema.hocon
  75. 0 1
      apps/emqx_management/i18n/emqx_mgmt_api_publish_i18n.conf
  76. 0 0
      rel/i18n/emqx_mgmt_api_status.hocon
  77. 0 0
      rel/i18n/emqx_modules_schema.hocon
  78. 0 0
      rel/i18n/emqx_plugins_schema.hocon
  79. 0 0
      rel/i18n/emqx_prometheus_schema.hocon
  80. 0 0
      rel/i18n/emqx_psk_schema.hocon
  81. 0 0
      rel/i18n/emqx_resource_schema.hocon
  82. 0 0
      rel/i18n/emqx_retainer_api.hocon
  83. 0 0
      rel/i18n/emqx_retainer_schema.hocon
  84. 0 0
      rel/i18n/emqx_rewrite_api.hocon
  85. 2 2
      apps/emqx_rule_engine/i18n/emqx_rule_api_schema.conf
  86. 0 0
      rel/i18n/emqx_rule_engine_api.hocon
  87. 0 0
      rel/i18n/emqx_rule_engine_schema.hocon
  88. 2 2
      apps/emqx/i18n/emqx_schema_i18n.conf
  89. 0 0
      rel/i18n/emqx_slow_subs_api.hocon
  90. 0 0
      rel/i18n/emqx_slow_subs_schema.hocon
  91. 0 0
      rel/i18n/emqx_statsd_api.hocon
  92. 0 0
      rel/i18n/emqx_statsd_schema.hocon
  93. 0 0
      rel/i18n/emqx_telemetry_api.hocon
  94. 0 0
      rel/i18n/emqx_topic_metrics_api.hocon
  95. 6 3
      scripts/check-i18n-style.escript
  96. 1 1
      scripts/check-i18n-style.sh
  97. 6 42
      scripts/merge-i18n.escript

+ 1 - 1
Makefile

@@ -82,7 +82,7 @@ ct: $(REBAR) merge-config
 static_checks:
 	@$(REBAR) as check do xref, dialyzer
 	@if [ "$${PROFILE}" = 'emqx-enterprise' ]; then $(REBAR) ct --suite apps/emqx/test/emqx_static_checks --readable $(CT_READABLE); fi
-	@if [ "$${PROFILE}" = 'emqx-enterprise' ]; then ./scripts/check-i18n-style.sh; fi
+	./scripts/check-i18n-style.sh
 
 APPS=$(shell $(SCRIPTS)/find-apps.sh)
 

+ 17 - 17
apps/emqx_gateway/src/emqx_gateway_schema.erl

@@ -453,20 +453,20 @@ fields(translator) ->
     ];
 fields(udp_listeners) ->
     [
-        {udp, sc(map(name, ref(udp_listener)), #{desc => ?DESC(udp_listener)})},
-        {dtls, sc(map(name, ref(dtls_listener)), #{desc => ?DESC(dtls_listener)})}
+        {udp, sc(map(name, ref(udp_listener)), #{desc => ?DESC(listener_name_to_settings_map)})},
+        {dtls, sc(map(name, ref(dtls_listener)), #{desc => ?DESC(listener_name_to_settings_map)})}
     ];
 fields(tcp_listeners) ->
     [
-        {tcp, sc(map(name, ref(tcp_listener)), #{desc => ?DESC(tcp_listener)})},
-        {ssl, sc(map(name, ref(ssl_listener)), #{desc => ?DESC(ssl_listener)})}
+        {tcp, sc(map(name, ref(tcp_listener)), #{desc => ?DESC(listener_name_to_settings_map)})},
+        {ssl, sc(map(name, ref(ssl_listener)), #{desc => ?DESC(listener_name_to_settings_map)})}
     ];
 fields(tcp_udp_listeners) ->
     [
-        {tcp, sc(map(name, ref(tcp_listener)), #{desc => ?DESC(tcp_listener)})},
-        {ssl, sc(map(name, ref(ssl_listener)), #{desc => ?DESC(ssl_listener)})},
-        {udp, sc(map(name, ref(udp_listener)), #{desc => ?DESC(udp_listener)})},
-        {dtls, sc(map(name, ref(dtls_listener)), #{desc => ?DESC(dtls_listener)})}
+        {tcp, sc(map(name, ref(tcp_listener)), #{desc => ?DESC(listener_name_to_settings_map)})},
+        {ssl, sc(map(name, ref(ssl_listener)), #{desc => ?DESC(listener_name_to_settings_map)})},
+        {udp, sc(map(name, ref(udp_listener)), #{desc => ?DESC(listener_name_to_settings_map)})},
+        {dtls, sc(map(name, ref(dtls_listener)), #{desc => ?DESC(listener_name_to_settings_map)})}
     ];
 fields(tcp_listener) ->
     %% some special configs for tcp listener
@@ -558,19 +558,19 @@ desc(udp_listeners) ->
 desc(tcp_listeners) ->
     "Settings for the TCP listeners.";
 desc(tcp_udp_listeners) ->
-    "Settings for the listeners.";
+    "Settings for TCP and UDP listeners.";
 desc(tcp_listener) ->
-    "Settings for the TCP listener.";
+    "Settings for TCP listener.";
 desc(ssl_listener) ->
-    "Settings for the SSL listener.";
+    "Settings for SSL listener.";
 desc(udp_listener) ->
-    "Settings for the UDP listener.";
+    "Settings for UDP listener.";
 desc(dtls_listener) ->
-    "Settings for the DTLS listener.";
+    "Settings for DTLS listener.";
 desc(udp_opts) ->
-    "Settings for the UDP sockets.";
+    "Settings for UDP sockets.";
 desc(dtls_opts) ->
-    "Settings for the DTLS protocol.";
+    "Settings for DTLS protocol.";
 desc(_) ->
     undefined.
 
@@ -625,7 +625,7 @@ mountpoint(Default) ->
         binary(),
         #{
             default => iolist_to_binary(Default),
-            desc => ?DESC(gateway_common_mountpoint)
+            desc => ?DESC(gateway_mountpoint)
         }
     ).
 
@@ -674,7 +674,7 @@ common_listener_opts() ->
                 binary(),
                 #{
                     default => undefined,
-                    desc => ?DESC(gateway_common_listener_mountpoint)
+                    desc => ?DESC(gateway_mountpoint)
                 }
             )},
         {access_rules,

+ 1 - 1
lib-ee/emqx_ee_bridge/src/emqx_ee_bridge_kafka.erl

@@ -233,7 +233,7 @@ fields(socket_opts) ->
                 boolean(),
                 #{
                     default => true,
-                    hidden => true,
+                    importance => ?IMPORTANCE_HIDDEN,
                     desc => ?DESC(socket_nodelay)
                 }
             )}

apps/emqx_authn/i18n/emqx_authn_api_i18n.conf → rel/i18n/emqx_authn_api.hocon


apps/emqx_authn/i18n/emqx_authn_http_i18n.conf → rel/i18n/emqx_authn_http.hocon


apps/emqx_authn/i18n/emqx_authn_jwt_i18n.conf → rel/i18n/emqx_authn_jwt.hocon


apps/emqx_authn/i18n/emqx_authn_mnesia_i18n.conf → rel/i18n/emqx_authn_mnesia.hocon


apps/emqx_authn/i18n/emqx_authn_mongodb_i18n.conf → rel/i18n/emqx_authn_mongodb.hocon


apps/emqx_authn/i18n/emqx_authn_mysql_i18n.conf → rel/i18n/emqx_authn_mysql.hocon


apps/emqx_authn/i18n/emqx_authn_pgsql_i18n.conf → rel/i18n/emqx_authn_pgsql.hocon


apps/emqx_authn/i18n/emqx_authn_redis_i18n.conf → rel/i18n/emqx_authn_redis.hocon


apps/emqx_authn/i18n/emqx_authn_schema_i18n.conf → rel/i18n/emqx_authn_schema.hocon


apps/emqx_authn/i18n/emqx_authn_user_import_api_i18n.conf → rel/i18n/emqx_authn_user_import_api.hocon


apps/emqx_authz/i18n/emqx_authz_api_cache_i18n.conf → rel/i18n/emqx_authz_api_cache.hocon


apps/emqx_authz/i18n/emqx_authz_api_mnesia_i18n.conf → rel/i18n/emqx_authz_api_mnesia.hocon


apps/emqx_authz/i18n/emqx_authz_api_schema_i18n.conf → rel/i18n/emqx_authz_api_schema.hocon


apps/emqx_authz/i18n/emqx_authz_api_settings_i18n.conf → rel/i18n/emqx_authz_api_settings.hocon


apps/emqx_authz/i18n/emqx_authz_api_sources_i18n.conf → rel/i18n/emqx_authz_api_sources.hocon


apps/emqx_authz/i18n/emqx_authz_schema_i18n.conf → rel/i18n/emqx_authz_schema.hocon


apps/emqx_auto_subscribe/i18n/emqx_auto_subscribe_api_i18n.conf → rel/i18n/emqx_auto_subscribe_api.hocon


apps/emqx_auto_subscribe/i18n/emqx_auto_subscribe_i18n.conf → rel/i18n/emqx_auto_subscribe_schema.hocon


apps/emqx_bridge/i18n/emqx_bridge_api.conf → rel/i18n/emqx_bridge_api.hocon


apps/emqx_bridge/i18n/emqx_bridge_mqtt_schema.conf → rel/i18n/emqx_bridge_mqtt_schema.hocon


apps/emqx_bridge/i18n/emqx_bridge_schema.conf → rel/i18n/emqx_bridge_schema.hocon


apps/emqx_bridge/i18n/emqx_bridge_webhook_schema.conf → rel/i18n/emqx_bridge_webhook_schema.hocon


apps/emqx_gateway/i18n/emqx_coap_api_i18n.conf → rel/i18n/emqx_coap_api.hocon


apps/emqx_conf/i18n/emqx_conf_schema.conf → rel/i18n/emqx_conf_schema.hocon


apps/emqx_connector/i18n/emqx_connector_api.conf → rel/i18n/emqx_connector_api.hocon


apps/emqx_connector/i18n/emqx_connector_http.conf → rel/i18n/emqx_connector_http.hocon


apps/emqx_connector/i18n/emqx_connector_ldap.conf → rel/i18n/emqx_connector_ldap.hocon


apps/emqx_connector/i18n/emqx_connector_mongo.conf → rel/i18n/emqx_connector_mongo.hocon


apps/emqx_connector/i18n/emqx_connector_mqtt.conf → rel/i18n/emqx_connector_mqtt.hocon


apps/emqx_connector/i18n/emqx_connector_mqtt_schema.conf → rel/i18n/emqx_connector_mqtt_schema.hocon


apps/emqx_connector/i18n/emqx_connector_mysql.conf → rel/i18n/emqx_connector_mysql.hocon


apps/emqx_connector/i18n/emqx_connector_pgsql.conf → rel/i18n/emqx_connector_pgsql.hocon


apps/emqx_connector/i18n/emqx_connector_redis.conf → rel/i18n/emqx_connector_redis.hocon


apps/emqx_connector/i18n/emqx_connector_schema_lib.conf → rel/i18n/emqx_connector_schema_lib.hocon


apps/emqx_dashboard/i18n/emqx_dashboard_api_i18n.conf → rel/i18n/emqx_dashboard_api.hocon


apps/emqx_dashboard/i18n/emqx_dashboard_i18n.conf → rel/i18n/emqx_dashboard_schema.hocon


apps/emqx_modules/i18n/emqx_delayed_api_i18n.conf → rel/i18n/emqx_delayed_api.hocon


lib-ee/emqx_ee_bridge/i18n/emqx_ee_bridge_cassa.conf → rel/i18n/emqx_ee_bridge_cassa.hocon


+ 2 - 4
lib-ee/emqx_ee_bridge/i18n/emqx_ee_bridge_clickhouse.conf

@@ -6,11 +6,9 @@ emqx_ee_bridge_clickhouse {
 matching the local_topic will be forwarded.</br>
 NOTE: if this bridge is used as the action of a rule (EMQX rule engine), and also local_topic is
 configured, then both the data got from the rule and the MQTT messages that match local_topic
-will be forwarded.
-"""
+will be forwarded."""
             zh: """发送到 'local_topic' 的消息都会转发到 Clickhouse。 </br>
-注意:如果这个 Bridge 被用作规则(EMQX 规则引擎)的输出,同时也配置了 'local_topic' ,那么这两部分的消息都会被转发。
-"""
+注意:如果这个 Bridge 被用作规则(EMQX 规则引擎)的输出,同时也配置了 'local_topic' ,那么这两部分的消息都会被转发。"""
         }
         label {
                 en: "Local Topic"

lib-ee/emqx_ee_bridge/i18n/emqx_ee_bridge_dynamo.conf → rel/i18n/emqx_ee_bridge_dynamo.hocon


lib-ee/emqx_ee_bridge/i18n/emqx_ee_bridge_gcp_pubsub.conf → rel/i18n/emqx_ee_bridge_gcp_pubsub.hocon


lib-ee/emqx_ee_bridge/i18n/emqx_ee_bridge_hstreamdb.conf → rel/i18n/emqx_ee_bridge_hstreamdb.hocon


lib-ee/emqx_ee_bridge/i18n/emqx_ee_bridge_influxdb.conf → rel/i18n/emqx_ee_bridge_influxdb.hocon


+ 2 - 2
lib-ee/emqx_ee_bridge/i18n/emqx_ee_bridge_kafka.conf

@@ -547,7 +547,7 @@ emqx_ee_bridge_kafka {
                 "<code>ts</code>: message timestamp.\n"
                 "<code>ts_type</code>: message timestamp type, which is one of"
                 " <code>create</code>, <code>append</code> or <code>undefined</code>.\n"
-                "<code>value</code>: Kafka message value (uses the chosen value encoding).\n"
+                "<code>value</code>: Kafka message value (uses the chosen value encoding)."
             zh: "用于转换收到的 Kafka 消息的模板。 "
                 "默认情况下,它将使用 JSON 格式来序列化来自 Kafka 的所有字段。 "
                 "这些字段包括:"
@@ -558,7 +558,7 @@ emqx_ee_bridge_kafka {
                 "<code>ts</code>: 消息的时间戳。\n"
                 "<code>ts_type</code>:消息的时间戳类型,值可能是:"
                 " <code>create</code>, <code>append</code> 或 <code>undefined</code>。\n"
-                "<code>value</code>: Kafka 消息值(使用选择的编码方式编码)。\n"
+                "<code>value</code>: Kafka 消息值(使用选择的编码方式编码)。"
 
         }
         label {

lib-ee/emqx_ee_bridge/i18n/emqx_ee_bridge_mongodb.conf → rel/i18n/emqx_ee_bridge_mongodb.hocon


lib-ee/emqx_ee_bridge/i18n/emqx_ee_bridge_mysql.conf → rel/i18n/emqx_ee_bridge_mysql.hocon


lib-ee/emqx_ee_bridge/i18n/emqx_ee_bridge_pgsql.conf → rel/i18n/emqx_ee_bridge_pgsql.hocon


lib-ee/emqx_ee_bridge/i18n/emqx_ee_bridge_redis.conf → rel/i18n/emqx_ee_bridge_redis.hocon


lib-ee/emqx_ee_bridge/i18n/emqx_ee_bridge_rocketmq.conf → rel/i18n/emqx_ee_bridge_rocketmq.hocon


+ 2 - 4
lib-ee/emqx_ee_bridge/i18n/emqx_ee_bridge_tdengine.conf

@@ -6,11 +6,9 @@ emqx_ee_bridge_tdengine {
 matching the local_topic will be forwarded.</br>
 NOTE: if this bridge is used as the action of a rule (EMQX rule engine), and also local_topic is
 configured, then both the data got from the rule and the MQTT messages that match local_topic
-will be forwarded.
-"""
+will be forwarded."""
             zh: """发送到 'local_topic' 的消息都会转发到 TDengine。 </br>
-注意:如果这个 Bridge 被用作规则(EMQX 规则引擎)的输出,同时也配置了 'local_topic' ,那么这两部分的消息都会被转发。
-"""
+注意:如果这个 Bridge 被用作规则(EMQX 规则引擎)的输出,同时也配置了 'local_topic' ,那么这两部分的消息都会被转发。"""
         }
         label {
                 en: "Local Topic"

lib-ee/emqx_ee_connector/i18n/emqx_ee_connector_cassa.conf → rel/i18n/emqx_ee_connector_cassa.hocon


+ 0 - 1
lib-ee/emqx_ee_connector/i18n/emqx_ee_connector_clickhouse.conf

@@ -1,4 +1,3 @@
-
 emqx_ee_connector_clickhouse {
 
     base_url {

+ 2 - 2
lib-ee/emqx_ee_connector/i18n/emqx_ee_connector_dynamo.conf

@@ -2,8 +2,8 @@ emqx_ee_connector_dynamo {
 
     url {
         desc {
-          en: """The url of DynamoDB endpoint.<br/>"""
-          zh: """DynamoDB 的地址。<br/>"""
+          en: """The url of DynamoDB endpoint."""
+          zh: """DynamoDB 的地址。"""
         }
         label: {
               en: "DynamoDB Endpoint"

lib-ee/emqx_ee_connector/i18n/emqx_ee_connector_hstreamdb.conf → rel/i18n/emqx_ee_connector_hstreamdb.hocon


lib-ee/emqx_ee_connector/i18n/emqx_ee_connector_influxdb.conf → rel/i18n/emqx_ee_connector_influxdb.hocon


+ 4 - 8
lib-ee/emqx_ee_connector/i18n/emqx_ee_connector_rocketmq.conf

@@ -2,16 +2,12 @@ emqx_ee_connector_rocketmq {
 
     server {
         desc {
-          en: """
-The IPv4 or IPv6 address or the hostname to connect to.<br/>
+          en: """The IPv4 or IPv6 address or the hostname to connect to.<br/>
 A host entry has the following form: `Host[:Port]`.<br/>
-The RocketMQ default port 9876 is used if `[:Port]` is not specified.
-"""
-          zh: """
-将要连接的 IPv4 或 IPv6 地址,或者主机名。<br/>
+The RocketMQ default port 9876 is used if `[:Port]` is not specified."""
+          zh: """将要连接的 IPv4 或 IPv6 地址,或者主机名。<br/>
 主机名具有以下形式:`Host[:Port]`。<br/>
-如果未指定 `[:Port]`,则使用 RocketMQ 默认端口 9876。
-"""
+如果未指定 `[:Port]`,则使用 RocketMQ 默认端口 9876。"""
         }
         label: {
               en: "Server Host"

+ 4 - 8
lib-ee/emqx_ee_connector/i18n/emqx_ee_connector_tdengine.conf

@@ -2,16 +2,12 @@ emqx_ee_connector_tdengine {
 
     server {
         desc {
-          en: """
-The IPv4 or IPv6 address or the hostname to connect to.<br/>
+          en: """The IPv4 or IPv6 address or the hostname to connect to.<br/>
 A host entry has the following form: `Host[:Port]`.<br/>
-The TDengine default port 6041 is used if `[:Port]` is not specified.
-"""
-          zh: """
-将要连接的 IPv4 或 IPv6 地址,或者主机名。<br/>
+The TDengine default port 6041 is used if `[:Port]` is not specified."""
+          zh: """将要连接的 IPv4 或 IPv6 地址,或者主机名。<br/>
 主机名具有以下形式:`Host[:Port]`。<br/>
-如果未指定 `[:Port]`,则使用 TDengine 默认端口 6041。
-"""
+如果未指定 `[:Port]`,则使用 TDengine 默认端口 6041。"""
         }
         label: {
               en: "Server Host"

apps/emqx_exhook/i18n/emqx_exhook_api_i18n.conf → rel/i18n/emqx_exhook_api.hocon


apps/emqx_exhook/i18n/emqx_exhook_i18n.conf → rel/i18n/emqx_exhook_schema.hocon


apps/emqx_gateway/i18n/emqx_gateway_api_i18n.conf → rel/i18n/emqx_gateway_api.hocon


apps/emqx_gateway/i18n/emqx_gateway_api_authn_i18n.conf → rel/i18n/emqx_gateway_api_authn.hocon


apps/emqx_gateway/i18n/emqx_gateway_api_clients_i18n.conf → rel/i18n/emqx_gateway_api_clients.hocon


apps/emqx_gateway/i18n/emqx_gateway_api_listeners_i18n.conf → rel/i18n/emqx_gateway_api_listeners.hocon


+ 4 - 32
apps/emqx_gateway/i18n/emqx_gateway_schema_i18n.conf

@@ -370,13 +370,6 @@ After succeed observe a resource of LwM2M client, Gateway will send the notify e
         }
     }
 
-    gateway_common_mountpoint {
-        desc {
-            en: """"""
-            zh: """"""
-        }
-    }
-
     gateway_common_clientinfo_override {
         desc {
             en: """ClientInfo override."""
@@ -431,10 +424,10 @@ After succeed observe a resource of LwM2M client, Gateway will send the notify e
         }
     }
 
-    tcp_listener {
+    listener_name_to_settings_map{
         desc {
-            en: """"""
-            zh: """"""
+            en: """A map from listener names to listener settings."""
+            zh: """从监听器名称到配置参数的映射。"""
         }
     }
 
@@ -468,13 +461,6 @@ EMQX will close the TCP connection if proxy protocol packet is not received with
         }
     }
 
-    ssl_listener {
-        desc {
-            en: """"""
-            zh: """"""
-        }
-    }
-
     ssl_listener_options {
         desc {
             en: """SSL Socket options."""
@@ -482,13 +468,6 @@ EMQX will close the TCP connection if proxy protocol packet is not received with
         }
     }
 
-    udp_listener {
-        desc {
-            en: """"""
-            zh: """"""
-        }
-    }
-
     udp_listener_udp_opts {
         desc {
             en: """Settings for the UDP sockets."""
@@ -533,13 +512,6 @@ See: https://erlang.org/doc/man/inet.html#setopts-2"""
         }
     }
 
-    dtls_listener {
-        desc {
-            en: """"""
-            zh: """"""
-        }
-    }
-
     dtls_listener_acceptors {
         desc {
             en: """Size of the acceptor pool."""
@@ -592,7 +564,7 @@ When set to <code>false</code> clients will be allowed to connect without authen
         }
     }
 
-    gateway_common_listener_mountpoint {
+    gateway_mountpoint {
         desc {
             en: """When publishing or subscribing, prefix all topics with a mountpoint string.
 The prefixed string will be removed from the topic name when the message is delivered to the subscriber.

lib-ee/emqx_license/i18n/emqx_license_http_api.conf → rel/i18n/emqx_license_http_api.hocon


lib-ee/emqx_license/i18n/emqx_license_schema_i18n.conf → rel/i18n/emqx_license_schema.hocon


apps/emqx/i18n/emqx_limiter_i18n.conf → rel/i18n/emqx_limiter_schema.hocon


apps/emqx_gateway/i18n/emqx_lwm2m_api_i18n.conf → rel/i18n/emqx_lwm2m_api.hocon


apps/emqx_management/i18n/emqx_mgmt_api_alarms_i18n.conf → rel/i18n/emqx_mgmt_api_alarms.hocon


apps/emqx_management/i18n/emqx_mgmt_api_banned_i18n.conf → rel/i18n/emqx_mgmt_api_banned.hocon


apps/emqx_management/i18n/emqx_mgmt_api_key_i18n.conf → rel/i18n/emqx_mgmt_api_key_schema.hocon


+ 0 - 1
apps/emqx_management/i18n/emqx_mgmt_api_publish_i18n.conf

@@ -1,4 +1,3 @@
-
 emqx_mgmt_api_publish {
     publish_api {
         desc {

apps/emqx_management/i18n/emqx_mgmt_api_status_i18n.conf → rel/i18n/emqx_mgmt_api_status.hocon


apps/emqx_modules/i18n/emqx_modules_schema_i18n.conf → rel/i18n/emqx_modules_schema.hocon


apps/emqx_plugins/i18n/emqx_plugins_schema.conf → rel/i18n/emqx_plugins_schema.hocon


apps/emqx_prometheus/i18n/emqx_prometheus_schema_i18n.conf → rel/i18n/emqx_prometheus_schema.hocon


apps/emqx_psk/i18n/emqx_psk_i18n.conf → rel/i18n/emqx_psk_schema.hocon


apps/emqx_resource/i18n/emqx_resource_schema_i18n.conf → rel/i18n/emqx_resource_schema.hocon


apps/emqx_retainer/i18n/emqx_retainer_api_i18n.conf → rel/i18n/emqx_retainer_api.hocon


apps/emqx_retainer/i18n/emqx_retainer_i18n.conf → rel/i18n/emqx_retainer_schema.hocon


apps/emqx_modules/i18n/emqx_rewrite_api_i18n.conf → rel/i18n/emqx_rewrite_api.hocon


+ 2 - 2
apps/emqx_rule_engine/i18n/emqx_rule_api_schema.conf

@@ -35,8 +35,8 @@ emqx_rule_api_schema {
 
     event_username {
                    desc {
-                         en: "The User Name"
-                         zh: ""
+                         en: "Username"
+                         zh: "用户名"
                         }
                    label: {
                            en: "Username"

apps/emqx_rule_engine/i18n/emqx_rule_engine_api.conf → rel/i18n/emqx_rule_engine_api.hocon


apps/emqx_rule_engine/i18n/emqx_rule_engine_schema.conf → rel/i18n/emqx_rule_engine_schema.hocon


+ 2 - 2
apps/emqx/i18n/emqx_schema_i18n.conf

@@ -1505,8 +1505,8 @@ In case PSK cipher suites are intended, make sure to configure
 
 common_ssl_opts_schema_hibernate_after {
     desc {
-        en: """ Hibernate the SSL process after idling for amount of time reducing its memory footprint. """
-        zh: """ 在闲置一定时间后休眠 SSL 进程,减少其内存占用。"""
+        en: """Hibernate the SSL process after idling for amount of time reducing its memory footprint."""
+        zh: """在闲置一定时间后休眠 SSL 进程,减少其内存占用。"""
     }
     label: {
         en: "hibernate after"

apps/emqx_slow_subs/i18n/emqx_slow_subs_api_i18n.conf → rel/i18n/emqx_slow_subs_api.hocon


apps/emqx_slow_subs/i18n/emqx_slow_subs_i18n.conf → rel/i18n/emqx_slow_subs_schema.hocon


apps/emqx_statsd/i18n/emqx_statsd_api_i18n.conf → rel/i18n/emqx_statsd_api.hocon


apps/emqx_statsd/i18n/emqx_statsd_schema_i18n.conf → rel/i18n/emqx_statsd_schema.hocon


apps/emqx_modules/i18n/emqx_telemetry_api_i18n.conf → rel/i18n/emqx_telemetry_api.hocon


apps/emqx_modules/i18n/emqx_topic_metrics_api_i18n.conf → rel/i18n/emqx_topic_metrics_api.hocon


+ 6 - 3
scripts/check-i18n-style.escript

@@ -1,12 +1,15 @@
 #!/usr/bin/env escript
 
+%% called from check-i18n-style.sh
+
 -mode(compile).
 
--define(YELLOW, "\e[33m").
+% -define(YELLOW, "\e[33m"). % not used
 -define(RED, "\e[31m").
 -define(RESET, "\e[39m").
 
 main([Files0]) ->
+    io:format(user, "checking i18n file styles", []),
     _ = put(errors, 0),
     Files = string:tokens(Files0, "\n"),
     ok = load_hocon(),
@@ -46,7 +49,7 @@ logerr(Fmt, Args) ->
 
 
 check(File) ->
-    io:format(user, "checking: ~s~n", [File]),
+    io:format(user, ".", []),
     {ok, C} = hocon:load(File),
     maps:foreach(fun check_one_field/2, C),
     ok.
@@ -84,7 +87,7 @@ do_check_desc(Name, _) ->
     die("~s: missing 'zh' or 'en'~n", [Name]).
 
 check_desc_string(Name, Tr, <<>>) ->
-    io:format(standard_error, ?YELLOW ++ "WARNING: ~s.~s: empty string~n" ++ ?RESET, [Name, Tr]);
+    logerr("~s.~s: empty string~n", [Name, Tr]);
 check_desc_string(Name, Tr, BinStr) ->
     Str = unicode:characters_to_list(BinStr, utf8),
     Err = fun(Reason) ->

+ 1 - 1
scripts/check-i18n-style.sh

@@ -3,6 +3,6 @@ set -euo pipefail
 
 cd -P -- "$(dirname -- "$0")/.."
 
-all_files="$(git ls-files '*i18n*.conf')"
+all_files="$(git ls-files 'rel/i18n/*.hocon')"
 
 ./scripts/check-i18n-style.escript "$all_files"

+ 6 - 42
scripts/merge-i18n.escript

@@ -4,12 +4,8 @@
 
 main(_) ->
     BaseConf = <<"">>,
-    Cfgs0 = get_all_cfgs("apps/"),
-    Cfgs1 = get_all_cfgs("lib-ee/"),
-    Conf0 = merge(BaseConf, Cfgs0),
-    Conf = [merge(Conf0, Cfgs1),
-            io_lib:nl()
-           ],
+    Cfgs0 = get_all_files(),
+    Conf = merge(BaseConf, Cfgs0),
     OutputFile = "apps/emqx_dashboard/priv/i18n.conf",
     ok = filelib:ensure_dir(OutputFile),
     ok = file:write_file(OutputFile, Conf).
@@ -25,39 +21,7 @@ merge(BaseConf, Cfgs) ->
               end
       end, BaseConf, Cfgs).
 
-get_all_cfgs(Root) ->
-    Apps = filelib:wildcard("*", Root) -- ["emqx_machine"],
-    Dirs = [filename:join([Root, App]) || App <- Apps],
-    lists:foldl(fun get_cfgs/2, [], Dirs).
-
-get_all_cfgs(Dir, Cfgs) ->
-    Fun = fun(E, Acc) ->
-                  Path = filename:join([Dir, E]),
-                  get_cfgs(Path, Acc)
-          end,
-    lists:foldl(Fun, Cfgs, filelib:wildcard("*", Dir)).
-
-get_cfgs(Dir, Cfgs) ->
-    case filelib:is_dir(Dir) of
-        false ->
-            Cfgs;
-        _ ->
-            Files = filelib:wildcard("*", Dir),
-            case lists:member("i18n", Files) of
-                false ->
-                    try_enter_child(Dir, Files, Cfgs);
-                true ->
-                    EtcDir = filename:join([Dir, "i18n"]),
-                    Confs = filelib:wildcard("*.conf", EtcDir),
-                    NewCfgs = [filename:join([EtcDir, Name]) || Name <- Confs],
-                    try_enter_child(Dir, Files, NewCfgs ++ Cfgs)
-            end
-    end.
-
-try_enter_child(Dir, Files, Cfgs) ->
-    case lists:member("src", Files) of
-        false ->
-            Cfgs;
-        true ->
-            get_all_cfgs(filename:join([Dir, "src"]), Cfgs)
-    end.
+get_all_files() ->
+    Dir = filename:join(["rel","i18n"]),
+    Files = filelib:wildcard("*.hocon", Dir),
+    lists:map(fun(Name) -> filename:join([Dir, Name]) end, Files).