Skip to content

Commit

Permalink
组件管理器翻译
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric X committed Aug 2, 2022
1 parent 3f9f731 commit 36997ac
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions get-started/_common/intro/_components_capabilities.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
## Component capabilities
<!-- ## Component capabilities -->
## 组件功能

Components obtain privileges to access various parts of the wider system
<!-- Components obtain privileges to access various parts of the wider system
through **capabilities**. Each component can declare new capabilities that
they offer to the system and capabilities provided by other components
(or the framework) that they require to function.
(or the framework) that they require to function. -->
组件通过**功能**获得访问更广泛系统各个部分的权限。 每个组件都可以声明它们提供给系统的新功能以及它们需要的由其他组件(或框架)提供的功能。

As you just saw, `runner` is an example of a capability declaring the runtime
<!-- As you just saw, `runner` is an example of a capability declaring the runtime
used by the component. Other examples of common capability types are
`directory` to access filesystem resources and `protocol` for communicating
with other components.
with other components. -->
如您所见,`runner` 是一个声明组件运行时所需功能的例子。其它通用功能类型的例子是访问文件系统资源的 `directory` 和与其它组件通信的协议。

Developers declare the capability types required by the component using the
<!-- Developers declare the capability types required by the component using the
component manifest. Below is an example of a component manifest requesting
two capabilities: read access to an `example-data` directory and a service
described by the `fuchsia.example.Foo` FIDL protocol.
described by the `fuchsia.example.Foo` FIDL protocol. -->
开发者用组件清单声明组件所需要的功能类型。以下是一个需要两个功能的组件清单示例:对 `example-data` 目录的读权限和以 FIDL 协议描述的名为 `fuchsia.example.Foo` 的服务。

```json5
use: [
Expand All @@ -28,6 +32,7 @@ use: [
]
```

Component manager uses the capability declarations to populate each component's
<!-- Component manager uses the capability declarations to populate each component's
namespace with the necessary directory handles. For this example, the component
would receive `/example/data` and `/svc/fuchsia.example.Foo` in their namespace.
would receive `/example/data` and `/svc/fuchsia.example.Foo` in their namespace. -->
组件管理器依据功能声明将各个组件所需的目录处理句柄填入各自的命名空间。对于本例子而言,组件将在其命名空间中接收 `/example/data``/svc/fuchsia.example.Foo`

0 comments on commit 36997ac

Please sign in to comment.