Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit62d7b1c

Browse files
committed
docs: update localization docs and modernize examples
Improves the localization documentation by updating code highlight syntax issuesand removing outdated TODOs.Additionally, the CDK examples have been updated to use the viewChild query signal API,aligning the docs with current recommended patterns.
1 parent664fa39 commit62d7b1c

File tree

3 files changed

+7
-20
lines changed

3 files changed

+7
-20
lines changed

‎adev/src/content/examples/drag-drop/src/root-element/app/app.component.ts‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import {
66
Component,
77
OnDestroy,
88
TemplateRef,
9-
ViewChild,
109
ViewContainerRef,
1110
inject,
11+
viewChild,
1212
}from'@angular/core';
1313

1414
/**
@@ -23,13 +23,12 @@ import {
2323
exportclassCdkDragDropRootElementExampleimplementsAfterViewInit,OnDestroy{
2424
private_overlay=inject(Overlay);
2525
private_viewContainerRef=inject(ViewContainerRef);
26-
27-
@ViewChild(TemplateRef)_dialogTemplate!:TemplateRef<any>;
26+
private_dialogTemplate=viewChild.required(TemplateRef);
2827
private_overlayRef!:OverlayRef;
2928
private_portal!:TemplatePortal;
3029

3130
ngAfterViewInit(){
32-
this._portal=newTemplatePortal(this._dialogTemplate,this._viewContainerRef);
31+
this._portal=newTemplatePortal(this._dialogTemplate(),this._viewContainerRef);
3332
this._overlayRef=this._overlay.create({
3433
positionStrategy:this._overlay.position().global().centerHorizontally().centerVertically(),
3534
hasBackdrop:true,

‎adev/src/content/guide/i18n/add-package.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ To take advantage of the localization features of Angular, use the [Angular CLI]
44

55
To add the`@angular/localize` package, use the following command to update the`package.json` and TypeScript configuration files in your project.
66

7-
<docs-codepath="adev/src/content/examples/i18n/doc-files/commands.sh"region="add-localize"/>
7+
<docs-codelanguage="shell"path="adev/src/content/examples/i18n/doc-files/commands.sh"region="add-localize"/>
88

99
It adds`types: ["@angular/localize"]` in the TypeScript configuration files.
1010
It also adds line`/// <reference types="@angular/localize" />` at the top of the`main.ts` file which is the reference to the type definition.

‎adev/src/content/guide/i18n/prepare.md‎

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,11 @@ The following example displays an image with a `title` attribute.
7474

7575
To mark the title attribute for translation, complete the following action.
7676

77-
1.Add the`i18n-title` attribute
77+
Add the`i18n-title` attribute
7878

79-
The following example displays how to mark the`title` attribute on the`img` tag by adding`i18n-title`.
79+
The following example displays how to mark the`title` attribute on the`img` tag by adding`i18n-title`.
8080

81-
<docs-codeheader="app.component.html"path="adev/src/content/examples/i18n/src/app/app.component.html"region="i18n-title-translate"/>
81+
<docs-codeheader="app.component.html"path="adev/src/content/examples/i18n/src/app/app.component.html"region="i18n-title-translate"/>
8282

8383
##Mark text in component code
8484

@@ -216,16 +216,12 @@ Different languages have different pluralization rules that increase the difficu
216216
Because other locales express cardinality differently, you may need to set pluralization categories that do not align with English.
217217
Use the`plural` clause to mark expressions that may not be meaningful if translated word-for-word.
218218

219-
<!--todo: replace with docs-code-->
220-
221219
```html
222220
{ component_property, plural, pluralization_categories }
223221
```
224222

225223
After the pluralization category, enter the default text\(English\) surrounded by open curly brace\(`{`\) and close curly brace\(`}`\) characters.
226224

227-
<!--todo: replace with docs-code-->
228-
229225
```html
230226
pluralization_category { }
231227
```
@@ -243,8 +239,6 @@ The following pluralization categories are available for English and may change
243239

244240
If none of the pluralization categories match, Angular uses`other` to match the standard fallback for a missing category.
245241

246-
<!--todo: replace with docs-code-->
247-
248242
```html
249243
other { default_quantity }
250244
```
@@ -310,8 +304,6 @@ Review the following details in the previous code example.
310304

311305
The`select` clause marks choices for alternate text based on your defined string values.
312306

313-
<!--todo: replace with docs-code-->
314-
315307
```html
316308
{ component_property, select, selection_categories }
317309
```
@@ -320,8 +312,6 @@ Translate all of the alternates to display alternate text based on the value of
320312

321313
After the selection category, enter the text\(English\) surrounded by open curly brace\(`{`\) and close curly brace\(`}`\) characters.
322314

323-
<!--todo: replace with docs-code-->
324-
325315
```html
326316
selection_category { text }
327317
```
@@ -330,8 +320,6 @@ Different locales have different grammatical constructions that increase the dif
330320
Use HTML markup.
331321
If none of the selection categories match, Angular uses`other` to match the standard fallback for a missing category.
332322

333-
<!--todo: replace with docs-code-->
334-
335323
```html
336324
other { default_value }
337325
```

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp