Skip to content

Commit 6f8499e

Browse files
Update Japanese message of ui_control (#764)
* update Japanese info of ui_control node * update Japanese info text of ui_control
1 parent c814a2f commit 6f8499e

File tree

4 files changed

+44
-14
lines changed

4 files changed

+44
-14
lines changed
Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
{
22
"ui_ui_control": {
33
"label": {
4-
"name": "Name"
4+
"name": "Name",
5+
"output": "Output"
56
},
67
"placeholder": {
78
"name": "Name"
8-
}
9+
},
10+
"events": {
11+
"all": "Connect, lost, change tab or group events",
12+
"change": "Change tab or group events only",
13+
"connect": "Connect event only"
14+
}
915
}
1016
}

nodes/locales/ja/ui_ui_control.html

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,23 @@
33
<p>表示されているタブの切り替えが可能です。<code>msg.payload</code>
44
The default function is to change the currently displayed tab. <code>msg.payload</code>に表示対象のタブもしくはリンクの<code>{tab:"タブ名"}</code><b></b>、もしくは、<b>添字</b> (0)</p>
55
<p>空のタブ名("")を送信すると、表示されているページを更新します。また、"+1"を送ると次のタブ、"-1"を送ると前のタブに切り替えられます。</p>
6+
<p>次の形式のオブジェクトを<code>msg.payload</code>
7+
ダッシュボードページ(タブ)を制御できます。<pre>{"tabs": {"hide": "非表示タブ", "disable": ["秘密タブ", "未使用"]}}</pre>
8+
ここでは、次の2つの状態が利用できます: <b>show</b>/<b>hide</b> および <b>enable</b>/<b>disable</b></p>
69
<p>widgetグループの表示を次のようなペイロードで制御できます。<br/>
7-
<code>{group:{hide:["タブ名_グループ名"], show:["他_グループ_表示"], focus:true}}</code><br/>
8-
<b>focus</b>は、グループが表示されるよう必要に応じて画面をスクロールするためのパラメータで、省略可能です。グループの指定は<i>タブ名</i><i></i>を下線(_)で結合したものを用います。空白は下線で置き換えます。</p>
9-
<p>クライアントのブラウザが接続もしくは切断した場合、次のプロパティを持つメッセージを送信します:</p>
10+
<pre>{group:{hide:["タブ名_グループ名"], show:["他_グループ_表示"], focus:true}}</pre>
11+
<b>focus</b>は、グループが表示されるよう必要に応じて画面をスクロールするためのパラメータで、省略可能です。
12+
また、`open`および`close`プロパティを用いてグループの状態をユーザが制御できます。
13+
グループ名の指定は<i>タブ名</i><i>グループ名</i>を下線(_)で結合したものを用います。空白は下線で置き換えます。</p>
14+
<p>クライアントのブラウザが接続もしくは切断した場合、タブが変更された場合、グループを拡大もしくは縮小した場合、次のプロパティを持つメッセージを送信します:</p>
1015
<ul>
11-
<li><code>payload</code> - <i>connect</i>もしくは<i>lost</i>,
12-
<li><code>socketid</code> - ソケットID(ブラウザがページを再ロードする毎に変化します),
13-
<li><code>socketip</code> - 接続元のIPアドレス。
16+
<li><code>payload</code> - <i>connect</i><i>lost</i><i>change</i>、もしくは<i>group</i>
17+
<li><code>socketid</code> - ソケットID(ブラウザがページを再ロードする毎に変化します)
18+
<li><code>socketip</code> - 接続元のIPアドレス,
19+
<li><code>tab</code> - タブ番号 ('change'イベントのみ)
20+
<li><code>name</code> - タブ名 ('change'イベントのみ)
21+
<li><code>group</code> - グループ名 ('group'イベントのみ)
22+
<li><code>open</code> - グループの状態 ('group'イベントのみ)
1423
</ul>
24+
<p>追加 - 「Connectイベントのみ」は新しいクライアントへのデータの再送を他のイベントをフィルタしないで行う場合に有用です。</p>
1525
</script>
Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
{
22
"ui_ui_control" : {
33
"label" : {
4-
"name" : "名前"
4+
"name" : "名前",
5+
"output": "出力"
56
},
67
"placeholder" : {
78
"name" : "名前"
8-
}
9+
},
10+
"events": {
11+
"all": "connect, lost, タブ変更もしくはグループイベント",
12+
"change": "タブ変更もしくはグループイベントのみ",
13+
"connect": "Connectイベントのみ"
14+
}
915
}
1016
}

nodes/ui_ui_control.html

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<script type="text/javascript">
2+
(function () {
23
// convert to i18 text
34
function c_(x) {
45
return RED._("node-red-dashboard/ui_ui_control:ui_ui_control."+x);
@@ -19,16 +20,23 @@
1920
label: function() { return this.name || "ui control"; },
2021
labelStyle: function() { return this.name?"node_label_italic":""; },
2122
outputLabels: function() { return this.events; },
23+
oneditprepare: function() {
24+
var node = this;
25+
var sel = $("#node-input-events");
26+
for (var name of ["all", "change", "connect"]) {
27+
var text = c_("events."+name);
28+
$("<option/>").val(name).text(text).appendTo(sel);
29+
}
30+
$(sel).val(node.events);
31+
},
2232
});
33+
})();
2334
</script>
2435

2536
<script type="text/html" data-template-name="ui_ui_control">
2637
<div class="form-row">
27-
<label for="node-input-events"><i class="fa fa-sign-out"></i> Output</label>
38+
<label for="node-input-events"><i class="fa fa-sign-out"></i> <span data-i18n="ui_ui_control.label.output"></span></label>
2839
<select id="node-input-events" style="width:70%;">
29-
<option value="all">Connect, lost, change tab or group events</option>
30-
<option value="change">Change tab or group events only</option>
31-
<option value="connect">Connect event only</option>
3240
</select>
3341
</div>
3442
<div class="form-row">

0 commit comments

Comments
 (0)