alfresco-ng2-components/docs/language-menu.component.md
Maurizio Vitale 729270b138 [ADF-1782] Language menu - Fix typo (#2520)
* Rename processlist.component.ts to process-list.component.ts
Rename processlist.component.md to process-list.component.md

* Fix typo

* Fix typo
2017-10-20 16:43:08 +01:00

2.1 KiB

Language Menu component

Displays all the languages that are present in the "app.config.json" or the defaul one (EN).

Language Menu screenshot

Basic usage

How to attach an ADF Language Menu as main menu

<button mat-icon-button [matMenuTriggerFor]="langMenu">
    <mat-icon>language</mat-icon>
</button>
<mat-menu #langMenu="matMenu">
    <adf-language-menu></adf-language-menu>
</mat-menu>

Details

In the previous example we are using the ADF Language Menu as main menu. The Language Menu component is able to fetch all the languages from the "app.config.json". This is how the configuration looks like in the the "app.config.json"

"languages": [
        {
            "key": "en",
            "label": "English"
        },
        {
            "key": "fr",
            "label": "French"
        },
        {
            "key": "it",
            "label": "Italian"
        }
    ]

In case no setting is provided, the component shows only the English language.

Nested Menu language

How to attach an ADF Language Menu as nested menu

<button md-icon-button class="dw-profile-menu" [mdMenuTriggerFor]="profileMenu">
    <md-icon>more_vert</md-icon>
</button>
<md-menu #profileMenu="mdMenu">
    <button md-menu-item>profile-settings</button>
    <button md-menu-item [matMenuTriggerFor]="langMenu">Languages</button>
    <button md-menu-item>sign-out</button>
</md-menu>
<md-menu #langMenu="mdMenu">
    <adf-language-menu></adf-language-menu>
</md-menu>

Nested Language Menu screenshot

Nested menu details

In the previous example we are using the ADF Language Menu as nested menu.