diff --git a/adev/BUILD.bazel b/adev/BUILD.bazel index 863ae78e584f..8a4f593c8fae 100644 --- a/adev/BUILD.bazel +++ b/adev/BUILD.bazel @@ -34,6 +34,8 @@ TEST_FILES = APPLICATION_FILES + [ ) APPLICATION_ASSETS = [ + "//adev/src/assets/css", + "//adev/src/assets/fonts", "//adev/src/assets/images", "//adev/src/assets/previews", "//adev/src/assets:tutorials", diff --git a/adev/angular.json b/adev/angular.json index b38f9f152f0d..7beaf44b560a 100644 --- a/adev/angular.json +++ b/adev/angular.json @@ -46,7 +46,8 @@ }, "configurations": { "production": { - "outputHashing": "all" + "outputHashing": "all", + "ssr": false }, "development": { "optimization": false, diff --git a/adev/shared-docs/components/cookie-popup/cookie-popup.component.html b/adev/shared-docs/components/cookie-popup/cookie-popup.component.html index 808d146175ba..55eb79cf16dd 100644 --- a/adev/shared-docs/components/cookie-popup/cookie-popup.component.html +++ b/adev/shared-docs/components/cookie-popup/cookie-popup.component.html @@ -1,21 +1,21 @@ @if (!hasAccepted()) {
-

This site uses cookies from Google to deliver its services and to analyze traffic.

+

本网站使用 Google 的 Cookie 来提供服务并分析流量。

-
diff --git a/adev/shared-docs/components/navigation-list/navigation-list.component.html b/adev/shared-docs/components/navigation-list/navigation-list.component.html index fde9bdbb738e..b0de763f381d 100644 --- a/adev/shared-docs/components/navigation-list/navigation-list.component.html +++ b/adev/shared-docs/components/navigation-list/navigation-list.component.html @@ -65,7 +65,7 @@ - \ No newline at end of file + diff --git a/adev/shared-docs/components/top-level-banner/top-level-banner.component.html b/adev/shared-docs/components/top-level-banner/top-level-banner.component.html index a3edc4a15a71..bb3984f0157e 100644 --- a/adev/shared-docs/components/top-level-banner/top-level-banner.component.html +++ b/adev/shared-docs/components/top-level-banner/top-level-banner.component.html @@ -13,7 +13,7 @@

+ } \ No newline at end of file diff --git a/adev/src/app/app.component.html b/adev/src/app/app.component.html index e589f3591286..be4dcaaf8f87 100644 --- a/adev/src/app/app.component.html +++ b/adev/src/app/app.component.html @@ -1,8 +1,8 @@ - + @defer (when isBrowser) { - + }
diff --git a/adev/src/app/core/constants/versions.ts b/adev/src/app/core/constants/versions.ts index 1c62311727d2..7576f680029b 100644 --- a/adev/src/app/core/constants/versions.ts +++ b/adev/src/app/core/constants/versions.ts @@ -11,55 +11,55 @@ export const VERSIONS_CONFIG = { aioVersions: [ { version: 'v18', - url: 'https://v18.angular.dev/overview', + url: 'https://v18.angular.cn/overview', }, { version: 'v17', - url: 'https://v17.angular.io/docs', + url: 'https://v17.angular.cn/docs', }, { version: 'v16', - url: 'https://v16.angular.io/docs', + url: 'https://v16.angular.cn/docs', }, { version: 'v15', - url: 'https://v15.angular.io/docs', + url: 'https://v15.angular.cn/docs', }, { version: 'v14', - url: 'https://v14.angular.io/docs', + url: 'https://v14.angular.cn/docs', }, { version: 'v13', - url: 'https://v13.angular.io/docs', + url: 'https://v13.angular.cn/docs', }, { version: 'v12', - url: 'https://v12.angular.io/docs', + url: 'https://v12.angular.cn/docs', }, { version: 'v11', - url: 'https://v11.angular.io/docs', + url: 'https://v11.angular.cn/docs', }, { version: 'v10', - url: 'https://v10.angular.io/docs', + url: 'https://v10.angular.cn/docs', }, { version: 'v9', - url: 'https://v9.angular.io/docs', + url: 'https://v9.angular.cn/docs', }, { version: 'v8', - url: 'https://v8.angular.io/docs', + url: 'https://v8.angular.cn/docs', }, { version: 'v7', - url: 'https://v7.angular.io/docs', + url: 'https://v7.angular.cn/docs', }, { version: 'v6', - url: 'https://v6.angular.io/docs', + url: 'https://v6.angular.cn/docs', }, { version: 'v5', @@ -67,11 +67,11 @@ export const VERSIONS_CONFIG = { }, { version: 'v4', - url: 'https://v4.angular.io/docs', + url: 'https://v4.angular.cn/docs', }, { version: 'v2', - url: 'https://v2.angular.io/docs', + url: 'https://v2.angular.cn/docs', }, ], }; diff --git a/adev/src/app/core/layout/footer/footer.component.html b/adev/src/app/core/layout/footer/footer.component.html index bc076da2ebda..a07311536fff 100644 --- a/adev/src/app/core/layout/footer/footer.component.html +++ b/adev/src/app/core/layout/footer/footer.component.html @@ -1,13 +1,13 @@ diff --git a/adev/src/app/core/layout/navigation/navigation.component.html b/adev/src/app/core/layout/navigation/navigation.component.html index e1e8aa9a3feb..cd38cd71e1cf 100644 --- a/adev/src/app/core/layout/navigation/navigation.component.html +++ b/adev/src/app/core/layout/navigation/navigation.component.html @@ -11,7 +11,7 @@ @@ -81,7 +81,7 @@ class="adev-nav-item adev-nav-item--logo" [class.adev-nav-item--active]="activeRouteItem() === HOME_ROUTE" > - + @if(!isUwu) {
  • @@ -462,10 +462,10 @@ type="button" cdkMenuItem (click)="setTheme('dark')" - aria-label="Set dark theme" + aria-label="设置为暗黑主题" > dark_mode - Dark + 暗黑
  • @@ -473,10 +473,10 @@ type="button" cdkMenuItem (click)="setTheme('light')" - aria-label="Set light theme" + aria-label="设置为明亮主题" > light_mode - Light + 明亮
  • @@ -491,7 +491,7 @@
    @@ -68,7 +68,7 @@ @@ -89,8 +89,8 @@ class="adev-editor-download-button" type="button" (click)="downloadCurrentCodeEditorState()" - aria-label="Download current source code" - matTooltip="Download current source code" + aria-label="下载当前源码" + matTooltip="下载当前源码" matTooltipPosition="above" > download diff --git a/adev/src/app/editor/code-editor/code-editor.component.ts b/adev/src/app/editor/code-editor/code-editor.component.ts index f360e9d65191..831c26400182 100644 --- a/adev/src/app/editor/code-editor/code-editor.component.ts +++ b/adev/src/app/editor/code-editor/code-editor.component.ts @@ -137,7 +137,7 @@ export class CodeEditor implements AfterViewInit, OnDestroy { const path = this.location.path(); const editorUrl = `${ANGULAR_DEV}${path}`; - const description = `Angular.dev example generated from [${editorUrl}](${editorUrl})`; + const description = `由 [${editorUrl}](${editorUrl}) 生成的 Angular.dev 代码`; await this.stackblitzOpener.openCurrentSolutionInStackBlitz({title, description}); } @@ -185,7 +185,7 @@ export class CodeEditor implements AfterViewInit, OnDestroy { if (renameFileInputValue) { if (renameFileInputValue.includes('..')) { - alert('File name can not contain ".."'); + alert('文件名不能包含 ".."'); return; } @@ -193,7 +193,7 @@ export class CodeEditor implements AfterViewInit, OnDestroy { const newFile = 'src/' + renameFileInputValue; if (this.files().find(({filename}) => filename.includes(newFile))) { - alert('File name already exists'); + alert('文件名已存在'); return; } @@ -212,7 +212,7 @@ export class CodeEditor implements AfterViewInit, OnDestroy { if (newFileInputValue) { if (newFileInputValue.includes('..')) { - alert('File name can not contain ".."'); + alert('文件名不能包含 ".."'); return; } @@ -220,7 +220,7 @@ export class CodeEditor implements AfterViewInit, OnDestroy { const newFile = 'src/' + newFileInputValue; if (this.files().find(({filename}) => filename.includes(newFile))) { - alert('File already exists'); + alert('文件已存在'); return; } diff --git a/adev/src/app/editor/code-editor/code-mirror-editor.service.ts b/adev/src/app/editor/code-editor/code-mirror-editor.service.ts index bb476e9f6257..0978af2d1d1d 100644 --- a/adev/src/app/editor/code-editor/code-mirror-editor.service.ts +++ b/adev/src/app/editor/code-editor/code-mirror-editor.service.ts @@ -172,7 +172,7 @@ export class CodeMirrorEditor { if (!this._editorView) return; const newFile = this.files().find((file) => file.filename === fileName); - if (!newFile) throw new Error(`File '${fileName}' not found`); + if (!newFile) throw new Error(`文件 '${fileName}' 未找到`); this.currentFile.set(newFile); @@ -394,7 +394,7 @@ export class CodeMirrorEditor { this.currentFile().language, - placeholderExtension('Type your code here...'), + placeholderExtension('在此键入你的代码...'), ...this.getLanguageExtensions(), ], diff --git a/adev/src/app/editor/embedded-editor.component.html b/adev/src/app/editor/embedded-editor.component.html index 68644eaff2b6..b2128d2d0f41 100644 --- a/adev/src/app/editor/embedded-editor.component.html +++ b/adev/src/app/editor/embedded-editor.component.html @@ -25,7 +25,7 @@
    - Preview + 预览
    @if (!displayPreviewInMatTabGroup()) { @@ -38,13 +38,13 @@ @if (displayPreviewInMatTabGroup()) { - + } - + - Console @if (errorsCount()) { + 控制台 @if (errorsCount()) { error {{ errorsCount() }} @@ -56,7 +56,7 @@ class="docs-tutorial-terminal" /> - + diff --git a/adev/src/app/editor/embedded-tutorial-manager.service.ts b/adev/src/app/editor/embedded-tutorial-manager.service.ts index 1dcfa872f564..dc251e23ff89 100644 --- a/adev/src/app/editor/embedded-tutorial-manager.service.ts +++ b/adev/src/app/editor/embedded-tutorial-manager.service.ts @@ -141,7 +141,7 @@ export class EmbeddedTutorialManager { `${TUTORIALS_ASSETS_WEB_PATH}/${tutorial}/source-code.json`, ); - if (!tutorialSourceCode.ok) throw new Error(`Missing source code for tutorial ${tutorial}`); + if (!tutorialSourceCode.ok) throw new Error(`缺少教程 ${tutorial} 的源代码。`); return await tutorialSourceCode.json(); } @@ -151,7 +151,7 @@ export class EmbeddedTutorialManager { `${TUTORIALS_ASSETS_WEB_PATH}/${tutorial}/metadata.json`, ); - if (!tutorialSourceCode.ok) throw new Error(`Missing metadata for ${tutorial}`); + if (!tutorialSourceCode.ok) throw new Error(`缺少教程 ${tutorial} 的元数据。`); return await tutorialSourceCode.json(); } diff --git a/adev/src/app/editor/node-runtime-sandbox.service.ts b/adev/src/app/editor/node-runtime-sandbox.service.ts index f036194ff369..23f7d80cdae8 100644 --- a/adev/src/app/editor/node-runtime-sandbox.service.ts +++ b/adev/src/app/editor/node-runtime-sandbox.service.ts @@ -20,6 +20,7 @@ import {ErrorType, NodeRuntimeState} from './node-runtime-state.service'; import {TerminalHandler} from './terminal/terminal-handler.service'; import {TypingsLoader} from './typings-loader.service'; +// 这两个不能翻译,因为它是用于判断状态的信息 export const DEV_SERVER_READY_MSG = 'Watch mode enabled. Watching for file changes...'; export const OUT_OF_MEMORY_MSG = 'Out of memory'; @@ -79,9 +80,9 @@ export class NodeRuntimeSandbox { try { if (!this.embeddedTutorialManager.type()) - throw Error("Tutorial type isn't available, can not initialize the NodeRuntimeSandbox"); + throw Error('教程类型不可用,无法初始化 NodeRuntimeSandbox。'); - console.time('Load time'); + console.time('加载时间'); let webContainer: WebContainer; if (this.nodeRuntimeState.loadingStep() === LoadingStep.NOT_STARTED) { @@ -103,7 +104,7 @@ export class NodeRuntimeSandbox { await this.initProject(); } - console.timeEnd('Load time'); + console.timeEnd('加载时间'); } catch (error: any) { // If we're already in an error state, throw away the most recent error which may have happened because // we were in the error state already and tried to do more things after terminating. @@ -183,7 +184,7 @@ export class NodeRuntimeSandbox { const exitCode = await this.installDependencies(); if (![PROCESS_EXIT_CODE.SIGTERM, PROCESS_EXIT_CODE.SUCCESS].includes(exitCode)) - throw new Error('Installation failed'); + throw new Error('安装失败'); await Promise.all([this.loadTypes(), this.startDevServer()]); } @@ -485,7 +486,7 @@ export class NodeRuntimeSandbox { // wait until the dev server finishes the first compilation await new Promise((resolve, reject) => { if (!this.devServerProcess) { - reject('dev server is not running'); + reject('没有运行中的开发服务器'); return; } diff --git a/adev/src/app/editor/node-runtime-state.service.ts b/adev/src/app/editor/node-runtime-state.service.ts index 54b99977338b..317b318668ca 100644 --- a/adev/src/app/editor/node-runtime-state.service.ts +++ b/adev/src/app/editor/node-runtime-state.service.ts @@ -79,7 +79,7 @@ export class NodeRuntimeState { private checkUnsupportedEnvironment(): void { if (isIos) { this.setError({ - message: 'Unsupported environment', + message: '不支持此环境', type: ErrorType.UNSUPPORTED_BROWSER_ENVIRONMENT, }); } diff --git a/adev/src/app/editor/preview/preview-error.component.html b/adev/src/app/editor/preview/preview-error.component.html index 88b6c773f8cc..bcfa5cfa8521 100644 --- a/adev/src/app/editor/preview/preview-error.component.html +++ b/adev/src/app/editor/preview/preview-error.component.html @@ -1,23 +1,21 @@
    @if (error()?.type === ErrorType.UNSUPPORTED_BROWSER_ENVIRONMENT) { @if (isIos) { -

    Open angular.dev on desktop to code in your browser.

    +

    在桌面设备上打开 angular.dev,直接在浏览器中编写代码。

    } } @else if (error()?.type === ErrorType.COOKIES || error()?.type === ErrorType.UNKNOWN) {

    - We couldn't start the tutorial app. Please ensure third party cookies are enabled for this - site. + 我们无法启动教程应用。请确保已为此站点启用第三方 Cookie。

    } @else if (error()?.type === ErrorType.OUT_OF_MEMORY) {

    - We couldn't start the tutorial app because your browser is out of memory. To free up memory, - close angular.dev tutorials in other tabs or windows, and refresh the page. + 我们无法启动教程应用,因为你的浏览器内存不足。请关闭其他标签页或窗口中的 angular.dev 教程,并刷新页面以释放内存。

    } @if (error()?.message) { - The error message is: + 错误信息为: {{ error()!.message }} } diff --git a/adev/src/app/editor/preview/preview.component.html b/adev/src/app/editor/preview/preview.component.html index edc30bb625f4..f752424efb8a 100644 --- a/adev/src/app/editor/preview/preview.component.html +++ b/adev/src/app/editor/preview/preview.component.html @@ -3,7 +3,7 @@ } @else { @@ -14,25 +14,25 @@
    @switch (loadingProgressValue()) { @case (loadingEnum.NOT_STARTED) { - Starting + 正在启动 } @case (loadingEnum.BOOT) { - Booting + 正在引导 } @case (loadingEnum.LOAD_FILES) { - Creating project + 正在创建项目 } @case (loadingEnum.INSTALL) { - Installing packages + 正在安装依赖包 } @case (loadingEnum.START_DEV_SERVER) { - Initializing dev server + 正在初始化开发服务器 } } diff --git a/adev/src/app/editor/terminal/interactive-terminal.ts b/adev/src/app/editor/terminal/interactive-terminal.ts index 7a97964d9eb3..d7fc1ffd2266 100644 --- a/adev/src/app/editor/terminal/interactive-terminal.ts +++ b/adev/src/app/editor/terminal/interactive-terminal.ts @@ -14,7 +14,7 @@ import {WINDOW} from '@angular/docs'; import {CommandValidator} from './command-validator.service'; -export const NOT_VALID_COMMAND_MSG = 'Angular Documentation - Not allowed command!'; +export const NOT_VALID_COMMAND_MSG = 'Angular 文档 - 不允许此命令!'; export const ALLOWED_KEYS: Array = [ // Allow Backspace to delete what was typed 'Backspace', diff --git a/adev/src/app/editor/typings-loader.service.ts b/adev/src/app/editor/typings-loader.service.ts index 429354273901..45618b31b296 100644 --- a/adev/src/app/editor/typings-loader.service.ts +++ b/adev/src/app/editor/typings-loader.service.ts @@ -133,7 +133,7 @@ export class TypingsLoader { } private async getTypeDefinitionFilesFromDirectory(directory: string): Promise { - if (!this.webContainer) throw new Error('this.webContainer is not defined'); + if (!this.webContainer) throw new Error('this.webContainer 尚未定义'); const files = await this.webContainer.fs.readdir(directory); diff --git a/adev/src/app/features/home/components/home-animation/home-animation.component.html b/adev/src/app/features/home/components/home-animation/home-animation.component.html index a599d9eefada..512ac6f02142 100644 --- a/adev/src/app/features/home/components/home-animation/home-animation.component.html +++ b/adev/src/app/features/home/components/home-animation/home-animation.component.html @@ -5,14 +5,15 @@ href="https://blog.angular.dev/meet-angular-v19-7b29dfd05b84" class="adev-banner" target="_blank" + rel="noopener" > -

    Angular v19 is here!

    -

    Read about our newest release.

    +

    Angular v19 已发布!

    +

    阅读我们的最新版本。

    -
    @@ -99,9 +100,9 @@

    Angular v19 is here!

    -

    Works at any scale

    +

    适用于任何规模

    - Angular lets you start small on a well-lit path and supports you as your team and apps grow. + Angular 让你从小规模开始,于坦途之上成长,并随着你的团队和应用程序的发展而提供支持。

    @@ -124,19 +125,17 @@

    Works at any scale

    -

    Loved by millions

    +

    深受数百万开发者喜爱

    - Join the millions of developers all over the world building with Angular in a thriving and - friendly community. + 加入全球数百万使用 Angular 构建应用的开发者,成为这个充满活力和友好的社区的一员。

    -

    Build for everyone

    +

    为所有人构建

    - Rely on Angular's built-in hydration, internationalization, security, and accessibility - support to build for everyone around the world. + 依靠 Angular 内置的水合、国际化、安全性和无障碍性支持,为全球所有人构建应用。

    diff --git a/adev/src/app/features/home/home.component.html b/adev/src/app/features/home/home.component.html index 77e44585fc2f..af70bb092e3a 100644 --- a/adev/src/app/features/home/home.component.html +++ b/adev/src/app/features/home/home.component.html @@ -11,7 +11,7 @@ @defer (when showEditor(); prefetch when prefetchEditor()) { } @loading { - Code editor + 代码编辑器 }
    diff --git a/adev/src/app/features/playground/playground.component.html b/adev/src/app/features/playground/playground.component.html index 32f533172997..426f42bd9f9d 100644 --- a/adev/src/app/features/playground/playground.component.html +++ b/adev/src/app/features/playground/playground.component.html @@ -1,9 +1,9 @@
    -

    Angular Playground

    +

    Angular 演练场

    - +

    } @empty {
    -

    No API items found.

    +

    未找到 API 条目。

    } diff --git a/adev/src/app/features/references/cli-reference-details-page/cli-reference-details-page.component.html b/adev/src/app/features/references/cli-reference-details-page/cli-reference-details-page.component.html index b9ba87546e1d..83054b11635b 100644 --- a/adev/src/app/features/references/cli-reference-details-page/cli-reference-details-page.component.html +++ b/adev/src/app/features/references/cli-reference-details-page/cli-reference-details-page.component.html @@ -2,4 +2,4 @@ } -
    Jump to details
    +
    跳转到详情
    diff --git a/adev/src/app/features/references/pipes/api-label.pipe.ts b/adev/src/app/features/references/pipes/api-label.pipe.ts index 766d6ff47424..2c414a74927f 100644 --- a/adev/src/app/features/references/pipes/api-label.pipe.ts +++ b/adev/src/app/features/references/pipes/api-label.pipe.ts @@ -36,17 +36,17 @@ export const shortLabelsMap: Record = { }; export const fullLabelsMap: Record = { - [ApiItemType.BLOCK]: 'Block', - [ApiItemType.CLASS]: 'Class', - [ApiItemType.CONST]: 'Const', - [ApiItemType.DECORATOR]: 'Decorator', - [ApiItemType.DIRECTIVE]: 'Directive', - [ApiItemType.ELEMENT]: 'Element', - [ApiItemType.ENUM]: 'Enum', - [ApiItemType.FUNCTION]: 'Function', - [ApiItemType.INTERFACE]: 'Interface', - [ApiItemType.PIPE]: 'Pipe', - [ApiItemType.NG_MODULE]: 'Module', - [ApiItemType.TYPE_ALIAS]: 'Type Alias', - [ApiItemType.INITIALIZER_API_FUNCTION]: 'Initializer API', + [ApiItemType.BLOCK]: '控制块', + [ApiItemType.CLASS]: '类', + [ApiItemType.CONST]: '常量', + [ApiItemType.DECORATOR]: '装饰器', + [ApiItemType.DIRECTIVE]: '指令', + [ApiItemType.ELEMENT]: '元素', + [ApiItemType.ENUM]: '枚举', + [ApiItemType.FUNCTION]: '函数', + [ApiItemType.INTERFACE]: '接口', + [ApiItemType.PIPE]: '管道', + [ApiItemType.NG_MODULE]: '模块', + [ApiItemType.TYPE_ALIAS]: '类型别名', + [ApiItemType.INITIALIZER_API_FUNCTION]: '初始化 API', }; diff --git a/adev/src/app/features/tutorial/tutorial.component.html b/adev/src/app/features/tutorial/tutorial.component.html index 31c1932aa176..a10595a14caa 100644 --- a/adev/src/app/features/tutorial/tutorial.component.html +++ b/adev/src/app/features/tutorial/tutorial.component.html @@ -60,11 +60,11 @@ (click)="answerRevealed() ? handleResetAnswer() : handleRevealAnswer()" [disabled]="!canRevealAnswer()" class="docs-reveal-answer-button adev-reveal-desktop-button docs-primary-btn" - [attr.text]="answerRevealed() ? 'Reset' : 'Reveal Answer'" - [attr.aria-label]="answerRevealed() ? 'Reset' : 'Reveal Answer'" + [attr.text]="answerRevealed() ? '重置' : '显示答案'" + [attr.aria-label]="answerRevealed() ? '重置' : '显示答案'" [class.adev-reset-answer-button]="answerRevealed()" > - {{ answerRevealed() ? 'Reset' : 'Reveal Answer' }} + {{ answerRevealed() ? '重置' : '显示答案' }} } @@ -116,11 +116,11 @@ (click)="answerRevealed() ? handleResetAnswer() : handleRevealAnswer()" [disabled]="!canRevealAnswer()" class="docs-reveal-answer-button adev-reveal-mobile-button docs-primary-btn" - [attr.text]="answerRevealed() ? 'Reset' : 'Reveal Answer'" - [attr.aria-label]="answerRevealed() ? 'Reset' : 'Reveal Answer'" + [attr.text]="answerRevealed() ? '重置' : '显示答案'" + [attr.aria-label]="answerRevealed() ? '重置' : '显示答案'" [class.adev-reset-answer-button]="answerRevealed()" > - {{ answerRevealed() ? 'Reset' : 'Reveal Answer' }} + {{ answerRevealed() ? '重置' : '显示答案' }} } @@ -137,7 +137,7 @@ class="adev-nav-list" /> @if (nextTutorialPath()) { - Next Tutorial + 下一个教程 } } diff --git a/adev/src/app/features/tutorial/tutorial.component.ts b/adev/src/app/features/tutorial/tutorial.component.ts index cdb3e6f17dbb..c5e196a24a35 100644 --- a/adev/src/app/features/tutorial/tutorial.component.ts +++ b/adev/src/app/features/tutorial/tutorial.component.ts @@ -49,7 +49,7 @@ import { } from '../../editor/index'; import {SplitResizerHandler} from './split-resizer-handler.service'; -const INTRODUCTION_LABEL = 'Introduction'; +const INTRODUCTION_LABEL = '简介'; @Component({ selector: 'adev-tutorial', diff --git a/adev/src/app/features/update/recommendations.ts b/adev/src/app/features/update/recommendations.ts index 8e94b03cfe90..ab0768d060a5 100644 --- a/adev/src/app/features/update/recommendations.ts +++ b/adev/src/app/features/update/recommendations.ts @@ -31,48 +31,46 @@ export const RECOMMENDATIONS: Step[] = [ possibleIn: 200, necessaryAsOf: 400, level: ApplicationComplexity.Basic, - step: 'Extends OnInit', + step: '扩展 OnInit', action: - "Ensure you don't use `extends OnInit`, or use `extends` with any lifecycle event. Instead use `implements .`", + '确保不要使用 `extends OnInit`,或者将 `extends` 与任何生命周期事件合用。而应该使用 `implements <生命周期事件>`。', }, { possibleIn: 200, necessaryAsOf: 400, level: ApplicationComplexity.Advanced, - step: 'Deep Imports', - action: - 'Stop using deep imports, these symbols are now marked with ɵ and are not part of our public API.', + step: '深层导入', + action: '停止使用深层导入,这些符号现在已标记为 ɵ,并不是我们公共 API 的一部分。', }, { possibleIn: 200, necessaryAsOf: 400, level: ApplicationComplexity.Advanced, step: 'invokeElementMethod', - action: - 'Stop using `Renderer.invokeElementMethod` as this method has been removed. There is not currently a replacement.', + action: '停止使用 `Renderer.invokeElementMethod`,因为该方法已被移除。目前没有替代方法。', }, { possibleIn: 400, necessaryAsOf: 400, level: ApplicationComplexity.Basic, - step: 'Non Animations Module', + step: '非动画模块', action: - 'If you use animations in your application, you should import `BrowserAnimationsModule` from `@angular/platform-browser/animations` in your App `NgModule`.', + '如果你的应用中使用了动画,请在你的应用 `NgModule` 中从 `@angular/platform-browser/animations` 导入 `BrowserAnimationsModule`。', }, { possibleIn: 400, necessaryAsOf: 400, level: ApplicationComplexity.Medium, - step: 'Native Form Validation', + step: '原生表单验证', action: - 'Angular began adding a `novalidate` attribute to form elements when you include `FormsModule`. To re-enable native forms behaviors, use `ngNoForm` or add `ngNativeValidate`.', + '当你包含 `FormsModule` 时,Angular 就会开始向表单元素添加 `novalidate` 属性。要重新启用原生表单行为,请使用 `ngNoForm` 或添加 `ngNativeValidate`。', }, { possibleIn: 400, necessaryAsOf: 400, level: ApplicationComplexity.Advanced, step: 'RootRenderer', - action: 'Replace `RootRenderer` with `RendererFactoryV2` instead.', + action: '用 `RendererFactoryV2` 替换 `RootRenderer`。', }, { possibleIn: 400, @@ -80,15 +78,15 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Advanced, ngUpgrade: true, step: 'downgradeInjectable', - action: 'The return value of `upgrade/static/downgradeInjectable` has changed.', + action: '`upgrade/static/downgradeInjectable` 的返回值已更改。', }, { possibleIn: 400, necessaryAsOf: 400, level: ApplicationComplexity.Advanced, - step: 'Animations Tests', + step: '动画测试', action: - 'If you use Animations and tests, add `mods[1].NoopAnimationsModule` to your `TestBed.initTestEnvironment` call.', + '如果你使用了动画和测试,请在你的 `TestBed.initTestEnvironment` 调用中添加 `mods[1].NoopAnimationsModule`。', }, { possibleIn: 200, @@ -96,35 +94,35 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Advanced, step: 'DefaultIterableDiffer', action: - 'Stop using `DefaultIterableDiffer`, `KeyValueDiffers#factories`, or `IterableDiffers#factories`', + '停止使用 `DefaultIterableDiffer`、`KeyValueDiffers#factories` 或 `IterableDiffers#factories`。', }, { possibleIn: 400, necessaryAsOf: 500, level: ApplicationComplexity.Basic, - step: 'Template Tag', - action: 'Rename your `template` tags to `ng-template`', + step: '模板标签', + action: '将你的 `template` 标签重命名为 `ng-template`。', }, { possibleIn: 400, necessaryAsOf: 500, level: ApplicationComplexity.Medium, step: 'OpaqueToken', - action: 'Replace any `OpaqueToken` with `InjectionToken`.', + action: '用 `InjectionToken` 替换任何 `OpaqueToken`。', }, { possibleIn: 400, necessaryAsOf: 500, level: ApplicationComplexity.Advanced, step: 'DifferFactory', - action: 'If you call `DifferFactory.create(...)` remove the `ChangeDetectorRef` argument.', + action: '如果调用了 `DifferFactory.create(...)`,就移除 `ChangeDetectorRef` 参数。', }, { possibleIn: 400, necessaryAsOf: 500, level: ApplicationComplexity.Advanced, - step: 'ErrorHandler Parameter', - action: 'Stop passing any arguments to the constructor for ErrorHandler', + step: 'ErrorHandler 参数', + action: '停止向 ErrorHandler 构造函数传递任何参数。', }, { possibleIn: 400, @@ -132,22 +130,22 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Advanced, step: 'ngProbeToken', action: - 'If you use ngProbeToken, make sure you import it from @angular/core instead of @angular/platform-browser', + '如果使用了 ngProbeToken,请确保从 @angular/core 而不是 @angular/platform-browser 导入它。', }, { possibleIn: 400, necessaryAsOf: 500, level: ApplicationComplexity.Advanced, step: 'TrackByFn', - action: 'If you use TrackByFn, instead use TrackByFunction', + action: '如果使用了 TrackByFn,改用 TrackByFunction。', }, { possibleIn: 500, necessaryAsOf: 500, level: ApplicationComplexity.Basic, - step: 'i18n Pipe Change', + step: 'i18n 管道更改', action: - 'If you rely on the date, currency, decimal, or percent pipes, in 5 you will see minor changes to the format. For applications using locales other than en-us you will need to import it and optionally `locale_extended_fr` from `@angular/common/i18n_data/locale_fr` and registerLocaleData(local).', + '如果依赖于日期、货币、小数或百分比管道,在 5 中将看到格式的轻微更改。对于使用其他区域设置而不是 en-us 的应用程序,你需要导入它,可选择从 `@angular/common/i18n_data/locale_fr` 导入 `locale_extended_fr` 并注册 locale。', }, { possibleIn: 500, @@ -155,52 +153,51 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Advanced, step: 'gendir', action: - 'Do not rely on `gendir`, instead look at using `skipTemplateCodeGen`. Read More', + '不要依赖于 `gendir`,而是考虑使用 `skipTemplateCodeGen`。 阅读更多', }, { possibleIn: 220, necessaryAsOf: 600, level: ApplicationComplexity.Basic, ngUpgrade: true, - step: 'Dynamic ngUpgrade', + step: '动态 ngUpgrade', action: - 'Replace `downgradeComponent`, `downgradeInjectable`, `UpgradeComponent`, and `UpgradeModule` imported from `@angular/upgrade`. Instead use the new versions in `@angular/upgrade/static`', + '用 `@angular/upgrade/static` 中的新版本替换从 `@angular/upgrade` 导入的 `downgradeComponent`、`downgradeInjectable`、`UpgradeComponent` 和 `UpgradeModule`。', }, { possibleIn: 400, necessaryAsOf: 600, level: ApplicationComplexity.Medium, - step: 'Animations in Core', - action: - 'If you import any animations services or tools from @angular/core, you should import them from @angular/animations', + step: '核心中的动画', + action: '如果从 @angular/core 导入了任何动画服务或工具,应该从 @angular/animations 导入。', }, { possibleIn: 400, necessaryAsOf: 600, level: ApplicationComplexity.Advanced, step: 'ngOutletContext', - action: 'Replace `ngOutletContext` with `ngTemplateOutletContext`.', + action: '用 `ngTemplateOutletContext` 替换 `ngOutletContext`。', }, { possibleIn: 400, necessaryAsOf: 600, level: ApplicationComplexity.Advanced, step: 'collectionChangeRecord', - action: 'Replace `CollectionChangeRecord` with `IterableChangeRecord`', + action: '用 `IterableChangeRecord` 替换 `CollectionChangeRecord`。', }, { possibleIn: 400, necessaryAsOf: 900, level: ApplicationComplexity.Advanced, step: 'Renderer', - action: 'Anywhere you use Renderer, now use Renderer2', + action: '任何使用 Renderer 的地方,现在使用 Renderer2。', }, { possibleIn: 400, necessaryAsOf: 600, level: ApplicationComplexity.Advanced, - step: 'Router Query Params', - action: 'If you use preserveQueryParams, instead use queryParamsHandling', + step: '路由器查询参数', + action: '如果使用了 preserveQueryParams,改用 queryParamsHandling。', }, { possibleIn: 430, @@ -208,82 +205,81 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Basic, step: 'Http', action: - "If you use the legacy `HttpModule` and the `Http` service, switch to `HttpClientModule` and the `HttpClient` service. HttpClient simplifies the default ergonomics (you don't need to map to JSON anymore) and now supports typed return values and interceptors. Read more on [angular.dev](https://angular.io/guide/http).", + '如果使用传统的 `HttpModule` 和 `Http` 服务,请切换到 `HttpClientModule` 和 `HttpClient` 服务。HttpClient 简化了默认的人体工程学(你不再需要映射到 JSON),现在支持类型化返回值和拦截器。在 [angular.dev](https://angular.io/guide/http) 上阅读更多。', }, { possibleIn: 430, necessaryAsOf: 600, level: ApplicationComplexity.Advanced, - step: 'DOCUMENT in @angular/platform-browser', - action: - 'If you use DOCUMENT from @angular/platform-browser, you should start to import this from @angular/common', + step: '@angular/platform-browser 中的 DOCUMENT', + action: '如果使用 @angular/platform-browser 中的 DOCUMENT,请开始从 @angular/common 导入。', }, { possibleIn: 500, necessaryAsOf: 600, level: ApplicationComplexity.Advanced, step: 'ReflectiveInjector', - action: 'Anywhere you use ReflectiveInjector, now use StaticInjector', + action: '任何使用 ReflectiveInjector 的地方,现在使用 StaticInjector。', }, { possibleIn: 500, necessaryAsOf: 550, level: ApplicationComplexity.Medium, - step: 'Whitespace', + step: '空白字符', action: - 'Choose a value of `off` for `preserveWhitespaces` in your `tsconfig.json` under the `angularCompilerOptions` key to gain the benefits of this setting, which was set to `off` by default in v6.', + '在你的 `tsconfig.json` 的 `angularCompilerOptions` 键下选择 `off` 作为 `preserveWhitespaces` 的值,以获得此设置的好处,该设置在 v6 中默认设置为 `off`。', }, { possibleIn: 600, necessaryAsOf: 600, level: ApplicationComplexity.Basic, - step: 'node 8', + step: 'Node 8', action: - 'Make sure you are using Node 8 or later', + '确保你正在使用Node 8或更高版本。', }, { possibleIn: 600, necessaryAsOf: 600, level: ApplicationComplexity.Basic, windows: false, - step: 'Update to CLI v6', + step: '更新到 CLI v6', action: - 'Update your Angular CLI, and migrate the configuration to the new angular.json format by running the following:

    `NG_DISABLE_VERSION_CHECK=1 npx @angular/cli@6 update @angular/cli@6`
    ', + '更新你的 Angular CLI,并将配置迁移到新的 angular.json 格式,方法如下:

    `NG_DISABLE_VERSION_CHECK=1 npx @angular/cli@6 update @angular/cli@6`
    ', }, { possibleIn: 600, necessaryAsOf: 600, level: ApplicationComplexity.Basic, windows: true, - step: 'Update to CLI v6', + step: '更新到 CLI v6', action: - 'Update your Angular CLI, and migrate the configuration to the new angular.json format by running the following:

    `cmd /C "set "NG_DISABLE_VERSION_CHECK=1" && npx @angular/cli@6 update @angular/cli@6 @angular/core@6"`
    ', + '更新你的 Angular CLI,并将配置迁移到新的 angular.json 格式,方法如下:

    `cmd /C "set "NG_DISABLE_VERSION_CHECK=1" && npx @angular/cli@6 update @angular/cli@6 @angular/core@6"`
    ', }, { possibleIn: 600, necessaryAsOf: 600, level: ApplicationComplexity.Medium, - step: 'cli v6 scripts', + step: 'CLI v6 脚本', action: - 'Update any `scripts` you may have in your `package.json` to use the latest Angular CLI commands. All CLI commands now use two dashes for flags (eg `ng build --prod --source-map`) to be POSIX compliant.', + '更新你在 `package.json` 中可能有的任何 `scripts`,以使用最新的 Angular CLI 命令。所有 CLI 命令现在使用两个短横线作为标志(例如 `ng build --prod --source-map`)以符合 POSIX 规范。', }, { possibleIn: 600, necessaryAsOf: 600, level: ApplicationComplexity.Basic, windows: false, - step: 'Update to Angular v6', + step: '更新到 Angular v6', action: - "Update all of your Angular framework packages to v6, and the correct version of RxJS and TypeScript.

    `NG_DISABLE_VERSION_CHECK=1 npx @angular/cli@6 update @angular/core@6`

    After the update, TypeScript and RxJS will more accurately flow types across your application, which may expose existing errors in your application's typings", + '将你的所有 Angular 框架包更新到 v6,并正确安装 RxJS 和 TypeScript 的版本。

    `NG_DISABLE_VERSION_CHECK=1 npx @angular/cli@6 update @angular/core@6`

    更新后,TypeScript 和 RxJS 将更准确地流经你的应用程序的类型,这可能会暴露出应用程序类型的现有错误', }, { possibleIn: 600, necessaryAsOf: 600, level: ApplicationComplexity.Basic, windows: true, - step: 'Update to Angular v6', + step: '更新到 Angular v6', action: - 'Update all of your Angular framework packages to v6, and the correct version of RxJS and TypeScript.

    `cmd /C "set "NG_DISABLE_VERSION_CHECK=1" && npx @angular/cli@6 update @angular/cli@6 @angular/core@6"`

    After the update, TypeScript and RxJS will more accurately flow types across your application, which may expose existing errors in your application\'s typings', + '将你的所有 Angular 框架包更新到 v6,并正确安装 RxJS 和 TypeScript 的版本。

    `cmd /C "set "NG_DISABLE_VERSION_CHECK=1" && npx @angular/cli@6 update @angular/cli@6 @angular/core@6"`

    更新后,TypeScript 和 RxJS 将更准确地流经你的应用程序的类型,这可能会暴露出应用程序类型的现有错误', }, { possibleIn: 600, @@ -291,31 +287,31 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Advanced, step: 'forms v6', action: - 'In Angular Forms, `AbstractControl#statusChanges` now emits an event of `PENDING` when you call `AbstractControl#markAsPending`. Ensure that if you are filtering or checking events from `statusChanges` that you account for the new event when calling `markAsPending`.', + '在 Angular Forms 中,当调用 `AbstractControl#markAsPending` 时,`AbstractControl#statusChanges` 现在会发出 `PENDING` 事件。确保如果你在调用 `markAsPending` 时过滤或检查 `statusChanges` 事件,你要考虑到调用 `markAsPending` 时的新事件。', }, { possibleIn: 600, necessaryAsOf: 600, level: ApplicationComplexity.Advanced, - step: 'animations timing', + step: '动画时序', action: - 'If you use totalTime from an `AnimationEvent` within a disabled Zone, it will no longer report a time of 0. To detect if an animation event is reporting a disabled animation then the `event.disabled` property can be used instead.', + '如果在禁用的 Zone 中使用 `AnimationEvent` 的 `totalTime`,它将不再报告为 0。要检测动画事件是否报告为禁用的动画,则可以使用 `event.disabled` 属性。', }, { possibleIn: 600, necessaryAsOf: 700, level: ApplicationComplexity.Advanced, - step: 'ngModel on form control', + step: '表单控件上的 ngModel', action: - 'Support for using the ngModel input property and ngModelChange event with reactive form directives has been deprecated in v6 and removed in v7.', + '在 v6 中已弃用并在 v7 中删除了对使用 ngModel 输入属性和 ngModelChange 事件与响应式表单指令一起使用的支持。', }, { possibleIn: 600, necessaryAsOf: 600, level: ApplicationComplexity.Medium, - step: 'ngModelChange order', + step: 'ngModelChange 顺序', action: - 'ngModelChange is now emitted after the value/validity is updated on its control instead of before to better match expectations. If you rely on the order of these events, you will need to begin tracking the old value in your component.', + '现在,在更新控件的值/有效性后,`ngModelChange` 被发出,而不是之前,以更好地匹配预期。如果你依赖于这些事件的顺序,你需要开始在你的组件中跟踪旧值。', }, { possibleIn: 600, @@ -323,9 +319,9 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Basic, windows: false, material: true, - step: 'Update Dependencies for v6', + step: '更新到 v6 的依赖项', action: - 'Update Angular Material to the latest version.

    `NG_DISABLE_VERSION_CHECK=1 npx @angular/cli@6 update @angular/material@6`

    This will also automatically migrate deprecated APIs.', + '将 Angular Material 更新到最新版本。

    `NG_DISABLE_VERSION_CHECK=1 npx @angular/cli@6 update @angular/material@6`

    这也将自动迁移已弃用的 API。', }, { possibleIn: 600, @@ -333,9 +329,9 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Basic, windows: true, material: true, - step: 'Update Dependencies for v6', + step: '更新到 v6 的依赖项', action: - 'Update Angular Material to the latest version.

    `cmd /C "set "NG_DISABLE_VERSION_CHECK=1" && npx @angular/cli@6 update @angular/material@6"`

    This will also automatically migrate deprecated APIs.', + '将 Angular Material 更新到最新版本。

    `cmd /C "set "NG_DISABLE_VERSION_CHECK=1" && npx @angular/cli@6 update @angular/material@6"`

    这也将自动迁移已弃用的 API。', }, { possibleIn: 600, @@ -343,30 +339,30 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Medium, step: 'strictPropertyInitializer', action: - 'If you have TypeScript configured to be strict (if you have set `strict` to `true` in your `tsconfig.json` file), update your `tsconfig.json` to disable `strictPropertyInitialization` or move property initialization from `ngOnInit` to your constructor. You can learn more about this flag on the TypeScript 2.7 release notes.', + '如果 TypeScript 配置为严格模式(如果你在 `tsconfig.json` 文件中将 `strict` 设置为 `true`),请更新你的 `tsconfig.json` 以禁用 `strictPropertyInitialization` 或将属性初始化从 `ngOnInit` 移动到你的构造函数。你可以在TypeScript 2.7 发布说明中了解更多关于此标志的信息。', }, { possibleIn: 600, necessaryAsOf: 700, level: ApplicationComplexity.Basic, - step: 'update to RxJS 6', + step: '更新到 RxJS 6', action: - 'Remove deprecated RxJS 5 features using rxjs-tslint auto update rules

    For most applications this will mean running the following two commands:

    `npx rxjs-tslint`
    `rxjs-5-to-6-migrate -p src/tsconfig.app.json`', + '使用rxjs-tslint 自动更新规则删除已弃用的 RxJS 5 特性

    对于大多数应用程序,这意味着运行以下两个命令:

    `npx rxjs-tslint`
    `rxjs-5-to-6-migrate -p src/tsconfig.app.json`', }, { possibleIn: 600, necessaryAsOf: 800, level: ApplicationComplexity.Medium, - step: 'remove rxjs-compat', - action: 'Once you and all of your dependencies have updated to RxJS 6, remove `rxjs-compat`.', + step: '移除 rxjs-compat', + action: '一旦你和你所有的依赖项都已更新到 RxJS 6,请移除 `rxjs-compat`。', }, { possibleIn: 610, necessaryAsOf: 800, level: ApplicationComplexity.Medium, - step: 'use files instead of versionedFiles', + step: '使用文件而不是 versionedFiles', action: - 'If you use the Angular Service worker, migrate any `versionedFiles` to the `files` array. The behavior is the same.', + '如果你使用 Angular Service Worker,请将任何 `versionedFiles` 迁移到 `files` 数组中。行为是一样的。', }, { possibleIn: 700, @@ -374,7 +370,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Basic, step: 'TypeScript 3.1', action: - 'Angular now uses TypeScript 3.1, read more about any potential breaking changes: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-1.html', + 'Angular 现在使用 TypeScript 3.1,请阅读有关任何潜在的破坏性变化:TypeScript 3.1 发布说明', }, { possibleIn: 700, @@ -382,25 +378,25 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Basic, step: 'Node 10', action: - 'Angular has now added support for Node 10: https://nodejs.org/en/blog/release/v10.0.0/', + 'Angular 现在添加了对 Node 10 的支持:Node 10 发布说明', }, { possibleIn: 700, necessaryAsOf: 700, level: ApplicationComplexity.Basic, windows: false, - step: 'v7 update', + step: '更新到 v7', action: - 'Update to v7 of the core framework and CLI by running `NG_DISABLE_VERSION_CHECK=1 npx @angular/cli@7 update @angular/cli@7 @angular/core@7` in your terminal.', + '在终端中运行`NG_DISABLE_VERSION_CHECK=1 npx @angular/cli@7 update @angular/cli@7 @angular/core@7`来更新核心框架和 CLI 到 v7。', }, { possibleIn: 700, necessaryAsOf: 700, level: ApplicationComplexity.Basic, windows: true, - step: 'v7 update', + step: '更新到 v7', action: - 'Update to v7 of the core framework and CLI by running `cmd /C "set "NG_DISABLE_VERSION_CHECK=1" && npx @angular/cli@7 update @angular/cli@7 @angular/core@7"` in your terminal.', + '在终端中运行`cmd /C "set "NG_DISABLE_VERSION_CHECK=1" && npx @angular/cli@7 update @angular/cli@7 @angular/core@7"`来更新核心框架和 CLI 到 v7。', }, { possibleIn: 700, @@ -408,9 +404,9 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Basic, windows: false, material: true, - step: 'v7 material update', + step: '更新到 v7 的 Material', action: - 'Update Angular Material to v7 by running `NG_DISABLE_VERSION_CHECK=1 npx @angular/cli@7 update @angular/material@7` in your terminal. You should test your application for sizing and layout changes.', + '在终端中运行`NG_DISABLE_VERSION_CHECK=1 npx @angular/cli@7 update @angular/material@7`来更新 Angular Material 到 v7。你应该测试你的应用程序是否有大小和布局的变化。', }, { possibleIn: 700, @@ -418,53 +414,52 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Basic, windows: true, material: true, - step: 'v7 material update', + step: '更新到 v7 的 Material', action: - 'Update Angular Material to v7 by running `cmd /C "set "NG_DISABLE_VERSION_CHECK=1" && npx @angular/cli@7 update @angular/material@7"` in your terminal. You should test your application for sizing and layout changes.', + '在终端中运行`cmd /C "set "NG_DISABLE_VERSION_CHECK=1" && npx @angular/cli@7 update @angular/material@7"`来更新 Angular Material 到 v7。你应该测试你的应用程序是否有大小和布局的变化。', }, { possibleIn: 700, necessaryAsOf: 700, level: ApplicationComplexity.Medium, material: true, - step: 'v7 material changes', + step: 'v7 的 Material 变化', action: - "If you use screenshot tests, you'll need to regenerate your screenshot golden files as many minor visual tweaks have landed.", + '如果你使用屏幕截图测试,你需要重新生成你的屏幕截图黄金文件,因为许多次要的视觉调整已经完成。', }, { possibleIn: 700, necessaryAsOf: 800, level: ApplicationComplexity.Advanced, material: true, - step: 'v7 material deprecations', - action: - 'Stop using `matRippleSpeedFactor` and `baseSpeedFactor` for ripples, using Animation config instead.', + step: 'v7 的 Material 弃用', + action: '停止使用 `matRippleSpeedFactor` 和 `baseSpeedFactor` 来进行涟漪,改用动画配置。', }, { possibleIn: 800, necessaryAsOf: 800, level: ApplicationComplexity.Basic, windows: false, - step: 'v8 update', + step: '更新到 v8', action: - 'Update to version 8 of the core framework and CLI by running `NG_DISABLE_VERSION_CHECK=1 npx @angular/cli@8 update @angular/cli@8 @angular/core@8` in your terminal and review and commit the changes.', + '在终端中运行 `NG_DISABLE_VERSION_CHECK=1 npx @angular/cli@8 update @angular/cli@8 @angular/core@8`,然后查看并提交更改。', }, { possibleIn: 800, necessaryAsOf: 800, level: ApplicationComplexity.Basic, windows: true, - step: 'v8 update', + step: '更新到 v8', action: - 'Update to version 8 of the core framework and CLI by running `cmd /C "set "NG_DISABLE_VERSION_CHECK=1" && npx @angular/cli@8 update @angular/cli@8 @angular/core@8"` in your terminal and review and commit the changes.', + '在终端中运行 `cmd /C "set "NG_DISABLE_VERSION_CHECK=1" && npx @angular/cli@8 update @angular/cli@8 @angular/core@8"`,然后查看并提交更改。', }, { possibleIn: 800, necessaryAsOf: 800, level: ApplicationComplexity.Basic, - step: 'use ::ng-deep instead of /deep/', + step: '使用 ::ng-deep 替代 /deep/', action: - 'Replace `/deep/` with `::ng-deep` in your styles, [read more about angular component styles and ::ng-deep](https://angular.io/guide/component-styles#deprecated-deep--and-ng-deep). `/deep/` and `::ng-deep` both are deprecated but using `::ng-deep` is preferred until the shadow-piercing descendant combinator is [removed from browsers and tools](https://www.chromestatus.com/features/6750456638341120) completely.', + '在你的样式中用 `::ng-deep` 替换 `/deep/`,[了解更多关于 Angular 组件样式和 ::ng-deep](https://angular.io/guide/component-styles#deprecated-deep--and-ng-deep)。 `/deep/` 和 `::ng-deep` 都已弃用,但在完全从浏览器和工具中移除影子穿透后,使用 `::ng-deep` 更可取。', }, { possibleIn: 800, @@ -472,7 +467,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Basic, step: 'TypeScript 3.4', action: - 'Angular now uses TypeScript 3.4, [read more about errors that might arise from improved type checking](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-4.html).', + 'Angular 现在使用 TypeScript 3.4,[了解更多可能由改进的类型检查引起的错误](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-4.html)。', }, { possibleIn: 800, @@ -480,31 +475,31 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Basic, step: 'node 10', action: - 'Make sure you are using Node 10 or later.', + '确保你正在使用 Node 10 或更高版本。', }, { possibleIn: 800, necessaryAsOf: 800, level: ApplicationComplexity.Basic, - step: 'Differential Loading', + step: '差异化加载', action: - "The CLI's build command now automatically creates a modern ES2015 build with minimal polyfills and a compatible ES5 build for older browsers, and loads the appropriate file based on the browser. You may opt-out of this change by setting your `target` back to `es5` in your `tsconfig.json`. Learn more on [angular.io](https://angular.io/guide/deployment#differential-loading).", + 'CLI 的构建命令现在会自动创建一个现代的 ES2015 构建,带有最小的 polyfills,并为旧版浏览器创建兼容的 ES5 构建,并根据浏览器加载适当的文件。 你可以通过将 `tsconfig.json` 中的 `target` 设置回 `es5` 来选择退出此更改。在 [angular.io](https://angular.io/guide/deployment#differential-loading) 上了解更多。', }, { possibleIn: 800, necessaryAsOf: 800, level: ApplicationComplexity.Basic, - step: 'CLI Telemetry', + step: 'CLI 遥测', action: - 'When using new versions of the CLI, you will be asked if you want to opt-in to share your CLI usage data. You can also add your own Google Analytics account. This lets us make better decisions about which CLI features to prioritize, and measure the impact of our improvements. Learn more on [angular.io](https://angular.io/analytics).', + '使用 CLI 的新版本时,你将被询问是否要选择加入共享 CLI 使用数据。你也可以添加自己的 Google Analytics 帐户。这样我们可以更好地决定优先考虑哪些 CLI 功能,并衡量我们改进的影响。在 [angular.io](https://angular.io/analytics) 上了解更多。', }, { possibleIn: 800, necessaryAsOf: 800, level: ApplicationComplexity.Basic, - step: 'static query timing', + step: '静态查询时机', action: - "If you use `ViewChild` or `ContentChild`, we're updating the way we resolve these queries to give developers more control. You must now specify that change detection should run before results are set. Example: `@ContentChild('foo', {static: false}) foo !: ElementRef;`. `ng update` will update your queries automatically, but it will err on the side of making your queries `static` for compatibility. Learn more on [angular.io](https://angular.io/guide/static-query-migration).", + "如果你使用 `ViewChild` 或 `ContentChild`,我们正在更新解析这些查询的方式,以给开发者更多控制。你现在必须指定变更检测应该在设置结果之前运行。示例:`@ContentChild('foo', {static: false}) foo !: ElementRef;`。 `ng update` 将自动更新你的查询,但它会倾向于使你的查询为 `static`,以保证兼容性。在 [angular.io](https://angular.io/guide/static-query-migration) 上了解更多。", }, { possibleIn: 800, @@ -512,9 +507,9 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Basic, windows: false, material: true, - step: 'v8 material update', + step: '更新到 v8 的 Material', action: - 'Update Angular Material to version 8 by running `NG_DISABLE_VERSION_CHECK=1 npx @angular/cli@8 update @angular/material@8` in your terminal.', + '在终端中运行 `NG_DISABLE_VERSION_CHECK=1 npx @angular/cli@8 update @angular/material@8`。', }, { possibleIn: 800, @@ -522,50 +517,50 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Basic, windows: true, material: true, - step: 'v8 material update', + step: '更新到 v8 的 Material', action: - 'Update Angular Material to version 8 by running `cmd /C "set "NG_DISABLE_VERSION_CHECK=1" && npx @angular/cli@8 update @angular/material@8"` in your terminal.', + '在终端中运行 `cmd /C "set "NG_DISABLE_VERSION_CHECK=1" && npx @angular/cli@8 update @angular/material@8"`。', }, { possibleIn: 800, necessaryAsOf: 900, level: ApplicationComplexity.Basic, material: true, - step: 'deep imports', + step: '深度导入', action: - 'Instead of importing from `@angular/material`, you should import deeply from the specific component. E.g. `@angular/material/button`. `ng update` will do this automatically for you.', + '不要直接从 `@angular/material` 导入,而是从特定组件进行深度导入。例如 `@angular/material/button`。`ng update` 将为你自动完成此操作。', }, { possibleIn: 800, necessaryAsOf: 900, level: ApplicationComplexity.Basic, - step: 'new loadChildren', + step: '新的 loadChildren', action: - 'For lazy loaded modules via the router, make sure you are [using dynamic imports](https://angular.io/guide/deprecations#loadchildren-string-syntax). Importing via string is removed in v9. `ng update` should take care of this automatically. Learn more on [angular.io](https://angular.io/guide/deprecations#loadchildren-string-syntax).', + '对于通过路由器进行的惰性加载的模块,请确保你正在[使用动态导入](https://angular.io/guide/deprecations#loadchildren-string-syntax)。在 v9 中,通过字符串进行导入已被移除。`ng update` 应该会自动处理这个。在 [angular.io](https://angular.io/guide/deprecations#loadchildren-string-syntax) 上了解更多。', }, { - possibleIn: 800, + possibleIn: 900, necessaryAsOf: 900, level: ApplicationComplexity.Advanced, - step: 'platform deprecated', + step: '平台废弃', action: - "We are deprecating support for `@angular/platform-webworker`, as it has been incompatible with the CLI. Running Angular's rendering architecture in a web worker did not meet developer needs. You can still use web workers with Angular. Learn more in our [web worker guide](https://v9.angular.io/guide/web-worker). If you have use cases where you need this, let us know at devrel@angular.io!", + '我们正在废弃对 `@angular/platform-webworker` 的支持,因为它与 CLI 不兼容。在 Web Worker 中运行 Angular 的渲染架构不符合开发者的需求。你仍然可以在 Angular 中使用 Web Worker。在我们的 [Web Worker 指南](https://v9.angular.io/guide/web-worker) 中了解更多。如果你有需要这方面的用例,请通过 devrel@angular.io 与我们联系!', }, { - possibleIn: 800, - necessaryAsOf: 800, + possibleIn: 900, + necessaryAsOf: 900, level: ApplicationComplexity.Advanced, step: 'node-sass', action: - 'We have switched from the native Sass compiler to the JavaScript compiler. To switch back to the native version, install it as a devDependency: `npm install node-sass --save-dev`.', + '我们已经从本地 Sass 编译器切换到 JavaScript 编译器。要切换回本地版本,请将其安装为 devDependency:`npm install node-sass --save-dev`。', }, { - possibleIn: 800, - necessaryAsOf: 800, + possibleIn: 900, + necessaryAsOf: 900, level: ApplicationComplexity.Advanced, - step: 'schematics async', + step: 'schematics 异步', action: - 'If you are building your own Schematics, they have previously been *potentially* asynchronous. As of 8.0, all schematics will be asynchronous.', + '如果你正在构建自己的 Schematics,它们之前*可能*是异步的。从 8.0 开始,所有的 Schematics 都将是异步的。', }, { possibleIn: 900, @@ -573,33 +568,33 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Basic, step: 'node 10.13', action: - 'Make sure you are using Node 10.13 or later.', + '确保你正在使用 Node 10.13 或更高版本。', }, { possibleIn: 900, necessaryAsOf: 900, level: ApplicationComplexity.Basic, windows: false, - step: 'cli v8 latest', + step: '更新到 CLI v8 最新版本', action: - 'Run `NG_DISABLE_VERSION_CHECK=1 npx @angular/cli@8 update @angular/core@8 @angular/cli@8` in your workspace directory to update to the latest 8.x version of `@angular/core` and `@angular/cli` and commit these changes.', + '在你的工作空间目录中运行 `NG_DISABLE_VERSION_CHECK=1 npx @angular/cli@8 update @angular/core@8 @angular/cli@8`,以更新到最新的 8.x 版本的 `@angular/core` 和 `@angular/cli` 并提交这些更改。', }, { possibleIn: 900, necessaryAsOf: 900, level: ApplicationComplexity.Basic, windows: true, - step: 'cli v8 latest', + step: '更新到 CLI v8 最新版本', action: - 'Run `cmd /C "set "NG_DISABLE_VERSION_CHECK=1" && npx @angular/cli@8 update @angular/cli@8 @angular/core@8"` in your workspace directory to update to the latest 8.x version of `@angular/core` and `@angular/cli` and commit these changes.', + '在你的工作空间目录中运行 `cmd /C "set "NG_DISABLE_VERSION_CHECK=1" && npx @angular/cli@8 update @angular/cli@8 @angular/core@8`,以更新到最新的 8.x 版本的 `@angular/core` 和 `@angular/cli` 并提交这些更改。', }, { possibleIn: 900, necessaryAsOf: 900, level: ApplicationComplexity.Medium, - step: 'create commits', + step: '创建提交', action: - 'You can optionally pass the `--create-commits` (or `-C`) flag to [ng update](https://angular.io/cli/update) commands to create a git commit per individual migration.', + '你可以选择向 [ng update](https://angular.io/cli/update) 命令传递 `--create-commits`(或 `-C`)标志,以每个独立迁移创建一个 git 提交。', }, { possibleIn: 900, @@ -608,7 +603,7 @@ export const RECOMMENDATIONS: Step[] = [ windows: false, step: 'ng update v9', action: - 'Run `NG_DISABLE_VERSION_CHECK=1 npx @angular/cli@9 update @angular/core@9 @angular/cli@9` which should bring you to version 9 of Angular.', + '运行 `NG_DISABLE_VERSION_CHECK=1 npx @angular/cli@9 update @angular/core@9 @angular/cli@9`,应该将你升级到 Angular 的 9 版本。', }, { possibleIn: 900, @@ -617,7 +612,7 @@ export const RECOMMENDATIONS: Step[] = [ windows: true, step: 'ng update v9', action: - 'Run `cmd /C "set "NG_DISABLE_VERSION_CHECK=1" && npx @angular/cli@9 update @angular/cli@9 @angular/core@9"` which should bring you to version 9 of Angular.', + '运行 `cmd /C "set "NG_DISABLE_VERSION_CHECK=1" && npx @angular/cli@9 update @angular/cli@9 @angular/core@9"`,应该将你升级到 Angular 的 9 版本。', }, { possibleIn: 900, @@ -625,7 +620,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Basic, step: 'typescript 3.8', action: - 'Your project has now been updated to TypeScript 3.8, read more about new compiler checks and errors that might require you to fix issues in your code in the [TypeScript 3.7](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html) or [TypeScript 3.8](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html) announcements.', + '你的项目现在已更新到 TypeScript 3.8,请阅读有关新编译器检查和可能需要修复代码中问题的错误的更多信息,可在 [TypeScript 3.7](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html) 或 [TypeScript 3.8](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html) 公告中了解更多。', }, { possibleIn: 900, @@ -633,8 +628,8 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Basic, windows: false, material: true, - step: 'update @angular/material', - action: 'Run `NG_DISABLE_VERSION_CHECK=1 npx @angular/cli@9 update @angular/material@9`.', + step: '更新 @angular/material', + action: '运行 `NG_DISABLE_VERSION_CHECK=1 npx @angular/cli@9 update @angular/material@9`。', }, { possibleIn: 900, @@ -642,51 +637,51 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Basic, windows: true, material: true, - step: 'update @angular/material', + step: '更新 @angular/material', action: - 'Run `cmd /C "set "NG_DISABLE_VERSION_CHECK=1" && npx @angular/cli@9 update @angular/material@9"`.', + '运行 `cmd /C "set "NG_DISABLE_VERSION_CHECK=1" && npx @angular/cli@9 update @angular/material@9"`。', }, { possibleIn: 900, necessaryAsOf: 900, level: ApplicationComplexity.Advanced, windows: false, - step: 'update @nguniversal/hapi-engine', + step: '更新 @nguniversal/hapi-engine', action: - 'If you use Angular Universal, run `NG_DISABLE_VERSION_CHECK=1 npx @angular/cli@9 update @nguniversal/hapi-engine@9` or `NG_DISABLE_VERSION_CHECK=1 npx @angular/cli@9 update @nguniversal/express-engine@9` depending on the engine you use. This step may require the `--force` flag if any of your third-party dependencies have not updated the Angular version of their peer dependencies.', + '如果你使用 Angular Universal,请运行 `NG_DISABLE_VERSION_CHECK=1 npx @angular/cli@9 update @nguniversal/hapi-engine@9` 或 `NG_DISABLE_VERSION_CHECK=1 npx @angular/cli@9 update @nguniversal/express-engine@9`,具体取决于你使用的引擎。如果你的任何第三方依赖项未更新其对等依赖项的 Angular 版本,则此步骤可能需要 `--force` 标志。', }, { possibleIn: 900, necessaryAsOf: 900, level: ApplicationComplexity.Advanced, windows: true, - step: 'update @nguniversal/hapi-engine', + step: '更新 @nguniversal/hapi-engine', action: - 'If you use Angular Universal, run `cmd /C "set "NG_DISABLE_VERSION_CHECK=1" && npx @angular/cli@9 update @nguniversal/hapi-engine@9"` or `cmd /C "set "NG_DISABLE_VERSION_CHECK=1" && npx @angular/cli@9 update @nguniversal/express-engine@9"` depending on the engine you use. This step may require the `--force` flag if any of your third-party dependencies have not updated the Angular version of their peer dependencies.', + '如果你使用 Angular Universal,请运行 `cmd /C "set "NG_DISABLE_VERSION_CHECK=1" && npx @angular/cli@9 update @nguniversal/hapi-engine@9"` 或 `cmd /C "set "NG_DISABLE_VERSION_CHECK=1" && npx @angular/cli@9 update @nguniversal/express-engine@9"`,具体取决于你使用的引擎。如果你的任何第三方依赖项未更新其对等依赖项的 Angular 版本,则此步骤可能需要 `--force` 标志。', }, { possibleIn: 900, necessaryAsOf: 900, level: ApplicationComplexity.Basic, - step: 'dependencies update', + step: '更新依赖项', action: - 'If your project depends on other Angular libraries, we recommend that you consider updating to their latest version. In some cases this update might be required in order to resolve API incompatibilities. Consult `ng update` or `npm outdated` to learn about your outdated libraries.', + '如果你的项目依赖于其他 Angular 库,我们建议你考虑更新到它们的最新版本。在某些情况下,此更新可能是必需的,以解决 API 不兼容性。查阅 `ng update` 或 `npm outdated` 以了解你过时的库。', }, { possibleIn: 900, necessaryAsOf: 900, level: ApplicationComplexity.Basic, - step: 'ivy update', + step: '更新 Ivy', action: - 'During the update to version 9, your project was transformed as necessary via code migrations in order to remove any incompatible or deprecated API calls from your code base. You can now review these changes, and consult the [Updating to version 9 guide](https://v9.angular.io/guide/updating-to-version-9) to learn more about the changes.', + '在升级到 9 版本期间,通过代码迁移必要地转换了你的项目,以从代码库中移除任何不兼容或已废弃的 API 调用。现在你可以查看这些更改,并查阅 [升级到 9 版本指南](https://v9.angular.io/guide/updating-to-version-9) 以了解更多详情。', }, { possibleIn: 900, necessaryAsOf: 900, level: ApplicationComplexity.Medium, - step: 'stylesUpdate', + step: '更新样式', action: - 'Bound CSS styles and classes previously were applied with a "last change wins" strategy, but now follow a defined precedence. Learn more about [Styling Precedence](https://angular.io/guide/attribute-binding#styling-precedence).', + '以前,绑定的 CSS 样式和类是采用“最后一次更改获胜”的策略应用的,但现在遵循一个定义好的优先级。了解更多关于 [样式优先级](https://angular.io/guide/attribute-binding#styling-precedence)。', }, { possibleIn: 900, @@ -694,7 +689,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Advanced, step: 'ModuleWithProviders', action: - 'If you are a library author and you had a method returning `ModuleWithProviders` (typically via a method named `forRoot()`), you will need to specify the generic type. Learn more [angular.io](https://v9.angular.io/guide/deprecations#modulewithproviders-type-without-a-generic)', + '如果你是库的作者,并且有一个返回 `ModuleWithProviders` 的方法(通常是通过名为 `forRoot()` 的方法),则需要指定泛型类型。了解更多 [angular.io](https://v9.angular.io/guide/deprecations#modulewithproviders-type-without-a-generic)', }, { possibleIn: 800, @@ -702,39 +697,38 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Advanced, step: 'wtf', action: - 'Support for web tracing framework in Angular was deprecated in version 8. You should stop using any of the `wtf*` APIs. To do performance tracing, we recommend using [browser performance tools](https://developers.google.com/web/tools/lighthouse/audits/user-timing).', + '在 Angular 8 中,支持 Web 追踪框架已废弃。你应该停止使用任何 `wtf*` API。为了进行性能追踪,我们建议使用 [浏览器性能工具](https://developers.google.com/web/tools/lighthouse/audits/user-timing)。', }, { possibleIn: 800, necessaryAsOf: 900, level: ApplicationComplexity.Medium, - step: 'es5browser', + step: 'es5 浏览器', action: - 'Remove any `es5BrowserSupport` flags in your `angular.json` and set your `target` to `es2015` in your `tsconfig.json`. Angular now uses your browserslist to determine if an ES5 build is needed. `ng update` will migrate you automatically.', + '在你的 `angular.json` 中删除任何 `es5BrowserSupport` 标志,并将你的 `tsconfig.json` 中的 `target` 设置为 `es2015`。Angular 现在使用你的 browserslist 来确定是否需要 ES5 构建。`ng update` 将自动迁移你。', }, { possibleIn: 900, necessaryAsOf: 900, level: ApplicationComplexity.Medium, - step: 'ngForm selector', - action: - 'If you use `ngForm` element selector to create Angular Forms, you should instead use `ng-form`.', + step: 'ngForm 选择器', + action: '如果你使用 `ngForm` 元素选择器创建 Angular 表单,你应该改用 `ng-form`。', }, { possibleIn: 900, necessaryAsOf: 900, level: ApplicationComplexity.Advanced, - step: 'typings compilation', + step: 'typings 编译', action: - 'We have updated the `tsconfig.app.json` to limit the files compiled. If you rely on other files being included in the compilation, such as a `typings.d.ts` file, you need to manually add it to the compilation.', + '我们已更新 `tsconfig.app.json` 以限制编译的文件。如果你依赖于其他文件被包含在编译中,比如一个 `typings.d.ts` 文件,你需要手动将其添加到编译中。', }, { possibleIn: 900, necessaryAsOf: 1000, level: ApplicationComplexity.Medium, - step: 'debug', + step: '调试', action: - 'With Angular 9 Ivy is now the default rendering engine, for any compatibility problems that might arise, read the [Ivy compatibility guide](https://v9.angular.io/guide/ivy-compatibility).', + '随着 Angular 9,Ivy 现在是默认的渲染引擎,针对可能出现的任何兼容性问题,阅读 [Ivy 兼容性指南](https://v9.angular.io/guide/ivy-compatibility)。', }, { possibleIn: 900, @@ -742,7 +736,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Advanced, step: 'express-universal-server', action: - 'If you use Angular Universal with `@nguniversal/express-engine` or `@nguniversal/hapi-engine`, several backup files will be created. One of them for `server.ts`. If this file defers from the default one, you may need to copy some changes from the `server.ts.bak` to `server.ts` manually.', + '如果你使用 Angular Universal 与 `@nguniversal/express-engine` 或 `@nguniversal/hapi-engine`,将会创建几个备份文件。其中一个是用于 `server.ts` 的。如果此文件与默认文件不同,你可能需要手动将一些更改从 `server.ts.bak` 复制到 `server.ts`。', }, { possibleIn: 900, @@ -750,7 +744,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Basic, step: 'ivy i18n', action: - "Angular 9 introduced a global `$localize()` function that needs to be loaded if you depend on Angular's internationalization (i18n). Run `ng add @angular/localize` to add the necessary packages and code modifications. Consult the [$localize Global Import Migration guide](https://v9.angular.io/guide/migration-localize) to learn more about the changes.", + 'Angular 9 引入了一个全局的 `$localize()` 函数,如果你依赖于 Angular 的国际化(i18n),则需要加载它。运行 `ng add @angular/localize` 来添加必要的包和代码修改。查阅 [$localize 全局导入迁移指南](https://v9.angular.io/guide/migration-localize) 以了解更多变化。', }, { possibleIn: 900, @@ -758,7 +752,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Medium, step: 'entryComponents', action: - 'In your application projects, you can remove `entryComponents` NgModules and any uses of `ANALYZE_FOR_ENTRY_COMPONENTS`. They are no longer required with the Ivy compiler and runtime. You may need to keep these if building a library that will be consumed by a View Engine application.', + '在你的应用项目中,你可以删除 `entryComponents` NgModules 和任何使用 `ANALYZE_FOR_ENTRY_COMPONENTS` 的地方。它们在 Ivy 编译器和运行时中不再需要。如果构建的是一个将被 View Engine 应用程序消费的库,可能需要保留这些。', }, { possibleIn: 900, @@ -766,7 +760,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Medium, step: 'testbed-get', action: - 'If you use `TestBed.get`, you should instead use `TestBed.inject`. This new method has the same behavior, but is type safe.', + '如果你使用 `TestBed.get`,你应该改用 `TestBed.inject`。这个新方法具有相同的行为,但是类型安全。', }, { possibleIn: 900, @@ -774,16 +768,15 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Medium, step: '$localize', action: - "If you use [Angular's i18n support](http://angular.io/guide/i18n), you will need to begin using `@angular/localize`. Learn more about the [$localize Global Import Migration](https://v9.angular.io/guide/migration-localize).", + '如果你使用 [Angular 的国际化支持](http://angular.io/guide/i18n),你将需要开始使用 `@angular/localize`。了解更多关于 [$localize 全局导入迁移](https://v9.angular.io/guide/migration-localize)。', }, - { possibleIn: 1000, necessaryAsOf: 1000, level: ApplicationComplexity.Basic, step: 'v10 NodeJS 12', action: - 'Make sure you are using Node 12 or later.', + '确保你正在使用 Node 12 或更高版本。', }, { possibleIn: 1000, @@ -791,23 +784,22 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Basic, step: 'ng update v10', action: - 'Run `npx @angular/cli@10 update @angular/core@10 @angular/cli@10` which should bring you to version 10 of Angular.', + '运行 `npx @angular/cli@10 update @angular/core@10 @angular/cli@10`,这将使你的 Angular 版本升级到 10。', }, { possibleIn: 1000, necessaryAsOf: 1000, level: ApplicationComplexity.Basic, material: true, - step: 'update @angular/material', - action: 'Run `npx @angular/cli@10 update @angular/material@10`.', + step: '更新 @angular/material', + action: '运行 `npx @angular/cli@10 update @angular/material@10`。', }, { possibleIn: 1000, necessaryAsOf: 1000, level: ApplicationComplexity.Basic, step: 'browserlist', - action: - 'New projects use the filename `.browserslistrc` instead of `browserslist`. `ng update` will migrate you automatically.', + action: '新项目使用文件名 `.browserslistrc`,而不是 `browserslist`。`ng update` 将自动迁移你。', }, { possibleIn: 1000, @@ -815,15 +807,14 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Medium, step: 'v10-versions', action: - 'Angular now requires `tslint` v6, `tslib` v2, and [TypeScript 3.9](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-9.html). `ng update` will migrate you automatically.', + 'Angular 现在需要 `tslint` v6、`tslib` v2 和 [TypeScript 3.9](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-9.html)。`ng update` 将自动迁移你。', }, { possibleIn: 1000, necessaryAsOf: 1000, level: ApplicationComplexity.Advanced, step: 'styleext', - action: - 'Stop using `styleext` or `spec` in your Angular schematics. `ng update` will migrate you automatically.', + action: '停止在你的 Angular schematics 中使用 `styleext` 或 `spec`。`ng update` 将自动迁移你。', }, { possibleIn: 900, @@ -831,7 +822,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Medium, step: 'classes-without-decorators', action: - 'In version 10, classes that use Angular features and do not have an Angular decorator are no longer supported. [Read more](https://v10.angular.io/guide/migration-undecorated-classes). `ng update` will migrate you automatically.', + '在 10 版本中,不带有 Angular 装饰器的类不再受支持。[了解更多](https://v10.angular.io/guide/migration-undecorated-classes)。`ng update` 将自动迁移你。', }, { possibleIn: 900, @@ -839,7 +830,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Medium, step: 'injectable-definitions', action: - 'As of Angular 9, enforcement of @Injectable decorators for DI is stricter and incomplete provider definitions behave differently. [Read more](https://v9.angular.io/guide/migration-injectable). `ng update` will migrate you automatically.', + '从 Angular 9 开始,对于 DI,@Injectable 装饰器的执行更加严格,不完整的提供程序定义的行为会有所不同。[了解更多](https://v9.angular.io/guide/migration-injectable)。`ng update` 将自动迁移你。', }, { possibleIn: 1000, @@ -847,7 +838,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Advanced, step: 'closure-jsdoc-comments', action: - "Angular's NPM packages no longer contain jsdoc comments, which are necessary for use with closure compiler (extremely uncommon). This support was experimental and only worked in some use cases. There will be an alternative recommended path announced shortly.", + 'Angular 的 NPM 包不再包含 jsdoc 注释,这在与闭包编译器的使用中是必需的(极其罕见)。此支持是实验性的,并且只在一些情况下起作用。很快将宣布替代推荐路径。', }, { possibleIn: 1000, @@ -855,7 +846,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Medium, step: 'forms-number-input', action: - 'If you use Angular forms, inputs of type `number` no longer listen to [change events](https://developer.mozilla.org/docs/Web/API/HTMLElement/change_event) (this events are not necessarily fired for each alteration the value), instead listen for an [input events](https://developer.mozilla.org/docs/Web/API/HTMLElement/input_event). ', + '如果你使用 Angular 表单,`number` 类型的输入不再监听 [change 事件](https://developer.mozilla.org/docs/Web/API/HTMLElement/change_event)(这些事件不一定会在每次更改值时触发),而是监听 [input 事件](https://developer.mozilla.org/docs/Web/API/HTMLElement/input_event)。', }, { possibleIn: 1000, @@ -863,7 +854,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Medium, step: 'forms-length-input', action: - "For Angular forms validation, the `minLength` and `maxLength` validators now verify that the form control's value has a numeric length property, and only validate for length if that's the case.", + '对于 Angular 表单验证,`minLength` 和 `maxLength` 验证器现在验证表单控件的值是否具有数字长度属性,并且仅在这种情况下验证长度。', }, { possibleIn: 1000, @@ -871,7 +862,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Medium, step: 'esm5-bundles', action: - "The [Angular Package Format](https://g.co/ng/apf) has been updated to remove `esm5` and `fesm5` formats. These are no longer distributed in our npm packages. If you don't use the CLI, you may need to downlevel Angular code to ES5 yourself.", + 'Angular 包格式已更新,删除了 `esm5` 和 `fesm5` 格式。这些不再分发在我们的 npm 包中。如果你不使用 CLI,你可能需要自行将 Angular 代码降级到 ES5。', }, { possibleIn: 1000, @@ -879,7 +870,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Medium, step: 'console-errors', action: - "Warnings about unknown elements are now logged as errors. This won't break your app, but it may trip up tools that expect nothing to be logged via `console.error`.", + '有关未知元素的警告现在记录为错误。这不会破坏你的应用程序,但可能会使期望 `console.error` 不记录任何内容的工具受到影响。', }, { possibleIn: 1000, @@ -887,7 +878,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Advanced, step: 'router-resolver-empty', action: - 'Any resolver which returns `EMPTY` will cancel navigation. If you want to allow navigation to continue, you will need to update the resolvers to emit some value, (i.e. `defaultIfEmpty(...)`, `of(...)`, etc).', + '任何返回 `EMPTY` 的解析器将取消导航。如果你想要允许导航继续,你需要更新解析器以发出一些值(例如 `defaultIfEmpty(...)`、`of(...)` 等)。', }, { possibleIn: 1000, @@ -895,7 +886,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Advanced, step: 'sw-vary-headers', action: - 'If you use the Angular service worker and rely on resources with [Vary](https://developer.mozilla.org/docs/Web/HTTP/Headers/Vary) headers, these headers are now ignored to avoid unpredictable behavior across browsers. To avoid this, [configure](https://angular.io/guide/service-worker-config) your service worker to avoid caching these resources.', + '如果你使用 Angular 服务工作器并依赖于带有 [Vary](https://developer.mozilla.org/docs/Web/HTTP/Headers/Vary) 标头的资源,这些标头现在被忽略,以避免在各个浏览器之间出现不可预测的行为。为了避免这种情况,[配置](https://angular.io/guide/service-worker-config) 你的服务工作器以避免缓存这些资源。', }, { possibleIn: 1000, @@ -903,7 +894,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Medium, step: 'expression-changed-after-checked-new', action: - 'You may see `ExpressionChangedAfterItHasBeenChecked` errors that were not detected before when using the `async` pipe. The error could previously have gone undetected because two `WrappedValues` are considered "equal" in all cases for the purposes of the check, even if their respective unwrapped values are not. In version 10, `WrappedValue` has been removed.', + '当使用 `async` 管道时,你可能会看到之前未检测到的 `ExpressionChangedAfterItHasBeenChecked` 错误。以前的错误可能未被检测到,因为两个 `WrappedValues` 在检查目的上被认为是“相等的”,即使它们各自的未包装值不相等。在版本 10 中,`WrappedValue` 已被移除。', }, { possibleIn: 1000, @@ -911,7 +902,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Advanced, step: 'property-binding-change-detection', action: - 'If you have a property binding such as `[val]=(observable | async).someProperty`, this will no longer trigger change detection if the value of `someProperty` is identical to the previous emit. If you rely on this, either manually subscribe and call `markForCheck` as needed or update the binding to ensure the reference changes.', + '如果你有一个属性绑定,例如 `[val]=(observable | async).someProperty`,如果 `someProperty` 的值与之前的发射值相同,这将不再触发变更检测。如果你依赖于此行为,要么手动订阅并根据需要调用 `markForCheck`,要么更新绑定以确保引用更改。', }, { possibleIn: 1000, @@ -919,15 +910,14 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Advanced, step: 'day-periods-crossing-midnight', action: - 'If you use either `formatDate()` or `DatePipe` and any of the `b` or `B` format codes, the logic has been updated so that it matches times that are within a day period that spans midnight, so it will now render the correct output, such as at `night` in the case of English.', + '如果你使用 `formatDate()` 或 `DatePipe`,并且使用了任何 `b` 或 `B` 格式代码,逻辑已更新,使其匹配跨越午夜的一天时段内的时间,因此现在将渲染正确的输出,例如在英文环境中的 `night`。', }, { possibleIn: 1000, necessaryAsOf: 1000, level: ApplicationComplexity.Advanced, step: 'urlmatcher-null', - action: - 'If you use the `UrlMatcher`, the type now reflects that it could always return `null`.', + action: '如果你使用 `UrlMatcher`,现在其类型反映了它可以始终返回 `null`。', }, { possibleIn: 1000, @@ -935,7 +925,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Basic, step: 'v10-more-details', action: - 'For more details about deprecations, automated migrations, and changes visit the [guide angular.io](https://v10.angular.io/guide/updating-to-version-10)', + '有关停用、自动迁移和更改的更多详细信息,请访问 [guide angular.io](https://v10.angular.io/guide/updating-to-version-10)', }, { possibleIn: 1020, @@ -943,16 +933,14 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Medium, step: 'universal-baseurl', action: - 'For Angular Universal users, if you use `useAbsoluteUrl` to setup `platform-server`, you now need to also specify `baseUrl`.', + '对于 Angular Universal 用户,如果你使用 `useAbsoluteUrl` 来设置 `platform-server`,现在还需要指定 `baseUrl`。', }, - { possibleIn: 1100, necessaryAsOf: 1100, level: ApplicationComplexity.Basic, step: 'v11 ng update', - action: - 'Run `ng update @angular/core@11 @angular/cli@11` which should bring you to version 11 of Angular.', + action: '运行 `ng update @angular/core@11 @angular/cli@11` 将把你的 Angular 版本升级到 11。', }, { possibleIn: 1100, @@ -960,7 +948,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Basic, material: true, step: 'update @angular/material', - action: 'Run `ng update @angular/material@11`.', + action: '运行 `ng update @angular/material@11`。', }, { possibleIn: 1100, @@ -968,7 +956,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Basic, step: 'v11 versions', action: - 'Angular now requires [TypeScript 4.0](https://devblogs.microsoft.com/typescript/announcing-typescript-4-0/). `ng update` will migrate you automatically.', + 'Angular 现在需要 [TypeScript 4.0](https://devblogs.microsoft.com/typescript/announcing-typescript-4-0/)。`ng update` 将自动迁移你的项目。', }, { possibleIn: 1100, @@ -976,7 +964,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Basic, step: 'v11 browser support', action: - 'Support for IE9, IE10, and IE mobile has been removed. This was announced in the [v10 update](http://blog.angular.dev/version-10-of-angular-now-available-78960babd41#c357). ', + '不再支持 IE9、IE10 和 IE 移动版。这在 [v10 更新](http://blog.angular.dev/version-10-of-angular-now-available-78960babd41#c357) 中已经宣布。', }, { possibleIn: 1100, @@ -984,7 +972,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Medium, step: 'webpack5 optin', action: - 'You can now opt-in to use webpack 5 by using Yarn and adding `"resolutions": {"webpack": "^5.0.0"}` to your `package.json`.', + '你现在可以选择使用 webpack 5,使用 Yarn 并将 `"resolutions": {"webpack": "^5.0.0"}` 添加到你的 `package.json`。', }, { possibleIn: 1100, @@ -992,7 +980,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Medium, step: 'ng new strict prompt', action: - 'When generating new projects, you will be asked if you want to enable strict mode. This will configure TypeScript and the Angular compiler for stricter type checking, and apply smaller bundle budgets by default. You can use the `--strict=true` or `--strict=false` to skip the prompt.', + '当生成新项目时,你将被询问是否要启用严格模式。这将为 TypeScript 和 Angular 编译器配置更严格的类型检查,并默认应用更小的捆绑预算。你可以使用 `--strict=true` 或 `--strict=false` 来跳过提示。', }, { possibleIn: 1100, @@ -1000,15 +988,15 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Advanced, step: 'v11 router relativeLinkResolution', action: - "If you use the router, the default value of `relativeLinkResolution` has changed from `legacy` to `corrected`. If your application previously used the default by not specifying a value in the `ExtraOptions` and uses relative links when navigating from children of empty path routes, you will need to update your `RouterModule`'s configuration to specifically specify `legacy` for `relativeLinkResolution`. See [the documentation](https://v11.angular.io/api/router/ExtraOptions#relativeLinkResolution) for more details.", + '如果你使用路由器,`relativeLinkResolution` 的默认值从 `legacy` 改为 `corrected`。如果你的应用程序以前使用默认值而未在 `ExtraOptions` 中指定值,并且在从空路径路由的子路由导航时使用相对链接,你需要更新你的 `RouterModule` 配置,明确为 `relativeLinkResolution` 指定 `legacy`。参见 [文档](https://v11.angular.io/api/router/ExtraOptions#relativeLinkResolution) 以获取更多详细信息。', }, { possibleIn: 1100, necessaryAsOf: 1100, level: ApplicationComplexity.Advanced, - step: 'router initialNavigation', + step: 'v11 router initialNavigation', action: - 'In the Angular Router, the options deprecated in v4 for `initialNavigation` have been removed. If you previously used `enabled` or `true`, now choose `enabledNonBlocking` or `enabledBlocking`. If you previously used `false` or `legacy_disabled`, now use `disabled`.', + '在 Angular 路由器中,v4 中已弃用的 `initialNavigation` 选项已被移除。如果你以前使用了 `enabled` 或 `true`,现在请选择 `enabledNonBlocking` 或 `enabledBlocking`。如果你以前使用了 `false` 或 `legacy_disabled`,现在使用 `disabled`。', }, { possibleIn: 1100, @@ -1016,7 +1004,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Medium, step: 'routerlink preserveQueryParams', action: - 'In the Angular Router\'s `routerLink`, `preserveQueryParams` has been removed, use `queryParamsHandling="preserve"` instead.', + '在 Angular 路由器的 `routerLink` 中,已删除了 `preserveQueryParams`,请使用 `queryParamsHandling="preserve"`。', }, { possibleIn: 1100, @@ -1024,7 +1012,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Advanced, step: 'routerlink queryParams typing', action: - 'If you were accessing the `routerLink` values of `queryParams`, `fragment` or `queryParamsHandling` you might need to relax the typing to also accept `undefined` and `null`.', + '如果你正在访问 `routerLink` 的 `queryParams`、`fragment` 或 `queryParamsHandling` 值,你可能需要放宽类型以接受 `undefined` 和 `null`。', }, { possibleIn: 1100, @@ -1032,7 +1020,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Advanced, step: 'viewencapsulation native removed', action: - 'The component view encapsulation option `ViewEncapsulation.Native` has been removed. Use `ViewEncapsulation.ShadowDom` instead. `ng update` will migrate you automatically.', + '组件视图封装选项 `ViewEncapsulation.Native` 已被移除。请使用 `ViewEncapsulation.ShadowDom`。`ng update` 将自动迁移你。', }, { possibleIn: 1100, @@ -1040,7 +1028,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Advanced, step: 'ICU expressions typechecked', action: - 'If you use i18n, expressions within International Components for Unicode (ICUs) expressions are now type-checked again. This may cause compilation failures if errors are found in expressions that appear within an ICU. ', + '如果你使用 i18n,在 International Components for Unicode (ICUs) 表达式中的表达式现在再次进行类型检查。如果在 ICU 中的表达式中发现错误,可能会导致编译失败。', }, { possibleIn: 1100, @@ -1048,7 +1036,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Advanced, step: 'forms validators asyncValidators typing', action: - "Directives in the `@angular/forms` package used to have `any[]` as the type of the expected `validators` and `asyncValidators` arguments in constructors. Now these arguments are properly typed, so if your code relies on form's directive constructor types it may require some updates to improve type safety.", + '在 `@angular/forms` 包中的指令构造函数中,预期的 `validators` 和 `asyncValidators` 参数的类型曾经是 `any[]`。现在这些参数已经被正确地类型化,因此如果你的代码依赖于表单指令构造函数类型,可能需要一些更新来提高类型安全性。', }, { possibleIn: 1100, @@ -1056,7 +1044,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Advanced, step: 'forms AbstractFormControl', action: - "If you use Angular Forms, the type of `AbstractFormControl.parent` now includes null. `ng update` will migrate you automatically, but in an unlikely case your code was testing the parent against undefined with strict equality, you'll need to change this to `=== null` instead, since the parent is now explicitly initialized with `null` instead of being left undefined.", + '如果你使用 Angular Forms,`AbstractFormControl.parent` 的类型现在包括 null。`ng update` 将自动迁移你,但在一个不太可能的情况下,如果你的代码使用严格相等将父级与 undefined 进行比较,你需要改为使用 `=== null`,因为父级现在明确初始化为 `null`,而不是保留为 undefined。', }, { possibleIn: 1100, @@ -1064,15 +1052,14 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Advanced, step: 'platform-webworker', action: - 'The rarely used `@angular/platform-webworker` and `@angular/platform-webworker-dynamic` were deprecated in v8 and have been removed. Running parts of Angular in a web worker was an experiment that never worked well for common use cases. Angular still has great support for [Web Workers](https://angular.io/guide/web-worker). ', + '很少使用的 `@angular/platform-webworker` 和 `@angular/platform-webworker-dynamic` 在 v8 中已被弃用并移除。在 web worker 中运行 Angular 的部分是一个从未对常见用例产生良好效果的实验。Angular 对 [Web Workers](https://angular.io/guide/web-worker) 仍然有很好的支持。', }, { possibleIn: 1100, necessaryAsOf: 1100, level: ApplicationComplexity.Advanced, step: 'v11 slice pipe typing', - action: - 'The `slice` pipe now returns null for the undefined input value, which is consistent with the behavior of most pipes.', + action: '现在 `slice` 管道对于未定义的输入值返回 null,这与大多数管道的行为一致。', }, { possibleIn: 1100, @@ -1080,22 +1067,21 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Advanced, step: 'v11 keyvalue typing', action: - 'The `keyvalue` pipe has been fixed to report that for input objects that have number keys, the result type will contain the string representation of the keys. This was already the case and the code has simply been updated to reflect this. Please update the consumers of the pipe output if they were relying on the incorrect types. Note that this does not affect use cases where the input values are `Map`s, so if you need to preserve `number`s, this is an effective way.', + '修复了 `keyvalue` 管道,对于具有数字键的输入对象,结果类型将包含键的字符串表示形式。这已经是现实,代码已经更新以反映这一点。如果管道输出的使用方依赖于不正确的类型,请更新。请注意,这不会影响输入值为 `Map` 的用例,因此如果你需要保留 `number`,这是一种有效的方法。', }, { possibleIn: 1100, necessaryAsOf: 1100, level: ApplicationComplexity.Advanced, step: 'v11 number pipe typing', - action: - 'The number pipes (`decimal`, `percent`, `currency`, etc) now explicitly state which types are accepted.', + action: '数字管道(`decimal`、`percent`、`currency` 等)现在明确指定接受的类型。', }, { possibleIn: 1100, necessaryAsOf: 1100, level: ApplicationComplexity.Advanced, step: 'v11 date pipe typing', - action: 'The `date` pipe now explicitly states which types are accepted.', + action: '日期管道现在明确指定接受的类型。', }, { possibleIn: 1100, @@ -1103,7 +1089,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Advanced, step: 'v11 datetime rounding', action: - 'When passing a date-time formatted string to the `DatePipe` in a format that contains fractions of a millisecond, the milliseconds will now always be rounded down rather than to the nearest millisecond. Most applications will not be affected by this change. If this is not the desired behaviour then consider pre-processing the string to round the millisecond part before passing it to the `DatePipe`.', + '当将带有毫秒分数的日期时间格式的字符串传递给 `DatePipe` 时,毫秒现在总是向下舍入,而不是舍入到最近的毫秒。大多数应用程序不会受到此更改的影响。如果这不是预期的行为,考虑在将字符串传递给 `DatePipe` 之前预处理毫秒部分以舍入。', }, { possibleIn: 1100, @@ -1111,7 +1097,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Advanced, step: 'v11 async pipe typing', action: - 'The `async` pipe no longer claims to return undefined for an input that was typed as undefined. Note that the code actually returned null on undefined inputs.', + '`async` 管道不再声称对于类型为 undefined 的输入返回 undefined。请注意,代码实际上对于未定义的输入返回 null。', }, { possibleIn: 1100, @@ -1119,7 +1105,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Medium, step: 'v11 case pipe update', action: - 'The `uppercase` and `lowercase` pipes no longer let falsy values through. They now map both `null` and `undefined` to `null` and raise an exception on invalid input (`0`, `false`, `NaN`). This matches other Angular pipes.', + '`uppercase` 和 `lowercase` 管道不再通过假值。它们现在将 `null` 和 `undefined` 都映射到 `null`,并在无效输入(`0`、`false`、`NaN`)时引发异常。这与其他 Angular 管道的行为相匹配。', }, { possibleIn: 1100, @@ -1127,7 +1113,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Advanced, step: 'v11 router NavigationExtras typing', action: - 'If you use the router with `NavigationExtras`, new typings allow a variable of type `NavigationExtras` to be passed in, but they will not allow object literals, as they may only specify known properties. They will also not accept types that do not have properties in common with the ones in the `Pick`. If you are affected by this change, only specify properties from the NavigationExtras which are actually used in the respective function calls or use a type assertion on the object or variable: `as NavigationExtras`.', + '如果你使用带有 `NavigationExtras` 的路由器,新的类型允许传递类型为 `NavigationExtras` 的变量,但不允许对象字面量,因为它们只能指定已知属性。它们也不接受与 `Pick` 中的属性没有共同属性的类型。如果你受到此更改的影响,请仅指定在相应函数调用中实际使用的 NavigationExtras 中的属性,或在对象或变量上使用类型断言:`as NavigationExtras`。', }, { possibleIn: 1100, @@ -1135,7 +1121,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Medium, step: 'v11 TestBed.overrideProvider', action: - 'In your tests if you call `TestBed.overrideProvider` after TestBed initialization, provider overrides are no longer applied. This behavior is consistent with other override methods (such as `TestBed.overrideDirective`, etc) but they throw an error to indicate that. The check was previously missing in the TestBed.overrideProvider function. If you see this error, you should move `TestBed.overrideProvider` calls before TestBed initialization is completed.', + '如果在 TestBed 初始化之后调用 `TestBed.overrideProvider`,则不再应用提供者覆盖。这种行为与其他覆盖方法(如 `TestBed.overrideDirective` 等)一致,但会引发错误以指示。之前在 TestBed.overrideProvider 函数中缺少此检查。如果看到此错误,请确保在 TestBed 初始化完成之前移动 `TestBed.overrideProvider` 调用。', }, { possibleIn: 1100, @@ -1143,7 +1129,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Medium, step: 'v11 router RouteReuseStrategy', action: - "If you use the Router's RouteReuseStrategy, the argument order has changed. When calling `RouteReuseStrategy#shouldReuseRoute` previously when evaluating child routes, they would be called with the `future` and `current` arguments swapped. If your `RouteReuseStrategy` relies specifically on only the future or current snapshot state, you may need to update the `shouldReuseRoute` implementation's use of `future` and `current` `ActivateRouteSnapshots`.", + '如果你使用路由器的 RouteReuseStrategy,参数顺序已更改。在调用 `RouteReuseStrategy#shouldReuseRoute` 时,以前在评估子路由时,会调用 `future` 和 `current` 参数的顺序已更改。如果你的 `RouteReuseStrategy` 专门依赖于将来或当前快照状态,可能需要更新 `shouldReuseRoute` 实现对 `future` 和 `current` `ActivateRouteSnapshots` 的使用。', }, { possibleIn: 1100, @@ -1151,15 +1137,14 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Advanced, step: 'v11 locale data readonly', action: - 'If you use locale data arrays, this API will now return readonly arrays. If you were mutating them (e.g. calling `sort()`, `push()`, `splice()`, etc) then your code will not longer compile. If you need to mutate the array, you should now take a copy (e.g. by calling `slice()`) and mutate the copy.', + '如果你使用区域设置数据数组,此 API 现在将返回只读数组。如果你对其进行了更改(例如调用 `sort()`、`push()`、`splice()` 等),那么你的代码将不再编译。如果你需要更改数组,则现在应该复制它(例如通过调用 `slice()`)并更改副本。', }, { possibleIn: 1100, necessaryAsOf: 1100, level: ApplicationComplexity.Advanced, step: 'v11 CollectionChangeRecord', - action: - 'In change detection, `CollectionChangeRecord` has been removed, use `IterableChangeRecord` instead.', + action: '在变更检测中,已移除了 `CollectionChangeRecord`,请改用 `IterableChangeRecord`。', }, { possibleIn: 1100, @@ -1167,16 +1152,14 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Medium, step: 'v11 forms async validators', action: - 'If you use Angular Forms with async validators defined at initialization time on class instances of `FormControl`, `FormGroup` or `FormArray` , the status change event was not previously emitted once async validator completed. This has been changed so that the status event is emitted into the `statusChanges` observable. If your code relies on the old behavior, you can filter/ignore this additional status change event.', + '如果你在 `FormControl`、`FormGroup` 或 `FormArray` 的类实例的初始化时间上使用异步验证器来定义,则在异步验证器完成后先前未发出状态更改事件。已更改为将状态事件发出到 `statusChanges` 可观察对象中。如果你的代码依赖于旧行为,你可以过滤/忽略此额外的状态更改事件。', }, - { possibleIn: 1200, necessaryAsOf: 1200, level: ApplicationComplexity.Basic, step: 'v12 ng update', - action: - 'Run `ng update @angular/core@12 @angular/cli@12` which should bring you to version 12 of Angular.', + action: '运行 `ng update @angular/core@12 @angular/cli@12`,这将把你的 Angular 版本升级到 12。', }, { possibleIn: 1200, @@ -1184,7 +1167,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Basic, material: true, step: 'update @angular/material', - action: 'Run `ng update @angular/material@12`.', + action: '运行 `ng update @angular/material@12`。', }, { possibleIn: 1200, @@ -1192,7 +1175,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Basic, step: 'v12 versions', action: - 'Angular now requires [TypeScript 4.2](https://devblogs.microsoft.com/typescript/announcing-typescript-4-2/). `ng update` will update you automatically.', + 'Angular 现在要求 [TypeScript 4.2](https://devblogs.microsoft.com/typescript/announcing-typescript-4-2/)。`ng update` 将自动更新你的 TypeScript。', }, { possibleIn: 1200, @@ -1200,21 +1183,21 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Basic, step: 'v12 browser support', action: - 'IE11 support has been deprecated. Find details in the [RFC for IE11 removal](https://github.com/angular/angular/issues/41840).', + 'IE11 支持已弃用。在 [IE11 删除 RFC](https://github.com/angular/angular/issues/41840) 中找到详细信息。', }, { possibleIn: 1200, necessaryAsOf: 1200, level: ApplicationComplexity.Basic, step: 'v12 minimum Node.js version', - action: 'You can no longer use Angular with Node.js version 10 or older', + action: '你不能再使用 Node.js 版本 10 或更早的版本。', }, { possibleIn: 1200, necessaryAsOf: 1200, level: ApplicationComplexity.Medium, step: 'v12 `XhrFactory` relocation', - action: 'Change the import of `XhrFactory` from `@angular/common/http` to `@angular/common`.', + action: '将 `XhrFactory` 的导入从 `@angular/common/http` 改为 `@angular/common`。', }, { possibleIn: 1200, @@ -1222,7 +1205,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Medium, step: 'v12 i18n message ids', action: - 'If you rely on legacy i18n message IDs use the `localize-migrate` tool to [move away from them](https://angular.io/guide/migration-legacy-message-id).', + '如果你依赖于旧版 i18n 消息 ID,请使用 `localize-migrate` 工具[迁移至新版](https://angular.io/guide/migration-legacy-message-id)。', }, { possibleIn: 1200, @@ -1230,7 +1213,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Medium, step: 'v12 deprecates `emitDistinctChangesOnly`', action: - 'If you are using `emitDistinctChangesOnly` to configure `@ContentChildren` and `@ViewChildren` queries, you may need to update its value to `false` to align with its previous behavior. In v12 `emitDistinctChangesOnly` has default value `true`, and in future releases we will remove this configuration option to prevent triggering of unnecessary changes.', + '如果你正在使用 `emitDistinctChangesOnly` 来配置 `@ContentChildren` 和 `@ViewChildren` 查询,可能需要将其值更新为 `false` 以与其先前行为对齐。在 v12 中,`emitDistinctChangesOnly` 的默认值为 `true`,在将来的版本中,我们将删除此配置选项,以防止触发不必要的更改。', }, { possibleIn: 1200, @@ -1238,7 +1221,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Medium, step: 'v12 prod by default', action: - 'You can run the optional migration for enabling production builds by default `ng update @angular/cli@12 --migrate-only production-by-default`.', + '你可以运行可选的迁移以将默认启用生产构建 `ng update @angular/cli@12 --migrate-only production-by-default`。', }, { possibleIn: 1200, @@ -1246,7 +1229,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Advanced, step: 'v12 min and max form attributes', action: - 'If you use Angular forms, `min` and `max` attributes on `` will now trigger validation logic.', + '如果你使用 Angular 表单,在 `` 上使用 `min` 和 `max` 属性现在将触发验证逻辑。', }, { possibleIn: 1200, @@ -1254,23 +1237,21 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Advanced, step: 'v12 `emitEvent` in `FormArray` and `FormGroup`', action: - 'If your app has custom classes that extend `FormArray` or `FormGroup` classes and override the above-mentioned methods, you may need to update your implementation', + '如果你的应用程序具有自定义类,它们扩展了 `FormArray` 或 `FormGroup` 类,并覆盖了上述方法,则可能需要更新你的实现。', }, { possibleIn: 1200, necessaryAsOf: 1200, level: ApplicationComplexity.Advanced, step: 'v12 zone.js minimum version', - action: - 'Update zone.js to version 0.11.4. `ng update` will update this dependency automatically.', + action: '将 zone.js 更新到版本 0.11.4。`ng update` 将自动更新此依赖项。', }, { possibleIn: 1200, necessaryAsOf: 1200, level: ApplicationComplexity.Advanced, step: 'v12 `HttpParams` method params update', - action: - 'If you extend the `HttpParams` class you may have to update the signature of its method to reflect changes in the parameter types.', + action: '如果你扩展了 `HttpParams` 类,你可能需要更新其方法的签名以反映参数类型的更改。', }, { possibleIn: 1200, @@ -1278,7 +1259,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Advanced, step: 'v12 `routerLinkActiveOptions`', action: - '`routerLinkActiveOptions` property of `RouterLinkActive` now has a more specific type. You may need to update code accessing this property to align with the changes.', + '`RouterLinkActive` 的 `routerLinkActiveOptions` 属性现在具有更具体的类型。你可能需要更新访问此属性的代码以与更改保持一致。', }, { possibleIn: 1200, @@ -1286,23 +1267,21 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Advanced, step: 'v12 `APP_INITIALIZER` callback types', action: - 'The initializer callbacks now have more specific return types, which may require update of your code if you are getting an `APP_INITIALIZER` instance via `Injector.get` or `TestBed.inject`.', + '初始化回调现在具有更具体的返回类型,如果你通过 `Injector.get` 或 `TestBed.inject` 获取 `APP_INITIALIZER` 实例,则可能需要更新你的代码。', }, { possibleIn: 1200, necessaryAsOf: 1200, level: ApplicationComplexity.Advanced, step: 'v12 fragment typings', - action: - 'The router fragments now could be `null`. Add `null` checks to avoid TypeScript failing with type errors.', + action: '路由器片段现在可能是 `null`。添加 `null` 检查以避免 TypeScript 产生类型错误。', }, { possibleIn: 1200, necessaryAsOf: 1200, level: ApplicationComplexity.Advanced, step: 'v12 `ng.getDirectives`', - action: - "Make sure you don't rely on `ng.getDirectives` throwing an error if it can't find a directive associated with a particular DOM node.", + action: '确保不依赖于 `ng.getDirectives` 如果找不到与特定 DOM 节点相关联的指令,则引发错误。', }, { possibleIn: 1200, @@ -1310,7 +1289,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Advanced, step: 'v12 `optimization.styles.inlineCritical`', action: - 'Check out `optimization.styles.inlineCritical` option in your angular.json file. It now defaults to `true`. Remember that the whole `optimization` option can be set as boolean which will set all the suboptions to defaults.', + '检查你的 angular.json 文件中的 `optimization.styles.inlineCritical` 选项。现在默认为 `true`。请记住,整个 `optimization` 选项可以设置为布尔值,这将将所有子选项设置为默认值。', }, { @@ -1318,8 +1297,7 @@ export const RECOMMENDATIONS: Step[] = [ necessaryAsOf: 1300, level: ApplicationComplexity.Basic, step: 'v13 ng update', - action: - 'Run `ng update @angular/core@13 @angular/cli@13` which should bring you to version 13 of Angular.', + action: '运行 `ng update @angular/core@13 @angular/cli@13` 将你的 Angular 版本更新至 13。', }, { possibleIn: 1300, @@ -1327,7 +1305,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Basic, material: true, step: 'update @angular/material', - action: 'Run `ng update @angular/material@13`.', + action: '运行 `ng update @angular/material@13`。', }, { possibleIn: 1300, @@ -1335,7 +1313,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Basic, step: 'TypeScript 4.4', action: - 'Angular now uses TypeScript 4.4, read more about any potential breaking changes: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-4.html', + 'Angular 现在使用 TypeScript 4.4,请阅读有关任何潜在变更的更多信息:[TypeScript 4.4 发布说明](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-4.html)', }, { possibleIn: 1300, @@ -1343,7 +1321,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Basic, step: 'v13 node', action: - 'Make sure you are using Node 12.20.0 or later', + '确保你使用的是 Node 12.20.0 或更高版本。', }, { possibleIn: 1300, @@ -1351,7 +1329,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Medium, step: 'v13 routerLink', action: - 'You can now disable the navigation of a `routerLink` by passing `undefined` and `null`. Previously the `routerLink` directive used to accept these two values as equivalent to an empty string.', + '现在可以通过传递 `undefined` 和 `null` 来禁用 `routerLink` 的导航。之前,`routerLink` 指令接受这两个值等同于空字符串。', }, { possibleIn: 1300, @@ -1359,7 +1337,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Medium, step: 'v13 router loadChildren', action: - 'You can no longer specify lazy-loaded routes by setting a string value to `loadChildren`. Make sure you move to dynamic ESM import statements.', + '不能再通过将字符串值设置为 `loadChildren` 来指定惰性加载的路由。确保切换到动态 ESM 导入语句。', }, { possibleIn: 1300, @@ -1367,7 +1345,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Medium, step: 'v13 service worker activated', action: - 'The `activated` observable of `SwUpdate` is now deprecated. To check the activation status of a service worker use the `activatedUpdate` method instead.', + '`SwUpdate` 的 `activated` 可观察对象现已弃用。要检查服务工作器的激活状态,请改用 `activatedUpdate` 方法。', }, { possibleIn: 1300, @@ -1375,7 +1353,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Medium, step: 'v13 service worker available', action: - 'The `available` observable of `SwUpdate` is now deprecated. To get the same information use `versionUpdates` and filter only the `VersionReadyEvent` events.', + '`SwUpdate` 的 `available` 可观察对象现已弃用。要获取相同的信息,请使用 `versionUpdates` 并仅过滤 `VersionReadyEvent` 事件。', }, { possibleIn: 1300, @@ -1383,7 +1361,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Medium, step: 'v13 renderModuleFactory', action: - 'The `renderModuleFactory` from `@angular/platform-server` is no longer necessary with Ivy. Use `renderModule` instead.', + '`@angular/platform-server` 中的 `renderModuleFactory` 不再与 Ivy 一起使用。改用 `renderModule`。', }, { possibleIn: 1300, @@ -1391,7 +1369,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Advanced, step: 'v13 forms status', action: - 'We narrowed the type of `AbstractControl.status` to `FormControlStatus` and `AbstractControl.status` to `Observable`. `FormControlStatus` is the union of all possible status strings for form controls.', + '我们将 `AbstractControl.status` 的类型缩小为 `FormControlStatus`,并将 `AbstractControl.status` 的类型缩小为 `Observable`。 `FormControlStatus` 是表单控件的所有可能状态字符串的联合。', }, { possibleIn: 1300, @@ -1399,7 +1377,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Advanced, step: 'v13 router serializer', action: - 'To align with the URI spec, now the URL serializer respects question marks in the query parameters. For example `/path?q=hello?&q2=2` will now be parsed to `{ q: `hello?`, q2: 2 }`', + '现在,URL 序列化程序遵守 URI 规范,会考虑查询参数中的问号。例如,`/path?q=hello?&q2=2` 现在将解析为 `{ q: `hello?`, q2: 2 }`。', }, { possibleIn: 1300, @@ -1407,7 +1385,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Advanced, step: 'v13 host binding', action: - "`href` is now an attribute binding. This means that `DebugElement.properties['href']` now returns the `href` value returned by the native element, rather than the internal value of the `href` property of the `routerLink`.", + "`href` 现在是属性绑定。这意味着 `DebugElement.properties['href']` 现在返回原生元素返回的 `href` 值,而不是 `routerLink` 的 `href` 属性的内部值。", }, { possibleIn: 1300, @@ -1415,7 +1393,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Advanced, step: 'v13 spy location', action: - '`SpyLocation` no longer emits the `popstate` event when `location.go` is called. In addition, `simulateHashChange` now triggers both `haschange` and `popstate`. Tests that rely on `location.go` most likely need to now use `simulateHashChange` to capture `popstate`.', + '`SpyLocation` 在调用 `location.go` 时不再触发 `popstate` 事件。此外,`simulateHashChange` 现在触发 `haschange` 和 `popstate`。依赖于 `location.go` 的测试现在可能需要使用 `simulateHashChange` 来捕获 `popstate`。', }, { possibleIn: 1300, @@ -1424,7 +1402,7 @@ export const RECOMMENDATIONS: Step[] = [ ngUpgrade: true, step: 'v13 router URL replacement', action: - 'The router will no longer replace the browser URL when a new navigation cancels an ongoing navigation. Hybrid applications which rely on the `navigationId` being present on initial navigations that were handled by the Angular router should subscribe to `NavigationCancel` events and perform the `location.replaceState` to add `navigationId` to the `Router` state. In addition, tests which assert `urlChanges` on the `SpyLocation` may need to be adjusted to account for the `replaceState` which is no longer triggered.', + '当新导航取消正在进行的导航时,路由器将不再替换浏览器 URL。依赖于 Angular 路由器处理的初始导航上存在 `navigationId` 的混合应用程序应该订阅 `NavigationCancel` 事件,并执行 `location.replaceState` 以将 `navigationId` 添加到 `Router` 状态中。此外,断言 `SpyLocation` 上的 `urlChanges` 的测试可能需要调整以考虑不再触发的 `replaceState`。', }, { possibleIn: 1300, @@ -1432,16 +1410,14 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Advanced, step: 'v13 removed symbols', action: - 'The route package no longer exports `SpyNgModuleFactoryLoader` and `DeprecatedLoadChildren`. In case you use them, make sure you remove their corresponding import statements.', + '路由器包不再导出 `SpyNgModuleFactoryLoader` 和 `DeprecatedLoadChildren`。如果使用了它们,请确保删除其对应的导入语句。', }, - { possibleIn: 1400, necessaryAsOf: 1400, level: ApplicationComplexity.Basic, step: 'v14 ng update', - action: - 'Run `ng update @angular/core@14 @angular/cli@14` which should bring you to version 14 of Angular.', + action: '运行 `ng update @angular/core@14 @angular/cli@14` 将你的 Angular 版本更新至 14。', }, { possibleIn: 1400, @@ -1449,7 +1425,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Basic, material: true, step: 'update @angular/material', - action: 'Run `ng update @angular/material@14`.', + action: '运行 `ng update @angular/material@14`。', }, { possibleIn: 1400, @@ -1457,16 +1433,15 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Basic, step: 'TypeScript 4.6', action: - 'Angular now uses TypeScript 4.6, read more about any potential breaking changes: https://devblogs.microsoft.com/typescript/announcing-typescript-4-6/', + 'Angular 现在使用 TypeScript 4.6,请阅读有关任何潜在变更的更多信息:[TypeScript 4.6 发布公告](https://devblogs.microsoft.com/typescript/announcing-typescript-4-6/)', }, - { possibleIn: 1400, necessaryAsOf: 1400, level: ApplicationComplexity.Basic, step: 'v14 node', action: - 'Make sure you are using Node 14.15.0 or later', + '确保你使用的是 Node 14.15.0 或更高版本。', }, { possibleIn: 1400, @@ -1474,14 +1449,14 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Medium, step: 'v14 strict forms', action: - 'Form models now require a generic type parameter. For gradual migration you can opt-out using the untyped version of the form model classes.', + '表单模型现在需要一个泛型类型参数。你可以选择使用表单模型类的不带类型的版本进行渐进式迁移。', }, { possibleIn: 1400, necessaryAsOf: 1400, level: ApplicationComplexity.Medium, step: 'v14 aotSummaries', - action: 'Remove `aotSummaries` from `TestBed` since Angular no longer needs them in Ivy.', + action: '从 `TestBed` 中删除 `aotSummaries`,因为 Angular 不再在 Ivy 中需要它们。', }, { possibleIn: 1400, @@ -1490,7 +1465,7 @@ export const RECOMMENDATIONS: Step[] = [ material: true, step: 'v14 MatVertical and Horizontal Stepper', action: - 'If you are using `MatVerticalStepper` or `MatHorizontalStepper` make sure you switch to `MatStepper`.', + '如果你正在使用 `MatVerticalStepper` 或 `MatHorizontalStepper`,请确保切换到 `MatStepper`。', }, { possibleIn: 1400, @@ -1498,7 +1473,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Medium, step: 'v14 JSONP', action: - 'Remove headers from JSONP requests. JSONP does not supports headers and if specified the HTTP module will now throw an error rather than ignoring them.', + '从 JSONP 请求中删除头部。JSONP 不支持头部,如果指定了头部,HTTP 模块现在将抛出错误而不是忽略它们。', }, { possibleIn: 1400, @@ -1506,7 +1481,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Medium, step: 'v14 resolvers', action: - 'Resolvers now will take the first emitted value by an observable and after that proceed to navigation to better align with other guards rather than taking the last emitted value.', + '解析器现在将接收到的 observable 的第一个发射值,并在此之后进行导航,以更好地与其他守卫保持一致,而不是取最后发射的值。', }, { possibleIn: 1400, @@ -1514,7 +1489,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Advanced, material: true, step: 'v14 deprecate protractor entry', - action: 'The deprecated `angular/cdk/testing/protractor` entry point is now removed.', + action: '已移除废弃的 `angular/cdk/testing/protractor` 入口点。', }, { possibleIn: 1400, @@ -1522,7 +1497,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Advanced, material: true, step: 'v14 chipInput', - action: 'Make sure you specify `chipInput` of `MatChipInputEvent` because it is now required.', + action: '确保指定 `MatChipInputEvent` 的 `chipInput`,因为现在它是必需的。', }, { possibleIn: 1400, @@ -1531,7 +1506,7 @@ export const RECOMMENDATIONS: Step[] = [ material: true, step: 'v14 mixinErrorState', action: - 'You need to implement `stateChanges` class member in abstractions using `mixinErrorState` because the mixin no longer provides it.', + '在使用 `mixinErrorState` 的抽象类中,你需要实现 `stateChanges` 类成员,因为 mixin 不再提供它。', }, { possibleIn: 1400, @@ -1539,7 +1514,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Advanced, material: true, step: 'v14 CdkStepper orientation', - action: 'Use `CdkStepper.orientation` instead of `CdkStepper._orientation`.', + action: '使用 `CdkStepper.orientation`,而不是 `CdkStepper._orientation`。', }, { possibleIn: 1400, @@ -1548,7 +1523,7 @@ export const RECOMMENDATIONS: Step[] = [ material: true, step: 'v14 CdkStepper and MatStepper', action: - 'If you are extending or using `CdkStepper` or `MatStepper` in the constructor you should no longer pass the `_document` parameter since it is now removed.', + '如果你在构造函数中扩展或使用 `CdkStepper` 或 `MatStepper`,则不再需要传递 `_document` 参数,因为它现在已被移除。', }, { possibleIn: 1400, @@ -1556,7 +1531,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Advanced, material: true, step: 'v14 mat-list-item-avatar', - action: 'Rename the `mat-list-item-avatar` CSS class to `mat-list-item-with-avatar`.', + action: '将 `mat-list-item-avatar` CSS 类重命名为 `mat-list-item-with-avatar`。', }, { possibleIn: 1400, @@ -1564,7 +1539,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Advanced, material: true, step: 'v14 MatSelectionListChange.option', - action: 'Use `MatSelectionListChange.options` rather than `MatSelectionListChange.option`.', + action: '使用 `MatSelectionListChange.options`,而不是 `MatSelectionListChange.option`。', }, { possibleIn: 1400, @@ -1573,7 +1548,7 @@ export const RECOMMENDATIONS: Step[] = [ material: true, step: 'v14 getHarnessLoaderForContent', action: - 'Use `getChildLoader(MatListItemSection.CONTENT)` rather than `getHarnessLoaderForContent`.', + '使用 `getChildLoader(MatListItemSection.CONTENT)`,而不是 `getHarnessLoaderForContent`。', }, { possibleIn: 1400, @@ -1582,14 +1557,14 @@ export const RECOMMENDATIONS: Step[] = [ material: true, step: 'v14 MatSelectionList', action: - 'If you are using `MatSelectionList` make sure you pass `_focusMonitor` in its constructor because it is now required. Additionally, this class no longer has `tabIndex` property and a `tabIndex` constructor parameter.', + '如果你正在使用 `MatSelectionList`,请确保在其构造函数中传递 `_focusMonitor`,因为现在它是必需的。此外,这个类不再具有 `tabIndex` 属性和 `tabIndex` 构造函数参数。', }, { possibleIn: 1400, necessaryAsOf: 1400, level: ApplicationComplexity.Advanced, step: 'v14 initialNavigation', - action: "Update `initialNavigation: 'enabled'` to `initialNavigation: 'enabledBlocking'`.", + action: "将 `initialNavigation: 'enabled'` 更新为 `initialNavigation: 'enabledBlocking'`。", }, { possibleIn: 1400, @@ -1597,7 +1572,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Advanced, step: 'v14 Route.pathMatch', action: - 'If you are defining routes with `pathMatch`, you may have to cast it to `Route` or `Routes` explicitly. `Route.pathMatch` is no longer compatible with `string` type.', + '如果你正在定义带有 `pathMatch` 的路由,可能需要将其显式转换为 `Route` 或 `Routes`。`Route.pathMatch` 不再兼容 `string` 类型。', }, { possibleIn: 1400, @@ -1605,46 +1580,42 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Advanced, step: 'v14 stricter LoadChildrenCallback', action: - 'The promise returned by `LoadChildrenCallback` now has a stricter type parameter `Type|NgModuleFactory` rather than `any`.', + '`LoadChildrenCallback` 返回的 Promise 现在具有更严格的类型参数 `Type|NgModuleFactory`,而不是 `any`。', }, { possibleIn: 1400, necessaryAsOf: 1400, level: ApplicationComplexity.Advanced, step: 'v14 router scheduling', - action: - 'The router does no longer schedule redirect navigation within a `setTimeout`. Make sure your tests do not rely on this behavior.', + action: '路由器不再在 `setTimeout` 内安排重定向导航。确保你的测试不依赖于这种行为。', }, { possibleIn: 1400, necessaryAsOf: 1400, level: ApplicationComplexity.Advanced, step: 'v14 LocationStrategy', - action: - 'Implementing the `LocationStrategy` interface now requires definition of `getState()`.', + action: '现在实现 `LocationStrategy` 接口需要定义 `getState()`。', }, { possibleIn: 1400, necessaryAsOf: 1400, level: ApplicationComplexity.Advanced, step: 'v14 http queries', - action: - 'Sending `+` as part of a query no longer requires workarounds since `+` no longer sends a space.', + action: '发送查询时不再需要对 `+` 进行处理,因为 `+` 不再发送空格。', }, { possibleIn: 1400, necessaryAsOf: 1400, level: ApplicationComplexity.Advanced, step: 'v14 AnimationDriver.getParentElement', - action: 'Implementing `AnimationDriver` now requires the `getParentElement` method.', + action: '现在实现 `AnimationDriver` 需要 `getParentElement` 方法。', }, { possibleIn: 1400, necessaryAsOf: 1400, level: ApplicationComplexity.Advanced, step: 'v14 invalid config', - action: - 'Invalid route configurations of lazy-loaded modules will now throw an error rather than being ignored.', + action: '懒加载模块的无效路由配置现在会引发错误,而不是被忽略。', }, { possibleIn: 1400, @@ -1652,64 +1623,14 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Advanced, step: 'v14 router resolver', action: - 'Remove the `resolver` from `RouterOutletContract.activateWith` function and the `resolver` from `OutletContext` class since factory resolvers are no longer needed.', + '从 `RouterOutletContract.activateWith` 函数中移除 `resolver`,以及从 `OutletContext` 类中移除 `resolver`,因为不再需要工厂解析器。', }, { possibleIn: 1400, necessaryAsOf: 1400, level: ApplicationComplexity.Advanced, step: 'v14 initialUrl', - action: - '`Router.initialUrl` accepts only `UrlTree` to prevent a misuse of the API by assigning a `string` value.', - }, - - { - possibleIn: 1500, - necessaryAsOf: 1500, - level: ApplicationComplexity.Basic, - step: 'v15 node support', - action: - 'Make sure that you are using a supported version of node.js before you upgrade your application. Angular v15 supports node.js versions: 14.20.x, 16.13.x and 18.10.x. Read further', - }, - { - possibleIn: 1500, - necessaryAsOf: 1500, - level: ApplicationComplexity.Basic, - step: 'v15 ts support', - action: - 'Make sure that you are using a supported version of TypeScript before you upgrade your application. Angular v15 supports TypeScript version 4.8 or later. Read further', - }, - { - possibleIn: 1500, - necessaryAsOf: 1500, - level: ApplicationComplexity.Basic, - step: 'v15 ng update', - action: - "In the application's project directory, run `ng update @angular/core@15 @angular/cli@15` to update your application to Angular v15.", - }, - { - possibleIn: 1500, - necessaryAsOf: 1500, - level: ApplicationComplexity.Basic, - material: true, - step: 'V15 update @angular/material', - action: 'Run `ng update @angular/material@15` to update the Material components.', - }, - { - possibleIn: 1500, - necessaryAsOf: 1500, - level: ApplicationComplexity.Medium, - step: 'v15 keyframe', - action: - 'In v15, the Angular compiler prefixes `@keyframes` in CSS with the component\'s scope. This means that any TypeScript code that relies on `keyframes` names no longer works in v15. Update any such instances to: define keyframes programmatically, use global stylesheets, or change the component\'s view encapsulation. Read further', - }, - { - possibleIn: 1500, - necessaryAsOf: 1500, - level: ApplicationComplexity.Basic, - step: 'v15 no-ivy', - action: - "In your application's `tsconfig.json` file, remove `enableIvy`. In v15, Ivy is the only rendering engine so `enableIvy` is not required.", + action: '`Router.initialUrl` 只接受 `UrlTree`,以防止通过分配 `string` 值来误用 API。', }, { possibleIn: 1500, @@ -1717,7 +1638,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Medium, step: 'v15 base-decorators', action: - 'Make sure to use decorators in base classes with child classes that inherit constructors and use dependency injection. Such base classes should be decorated with either `@Injectable` or `@Directive` or the compiler returns an error. Read further', + '确保在具有继承构造函数和使用依赖注入的子类中使用基类中的装饰器。这样的基类应该用 `@Injectable` 或 `@Directive` 装饰,否则编译器会返回错误。继续阅读', }, { possibleIn: 1500, @@ -1725,7 +1646,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Medium, step: 'v15 setDisabledState', action: - 'In v15, `setDisabledState` is always called when a `ControlValueAccessor` is attached. To opt-out of this behavior, use `FormsModule.withConfig` or `ReactiveFormsModule.withConfig`. Read further', + '在 v15 中,当附加 `ControlValueAccessor` 时,始终调用 `setDisabledState`。要退出此行为,使用 `FormsModule.withConfig` 或 `ReactiveFormsModule.withConfig`。继续阅读', }, { possibleIn: 1500, @@ -1733,7 +1654,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Advanced, step: 'v15 canParse', action: - 'Applications that use `canParse` should use `analyze` from `@angular/localize/tools` instead. In v15, the `canParse` method was removed from all translation parsers in `@angular/localize/tools`. Read further', + '使用 `canParse` 的应用程序应该改为使用 `@angular/localize/tools` 中的 `analyze`。在 v15 中,从 `@angular/localize/tools` 的所有翻译解析器中删除了 `canParse` 方法。继续阅读', }, { possibleIn: 1500, @@ -1741,7 +1662,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Basic, step: 'v15 ActivatedRoutSnapshot', action: - 'Make sure that all `ActivatedRouteSnapshot` objects have a `title` property. In v15, the `title` property is a required property of `ActivatedRouteSnapshot`. Read further', + '确保所有 `ActivatedRouteSnapshot` 对象都有 `title` 属性。在 v15 中,`title` 属性是 `ActivatedRouteSnapshot` 的必需属性。继续阅读', }, { possibleIn: 1500, @@ -1749,7 +1670,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Advanced, step: 'v15 RouterOutlet', action: - 'If your tests with `RouterOutlet` break, make sure they don\'t depend on the instantiation order of the corresponding component relative to change detection. In v15, `RouterOutlet` instantiates the component after change detection. Read further', + '如果你的 `RouterOutlet` 测试出现问题,请确保它们不依赖于与变更检测相关的相应组件的实例化顺序。在 v15 中,`RouterOutlet` 在变更检测之后实例化组件。继续阅读', }, { possibleIn: 1500, @@ -1757,7 +1678,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Basic, step: 'v15 relativeLinkResolution', action: - 'In v15, `relativeLinkResolution` is not configurable in the Router. It was used to opt out of an earlier bug fix that is now standard. Read further', + '在 v15 中,`relativeLinkResolution` 在路由器中不可配置。它用于退出先前的错误修复,现在已成为标准。继续阅读', }, { possibleIn: 1500, @@ -1765,7 +1686,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Medium, step: 'v15 DATE_PIPE_DEFAULT_OPTIONS', action: - 'Change instances of the `DATE_PIPE_DEFAULT_TIMEZONE` token to use `DATE_PIPE_DEFAULT_OPTIONS` to configure time zones. In v15, the `DATE_PIPE_DEFAULT_TIMEZONE` token is deprecated. Read further', + '将 `DATE_PIPE_DEFAULT_TIMEZONE` 令牌的实例更改为使用 `DATE_PIPE_DEFAULT_OPTIONS` 配置时区。在 v15 中,`DATE_PIPE_DEFAULT_TIMEZONE` 令牌已过时。继续阅读', }, { possibleIn: 1500, @@ -1773,7 +1694,7 @@ export const RECOMMENDATIONS: Step[] = [ level: ApplicationComplexity.Medium, step: 'v15 iframe', action: - "Existing `