complete traditional chinese translation

This commit is contained in:
JIYE YU
2020-02-10 11:31:37 +09:00
parent a05589c5a6
commit 389cbf4900
41 changed files with 2013 additions and 246 deletions

View File

@@ -0,0 +1,51 @@
<!--
Copyright JS Foundation and other contributors, http://js.foundation
Licensed 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.
-->
<script type="text/x-red" data-help-name="function">
<p>定義對接收到的消息進行處理的JavaScript代碼函數的主體</p>
<p>輸入消息在名爲<code>msg</code>JavaScript</p>
<p>通常<code>msg</code><code>msg.payload</code></p>
<p>該函數一般會返回一個消息對象或多個消息對象但也可以爲了停止流程而什麽都不返回</p>
<h3>詳細</h3>
<p>請參見<a target="_blank" href="http://nodered.org/docs/writing-functions.html">在線文檔</a></p>
<h4>傳送消息</h4>
<p>要將消息傳遞到流程中的下一個節點請返回消息或調用<code>node.send(messages)</code></p>
<p>它將返回/send:</p>
<ul>
<li>單個消息對象 - 傳遞給連接到第一個輸出的節點</li>
<li>消息對象數組傳遞給連接到相應輸出的節點</li>
</ul>
<p>如果數組元素是數組則將多個消息發送到相應的輸出</p>
<p>無論return方法是單個值還是數組元素如果返回值爲null則不會發送任何消息</p>
<h4>日志輸出和錯誤處理</h4>
<p>使用以下功能輸出日志信息和輸出錯誤</p>
<ul>
<li><code>node.log("Log message")</code></li>
<li><code>node.warn("Warning")</code></li>
<li><code>node.error("Error")</code></li>
</ul>
</p>
<p>使用catch節點可以進行錯誤處理 要由catch節點處理請將<code>msg</code><code>node.error</code></p>
<pre>node.error("Error",msg);</pre>
<h4>訪問節點信息</h4>
<p>您可以使用以下屬性來在代碼中引用節點ID和名稱</p>
<ul>
<li><code>node.id</code> - ID</li>
<li><code>node.name</code> - </li>
</ul>
<h4>使用環境變量</h4>
<p>環境變量可以通過<code>env.get("MY_ENV_VAR")</code></p>
</script>

View File

@@ -0,0 +1,37 @@
<!--
Copyright JS Foundation and other contributors, http://js.foundation
Licensed 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.
-->
<script type="text/x-red" data-help-name="switch">
<p>按屬性值來分配消息的傳送路線</p>
<h3>詳細</h3>
<p>根據接收到的消息評估指定的規則然後將消息發送到與匹配的規則相對應的輸出端口</p>
<p>可以將節點設置爲一旦發現一個匹配的規則則停止後續的匹配</p>
<p>對于評估規則可以使用消息屬性流程上下文/全局上下文屬性環境變量和JSONata表達式的評估結果</p>
<h4>規則</h4>
<p>有四種規則</p>
<ol>
<li><b></b></li>
<li><b>順序</b></li>
<li><b>JSONata表達式</b></li>
<li><b>其他</b></li>
</ol>
<h4>注釋</h4>
<p><code>is true/false</code><code>is null</code> </p>
<p><code>is empty</code><code>null</code><code>undefined</code></p>
<h4>處理消息序列</h4>
<p>默認情況下節點不會修改<code>msg.parts</code></p>
<p>可以啓用<b>重建消息序列</b><code>nodeMessageBufferMaxLength</code></p>
</script>

View File

@@ -0,0 +1,33 @@
<!--
Copyright JS Foundation and other contributors, http://js.foundation
Licensed 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.
-->
<script type="text/x-red" data-help-name="change">
<p>設置更改刪除或移動消息流程上下文或全局上下文的屬性</p>
<p>如果指定了多個規則則將按定義的順序來應用它們</p>
<h3>詳細</h3>
<p>可用的操作有</p>
<dl class="message-properties">
<dt>設置</dt>
<dd>設置一個屬性該值可以是多種不同類型也可以從現有消息或上下文屬性中獲取</dd>
<dt>置換</dt>
<dd>搜索並替換屬性 如果啓用了正則表達式則可以爲replace with屬性指定捕獲組例如<code>$1</code> </dd>
<dt>刪除</dt>
<dd>刪除一個屬性</dd>
<dt>移動</dt>
<dd>移動或者重命名一個屬性</dd>
</dl>
<p>類型"expression"使用<a href="http://jsonata.org/" target="_new">JSONata</a></p>
</script>

