YUKI Hiroshi
null+****@clear*****
Fri Dec 27 16:21:46 JST 2013
YUKI Hiroshi 2013-12-27 16:21:46 +0900 (Fri, 27 Dec 2013) New Revision: 6a01cd16e20cfba338e1804945bd782e45da2496 https://github.com/droonga/droonga.org/commit/6a01cd16e20cfba338e1804945bd782e45da2496 Message: Translate add command reference Modified files: _po/ja/reference/commands/add/index.po ja/reference/commands/add/index.md Modified: _po/ja/reference/commands/add/index.po (+183 -50) =================================================================== --- _po/ja/reference/commands/add/index.po 2013-12-27 14:48:10 +0900 (5a308bc) +++ _po/ja/reference/commands/add/index.po 2013-12-27 16:21:46 +0900 (8a9af19) @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2011-11-20 22:17+0900\n" -"PO-Revision-Date: 2013-12-19 14:53+0900\n" +"PO-Revision-Date: 2013-12-25 18:27+0900\n" "Last-Translator: Kouhei Sutou <kou �� clear-code.com>\n" "Language-Team: Japanese\n" "Language: ja\n" @@ -23,6 +23,10 @@ msgid "" "layout: documents\n" "---" msgstr "" +"---\n" +"title: add\n" +"layout: documents_ja\n" +"---" msgid "" "* TOC\n" @@ -30,24 +34,49 @@ msgid "" msgstr "" msgid "## Abstract {#abstract}" -msgstr "" +msgstr "## 概要 {#abstract}" msgid "" "The `add` command adds a new record to the specified table. Column values of t" "he existing record are updated by given values, if the table has a primary key" " and there is existing record with the specified key." msgstr "" +"`add` は、テーブルにレコードを登録します。対象のテーブルが主キーを持っており、同じキーのレコードが既に存在している場合には、既存レコードのカラムの値を" +"更新します。" msgid "" -"This is a request-response style command. One response message is always retur" -"ned per one request." +"Style\n" +": Request-Response. One response message is always returned per one request." msgstr "" +"形式\n" +": Request-Response型。コマンドに対しては必ず対応するレスポンスが返されます。" -msgid "## Syntax {#syntax}" +msgid "" +"`type` of the request\n" +": `add`" msgstr "" +"リクエストの `type`\n" +": `add`" -msgid "If the table has a primary key column:" +msgid "" +"`body` of the request\n" +": A hash of parameters." +msgstr "" +"リクエストの `body`\n" +": パラメータのハッシュ。" + +msgid "" +"`type` of the response\n" +": `add.result`" msgstr "" +"レスポンスの `type`\n" +": `add.result`" + +msgid "## Parameter syntax {#syntax}" +msgstr "## パラメータの構文 {#syntax}" + +msgid "If the table has a primary key column:" +msgstr "対象のテーブルが主キーを持つ場合:" msgid "" " {\n" @@ -60,9 +89,18 @@ msgid "" " }\n" " }" msgstr "" +" {\n" +" \"table\" : \"<テーブル名>\",\n" +" \"key\" : \"<レコードの主キー>\",\n" +" \"values\" : {\n" +" \"<カラム1の名前>\" : <値1>,\n" +" \"<カラム2の名前>\" : <値2>,\n" +" ...\n" +" }\n" +" }" msgid "If the table has no primary key column:" -msgstr "" +msgstr "対象のテーブルが主キーを持たない場合:" msgid "" " {\n" @@ -74,26 +112,37 @@ msgid "" " }\n" " }" msgstr "" +" {\n" +" \"table\" : \"<テーブル名>\",\n" +" \"values\" : {\n" +" \"<カラム1の名前>\" : <値1>,\n" +" \"<カラム2の名前>\" : <値2>,\n" +" ...\n" +" }\n" +" }" msgid "## Usage {#usage}" -msgstr "" +msgstr "## 使い方 {#usage}" msgid "" "This section describes how to use the `add` command, via a typical usage with " "following two tables:" -msgstr "" +msgstr "本項の説明では以下のような2つのテーブルが存在している事を前提として、典型的な使い方を通じて `add` コマンドの使い方を説明します。" msgid "Person table (without primary key):" -msgstr "" +msgstr "Personテーブル(主キー無し):" msgid "" "|name|job (referring the Job table)|\n" "|Alice Arnold|announcer|\n" "|Alice Cooper|musician|" msgstr "" +"|name|job (Jobテーブルを参照)|\n" +"|Alice Arnold|announcer|\n" +"|Alice Cooper|musician|" msgid "Job table (with primary key)" -msgstr "" +msgstr "Jobテーブル(主キー有り):" msgid "" "|_key|label|\n" @@ -104,27 +153,31 @@ msgstr "" msgid "" "### Adding a new record to a table without primary key {#adding-record-to-tabl" "e-without-key}" -msgstr "" +msgstr "### 主キーを持たないテーブルにレコードを追加する {#adding-record-to-table-without-key}" msgid "" "Specify only `table` and `values`, without `key`, if the table has no primary " "key." -msgstr "" +msgstr "主キーを持たないテーブルにレコードを追加する場合は、 `key` を指定せずに `table` と `values` だけを指定します。" msgid "" -" add\n" " {\n" -" \"table\" : \"Person\",\n" -" \"values\" : {\n" -" \"name\" : \"Bob Dylan\",\n" -" \"job\" : \"musician\"\n" +" \"type\" : \"add\",\n" +" \"body\" : {\n" +" \"table\" : \"Person\",\n" +" \"values\" : {\n" +" \"name\" : \"Bob Dylan\",\n" +" \"job\" : \"musician\"\n" +" }\n" " }\n" " }" msgstr "" msgid "" -" => add.result\n" -" true" +" => {\n" +" \"type\" : \"add.result\",\n" +" \"body\" : true\n" +" }" msgstr "" msgid "" @@ -133,14 +186,19 @@ msgid "" "ll see no error response. For example this will add a new Person record with a" " new Job record named `doctor`." msgstr "" +"`add` は再帰的に動作します。別のテーブルを参照しているカラムについて、参照先のテーブルに存在しない値を指定した場合、エラーにはならず、参照先のテーブル" +"にも同時に新しいレコードが追加されます。例えば、以下は テーブルに存在しない主キー `doctor` を伴って Person テーブルにレコードを追加しま" +"す。" msgid "" -" add\n" " {\n" -" \"table\" : \"Person\",\n" -" \"values\" : {\n" -" \"name\" : \"Alice Miller\",\n" -" \"job\" : \"doctor\"\n" +" \"type\" : \"add\",\n" +" \"body\" : {\n" +" \"table\" : \"Person\",\n" +" \"values\" : {\n" +" \"name\" : \"Alice Miller\",\n" +" \"job\" : \"doctor\"\n" +" }\n" " }\n" " }" msgstr "" @@ -148,7 +206,7 @@ msgstr "" msgid "" "By the command above, a new record will be automatically added to the Job tabl" "e like;" -msgstr "" +msgstr "この時、Jobテーブルには主キーだけが指定された新しいレコードが自動的に追加されます。" msgid "" "|_key|label|\n" @@ -156,43 +214,51 @@ msgid "" "|musician|musician|\n" "|doctor|(blank)|" msgstr "" +"|_key|label|\n" +"|announcer|announcer|\n" +"|musician|musician|\n" +"|doctor|(空文字)|" msgid "" "### Adding a new record to a table with primary key {#adding-record-to-table-w" "ith-key}" -msgstr "" +msgstr "### 主キーを持つテーブルにレコードを追加する {#adding-record-to-table-with-key}" msgid "" "Specify all parameters `table`, `values` and `key`, if the table has a primary" " key column." -msgstr "" +msgstr "主キーを持つテーブルにレコードを追加する場合は、 `table`、`key`、`values` のすべてを指定します。" msgid "" -" add\n" " {\n" -" \"table\" : \"Job\",\n" -" \"key\" : \"writer\",\n" -" \"values\" : {\n" -" \"label\" : \"writer\"\n" +" \"type\" : \"add\",\n" +" \"body\" : {\n" +" \"table\" : \"Job\",\n" +" \"key\" : \"writer\",\n" +" \"values\" : {\n" +" \"label\" : \"writer\"\n" +" }\n" " }\n" " }" msgstr "" msgid "### Updating column values of an existing record {#updating}" -msgstr "" +msgstr "### 既存レコードのカラムの値を更新する {#updating}" msgid "" "This command works as \"updating\" operation, if the table has a primary key col" "umn and there is an existing record for the specified key." -msgstr "" +msgstr "主キーを持つテーブルに対する、既存レコードの主キーを伴う `add` コマンドは、既存レコードのカラムの値の更新操作と見なされます。" msgid "" -" add\n" " {\n" -" \"table\" : \"Job\",\n" -" \"key\" : \"doctor\",\n" -" \"values\" : {\n" -" \"label\" : \"doctor\"\n" +" \"type\" : \"add\",\n" +" \"body\" : {\n" +" \"table\" : \"Job\",\n" +" \"key\" : \"doctor\",\n" +" \"values\" : {\n" +" \"label\" : \"doctor\"\n" +" }\n" " }\n" " }" msgstr "" @@ -201,10 +267,10 @@ msgid "" "You cannot update column values of existing records, if the table has no prima" "ry key column. Then this command will always work as \"adding\" operation for th" "e table." -msgstr "" +msgstr "主キーを持たないテーブルのレコードに対しては、値の更新操作はできません(常にレコードの追加と見なされます)。" -msgid "## Parameters {#parameters}" -msgstr "" +msgid "## Parameter details {#parameters}" +msgstr "## パラメータの詳細 {#parameters}" msgid "### `table` {#parameter-table}" msgstr "" @@ -213,16 +279,22 @@ msgid "" "Abstract\n" ": The name of a table which a record is going to be added to." msgstr "" +"概要\n" +": レコードを登録するテーブルの名前を指定します。" msgid "" "Value\n" ": A name string of an existing table." msgstr "" +"値\n" +": テーブル名の文字列。" msgid "" "Default value\n" ": Nothing. This is a required parameter." msgstr "" +"省略時の既定値\n" +": なし。このパラメータは必須です。" msgid "### `key` {#parameter-key}" msgstr "" @@ -231,25 +303,31 @@ msgid "" "Abstract\n" ": The primary key for the record going to be added." msgstr "" +"概要\n" +": レコードの主キーを指定します。" msgid "" "Value\n" ": A primary key string." msgstr "" +"値\n" +": 主キーとなる文字列。" msgid "" "Default value\n" ": Nothing. This is required if the table has a primary key column. Otherwise, " "this is ignored." msgstr "" +"省略時の初期値\n" +": Nなし。対象のテーブルが主キーを持つ場合、このパラメータは必須です。主キーがない場合、このパラメータは無視されます。" msgid "" "Existing column values will be updated, if there is an existing record for the" " key." -msgstr "" +msgstr "既に同じ主キーを持つレコードが存在している場合は、レコードの各カラムの値を更新します。" msgid "This parameter will be ignored if the table has no primary key column." -msgstr "" +msgstr "対象のテーブルが主キーを持たない場合は、指定しても単に無視されます。" msgid "### `values` {#parameter-values}" msgstr "" @@ -258,30 +336,85 @@ msgid "" "Abstract\n" ": New values for columns of the record." msgstr "" +"概要\n" +": レコードの各カラムの値を指定します。" msgid "" "Value\n" ": A hash. Keys of the hash are column names, values of the hash are new values" " for each column." msgstr "" +"値\n" +": カラム名をキー、カラムの値を値としたハッシュ。" msgid "" "Default value\n" ": `null`" msgstr "" +"省略時の初期値\n" +": `null`" msgid "Value of unspecified columns will not be changed." -msgstr "" +msgstr "指定されなかったカラムの値は登録・更新されません。" msgid "## Responses {#response}" +msgstr "## レスポンス {#response}" + +msgid "" +"This returns a boolean value `true` like following as the response's `body`, w" +"ith `200` as its `statusCode`, if a record is successfully added or updated." +msgstr "" +"このコマンドは、レコードを正常に追加または更新できた場合、真偽値 `true` を`body` 、`200` を `statusCode` としたレスポンス" +"を返します。以下はレスポンスの `body` の例です。" + +msgid " true" msgstr "" +msgid "## Error types {#errors}" +msgstr "## エラーの種類 {#errors}" + msgid "" -"This returns an array including a boolean value which means the operation was " -"successfully done or not." +"This command reports errors not only [general errors](/reference/message/#erro" +"r) but also followings." +msgstr "このコマンドは[一般的なエラー](/ja/reference/message/#error)に加えて、以下のエラーを場合に応じて返します。" + +msgid "### `MissingTableParameter`" msgstr "" msgid "" -" * `[true]`:The record was successfully added or updated.\n" -" * `[false]`:Failed to add or update a record." +"Means you've forgotten to specify the `table` parameter. The status code is `4" +"00`." +msgstr "`table` パラメータの指定を忘れていることを示します。ステータスコードは `400` です。" + +msgid "### `MissingPrimaryKeyParameter`" msgstr "" + +msgid "" +"Means you've forgotten to specify the `key` parameter, for a table with the pr" +"imary key column. The status code is `400`." +msgstr "主キーが存在するテーブルに対して、`key` パラメータの指定を忘れていることを示します。ステータスコードは `400` です。" + +msgid "### `InvalidValue`" +msgstr "" + +msgid "" +"Means you've specified an invalid value for a column. For example, a string fo" +"r a geolocation column, a string for an integer column, etc. The status code i" +"s `400`." +msgstr "カラムに設定しようとした値が不正である(例:位置情報型や整数型のカラムに通常の文字列を指定した、など)事を示します。ステータスコードは `400` です。" + +msgid "### `UnknownTable`" +msgstr "" + +msgid "" +"Means you've specified a table which is not existing in the specified dataset." +" The status code is `404`." +msgstr "指定されたデータセット内に、指定されたレコードが存在していない事を示します。ステータスコードは `404` です。" + +msgid "### `UnknownColumn`" +msgstr "" + +msgid "" +"Means you've specified any column which is not existing in the specified table" +". The status code is `404`." +msgstr "指定されたカラムがテーブルに存在しない未知のカラムである事を示します。ステータスコードは `400` です。" Modified: ja/reference/commands/add/index.md (+99 -53) =================================================================== --- ja/reference/commands/add/index.md 2013-12-27 14:48:10 +0900 (025f7f3) +++ ja/reference/commands/add/index.md 2013-12-27 16:21:46 +0900 (ccfcf1a) @@ -8,22 +8,30 @@ layout: documents_ja ## 概要 {#abstract} -`add` は、テーブルにレコードを登録します。 +`add` は、テーブルにレコードを登録します。対象のテーブルが主キーを持っており、同じキーのレコードが既に存在している場合には、既存レコードのカラムの値を更新します。 -対象のテーブルが主キーを持っており、同じキーのレコードが既に存在している場合には、既存レコードのカラムの値を更新します。 +形式 +: Request-Response型。コマンドに対しては必ず対応するレスポンスが返されます。 -`add` はRequest-Response型のコマンドです。コマンドに対しては必ず対応するレスポンスが返されます。 +リクエストの `type` +: `add` -## 構文 {#syntax} +リクエストの `body` +: パラメータのハッシュ。 + +レスポンスの `type` +: `add.result` + +## パラメータの構文 {#syntax} 対象のテーブルが主キーを持つ場合: { - "table" : "テーブル名", - "key" : "主キー", + "table" : "<テーブル名>", + "key" : "<レコードの主キー>", "values" : { - "カラム名1" : 値1, - "カラム名2" : 値2, + "<カラム1の名前>" : <値1>, + "<カラム2の名前>" : <値2>, ... } } @@ -31,108 +39,122 @@ layout: documents_ja 対象のテーブルが主キーを持たない場合: { - "table" : "テーブル名", + "table" : "<テーブル名>", "values" : { - "カラム名1" : 値1, - "カラム名2" : 値2, + "<カラム1の名前>" : <値1>, + "<カラム2の名前>" : <値2>, ... } } ## 使い方 {#usage} -典型的な使い方を通じて、`add` コマンドの働きを説明します。 - -なお、本項の説明では以下のような2つのテーブルが存在している事を前提とします。 +本項の説明では以下のような2つのテーブルが存在している事を前提として、典型的な使い方を通じて `add` コマンドの使い方を説明します。 Personテーブル(主キー無し): -|name|job(Jobテーブルを参照)| +|name|job (Jobテーブルを参照)| |Alice Arnold|announcer| |Alice Cooper|musician| Jobテーブル(主キー有り): |_key|label| -|announcer|アナウンサー| -|musician|ミュージシャン| +|announcer|announcer| +|musician|musician| ### 主キーを持たないテーブルにレコードを追加する {#adding-record-to-table-without-key} 主キーを持たないテーブルにレコードを追加する場合は、 `key` を指定せずに `table` と `values` だけを指定します。 - add { - "table" : "Person", - "values" : { - "name" : "Bob Dylan", - "job" : "musician" + "type" : "add", + "body" : { + "table" : "Person", + "values" : { + "name" : "Bob Dylan", + "job" : "musician" + } } } - => add.result - true + => { + "type" : "add.result", + "body" : true + } `add` は再帰的に動作します。別のテーブルを参照しているカラムについて、参照先のテーブルに存在しない値を指定した場合、エラーにはならず、参照先のテーブルにも同時に新しいレコードが追加されます。例えば、以下は テーブルに存在しない主キー `doctor` を伴って Person テーブルにレコードを追加します。 - add { - "table" : "Person", - "values" : { - "name" : "Alice Miller", - "job" : "doctor" + "type" : "add", + "body" : { + "table" : "Person", + "values" : { + "name" : "Alice Miller", + "job" : "doctor" + } } } - => add.result - true + => { + "type" : "add.result", + "body" : true + } この時、Jobテーブルには主キーだけが指定された新しいレコードが自動的に追加されます。 |_key|label| -|announcer|アナウンサー| -|musician|ミュージシャン| -|doctor|(空文字)| +|announcer|announcer| +|musician|musician| +|doctor|(空文字)| ### 主キーを持つテーブルにレコードを追加する {#adding-record-to-table-with-key} 主キーを持つテーブルにレコードを追加する場合は、 `table`、`key`、`values` のすべてを指定します。 - add { - "table" : "Job", - "key" : "writer", - "values" : { - "label" : "作家" + "type" : "add", + "body" : { + "table" : "Job", + "key" : "writer", + "values" : { + "label" : "writer" + } } } - => add.result - true + => { + "type" : "add.result", + "body" : true + } ### 既存レコードのカラムの値を更新する {#updating} 主キーを持つテーブルに対する、既存レコードの主キーを伴う `add` コマンドは、既存レコードのカラムの値の更新操作と見なされます。 - add { - "table" : "Job", - "key" : "doctor", - "values" : { - "label" : "医師" + "type" : "add", + "body" : { + "table" : "Job", + "key" : "doctor", + "values" : { + "label" : "doctor" + } } } - => add.result - true + => { + "type" : "add.result", + "body" : true + } 主キーを持たないテーブルのレコードに対しては、値の更新操作はできません(常にレコードの追加と見なされます)。 -## パラメータ {#parameters} +## パラメータの詳細 {#parameters} ### `table` {#parameter-table} @@ -154,7 +176,7 @@ Jobテーブル(主キー有り): : 主キーとなる文字列。 省略時の初期値 -: なし。対象のテーブルが主キーを持つ場合、このパラメータは必須です。主キーがない場合、このパラメータは無視されます。 +: Nなし。対象のテーブルが主キーを持つ場合、このパラメータは必須です。主キーがない場合、このパラメータは無視されます。 既に同じ主キーを持つレコードが存在している場合は、レコードの各カラムの値を更新します。 @@ -176,7 +198,31 @@ Jobテーブル(主キー有り): ## レスポンス {#response} -このコマンドは、レスポンスとしてレコードの登録の成否を示す真偽値を含んだ配列を返却します。 +このコマンドは、レコードを正常に追加または更新できた場合、真偽値 `true` を`body` 、`200` を `statusCode` としたレスポンスを返します。以下はレスポンスの `body` の例です。 + + true + +## エラーの種類 {#errors} + +このコマンドは[一般的なエラー](/ja/reference/message/#error)に加えて、以下のエラーを場合に応じて返します。 + +### `MissingTableParameter` + +`table` パラメータの指定を忘れていることを示します。ステータスコードは `400` です。 + +### `MissingPrimaryKeyParameter` + +主キーが存在するテーブルに対して、`key` パラメータの指定を忘れていることを示します。ステータスコードは `400` です。 + +### `InvalidValue` + +カラムに設定しようとした値が不正である(例:位置情報型や整数型のカラムに通常の文字列を指定した、など)事を示します。ステータスコードは `400` です。 + +### `UnknownTable` + +指定されたデータセット内に、指定されたレコードが存在していない事を示します。ステータスコードは `404` です。 + +### `UnknownColumn` + +指定されたカラムがテーブルに存在しない未知のカラムである事を示します。ステータスコードは `400` です。 - * `[true]`:レコードの登録に成功した。 - * `[false]`:レコードの登録に失敗した。 -------------- next part -------------- HTML����������������������������...Download