diff --git a/aio/src/app/embedded/live-example/live-example.component.html b/aio/src/app/embedded/live-example/live-example.component.html index 4def108a78..0cdab066b3 100644 --- a/aio/src/app/embedded/live-example/live-example.component.html +++ b/aio/src/app/embedded/live-example/live-example.component.html @@ -1,12 +1,12 @@ - {{title}} (not available on this device) + {{title}} (在此设备上不可用)
{{title}}

- You can also download this example. + 你还可以 下载这个例子

@@ -15,7 +15,7 @@ {{title}} - / download example + / 下载范例 diff --git a/aio/src/app/embedded/live-example/live-example.component.ts b/aio/src/app/embedded/live-example/live-example.component.ts index b484665697..8cc6059f4b 100644 --- a/aio/src/app/embedded/live-example/live-example.component.ts +++ b/aio/src/app/embedded/live-example/live-example.component.ts @@ -145,7 +145,7 @@ export class LiveExampleComponent implements OnInit { // It is the original innerHTML of the host element. // Angular will sanitize this title when displayed so should be plain text. const title = this.elementRef.nativeElement.liveExampleContent; - this.title = (title || this.attrs.title || 'live example').trim(); + this.title = (title || this.attrs.title || '在线例子').trim(); this.onResize(window.innerWidth); } diff --git a/aio/src/app/shared/toc.service.ts b/aio/src/app/shared/toc.service.ts index 541ee514ae..3d39f2e4af 100644 --- a/aio/src/app/shared/toc.service.ts +++ b/aio/src/app/shared/toc.service.ts @@ -76,7 +76,7 @@ export class TocService { private isOriginalText(heading: HTMLHeadingElement): boolean { if (heading && heading.hasAttribute('translation-origin')) { const prevNode = heading.previousElementSibling; - if (prevNode.hasAttribute('translation-result')) { + if (prevNode && prevNode.hasAttribute('translation-result')) { return true; } }