View File

@@ -0,0 +1,40 @@
<!--
Copyright JS Foundation and other contributors, http://js.foundation
Licensed 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.
-->
<script type="text/x-red" data-help-name="range">
<p>將數值映射爲另一個區間的數值</p>
<h3>輸入</h3>
<dl class="message-properties">
<dt>payload<span class="property-type">數值</span></dt>
<dd>有效荷載<i>一定</i>. </dd>
</dl>
<h3>輸出</h3>
<dl class="message-properties">
<dt>payload<span class="property-type">數值</span></dt>
<dd>被映射到新區間的數值</dd>
</dl>
<h3>詳細</h3>
<p>該節點將線性縮放所接收到的數值在默認情況下結果不限于節點中定義的範圍</p>
<p><i>縮放並限制到目標範圍</i></p>
<p><i>在目標範圍內縮放並折疊</i></p>
<p>例如輸入0-10映射到0-100</p>
<table style="outline-width:#888 solid thin">
<tr><th width="80px">模式</th><th width="80px"></th><th width="80px"></th></tr>
<tr><td><center>scale</center></td><td><center>12</center></td><td><center>120</center></td></tr>
<tr><td><center>limit</center></td><td><center>12</center></td><td><center>100</center></td></tr>
<tr><td><center>wrap</center></td><td><center>12</center></td><td><center>20</center></td></tr>
</table>
</script>

View File

@@ -0,0 +1,46 @@
<!--
Copyright JS Foundation and other contributors, http://js.foundation
Licensed 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.
-->
<script type="text/x-red" data-help-name="template">
<p>根據提供的模板設置屬性</p>
<h3>輸入</h3>
<dl class="message-properties">
<dt>msg <span class="property-type">object</span></dt>
<dd>一個msg對象其中包含著用于填充模板的信息</dd>
<dt class="optional">template <span class="property-type">string</span></dt>
<dd><code>msg.payload</code>msg</dd>
</dl>
<h3>Outputs</h3>
<dl class="message-properties">
<dt>msg <span class="property-type">object</span></dt>
<dd>由來自傳入msg的屬性來填充已配置的模板後輸出的帶有屬性的msg</dd>
</dl>
<h3>詳細</h3>
<p>默認情況下使用<i><a href="http://mustache.github.io/mustache.5.html" target="_blank">mustache</a></i>格式如有需要也可以切換其他格式</p>
<p>例如:
<pre>Hello {{payload.name}}. Today is {{date}}</pre>
<p>receives a message containing:
<pre>{
date: "Monday",
payload: {
name: "Fred"
}
}</pre>
<p>輸出的消息將會是:
<pre>Hello Fred. Today is Monday</pre>
<p>也可以使用流程上下文或全局上下文中的屬性<code>{{flow.name}}</code><code>{{global.name}}</code><code>store</code>使<code>{{flow[store].name}}</code><code>{{global[store].name}}</code>
<p><b>注意</b>默認情況下,<i>mustache</i>將在其替換的值中轉義任何非字母數字或HTML實體爲了防止這種情況請使用<code>{{{triple}}}</code>
</script>

View File

@@ -0,0 +1,32 @@
<!--
Copyright JS Foundation and other contributors, http://js.foundation
Licensed 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.
-->
<script type="text/x-red" data-help-name="delay">
<p>對通過節點的消息進行延遲發送或限制</p>
<h3>輸入</h3>
<dl class="message-properties">
<dt class="optional">delay <span class="property-type">數值</span></dt>
<dd>設置要應用于消息的延遲以毫秒爲單位僅當節點配置爲允許消息去覆蓋配置的默認延遲間隔時此選項才適用</dd>
<dt class="optional">reset</dt>
<dd>如果接收到的消息將此屬性設置爲任何值則將清空該節點保留的所有的未發送消息</dd>
<dt class="optional">flush</dt>
<dd>如果接收到的消息的此屬性設置爲任何值則將立即發送該節點保留的所有未發送消息</dd>
</dl>
<h3>詳細</h3>
<p>當配置爲延遲發送消息時延遲間隔可以是一個固定值一個範圍內的隨機值或爲每個消息動態設置</p>
<p>當配置爲對消息進行限制時它們的傳遞將分散在配置的時間段內狀態顯示隊列中當前的消息數可以選擇在中間消息到達時丟棄它們</p>
<p>速率限制可以應用于所有消息也可以根據<code>msg.topic</code></p>
</script>

