Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

翻译location.md #12

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

翻译location.md #12

wants to merge 4 commits into from

Conversation

lordmos
Copy link

@lordmos lordmos commented Sep 24, 2017

location.md初翻已经完成

> **IMPORTANT:** Starting with NativeScript 1.5.0, the built-in Location module is deprecated. To implement geolocation in your apps, use the `nativescript-geolocation` plugin, available via npm. This plugin provides an API similar to the [W3C Geolocation API](http://dev.w3.org/geo/api/spec-source.html).

> **重要信息:** 从NativeScript 1.5.0版本开始, 内建的地理位置模块将被弃用. 若需要在您的应用中实现地理位置处理相关功能, 可以通过npm安装使用`nativescript-geolocation`插件。 该插件提供了类似于[W3C Geolocation API](http://dev.w3.org/geo/api/spec-source.html)的API。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

“已被弃用”可直接翻译为“已弃用”,英文中很多被动语句在中文中并不需要加“被”。

“若需要在您的应用中实现地理位置处理相关功能, 可以通过npm安装使用nativescript-geolocation插件”
建议改为
“若要在应用中实现处理地理位置的功能,可用npm安装一个nativescript-geolocation插件”

这样比较简短,而且英文中使用的you在很多情况下并不需要翻译。

The most important difference between the deprecated module and the new plugin is that location monitoring via the plugin returns an `id` that you can use to stop location monitoring. The `nativescript-geolocation` plugin also uses an accuracy criteria approach to deliver geolocation. This means that getting a location is powered by the most accurate location provider that is available. For example, if a GPS signal is available and the GPS provider is enabled, the plugin uses GPS; if GPS is not connected, the device falls back to other available providers such as Wi-Fi networks or cell towers).

被弃用的模块和新启用的插件之间最大的区别在于,通过插件获取到的位置监控器返回一个`id`,你可以通过使用这个`id`来结束位置监控器。此外,`nativescript-geolocation`插件还通过使用一种高精度标准的方式来提供地理位置信息。这意味着获取的位置信息由当前可用的最精确的位置提供者提供。例如,如果可以获取到GPS信号而且GPS提供者被启用,则插件使用GPS;如果GPS无法连接,则设备使用其他可用的提供者例如Wi-Fi网络或者蜂窝网络信号塔。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

”通过插件获取到的位置监控器(会)返回一个id,你可以 通过使 用这个id结束 停止位置监控器“。位置监控器是个名词,一般”结束“后面要跟动词。所以可改为停止监控器或者结束监控。

建议翻译完英文之后,完整的通读一遍中文,避免英文语法带来的翻译腔。

This approach does not limit location monitoring only to a specific location provider; it can still work with all of them.

这种方式并不是要限制位置监控器,使其使用某个特定的位置提供者;所有的位置提供者均被会使用。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

但这种方式并不会把位置监控器限定为某个特定的位置提供者,而是仍使用全部的。

You might want to start with this [example](https://github.com/nsndeck/locationtest), which demonstrates how to use the `nativescript-geolocation` plugin.

你可能会希望通过一个教你如何使用`nativescript-geolocation`插件的[示例](https://github.com/nsndeck/locationtest)来开始了解这一部分的内容。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

你可能会希望先通过一个示例来学会如何使用nativescript-geolocation插件。

After you install the plugin, you can request to use location services in the app with the code in __Example 1__:

在你完成插件的安装后,你可以使用__样例1__中的代码来请求使用位置服务。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

”你“字过多,在中文中一个语句中出现两个”你“通常是坏味道。

比如可翻译为:

在安装完插件后,你可以使用__样例1__中的代码来申请使用位置服务。

> Example 1: How to enable location service on a device

> 样例1:如何在设备启用位置服务
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果在设备启用位置服务

@@ -88,12 +128,20 @@ You can get location with `getCurrentLocation` or with `watchLocation`. Using `d

This method gets a single location. It accepts the `location options` parameter.

这个方法获取单个位置信息。方法接受`location options`参数。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个方法获取单个位置信息,它接受location options参数。

两句简短的英文可以合并成一个汉语语句,不要过于受限于英文的句号。

属性 | 类型 | 描述
---|---|---
`latitude` | Number | 纬度,以角度为单位
`longitude` | Number | 纬度,以角度为单位
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

精度


属性 | 类型 | 描述
---|---|---
`latitude` | Number | 纬度,以角度为单位
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

”以角度为单位“
建议改为
”以度数(deg)为单位“

因为角度是个广义词,有多种表示方法,包括弧度。

`verticalAccuracy` | Number | 垂直精度,以米为单位
`speed` | Number | 速度,以米每秒为单位
`direction` | Number | 方向(航向),以角度为单位
`timestamp` | Object | 此位置获取完成时候的时间戳
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

刚刚取到此位置时的时间戳

@@ -121,7 +187,18 @@ Property | Type | Description
`maximumAge` | Number | (Optional) Filters locations by how long ago they were received, in milliseconds. For example, if the `maximumAge` is 5000, you will get locations only from the last 5 seconds.
`timeout` | Number | (Optional) Specifies how long to wait for a location, in milliseconds.

属性 | 类型 | 描述
---|---|---
`desiredAccuracy` | Number | (可选的)制定所需的精度,以米为单位. NativeScript有一个特殊的枚举类型[Accuracy](http://docs.nativescript.org/api-reference/modules/_ui_enums_.accuracy.html)来帮助提高代码的可读性。默认设为`Accuracy.any`。这样的精度可以通过WiFi和辅助GPS来实现,不会对电池消耗造成额外的压力。若要使用高精度模式(需要GPS传感器)请将其设置为`Accuracy.high`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

指定

@@ -166,9 +243,15 @@ exports.buttonGetLocationTap = buttonGetLocationTap;

### `watchLocation`

### `监视位置`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

watchLocation(监视位置)

方法名本身不要翻译,翻译信息可以跟在后面加括号。

@@ -233,9 +316,15 @@ exports.buttonStopTap = buttonStopTap;

### `distance`

### `距离`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上节

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants