mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-2526] Fixed interpolation marker issue in doc files (#3098)
* [ADF-2526] Test commit of a file with escape tags * [ADF-2526] Fixed interpolation marker issue in doc code samples
This commit is contained in:
committed by
Eugenio Romano
parent
f5d58178db
commit
347b2bb5e8
@@ -101,10 +101,14 @@ export class HomeComponent implements OnInit {
|
||||
|
||||
...with very simple corresponding HTML:
|
||||
|
||||
<!-- {% raw %} -->
|
||||
|
||||
```html
|
||||
{{translatedText}}
|
||||
```
|
||||
|
||||
<!-- {% endraw %} -->
|
||||
|
||||
In the browser, this is displayed as:
|
||||
|
||||

|
||||
@@ -139,8 +143,12 @@ corresponding text. For example, the following will display the
|
||||
"Start Form" text as above but without any code or variables in the
|
||||
component's `.ts` file:
|
||||
|
||||
<!-- {% raw %} -->
|
||||
|
||||
{{ "FORM.START_FORM.TITLE" | translate }}
|
||||
|
||||
<!-- {% endraw %} -->
|
||||
|
||||
## Adding your own messages
|
||||
|
||||
The built-in translations certainly won't cover everything you will need for
|
||||
@@ -156,6 +164,8 @@ string at a specified position within a message). This is very useful for
|
||||
messages whose content can change at runtime. For example, in the built-in
|
||||
`en.json` there is the `CORE.PAGINATION.ITEMS_RANGE` key:
|
||||
|
||||
<!-- {% raw %} -->
|
||||
|
||||
```json
|
||||
...
|
||||
"CORE": {
|
||||
@@ -168,6 +178,8 @@ messages whose content can change at runtime. For example, in the built-in
|
||||
...
|
||||
```
|
||||
|
||||
<!-- {% endraw %} -->
|
||||
|
||||
The sections in curly braces are _interpolation variables_ that you supply
|
||||
at runtime. You can specify them by passing an extra parameter to
|
||||
`TranslationService.get`; this is an object whose properties have the same
|
||||
@@ -187,8 +199,12 @@ this.trans.get(
|
||||
|
||||
You can use interpolations with the `translate` pipe in a similar way:
|
||||
|
||||
<!-- {% raw %} -->
|
||||
|
||||
{{ "CORE.PAGINATION.ITEMS_RANGE" | translate: { range: "1..10", total: "122"} }}
|
||||
|
||||
<!-- {% endraw %} -->
|
||||
|
||||
## Selecting the display language
|
||||
|
||||
ADF provides a [Language Menu component](../core/language-menu.component.md) that
|
||||
|
Reference in New Issue
Block a user