You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ld...@apache.org on 2014/07/07 19:50:55 UTC
[10/14] git commit: documentation translation:
cordova-plugin-file-transfer
documentation translation: cordova-plugin-file-transfer
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/commit/df530ad5
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/tree/df530ad5
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/diff/df530ad5
Branch: refs/heads/master
Commit: df530ad57beafdb5d0d1b39e4ed1c406936a8813
Parents: 131f84f
Author: ldeluca <ld...@us.ibm.com>
Authored: Tue May 27 21:36:29 2014 -0400
Committer: ldeluca <ld...@us.ibm.com>
Committed: Tue May 27 21:36:29 2014 -0400
----------------------------------------------------------------------
doc/de/index.md | 281 +++++++++++++++++++++++++++++++++++++++++++++++++++
doc/ja/index.md | 18 ++--
2 files changed, 290 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/blob/df530ad5/doc/de/index.md
----------------------------------------------------------------------
diff --git a/doc/de/index.md b/doc/de/index.md
new file mode 100644
index 0000000..b767161
--- /dev/null
+++ b/doc/de/index.md
@@ -0,0 +1,281 @@
+<!---
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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.
+-->
+
+# org.apache.cordova.file-transfer
+
+Dieses Plugin ermöglicht Ihnen zum Hochladen und Herunterladen von Dateien.
+
+## Installation
+
+ cordova plugin add org.apache.cordova.file-transfer
+
+
+## Unterstützte Plattformen
+
+* Amazon Fire OS
+* Android
+* BlackBerry 10 *
+* iOS
+* Windows Phone 7 und 8 *
+* Windows 8 *
+
+* *Unterstützen nicht `onprogress` noch `abort()` *
+
+# FileTransfer
+
+Das `FileTransfer` Objekt bietet eine Möglichkeit zum Hochladen von Dateien, die mithilfe einer HTTP-Anforderung für mehrteiligen POST sowie Informationen zum Herunterladen von Dateien sowie.
+
+## Eigenschaften
+
+* **OnProgress**: aufgerufen, wobei ein `ProgressEvent` wann wird eine neue Datenmenge übertragen. *(Funktion)*
+
+## Methoden
+
+* **Upload**: sendet eine Datei an einen Server.
+
+* **Download**: lädt eine Datei vom Server.
+
+* **Abbrechen**: Abbruch eine Übertragung in Bearbeitung.
+
+## Upload
+
+**Parameter**:
+
+* **FileURL**: Dateisystem-URL, das die Datei auf dem Gerät. Für rückwärts Kompatibilität, dies kann auch der vollständige Pfad der Datei auf dem Gerät sein. (Siehe [rückwärts Kompatibilität Notes] unten)
+
+* **Server**: URL des Servers, die Datei zu empfangen, wie kodiert`encodeURI()`.
+
+* **SuccessCallback**: ein Rückruf, der übergeben wird ein `Metadata` Objekt. *(Funktion)*
+
+* **ErrorCallback**: ein Rückruf, der ausgeführt wird, tritt ein Fehler beim Abrufen der `Metadata` . Aufgerufene mit einem `FileTransferError` Objekt. *(Funktion)*
+
+* **TrustAllHosts**: Optionaler Parameter, wird standardmäßig auf `false` . Wenn legen Sie auf `true` , es akzeptiert alle Sicherheitszertifikate. Dies ist nützlich, da Android selbstsignierte Zertifikate ablehnt. Nicht für den produktiven Einsatz empfohlen. Auf Android und iOS unterstützt. *(Boolean)*
+
+* **Optionen**: optionale Parameter *(Objekt)*. Gültige Schlüssel:
+
+ * **FileKey**: der Name des Form-Elements. Wird standardmäßig auf `file` . (DOM-String und enthält)
+ * **Dateiname**: der Dateiname beim Speichern der Datei auf dem Server verwendet. Wird standardmäßig auf `image.jpg` . (DOM-String und enthält)
+ * **MimeType**: den Mime-Typ der Daten hochzuladen. Wird standardmäßig auf `image/jpeg` . (DOM-String und enthält)
+ * **Params**: eine Reihe von optionalen Schlüssel/Wert-Paaren in der HTTP-Anforderung übergeben. (Objekt)
+ * **ChunkedMode**: ob die Daten in "Chunked" streaming-Modus hochladen. Wird standardmäßig auf `true` . (Boolean)
+ * **Header**: eine Karte von Header-Name-Header-Werte. Verwenden Sie ein Array, um mehr als einen Wert anzugeben. (Objekt)
+
+### Beispiel
+
+ // !! Assumes variable fileURL contains a valid URL to a text file on the device,
+ // for example, cdvfile://localhost/persistent/path/to/file.txt
+
+ var win = function (r) {
+ console.log("Code = " + r.responseCode);
+ console.log("Response = " + r.response);
+ console.log("Sent = " + r.bytesSent);
+ }
+
+ var fail = function (error) {
+ alert("An error has occurred: Code = " + error.code);
+ console.log("upload error source " + error.source);
+ console.log("upload error target " + error.target);
+ }
+
+ var options = new FileUploadOptions();
+ options.fileKey = "file";
+ options.fileName = fileURL.substr(fileURL.lastIndexOf('/') + 1);
+ options.mimeType = "text/plain";
+
+ var params = {};
+ params.value1 = "test";
+ params.value2 = "param";
+
+ options.params = params;
+
+ var ft = new FileTransfer();
+ ft.upload(fileURL, encodeURI("http://some.server.com/upload.php"), win, fail, options);
+
+
+### Beispiel mit hochladen Kopf- und Progress-Ereignisse (Android und iOS nur)
+
+ function win(r) {
+ console.log("Code = " + r.responseCode);
+ console.log("Response = " + r.response);
+ console.log("Sent = " + r.bytesSent);
+ }
+
+ function fail(error) {
+ alert("An error has occurred: Code = " + error.code);
+ console.log("upload error source " + error.source);
+ console.log("upload error target " + error.target);
+ }
+
+ var uri = encodeURI("http://some.server.com/upload.php");
+
+ var options = new FileUploadOptions();
+ options.fileKey="file";
+ options.fileName=fileURL.substr(fileURL.lastIndexOf('/')+1);
+ options.mimeType="text/plain";
+
+ var headers={'headerParam':'headerValue'};
+
+ options.headers = headers;
+
+ var ft = new FileTransfer();
+ ft.onprogress = function(progressEvent) {
+ if (progressEvent.lengthComputable) {
+ loadingStatus.setPercentage(progressEvent.loaded / progressEvent.total);
+ } else {
+ loadingStatus.increment();
+ }
+ };
+ ft.upload(fileURL, uri, win, fail, options);
+
+
+## FileUploadResult
+
+A `FileUploadResult` -Objekt wird an den Erfolg-Rückruf des übergeben die `FileTransfer` des Objekts `upload()` Methode.
+
+### Eigenschaften
+
+* **BytesSent**: die Anzahl der Bytes, die als Teil des Uploads an den Server gesendet. (lange)
+
+* **ResponseCode**: die HTTP-Response-Code vom Server zurückgegeben. (lange)
+
+* **Antwort**: der HTTP-Antwort vom Server zurückgegeben. (DOM-String und enthält)
+
+* **Header**: die HTTP-Response-Header vom Server. (Objekt)
+
+ * Derzeit unterstützt auf iOS nur.
+
+### iOS Macken
+
+* Unterstützt keine `responseCode` oder`bytesSent`.
+
+## Download
+
+**Parameter**:
+
+* **Quelle**: URL des Servers, um die Datei herunterzuladen, wie kodiert`encodeURI()`.
+
+* **Ziel**: Dateisystem-Url, das die Datei auf dem Gerät. Für rückwärts Kompatibilität, dies kann auch der vollständige Pfad der Datei auf dem Gerät sein. (Siehe [rückwärts Kompatibilität Notes] unten)
+
+* **SuccessCallback**: ein Rückruf, der übergeben wird ein `FileEntry` Objekt. *(Funktion)*
+
+* **ErrorCallback**: ein Rückruf, der ausgeführt wird, tritt ein Fehler beim Abrufen der `Metadata` . Aufgerufene mit einem `FileTransferError` Objekt. *(Funktion)*
+
+* **TrustAllHosts**: Optionaler Parameter, wird standardmäßig auf `false` . Wenn legen Sie auf `true` , es akzeptiert alle Sicherheitszertifikate. Dies ist nützlich, da Android selbstsignierte Zertifikate ablehnt. Nicht für den produktiven Einsatz empfohlen. Auf Android und iOS unterstützt. *(Boolean)*
+
+* **Optionen**: optionale Parameter, derzeit nur unterstützt Kopfzeilen (z. B. Autorisierung (Standardauthentifizierung), etc.).
+
+### Beispiel
+
+ // !! Assumes variable fileURL contains a valid URL to a path on the device,
+ // for example, cdvfile://localhost/persistent/path/to/downloads/
+
+ var fileTransfer = new FileTransfer();
+ var uri = encodeURI("http://some.server.com/download.php");
+
+ fileTransfer.download(
+ uri,
+ fileURL,
+ function(entry) {
+ console.log("download complete: " + entry.fullPath);
+ },
+ function(error) {
+ console.log("download error source " + error.source);
+ console.log("download error target " + error.target);
+ console.log("upload error code" + error.code);
+ },
+ false,
+ {
+ headers: {
+ "Authorization": "Basic dGVzdHVzZXJuYW1lOnRlc3RwYXNzd29yZA=="
+ }
+ }
+ );
+
+
+## Abbruch
+
+Bricht einen in-Progress-Transfer. Der Onerror-Rückruf wird ein FileTransferError-Objekt übergeben, die einen Fehlercode FileTransferError.ABORT_ERR hat.
+
+### Beispiel
+
+ // !! Assumes variable fileURL contains a valid URL to a text file on the device,
+ // for example, cdvfile://localhost/persistent/path/to/file.txt
+
+ var win = function(r) {
+ console.log("Should not be called.");
+ }
+
+ var fail = function(error) {
+ // error.code == FileTransferError.ABORT_ERR
+ alert("An error has occurred: Code = " + error.code);
+ console.log("upload error source " + error.source);
+ console.log("upload error target " + error.target);
+ }
+
+ var options = new FileUploadOptions();
+ options.fileKey="file";
+ options.fileName="myphoto.jpg";
+ options.mimeType="image/jpeg";
+
+ var ft = new FileTransfer();
+ ft.upload(fileURL, encodeURI("http://some.server.com/upload.php"), win, fail, options);
+ ft.abort();
+
+
+## FileTransferError
+
+A `FileTransferError` Objekt wird an eine Fehler-Callback übergeben, wenn ein Fehler auftritt.
+
+### Eigenschaften
+
+* **Code**: einer der vordefinierten Fehlercodes aufgeführt. (Anzahl)
+
+* **Quelle**: URL der Quelle. (String)
+
+* **Ziel**: URL zum Ziel. (String)
+
+* **HTTP_STATUS**: HTTP-Statuscode. Dieses Attribut ist nur verfügbar, wenn ein Response-Code aus der HTTP-Verbindung eingeht. (Anzahl)
+
+### Konstanten
+
+* `FileTransferError.FILE_NOT_FOUND_ERR`
+* `FileTransferError.INVALID_URL_ERR`
+* `FileTransferError.CONNECTION_ERR`
+* `FileTransferError.ABORT_ERR`
+
+## Hinweise rückwärts Kompatibilität
+
+Frühere Versionen des Plugins würde nur Gerät-Absolute-Dateipfade als Quelle für Uploads oder als Ziel für Downloads übernehmen. Diese Pfade wäre in der Regel der form
+
+ /var/mobile/Applications/<application UUID>/Documents/path/to/file (iOS)
+ /storage/emulated/0/path/to/file (Android)
+
+
+Für rückwärts Kompatibilität, diese Pfade noch akzeptiert werden, und wenn Ihre Anwendung Pfade wie diese im permanenten Speicher aufgezeichnet hat, dann sie können weiter verwendet werden.
+
+Diese Pfade waren zuvor ausgesetzt, der `fullPath` -Eigenschaft des `FileEntry` und `DirectoryEntry` Objekte, die durch das Plugin Datei zurückgegeben. Neue Versionen der die Datei-Erweiterung, jedoch nicht länger werden diese Pfade zu JavaScript.
+
+Wenn Sie ein auf eine neue Upgrade (1.0.0 oder neuere) Version der Datei und Sie zuvor verwendet haben `entry.fullPath` als Argumente für `download()` oder `upload()` , dann du den Code musst, um die Dateisystem-URLs verwenden zu ändern.
+
+`FileEntry.toURL()`und `DirectoryEntry.toURL()` zurück, eine Dateisystem-URL in der Form
+
+ cdvfile://localhost/persistent/path/to/file
+
+
+die benutzt werden kann, anstelle der absoluten Dateipfad in beiden `download()` und `upload()` Methoden.
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/blob/df530ad5/doc/ja/index.md
----------------------------------------------------------------------
diff --git a/doc/ja/index.md b/doc/ja/index.md
index b57d591..ef7883a 100644
--- a/doc/ja/index.md
+++ b/doc/ja/index.md
@@ -19,7 +19,7 @@
# org.apache.cordova.file-transfer
-This plugin allows you to upload and download files.
+このプラグインは、アップロードし、ファイルをダウンロードすることができます。
## インストール
@@ -30,16 +30,16 @@ This plugin allows you to upload and download files.
* アマゾン火 OS
* アンドロイド
-* BlackBerry 10*
+* ブラックベリー 10 *
* iOS
-* Windows Phone 7 and 8*
-* Windows 8*
+* Windows Phone 7 と 8 *
+* Windows 8 *
-* *Do not support `onprogress` nor `abort()`*
+**サポートしていない `onprogress` も `abort()` *
# ファイル転送
-The `FileTransfer` object provides a way to upload files using an HTTP multi-part POST request, and to download files as well.
+`FileTransfer`オブジェクトはマルチパートのポスト、HTTP 要求を使用してファイルをアップロードして同様にファイルをダウンロードする方法を提供します。
## プロパティ
@@ -57,7 +57,7 @@ The `FileTransfer` object provides a way to upload files using an HTTP multi-par
**パラメーター**:
-* **fileURL**: Filesystem URL representing the file on the device. For backwards compatibility, this can also be the full path of the file on the device. (参照してください [後方互換性メモ] の下)
+* **fileURL**: デバイス上のファイルを表すファイルシステム URL。 下位互換性は、このことも、デバイス上のファイルの完全パスであります。 (参照してください [後方互換性メモ] の下)
* **サーバー**: によって符号化されるように、ファイルを受信するサーバーの URL`encodeURI()`.
@@ -67,7 +67,7 @@ The `FileTransfer` object provides a way to upload files using an HTTP multi-par
* **trustAllHosts**: 省略可能なパラメーターは、デフォルト `false` 。 場合設定 `true` 、セキュリティ証明書をすべて受け付けます。 これは Android の自己署名入りセキュリティ証明書を拒否するので便利です。 運用環境で使用しないでください。 Android と iOS でサポートされています。 *(ブール値)*
-* **options**: Optional parameters *(Object)*. Valid keys:
+* **オプション**: 省略可能なパラメーター *(オブジェクト)*。有効なキー:
* **fileKey**: フォーム要素の名前。既定値は `file` です。(,)
* **ファイル名**: ファイル名、サーバー上のファイルを保存するときに使用します。既定値は `image.jpg` です。(,)
@@ -108,7 +108,7 @@ The `FileTransfer` object provides a way to upload files using an HTTP multi-par
ft.upload(fileURL, encodeURI("http://some.server.com/upload.php"), win, fail, options);
-### Example with Upload Headers and Progress Events (Android and iOS only)
+### サンプルのアップロード ヘッダーと進行状況のイベント (Android と iOS のみ)
function win(r) {
console.log("Code = " + r.responseCode);