documentation translation: cordova-plugin-network-information
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information/commit/0e18a3a0 Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information/tree/0e18a3a0 Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information/diff/0e18a3a0 Branch: refs/heads/master Commit: 0e18a3a0506ca81821f797c9a99e7f72fe2f1801 Parents: def55b8 Author: ldeluca <[email protected]> Authored: Tue May 27 21:36:58 2014 -0400 Committer: ldeluca <[email protected]> Committed: Tue May 27 21:36:58 2014 -0400 ---------------------------------------------------------------------- doc/de/index.md | 181 +++++++++++++++++++++++++++++++++++++++++++++++++++ doc/ja/index.md | 16 ++--- 2 files changed, 189 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information/blob/0e18a3a0/doc/de/index.md ---------------------------------------------------------------------- diff --git a/doc/de/index.md b/doc/de/index.md new file mode 100644 index 0000000..71e8647 --- /dev/null +++ b/doc/de/index.md @@ -0,0 +1,181 @@ +<!--- + 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.network-information + +Dieses Plugin stellt eine Implementierung einer alten Version der [Netzwerk-Informationen-API][1]. Es werden Informationen über das Gerät Mobilfunk und Wifi-Anschluss, und ob das Gerät über eine Internetverbindung verfügt. + + [1]: http://www.w3.org/TR/2011/WD-netinfo-api-20110607/ + +## Installation + + cordova plugin add org.apache.cordova.network-information + + +## Unterstützte Plattformen + +* Amazon Fire OS +* Android +* BlackBerry 10 +* iOS +* Windows Phone 7 und 8 +* Tizen +* Windows 8 +* Firefox OS + +# Verbindung + +> Das `connection` Objekt, verfügbar gemachten über `navigator.connection`, enthält Informationen über die Mobilfunk- und Wi-Fi-Verbindung des Gerätes. + +## Eigenschaften + +* connection.type + +## Konstanten + +* Connection.UNKNOWN +* Connection.ETHERNET +* Connection.WIFI +* Connection.CELL_2G +* Connection.CELL_3G +* Connection.CELL_4G +* Connection.CELL +* Connection.NONE + +## connection.type + +Diese Eigenschaft bietet eine schnelle Möglichkeit, um den Netzwerkverbindungsstatus und die Art der Verbindung zu bestimmen. + +### Kleines Beispiel + + function checkConnection() { + var networkState = navigator.connection.type; + + var states = {}; + states[Connection.UNKNOWN] = 'Unknown connection'; + states[Connection.ETHERNET] = 'Ethernet connection'; + states[Connection.WIFI] = 'WiFi connection'; + states[Connection.CELL_2G] = 'Cell 2G connection'; + states[Connection.CELL_3G] = 'Cell 3G connection'; + states[Connection.CELL_4G] = 'Cell 4G connection'; + states[Connection.CELL] = 'Cell generic connection'; + states[Connection.NONE] = 'No network connection'; + + alert('Connection type: ' + states[networkState]); + } + + checkConnection(); + + +### API Ãnderung + +Bis Cordova 2.3.0 wurde auf das `Connection` Objekt über `navigator.network.connection` zugegriffen, danach wurde der Zugriff auf `navigator.connection` geändert, um der W3C-Spezifikation zu entsprechen. Es steht immer noch an seiner ursprünglichen Stelle, aber ist veraltet und wird schliesslich entfernt. + +### iOS Macken + +* iOS kann Mobilfunknetz Verbindungstyp nicht erkennen. + * `navigator.connection.type`auf festgelegt ist `Connection.CELL` für alle Handy-Daten. + +### Windows Phone Macken + +* Wenn im Emulator ausgeführt wird, erkennt immer `navigator.connection.type` als`Connection.UNKNOWN`. + +* Windows Phone kann Mobilfunknetz Verbindungstyp nicht erkennen. + + * `navigator.connection.type`auf festgelegt ist `Connection.CELL` für alle Handy-Daten. + +### Tizen Macken + +* Tizen kann nur eine Wi-Fi- oder Mobilfunkverbindung erkennen. + * `navigator.connection.type`auf festgelegt ist `Connection.CELL_2G` für alle Handy-Daten. + +### Firefox OS Macken + +* Firefox-OS kann Mobilfunknetz Verbindungstyp nicht erkennen. + * `navigator.connection.type`auf festgelegt ist `Connection.CELL` für alle Handy-Daten. + +# Netzwerk-Veranstaltungen + +## offline + +Das Ereignis wird ausgelöst, wenn eine Anwendung offline geht, und das Gerät nicht mit dem Internet verbunden ist. + + document.addEventListener("offline", yourCallbackFunction, false); + + +### Informationen + +Das `offline` -Ereignis wird ausgelöst, wenn ein bereits angeschlossenes Gerät eine Netzwerkverbindung verliert, so dass eine Anwendung nicht mehr auf das Internet zugreifen kann. Es stützt sich auf die gleichen Informationen wie die Verbindung-API und wird ausgelöst, wenn die `connection.type` ändert sich von `NONE` auf einen anderen Wert. + +Anwendungen sollten in der Regel verwenden `document.addEventListener` einmal einen Ereignis-Listener hinzufügen das `deviceready` -Ereignis ausgelöst. + +### Kleines Beispiel + + document.addEventListener("offline", onOffline, false); + + function onOffline() { + // Handle the offline event + } + + +### iOS Macken + +Beim ersten Start dauert das erste offline-Event (falls zutreffend) mindestens eine Sekunde zu schieÃen. + +### Windows Phone 7 Macken + +Bei der Ausführung im Emulator, der `connection.status` ist immer unbekannt, so dass dieses Ereignis *nicht* Feuer. + +### Windows Phone 8 Macken + +Der Emulator meldet den Verbindungstyp als `Cellular` , die wird nicht geändert, so dass das Ereignis *nicht* Feuer. + +## online + +Dieses Ereignis wird ausgelöst, wenn eine Anwendung online geht, und das Gerät wird mit dem Internet verbunden. + + document.addEventListener("online", yourCallbackFunction, false); + + +### Informationen + +Das `online` -Ereignis wird ausgelöst, wenn ein zuvor unverbundenen Gerät eine Netzwerkverbindung zu einem Anwendung Zugriff auf das Internet empfängt. Es stützt sich auf die gleichen Informationen wie die Verbindung-API und wird ausgelöst, wenn der Wert des `connection.type` wird`NONE`. + +Anwendungen sollten in der Regel verwenden `document.addEventListener` einmal einen Ereignis-Listener hinzufügen das `deviceready` -Ereignis ausgelöst. + +### Kleines Beispiel + + document.addEventListener("online", onOnline, false); + + function onOnline() { + // Handle the online event + } + + +### iOS Macken + +Beim ersten Start die erste `online` Ereignis (falls zutreffend) dauert mindestens eine Sekunde vor dem Feuer `connection.type` ist`UNKNOWN`. + +### Windows Phone 7 Macken + +Bei der Ausführung im Emulator, der `connection.status` ist immer unbekannt, so dass dieses Ereignis *nicht* Feuer. + +### Windows Phone 8 Macken + +Der Emulator meldet den Verbindungstyp als `Cellular` , die wird nicht geändert, so dass Ereignisse *nicht* Feuer. \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information/blob/0e18a3a0/doc/ja/index.md ---------------------------------------------------------------------- diff --git a/doc/ja/index.md b/doc/ja/index.md index 965fc01..b24c49f 100644 --- a/doc/ja/index.md +++ b/doc/ja/index.md @@ -19,7 +19,7 @@ # org.apache.cordova.network-information -This plugin provides an implementation of an old version of the [Network Information API][1]. It provides information about the device's cellular and wifi connection, and whether the device has an internet connection. +ãã®ãã©ã°ã¤ã³ã¯ãå¤ããã¼ã¸ã§ã³ã®[ãããã¯ã¼ã¯æ å ± API][1]ã®å®è£ ãæä¾ãã¾ãã ããã¤ã¹ã®æºå¸¯é»è©±ã wifi æ¥ç¶ã«é¢ããæ å ±ãæä¾ãããã©ãããããã¤ã¹ãã¤ã³ã¿ã¼ãããã«æ¥ç¶ãã¾ãã [1]: http://www.w3.org/TR/2011/WD-netinfo-api-20110607/ @@ -37,7 +37,7 @@ This plugin provides an implementation of an old version of the [Network Informa * Windows Phone 7 㨠8 * Tizen * Windows 8 -* Firefox OS +* Firefox ã® OS # æ¥ç¶ @@ -90,27 +90,27 @@ This plugin provides an implementation of an old version of the [Network Informa ### iOS ã®ç * iOS ã¯ãæºå¸¯é»è©±ã®ãããã¯ã¼ã¯æ¥ç¶ã®ç¨®é¡ãæ¤åºã§ãã¾ããã - * `navigator.connection.type` is set to `Connection.CELL` for all cellular data. + * `navigator.connection.type`è¨å®ãã `Connection.CELL` ãã¹ã¦ã®æºå¸¯é»è©±ãã¼ã¿ã®ã ### Windows Phone ã®ç -* When running in the emulator, always detects `navigator.connection.type` as `Connection.UNKNOWN`. +* ã¨ãã¥ã¬ã¼ã¿ã¼ã§å®è¡ãã¦ããã¨ããå¸¸ã«æ¤åº `navigator.connection.type` ã¨ãã¦`Connection.UNKNOWN`. * Windows Phone æºå¸¯é»è©±ãããã¯ã¼ã¯æ¥ç¶ã®ç¨®é¡ãæ¤åºã§ãã¾ããã - * `navigator.connection.type` is set to `Connection.CELL` for all cellular data. + * `navigator.connection.type`è¨å®ãã `Connection.CELL` ãã¹ã¦ã®æºå¸¯é»è©±ãã¼ã¿ã®ã ### Tizen ã®ç * Tizen ã«ã¯ãWiFi ã¾ãã¯æºå¸¯é»è©±ã®æ¥ç¶ã ããæ¤åºã§ãã¾ãã - * `navigator.connection.type` is set to `Connection.CELL_2G` for all cellular data. + * `navigator.connection.type`è¨å®ãã `Connection.CELL_2G` ãã¹ã¦ã®æºå¸¯é»è©±ãã¼ã¿ã®ã ### Firefox OS ç * Firefox ã® OS ã¯ãæºå¸¯é»è©±ã®ãããã¯ã¼ã¯æ¥ç¶ã®ç¨®é¡ãæ¤åºã§ãã¾ããã - * `navigator.connection.type` is set to `Connection.CELL` for all cellular data. + * `navigator.connection.type`è¨å®ãã `Connection.CELL` ãã¹ã¦ã®æºå¸¯é»è©±ãã¼ã¿ã®ã -# Network-related Events +# ãããã¯ã¼ã¯é¢é£ã®ã¤ãã³ã ## offline
