Skip to content

Commit

Permalink
Translate more sections
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Mar 27, 2014
1 parent b31d40d commit 39ff28e
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 45 deletions.
17 changes: 0 additions & 17 deletions _po/ja/reference/plugin/adapter/index.po
Expand Up @@ -217,15 +217,6 @@ msgstr ""
": 出力メッセージに対する[マッチングパターン][matching pattern]。\n"
" パターンが指定されていない(もしくは`nil`が指定された)場合は、すべてのメッセージがマッチします。"

msgid ""
"Note: On Droonga 0.9.9, they are named as `message.input_pattern` and `message"
".output_pattern` but changed to new configurations on Droonga 1.0.0, like abov"
"e. If you write plugins for Droonga 0.9.9, you have to migrate it."
msgstr ""
"注意: Droonga 0.9.9では、これらの設定は`message.input_pattern`および`message.output_pattern`と"
"いう名前でしたが、Droonga 1.0.0で上記の通りに変更されました。Droonga 0.9.9用に開発されたプラグインは、移行のために書き換える必要が"
"あります。"

msgid "## Classes and methods {#classes}"
msgstr "## クラスとメソッド {#classes}"

Expand Down Expand Up @@ -357,14 +348,6 @@ msgstr ""
"end\n"
"~~~"

msgid ""
"Note: On Droonga 0.9.9, this method is named as `command` but changed to `type"
"` on Droonga 1.0.0, like above. If you write plugins for Droonga 0.9.9, you ha"
"ve to migrate it."
msgstr ""
"注意: Droonga 0.9.9では、このメソッドは`command`という名前でしたが、Droonga 1.0.0で上記の通りに`type`に変更されま"
"した。Droonga 0.9.9用に開発されたプラグインは、移行のために書き換える必要があります。"

msgid "#### `#body`, `#body=(body)` {#classes-Droonga-InputMessage-body}"
msgstr ""

Expand Down
16 changes: 7 additions & 9 deletions _po/ja/tutorial/plugin-development/adapter/index.po
Expand Up @@ -346,23 +346,19 @@ msgstr ""
"この例では、プラグインを`\"type\":\"search\"`という情報を持つすべての入力メッセージに対して働くように定義しています。.\n"
"詳しくは[リファレンスマニュアルの設定のセクション](../../../reference/plugin/adapter/#config)を参照して下さい。"

msgid ""
"(Note: `input_message.pattern` is for Droonga 1.0.0 and later. On Droonga 0.9."
"9, you have to use a deprecated configuration `message.input_pattern` instead."
")"
msgstr ""

msgid ""
"The method `adapt_input` is called for every incoming message matching to the "
"pattern.\n"
"The argument `input_message` is a wrapped version of the incoming message."
msgstr ""
"`adapt_input`メソッドは、パターンに当てはまるすべての入力メッセージに対して毎回呼ばれます。\n"
"引数の`input_message`は、入力メッセージをラップした物です。"

msgid "Restart fluentd:"
msgstr ""
msgstr "fluentdを再起動します:"

msgid "Send the request same as the previous section:"
msgstr ""
msgstr "前のセクションと同じリクエストを送信します:"

msgid ""
"~~~\n"
Expand Down Expand Up @@ -394,7 +390,7 @@ msgid ""
msgstr ""

msgid "You will see something like below fluentd's log in `fluentd.log`:"
msgstr ""
msgstr "すると、fluentdのログファイルである`fluentd.log`に以下のようなログが出力される事を確認できるでしょう。"

msgid ""
"~~~\n"
Expand All @@ -414,6 +410,8 @@ msgid ""
"en passed to Droonga. Here we can modify the message before the actual data pr"
"ocessing."
msgstr ""
"このログは、メッセージが`SampleLoggerPlugin::Adapter`によって受信されて、Droongaに渡されたことを示しています。実際のデー"
"タ処理の前に、この時点でメッセージを加工することができます。"

msgid "### Modify messages with the plugin"
msgstr "### プラグインでメッセージを加工する"
Expand Down
4 changes: 0 additions & 4 deletions ja/reference/plugin/adapter/index.md
Expand Up @@ -98,8 +98,6 @@ end
: 出力メッセージに対する[マッチングパターン][matching pattern]
パターンが指定されていない(もしくは`nil`が指定された)場合は、すべてのメッセージがマッチします。

注意: Droonga 0.9.9では、これらの設定は`message.input_pattern`および`message.output_pattern`という名前でしたが、Droonga 1.0.0で上記の通りに変更されました。Droonga 0.9.9用に開発されたプラグインは、移行のために書き換える必要があります。

## クラスとメソッド {#classes}

### `Droonga::Adapter` {#classes-Droonga-Adapter}
Expand Down Expand Up @@ -173,8 +171,6 @@ module Droonga::Plugins::MySearch
end
~~~

注意: Droonga 0.9.9では、このメソッドは`command`という名前でしたが、Droonga 1.0.0で上記の通りに`type`に変更されました。Droonga 0.9.9用に開発されたプラグインは、移行のために書き換える必要があります。

#### `#body`, `#body=(body)` {#classes-Droonga-InputMessage-body}