View File

@@ -0,0 +1,33 @@
<!--
Copyright JS Foundation and other contributors, http://js.foundation
Licensed 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.
-->
<script type="text/x-red" data-help-name="trigger">
<p>触发后将会发送一条消息如果被拓展或重置则可以选择发送第二条消息</p>
<h3>输入</h3>
<dl class="message-properties">
<dt class="optional">reset</dt>
<dd>如果收到带有此属性的消息则将清除当前正在进行的任何超时或重复且不会触发任何消息</dd>
</dl>
<h3>详细</h3>
<p>该节点可用于在流程中创建一个超时 默认情况下当它收到一条消息时它将发送一条带有<code>1</code>250<code>0</code>使Raspberry Pi GPIOLED</p>
<p>可以将发送的每个消息的有效荷载配置为各种值包括不发送任何内容的选项例如将初始消息设置为<i>nothing</i></p>
<p>如果设置为<i>字符串</i>类型,则该节点支持<i>mustache</i>模板语法</p>
<p>如果节点收到具有<code>reset</code><code></code></p>
<p>可以将节点配置为以固定的时间间隔重新发送消息直到被收到的消息重置为止</p>
<p>可选可以将节点配置为将带有<code>msg.topic</code></p>
</script>

View File

@@ -0,0 +1,74 @@
<!--
Copyright JS Foundation and other contributors, http://js.foundation
Licensed 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.
-->
<script type="text/x-red" data-help-name="exec">
<p>運行系統命令並返回其輸出</p>
<p>可以將節點配置爲等待命令完成或者在命令生成時發送其輸出</p>
<p>運行的命令可以在節點中配置也可以由收到的消息提供</p>
<h3>輸入</h3>
<dl class="message-properties">
<dt class="optional">payload <span class="property-type">字符串</span></dt>
<dd>如果這樣配置則將被附加到執行命令中</dd>
<dt class="optional">kill <span class="property-type">字符串</span></dt>
<dd>指定發送到現有的exec節點進程的kill信號類型</dd>
<dt class="optional">pid <span class="property-type">數值|字符串</span></dt>
<dd>要殺死的現有exec節點進程的進程ID</dd>
</dl>
<h3>輸出</h3>
<ol class="node-ports">
<li>標准輸出(stdout)
<dl class="message-properties">
<dt>payload <span class="property-type">字符串</span></dt>
<dd>命令的標准輸出</dd>
</dl>
<dl class="message-properties">
<dt>rc <span class="property-type">object</span></dt>
<dd>僅執行模式一個返回代碼對象的副本在端口3上也可用</dd>
</dl>
</li>
<li>標准error輸出(stderr)
<dl class="message-properties">
<dt>payload <span class="property-type">字符串</span></dt>
<dd>命令的標准錯誤輸出</dd>
</dl>
<dl class="message-properties">
<dt>rc <span class="property-type">object</span></dt>
<dd>僅執行模式一個返回代碼對象的副本在端口3上也可用</dd>
</dl>
</li>
<li>返回代碼
<dl class="message-properties">
<dt>payload <span class="property-type">object</span></dt>
<dd>一個包含返回代碼以及<code>message</code><code>signal</code></dd>
</dl>
</li>
</ol>
<h3>詳細</h3>
<p>默認情況下使用<code>exec</code>調調<code>{code0}</code></p>
<p>可選可以選擇使用<code>spawn</code>stdoutstderr<code>{code0}</code></p>
<p>錯誤可能會在第三個端口<code>msg.payload</code><code>message</code><code>signal</code></p>
<p>運行的命令是在節點內定義的帶有附加<code>msg.payload</code></p>
<p>帶空格的命令或參數應該用引號引起來<code>這是一個參數</code></p>
<p>返回的<code>有效荷載</code>通常是<i>字符串</i>類型除非檢測到非UTF8字符在這種情況下它會是<i>buffer</i></p>
<p>節點處于活動狀態時該節點的狀態圖標和PID將可見對此更改可以通過<code>Status</code></p>
<h4>殺死進程</h4>
<p>發送<code>msg.kill</code><code>msg.kill</code><code>SIGINT</code><code>SIGQUIT</code><code>SIGHUP</code><code>SIGTERM</code></p>
<p>如果節點有多個進程在運行則還必須設置<code>msg.pid</code>PID</p>
<p>如果<code>超時</code></p>
<p>提示如果運行Python應用程序則可能需要使用<code>-u</code></p>
</script>