Ver código fonte

style: make hocon style check and spellcheck happy

- with more human readable i18n style check format
JimMoen 2 anos atrás
pai
commit
35ab1c0190

+ 1 - 1
changes/ee/feat-10363.en.md

@@ -1 +1 @@
-Add MicroSoft SQL Server data Bridge support.
+Implement Microsoft SQL Server bridge.

+ 1 - 1
rel/i18n/emqx_ee_bridge_dynamo.hocon

@@ -39,7 +39,7 @@ will be forwarded."""
 
     desc_config {
         desc {
-            en: """Configuration for an DynamoDB bridge."""
+            en: """Configuration for a DynamoDB bridge."""
             zh: """DynamoDB 桥接配置"""
         }
         label: {

+ 1 - 1
rel/i18n/emqx_ee_bridge_pgsql.hocon

@@ -39,7 +39,7 @@ will be forwarded."""
 
     desc_config {
         desc {
-            en: """Configuration for an PostgreSQL bridge."""
+            en: """Configuration for a PostgreSQL bridge."""
             zh: """PostgreSQL 桥接配置"""
         }
         label: {

+ 8 - 10
rel/i18n/emqx_ee_bridge_sqlserver.hocon

@@ -2,15 +2,13 @@ emqx_ee_bridge_sqlserver {
 
   local_topic {
     desc {
-      en: """The MQTT topic filter to be forwarded to MicroSoft SQL Server. All MQTT 'PUBLISH' messages with the topic
+      en: """The MQTT topic filter to be forwarded to Microsoft SQL Server. All MQTT 'PUBLISH' messages with the topic
 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.
-"""
-      zh: """发送到 'local_topic' 的消息都会转发到 MicroSoft SQL Server。 </br>
-注意:如果这个 Bridge 被用作规则(EMQX 规则引擎)的输出,同时也配置了 'local_topic' ,那么这两部分的消息都会被转发。
-"""
+will be forwarded."""
+      zh: """发送到 'local_topic' 的消息都会转发到 Microsoft SQL Server。 </br>
+注意:如果这个 Bridge 被用作规则(EMQX 规则引擎)的输出,同时也配置了 'local_topic' ,那么这两部分的消息都会被转发。"""
     }
     label {
       en: """Local Topic"""
@@ -53,12 +51,12 @@ will be forwarded.
 
   desc_config {
     desc {
-      en: """Configuration for an MicroSoft SQL Server bridge."""
-      zh: """MicroSoft SQL Server 桥接配置"""
+      en: """Configuration for a Microsoft SQL Server bridge."""
+      zh: """Microsoft SQL Server 桥接配置"""
     }
     label: {
-      en: """MicroSoft SQL Server Bridge Configuration"""
-      zh: """MicroSoft SQL Server 桥接配置"""
+      en: """Microsoft SQL Server Bridge Configuration"""
+      zh: """Microsoft SQL Server 桥接配置"""
     }
   }
 

+ 1 - 1
rel/i18n/emqx_ee_bridge_tdengine.hocon

@@ -39,7 +39,7 @@ will be forwarded."""
 
     desc_config {
         desc {
-            en: """Configuration for an TDengine bridge."""
+            en: """Configuration for a TDengine bridge."""
             zh: """TDengine 桥接配置"""
         }
         label: {

+ 4 - 8
rel/i18n/emqx_ee_connector_sqlserver.hocon

@@ -2,16 +2,12 @@ emqx_ee_connector_sqlserver {
 
   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 SQL Server default port 1433 is used if `[:Port]` is not specified.
-"""
-      zh: """
-将要连接的 IPv4 或 IPv6 地址,或者主机名。<br/>
+The SQL Server default port 1433 is used if `[:Port]` is not specified."""
+      zh: """将要连接的 IPv4 或 IPv6 地址,或者主机名。<br/>
 主机名具有以下形式:`Host[:Port]`。<br/>
-如果未指定 `[:Port]`,则使用 SQL Server 默认端口 1433。
-"""
+如果未指定 `[:Port]`,则使用 SQL Server 默认端口 1433。"""
     }
     label: {
       en: "Server Host"

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

@@ -9,7 +9,7 @@
 -define(RESET, "\e[39m").
 
 main([Files0]) ->
-    io:format(user, "checking i18n file styles", []),
+    io:format(user, "checking i18n file styles~n", []),
     _ = put(errors, 0),
     Files = string:tokens(Files0, "\n"),
     ok = load_hocon(),
@@ -20,7 +20,7 @@ main([Files0]) ->
         N when is_integer(N) andalso N > 1 ->
             logerr("~p errors found~n", [N]);
         _ ->
-            io:format(user, "OK~n", [])
+            io:format(user, "~nOK~n", [])
     end.
 
 load_hocon() ->
@@ -42,7 +42,7 @@ die(Msg, Args) ->
     halt(1).
 
 logerr(Fmt, Args) ->
-    io:format(standard_error, ?RED ++ "ERROR: " ++ Fmt ++ ?RESET, Args),
+    io:format(standard_error, "~n" ++ ?RED ++ "ERROR: " ++ Fmt ++ ?RESET, Args),
     N = get(errors),
     _ = put(errors, N + 1),
     ok.