入力メッセージの`"body"`の値を返します。
Expand Down
26 changes: 11 additions & 15 deletions ja/tutorial/plugin-development/adapter/index.md
Expand Up @@ -215,19 +215,17 @@ lib/droonga/plugins/sample-logger.rb:
この例では、プラグインを`"type":"search"`という情報を持つすべての入力メッセージに対して働くように定義しています。.
詳しくは[リファレンスマニュアルの設定のセクション](../../../reference/plugin/adapter/#config)を参照して下さい。

(Note: `input_message.pattern` is for Droonga 1.0.0 and later. On Droonga 0.9.9, you have to use a deprecated configuration `message.input_pattern` instead.)
`adapt_input`メソッドは、パターンに当てはまるすべての入力メッセージに対して毎回呼ばれます。
引数の`input_message`は、入力メッセージをラップした物です。

The method `adapt_input` is called for every incoming message matching to the pattern.
The argument `input_message` is a wrapped version of the incoming message.

Restart fluentd:
fluentdを再起動します:

~~~
# kill $(cat fluentd.pid)
# RUBYLIB=./lib fluentd --config fluentd.conf --log fluentd.log --daemon fluentd.pid
~~~

Send the request same as the previous section:
前のセクションと同じリクエストを送信します:

~~~
# droonga-request --tag starbucks search-columbus.json
Expand Down Expand Up @@ -256,13 +254,13 @@ Elapsed time: 0.014714
]
~~~

You will see something like below fluentd's log in `fluentd.log`:
すると、fluentdのログファイルである`fluentd.log`に以下のようなログが出力される事を確認できるでしょう。

~~~
2014-02-17 15:20:37 +0900 [info]: SampleLoggerPlugin::Adapter message=#<Droonga::InputMessage:0x007f8ae3e1dd98 @raw_message={"dataset"=>"Starbucks", "type"=>"search", "body"=>{"queries"=>{"stores"=>{"source"=>"Store", "condition"=>{"query"=>"Columbus", "matchTo"=>"_key"}, "output"=>{"elements"=>["startTime", "elapsedTime", "count", "attributes", "records"], "attributes"=>["_key"], "limit"=>-1}}}}, "replyTo"=>{"type"=>"search.result", "to"=>"127.0.0.1:64591/droonga"}, "id"=>"1392618037.935901", "date"=>"2014-02-17 15:20:37 +0900", "appliedAdapters"=>[]}>
~~~

This shows the message is received by our `SampleLoggerPlugin::Adapter` and then passed to Droonga. Here we can modify the message before the actual data processing.
このログは、メッセージが`SampleLoggerPlugin::Adapter`によって受信されて、Droongaに渡されたことを示しています。実際のデータ処理の前に、この時点でメッセージを加工することができます。

### プラグインでメッセージを加工する

Expand All @@ -284,7 +282,7 @@ lib/droonga/plugins/sample-logger.rb:
Like above, you can modify the incoming message via methods of the argument `input_message`.
See the [reference manual for the message class](../../../reference/plugin/adapter/#classes-Droonga-InputMessage).

Restart fluentd:
fluentdを再起動します:

~~~
# kill $(cat fluentd.pid)
Expand Down Expand Up @@ -321,7 +319,7 @@ Elapsed time: 0.017343

Note that `count` is still `2` because `limit` does not affect to `count`. See [search][] for details of the `search` command.

You will see something like below fluentd's log in `fluentd.log`:
すると、fluentdのログファイルである`fluentd.log`に以下のようなログが出力される事を確認できるでしょう。

~~~
2014-02-17 15:24:39 +0900 [info]: SampleLoggerPlugin::Adapter message=#<Droonga::InputMessage:0x007f956685c908 @raw_message={"dataset"=>"Starbucks", "type"=>"search", "body"=>{"queries"=>{"stores"=>{"source"=>"Store", "condition"=>{"query"=>"Columbus", "matchTo"=>"_key"}, "output"=>{"elements"=>["startTime", "elapsedTime", "count", "attributes", "records"], "attributes"=>["_key"], "limit"=>-1}}}}, "replyTo"=>{"type"=>"search.result", "to"=>"127.0.0.1:64616/droonga"}, "id"=>"1392618279.0578449", "date"=>"2014-02-17 15:24:39 +0900", "appliedAdapters"=>[]}>
Expand Down Expand Up @@ -429,7 +427,7 @@ lib/droonga/plugins/sample-logger.rb:
Like above, you can modify the outgoing message via methods of the argument `output_message`.
See the [reference manual for the message class](../../../reference/plugin/adapter/#classes-Droonga-OutputMessage).

Restart fluentd:
fluentdを再起動します:

~~~
# kill $(cat fluentd.pid)
Expand Down Expand Up @@ -542,8 +540,6 @@ module Droonga
end
~~~

(Note: `input_message.pattern` is for Droonga 1.0.0 and later. On Droonga 0.9.9, you have to use a deprecated configuration `message.input_pattern` instead.)

Then update your `catalog.json` to activate the plugin.
Remove the `sample-logger` plugin previously created.

Expand All @@ -560,7 +556,7 @@ catalog.json:

Remember, you must place your plugin `"store-search"` before the `"search"` because yours depends on it.

Restart fluentd:
fluentdを再起動します:

~~~
# kill $(cat fluentd.pid)
Expand Down Expand Up @@ -653,7 +649,7 @@ lib/droonga/plugins/store-search.rb:

The `adapt_output` method receives outgoing messages only corresponding to the incoming messages processed by the `adapt_input` method.

Restart fluentd:
fluentdを再起動します:

~~~
# kill $(cat fluentd.pid)
Expand Down

0 comments on commit 39ff28e

Please sign in to comment.