fix: 文字微调

“来”使用的过于口语化
This commit is contained in:
Zhicheng WANG 2020-06-29 14:18:58 +08:00
parent c79e3a1d8d
commit c1501f60ed

View File

@ -24,11 +24,11 @@ Create an adaptable user interface for all of your target locales that takes int
Use Angular to internationalize your app:
使用 Angular 国际化你的应用:
使用 Angular 国际化你的应用:
* Use built-in pipes to display dates, numbers, percentages, and currencies in a local format.
使用内置管道以本地格式显示日期、数字、百分比和货币。
使用内置管道以本地格式显示日期、数字、百分比和货币。
* Mark text in component templates for translation.
@ -44,7 +44,7 @@ Use Angular to internationalize your app:
After preparing your app for an international audience, use the [Angular CLI](cli) to localize your app by performing the following tasks:
在为国际用户准备好应用之后,通过执行以下任务,用 [Angular CLI](cli) 本地化你的应用:
在为国际用户准备好应用之后,通过执行以下任务,用 [Angular CLI](cli) 本地化你的应用:
* Use the CLI to extract marked text to a _source language_ file.
@ -56,7 +56,7 @@ After preparing your app for an international audience, use the [Angular CLI](cl
* Use the CLI to merge the finished translation files when building your app for one or more locales.
在为一个或多个本地环境构建应用时,使用 CLI 合并这些翻译完成的文件。
在为一个或多个本地环境构建应用时,使用 CLI 合并这些翻译完成的文件。
<div class="alert is-helpful">
@ -187,7 +187,7 @@ If `@angular/localize` is not installed, the Angular CLI may generate an error w
Refer to a locale using the Unicode *locale identifier* (ID), which specifies the language, country, and an optional code for further variants or subdivisions.
使用 Unicode *本地环境标识符*ID引用本地环境,该*标识符*用于指定语言、国家/地区以及其他变体或细分的可选代码。
使用 Unicode *本地环境标识符*ID引用本地环境该*标识符*用于指定语言、国家/地区以及其他变体或细分的可选代码。
<div class="callout is-helpful">
@ -233,7 +233,7 @@ The [Angular repository](https://github.com/angular/angular/tree/master/packages
You can change your app's source locale for the build by setting the source locale in the `sourceLocale` field of your app's [workspace configuration](guide/workspace-config "Angular workspace configuration") file (`angular.json`).
The build process (described in [Merge translations into the app](#merge) in this guide) uses your app's `angular.json` file to automatically set the [`LOCALE_ID`](api/core/LOCALE_ID "API reference for LOCALE_ID") token and load the locale data.
[Angular 的代码仓库中](https://github.com/angular/angular/tree/master/packages/common/locales "Angular 存储库中的常用语言环节")包含常见的本地环境。你可以通过在应用的[工作区配置](guide/workspace-config "Angular 工作空间配置")文件 `angular.json` 中的 `sourceLocale` 字段中设置源本地环境来为此构建更改应用的源本地环境。构建过程(在本指南的[把翻译合并到应用程序](#merge)中描述)会使用应用中的 `angular.json` 文件自动设置 [`LOCALE_ID`](api/core/LOCALE_ID "LOCALE_ID 的 API 参考") 令牌并加载本地化数据。
[Angular 的代码仓库中](https://github.com/angular/angular/tree/master/packages/common/locales "Angular 存储库中的常用语言环节")包含常见的本地环境。你可以通过在应用的[工作区配置](guide/workspace-config "Angular 工作空间配置")文件 `angular.json` 中的 `sourceLocale` 字段中设置源本地环境来为此构建更改应用的源本地环境。构建过程(在本指南的[把翻译合并到应用程序](#merge)中描述)会使用应用中的 `angular.json` 文件自动设置 [`LOCALE_ID`](api/core/LOCALE_ID "LOCALE_ID 的 API 参考") 令牌并加载本地化数据。
{@a i18n-pipes}
@ -243,7 +243,7 @@ The build process (described in [Merge translations into the app](#merge) in thi
Angular provides the following built-in data transformation [pipes](guide/glossary#pipe "Definition of a pipe") that use the [`LOCALE_ID`](api/core/LOCALE_ID "API reference for LOCALE_ID") token to format data according to the locale's rules:
Angular 提供了下列内置数据转换[管道](guide/glossary#pipe "管道的定义") ,它们根据本地化的规则使用 [`LOCALE_ID`](api/core/LOCALE_ID "LOCALE_ID 的 API 参考") 令牌格式化数据:
Angular 提供了下列内置数据转换[管道](guide/glossary#pipe "管道的定义") ,它们根据本地化的规则使用 [`LOCALE_ID`](api/core/LOCALE_ID "LOCALE_ID 的 API 参考") 令牌格式化数据:
* [`DatePipe`](api/common/DatePipe): Formats a date value.
@ -263,7 +263,7 @@ Angular 提供了下列内置数据转换[管道](guide/glossary#pipe "管道的
For example, `{{today | date}}` uses `DatePipe` to display the current date in the format for the locale in `LOCALE_ID`.
例如,`{{today | date}}` 使用 `DatePipe``LOCALE_ID` 中指定的本地化格式显示当前日期。
例如,`{{today | date}}` 使用 `DatePipe``LOCALE_ID` 中指定的本地化格式显示当前日期。
To override the value of `LOCALE_ID`, add the `locale` parameter.
For example, to force the currency to use `en-US` no matter which language-locale you set for `LOCALE_ID`, use this form: `{{amount | currency : 'en-US'}}`.
@ -279,7 +279,7 @@ For example, to force the currency to use `en-US` no matter which language-local
To translate your app's templates, you need to prepare the text for a translator or translation service by marking text, attributes, and other elements with the Angular `i18n` attribute.
Follow these general steps:
要翻译你的应用模板,就要用 Angular 的 `i18n` 属性标记出文本、属性和其他元素为翻译人员或翻译服务准备出文本。请遵循以下常规步骤:
要翻译你的应用模板,就要用 Angular 的 `i18n` 属性标记出文本、属性和其他元素为翻译人员或翻译服务准备出文本。请遵循以下常规步骤:
1. [Mark text for translations](#i18n-attribute).
@ -452,13 +452,13 @@ ICU 条款遵循 [CLDR 复数规则](http://cldr.unicode.org/index/cldr-spec/plu
Use the `plural` clause to mark expressions that may not be meaningful if translated word-for-word.
使用 `plural` 子句标出那些在逐字翻译时可能用不到的表达式。
使用 `plural` 子句标出那些在逐字翻译时可能用不到的表达式。
For example, if you want to display "updated x minutes ago" in English, you may want to display "just now", "one minute ago", or "_x_ minutes ago" (with _x_ as the actual number).
Other languages might express this cardinality differently.
The following example shows how to use a `plural` clause to express these three options:
比如,如果你想用英文显示 “updated x minutes ago”你可能需要显示 “just now”、“one minute ago” 或 “ *x* minutes ago” *x*为实际数字)。在其他语言中这种基数规则可能不同。下面的代码演示了如何使用 `plural` 子句表达这三个选项:
比如,如果你想用英文显示 “updated x minutes ago”你可能需要显示 “just now”、“one minute ago” 或 “ *x* minutes ago” *x*为实际数字)。在其他语言中这种基数规则可能不同。下面的代码演示了如何使用 `plural` 子句表达这三个选项:
<code-example path="i18n/src/app/app.component.html" region="i18n-plural" header="src/app/app.component.html"></code-example>
@ -559,7 +559,7 @@ The `select` clause, similar to the `plural` clause, marks choices for alternate
For example, the following clause in the component template binds to the component's `gender` property, which outputs one of the following string values: "male", "female" or "other".
The clause maps those values to the appropriate translations:
`select` 子句类似于 `plural` 子句,它会根据你定义的字符串值标记出备用文本的可选值。例如,组件模板中的下列子句绑定了组件的 `gender` 属性该属性输出以下字符串值之一“male”、“female” 或 “other”。该子句将这些值映射成适当的翻译
`select` 子句类似于 `plural` 子句,它会根据你定义的字符串值标记出备用文本的可选值。例如,组件模板中的下列子句绑定了组件的 `gender` 属性该属性输出以下字符串值之一“male”、“female” 或 “other”。该子句将这些值映射成适当的翻译
<code-example path="i18n/src/app/app.component.html" region="i18n-select" header="src/app/app.component.html"></code-example>
@ -935,7 +935,7 @@ The build process uses [ahead-of-time (AOT) compilation](guide/glossary#ahead-of
ready-to-run app. With Ivy in Angular version 9, AOT is used by default for both
development and production builds, and AOT is required to localize component templates.
此构建过程会用[预先AOT编译](guide/glossary#ahead-of-time-aot-compilation)生成一个小巧、快速、可立即运行的应用。在 Angular 9 的 Ivy 中AOT 默认用于开发版本和生产版本,并且需要 AOT 对组件模板进行本地化。
此构建过程会用[预先AOT编译](guide/glossary#ahead-of-time-aot-compilation)生成一个小巧、快速、可立即运行的应用。在 Angular 9 的 Ivy 中AOT 默认用于开发版本和生产版本,并且需要 AOT 对组件模板进行本地化。
<div class="alert is-helpful">
@ -968,7 +968,7 @@ You can then [generate app versions for each locale](#localize-generate) using t
You can optionally [apply specific build options for just one locale](#localize-build-one-locale) for a custom locale configuration.
你也可以选择[只针对一种本地环境来特定构建选项](#localize-build-one-locale)配置自定义本地环境。
你也可以选择[只针对一种本地环境来用特定构建选项](#localize-build-one-locale)配置自定义本地环境。
</div>
@ -1332,7 +1332,7 @@ The following example sets the value of `LOCALE_ID` to `fr` (French):
Angular will automatically include locale data if you configure the locale using the `--localize` option with [`ng build`](cli/build "ng build description") CLI command.
如果使用带有 `--localize` 选项的 CLI 命令 [`ng build`](cli/build "ng build description") 配置本地环境Angular 就会自动包含本地化数据。
如果使用带有 `--localize` 选项的 CLI 命令 [`ng build`](cli/build "ng build description") 配置本地环境Angular 就会自动包含本地化数据。
The [Angular repository](https://github.com/angular/angular/tree/master/packages/common/locales "Common locales in the Angular repository") files (`@angular/common/locales`) contain most of the locale data that you need, but some advanced formatting options require additional locale data.
Global variants of the locale data are available in [`@angular/common/locales/global`](https://github.com/angular/angular/tree/master/packages/common/locales/global "Global locale variants in the Angular repository").
@ -1368,7 +1368,7 @@ However, some translation systems require a specific form or syntax for the ID.
To address this requirement, you can mark text with _custom_ IDs.
While most developers don't need to use custom IDs, some may want to use IDs that have a unique syntax to convey additional metadata (such as the library, component, or area of the app in which the text appears).
但是,某些翻译系统需要 ID 满足特定的格式或语法。为满足这一需求,你可以用*自定义* ID 来标记文本。虽然大多数开发人员不需要使用自定义 ID但有些开发人员可能希望使用具有独特语法的 ID 传递额外的元数据(例如应用中的库、组件或应用范围)。
但是,某些翻译系统需要 ID 满足特定的格式或语法。为满足这一需求,你可以用*自定义* ID 来标记文本。虽然大多数开发人员不需要使用自定义 ID但有些开发人员可能希望使用具有独特语法的 ID 传递额外的元数据(例如应用中的库、组件或应用范围)。
Specify a custom ID in the `i18n` attribute by using the prefix `@@`.
The following example defines the custom ID `introductionHeader`:
@ -1413,7 +1413,7 @@ The following example adds a meaning:
Be sure to define custom IDs that are unique.
If you use the same ID for two different text elements, the extraction tool extracts only the first one, and Angular uses its translation in place of both original text elements.
一定要确保定义的自定义 ID 是唯一的。如果对两个不同的文本元素使用了相同的 ID那么提取工具只会提取出第一个而 Angular 会使用它的翻译代替两个原始文本元素。
一定要确保定义的自定义 ID 是唯一的。如果对两个不同的文本元素使用了相同的 ID那么提取工具只会提取出第一个而 Angular 会使用它的翻译代替两个原始文本元素。
For example, in the following code the same custom ID `myId` is defined for two different text elements:
@ -1438,7 +1438,7 @@ The following shows the translation to French:
Both elements now use the same translation (`Bonjour`) because they were defined with the same custom ID:
这两个元素现在都使用了相同的翻译( `Bonjour` ),这是因为它们是使用相同的自定义 ID 定义的:
这两个元素现在都使用了相同的翻译( `Bonjour` ),这是因为它们是使用相同的自定义 ID 定义的:
```html
<h3>Bonjour</h3>