mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-09-17 14:21:14 +00:00
[ACA-968] Language Picker
This commit is contained in:
committed by
Denys Vuika
parent
c3f8724a23
commit
7007c735e4
@@ -4,6 +4,7 @@
|
||||
"name": "Alfresco Example Content Application",
|
||||
"build": "1234"
|
||||
},
|
||||
"languagePicker": false,
|
||||
"document-list": {
|
||||
"supportedPageSizes": [
|
||||
25,
|
||||
@@ -18,5 +19,47 @@
|
||||
"thumbs.db",
|
||||
".git"
|
||||
]
|
||||
}
|
||||
},
|
||||
"languages": [
|
||||
{
|
||||
"key": "de",
|
||||
"label": "German"
|
||||
},
|
||||
{
|
||||
"key": "en",
|
||||
"label": "English"
|
||||
},
|
||||
{
|
||||
"key": "es",
|
||||
"label": "Spanish"
|
||||
},
|
||||
{
|
||||
"key": "fr",
|
||||
"label": "French"
|
||||
},
|
||||
{
|
||||
"key": "it",
|
||||
"label": "Italian"
|
||||
},
|
||||
{
|
||||
"key": "ja",
|
||||
"label": "Japanese"
|
||||
},
|
||||
{
|
||||
"key": "nb",
|
||||
"label": "Norwegian"
|
||||
},
|
||||
{
|
||||
"key": "nl",
|
||||
"label": "Dutch"
|
||||
},
|
||||
{
|
||||
"key": "pt-BR",
|
||||
"label": "Brazilian Portuguese"
|
||||
},
|
||||
{
|
||||
"key": "ru",
|
||||
"label": "Russian"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@@ -11,8 +11,17 @@
|
||||
</div>
|
||||
|
||||
<mat-menu #userMenu="matMenu" [overlapTrigger]="false">
|
||||
<button *ngIf="showLanguagePicker"
|
||||
mat-menu-item [matMenuTriggerFor]="langMenu">
|
||||
{{ 'APP.LANGUAGE' | translate }}
|
||||
</button>
|
||||
|
||||
<button mat-menu-item adf-logout>
|
||||
{{ 'APP.SIGN_OUT' | translate }}
|
||||
</button>
|
||||
</mat-menu>
|
||||
|
||||
<mat-menu #langMenu="matMenu">
|
||||
<adf-language-menu></adf-language-menu>
|
||||
</mat-menu>
|
||||
</div>
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { Component, OnInit, OnDestroy } from '@angular/core';
|
||||
import { PeopleContentService } from 'ng2-alfresco-core';
|
||||
import { PeopleContentService, AppConfigService } from 'ng2-alfresco-core';
|
||||
import { Subscription } from 'rxjs/Rx';
|
||||
|
||||
@Component({
|
||||
@@ -29,7 +29,10 @@ export class CurrentUserComponent implements OnInit, OnDestroy {
|
||||
|
||||
user: any = null;
|
||||
|
||||
constructor(private peopleApi: PeopleContentService) {}
|
||||
constructor(
|
||||
private peopleApi: PeopleContentService,
|
||||
private appConfig: AppConfigService
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.personSubscription = this.peopleApi.getCurrentPerson()
|
||||
@@ -61,4 +64,8 @@ export class CurrentUserComponent implements OnInit, OnDestroy {
|
||||
const { userFirstName: first, userLastName: last } = this;
|
||||
return [ first[0], last[0] ].join('');
|
||||
}
|
||||
|
||||
get showLanguagePicker() {
|
||||
return this.appConfig.get('languagePicker') || false;
|
||||
}
|
||||
}
|
||||
|
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"APP": {
|
||||
"LANGUAGE": "Language",
|
||||
"SIGN_IN": "Sign in",
|
||||
"SIGN_OUT": "Sign out",
|
||||
"NEW_MENU": {
|
||||
|
Reference in New Issue
Block a user