Yoji Shidara
null+****@clear*****
Mon Mar 3 18:28:42 JST 2014
Yoji Shidara 2014-03-03 18:28:42 +0900 (Mon, 03 Mar 2014) New Revision: b1214425295f7bfddbc89c2296c821c6c1cb1611 https://github.com/droonga/droonga.org/commit/b1214425295f7bfddbc89c2296c821c6c1cb1611 Message: ja: Translate plugin-development/adapter Modified files: _po/ja/tutorial/plugin-development/adapter/index.po ja/tutorial/plugin-development/adapter/index.md Modified: _po/ja/tutorial/plugin-development/adapter/index.po (+21 -17) =================================================================== --- _po/ja/tutorial/plugin-development/adapter/index.po 2014-03-03 19:09:04 +0900 (175970c) +++ _po/ja/tutorial/plugin-development/adapter/index.po 2014-03-03 18:28:42 +0900 (7d45662) @@ -14,6 +14,10 @@ msgid "" "layout: en\n" "---" msgstr "" +"---\n" +"title: \"プラグイン: リクエストとレスポンスを加工し、既存のコマンドに基づいた新しいコマンドを作成する\"\n" +"layout: ja\n" +"---" msgid "" "* TOC\n" @@ -39,23 +43,23 @@ msgid "* You must complete the [basic tutorial][]." msgstr "* [基本的な使い方のチュートリアル][basic tutorial] を完了している必要があります。" msgid "## Adaption for incoming messages" -msgstr "## 入力のメッセージの加工" +msgstr "## 入力メッセージの加工" msgid "" "First, let's study basics with a simple logger plugin named `sample-logger` af" "fects at the adaption phase." -msgstr "" -"まず`sample-logger`という簡単なロガープラグインを使って、adaption phaseに作用するプラグインを作りながら、基礎を学びましょう。" +msgstr "まず`sample-logger`という簡単なロガープラグインを使って、adaption phaseに作用するプラグインを作りながら、基礎を学びましょう。" msgid "" "We sometime need to modify incoming requests from outside to Droonga Engine.\n" "We can use a plugin for this purpose.\n" "Let's see how to create a plugin for the adaption phase, in this section." msgstr "" -"外部のシステムからDroonga Engineにやってくるリクエストを加工する必要がある場合があります。このようなときに、プラグインを利用できます。このセクションでは、どのようにしてadaption phaseのプラグインをつくるのかをみていきます。" +"外部のシステムからDroonga Engineにやってくるリクエストを加工する必要がある場合があります。このようなときに、プラグインを利用できます。このセク" +"ションでは、どのようにしてadaption phaseのプラグインをつくるのかをみていきます。" msgid "### Directory Structure" -msgstr "" +msgstr "### ディレクトリの構造" msgid "" "Assume that we are going to add a new plugin to the system built in the [basic" @@ -90,7 +94,7 @@ msgid "" msgstr "" msgid "### Create a plugin" -msgstr "" +msgstr "### プラグインの作成" msgid "" "You must put codes for a plugin into a file which has the name *same to the pl" @@ -138,7 +142,7 @@ msgid "" msgstr "" msgid "### Activate the plugin with `catalog.json`" -msgstr "" +msgstr "### `catalog.json`でプラグインを有効化する" msgid "" "You need to update `catalog.json` to activate your plugin.\n" @@ -168,7 +172,7 @@ msgid "" msgstr "" msgid "### Run and test" -msgstr "" +msgstr "### 実行と動作を確認する" msgid "" "Let's get Droonga started.\n" @@ -266,7 +270,7 @@ msgid "This is the search result." msgstr "" msgid "### Do something in the plugin: take logs" -msgstr "" +msgstr "### プラグインを動作させる: ログをとる" msgid "" "The plugin we have created do nothing so far. Let's get the plugin to do some " @@ -378,7 +382,7 @@ msgid "" msgstr "" msgid "### Modify messages with the plugin" -msgstr "" +msgstr "### プラグインでメッセージを加工する" msgid "" "Suppose that we want to restrict the number of records returned in the respons" @@ -459,7 +463,7 @@ msgid "" msgstr "" msgid "## Adaption for outgoing messages" -msgstr "" +msgstr "## 出力メッセージの加工" msgid "" "In case we need to modify outgoing messages from Droonga Engine, for example, " @@ -468,7 +472,7 @@ msgid "" msgstr "" msgid "### Add a method to adapt outgoing messages" -msgstr "" +msgstr "### 出力のメッセージを加工するメソッドを追加する" msgid "" "Let's take logs of results of `search` command.\n" @@ -500,7 +504,7 @@ msgid "" msgstr "" msgid "### Run" -msgstr "" +msgstr "### 実行する" msgid "Let's restart fluentd:" msgstr "" @@ -560,7 +564,7 @@ msgid "" msgstr "" msgid "### Modify results in the adaption phase" -msgstr "" +msgstr "### 結果をadaption phaseで加工する" msgid "" "Let's modify the result.\n" @@ -640,7 +644,7 @@ msgid "" msgstr "" msgid "## Adaption for both incoming and outgoing messages" -msgstr "" +msgstr "## 入出力メッセージの加工" msgid "" "We have learned the basics of plugins for the adaption phase so far.\n" @@ -654,7 +658,7 @@ msgid "" " new plugin named `store-search`." msgstr "" -msgid "### Accepting of simple requests" +msgid "### シンプルなリクエストを受け取る" msgstr "" msgid "" @@ -826,7 +830,7 @@ msgid "" "the method `adapt_input`." msgstr "" -msgid "### Returning of simple responses" +msgid "### シンプルなレスポンスを返す" msgstr "" msgid "" Modified: ja/tutorial/plugin-development/adapter/index.md (+14 -14) =================================================================== --- ja/tutorial/plugin-development/adapter/index.md 2014-03-03 19:09:04 +0900 (ef580e4) +++ ja/tutorial/plugin-development/adapter/index.md 2014-03-03 18:28:42 +0900 (a7750af) @@ -1,6 +1,6 @@ --- -title: "Plugin: Adapt requests and responses, to add a new command based on other existing commands" -layout: en +title: "プラグイン: リクエストとレスポンスを加工し、既存のコマンドに基づいた新しいコマンドを作成する" +layout: ja --- {% comment %} @@ -27,13 +27,13 @@ At the last, we create a new command `storeSearch` based on the existing `search * [基本的な使い方のチュートリアル][basic tutorial] を完了している必要があります。 -## 入力のメッセージの加工 +## 入力メッセージの加工 まず`sample-logger`という簡単なロガープラグインを使って、adaption phaseに作用するプラグインを作りながら、基礎を学びましょう。 外部のシステムからDroonga Engineにやってくるリクエストを加工する必要がある場合があります。このようなときに、プラグインを利用できます。このセクションでは、どのようにしてadaption phaseのプラグインをつくるのかをみていきます。 -### Directory Structure +### ディレクトリの構造 Assume that we are going to add a new plugin to the system built in the [basic tutorial][]. In that tutorial, Groonga engine was placed under `engine` directory. @@ -57,7 +57,7 @@ engine ~~~ -### Create a plugin +### プラグインの作成 You must put codes for a plugin into a file which has the name *same to the plugin itself*. Because the plugin now you creating is `sample-logger`, put codes into a file `sample-logger.rb` in the `droonga/plugins` directory. @@ -89,7 +89,7 @@ This plugin does nothing except registering itself to the Droonga Engine. An adapter class must be defined as a subclass of the `Droonga::Adapter`, under the namespace of the plugin module. -### Activate the plugin with `catalog.json` +### `catalog.json`でプラグインを有効化する You need to update `catalog.json` to activate your plugin. Insert the name of the plugin `"sample-logger"` to the `"plugins"` list under the dataset, like: @@ -107,7 +107,7 @@ catalog.json: Note: you must place `"sample-logger"` before `"search"`, because the `sample-logger` plugin depends on the `search`. Droonga Engine applies plugins at the adaption phase in the order defined in the `catalog.json`, so you must resolve plugin dependencies by your hand (for now). -### Run and test +### 実行と動作を確認する Let's get Droonga started. Note that you need to specify `./lib` directory in `RUBYLIB` environment variable in order to make ruby possible to find your plugin. @@ -186,7 +186,7 @@ Elapsed time: 0.021544 This is the search result. -### Do something in the plugin: take logs +### プラグインを動作させる: ログをとる The plugin we have created do nothing so far. Let's get the plugin to do some interesting. @@ -264,7 +264,7 @@ You will see something like below fluentd's log in `fluentd.log`: 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. -### Modify messages with the plugin +### プラグインでメッセージを加工する Suppose that we want to restrict the number of records returned in the response, say `1`. What we need to do is set `limit` to be `1` for every request. @@ -328,13 +328,13 @@ You will see something like below fluentd's log in `fluentd.log`: ~~~ -## Adaption for outgoing messages +## 出力メッセージの加工 In case we need to modify outgoing messages from Droonga Engine, for example, search results, then we can do it simply by another method. In this section, we are going to define a method to adapt outgoing messages. -### Add a method to adapt outgoing messages +### 出力のメッセージを加工するメソッドを追加する Let's take logs of results of `search` command. Define the `adapt_output` method to process outgoing messages. @@ -362,7 +362,7 @@ lib/droonga/plugins/sample-logger.rb: The method `adapt_output` is called only for outgoing messages triggered by incoming messages processed by the plugin itself. See the [reference manual for plugin developers](../../../reference/plugin/adapter/) for more details. -### Run +### 実行する Let's restart fluentd: @@ -409,7 +409,7 @@ The fluentd's log should be like as follows: This shows that the result of `search` is passed to the `adapt_output` method (and logged), then outputted. -### Modify results in the adaption phase +### 結果をadaption phaseで加工する Let's modify the result. For example, add `completedAt` attribute that shows the time completed the request. @@ -474,7 +474,7 @@ The results in `fluentd.log` will be like this: ~~~ -## Adaption for both incoming and outgoing messages +## 入出力メッセージの加工 We have learned the basics of plugins for the adaption phase so far. Let's try to build more practical plugin. -------------- next part -------------- HTML����������������������������... ダウンロード