diff options
author | Chocobozzz <me@florianbigard.com> | 2018-06-28 13:59:48 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-06-28 15:53:12 +0200 |
commit | 8afc19a6121569da054462c7cb351a3f13030a32 (patch) | |
tree | 6dba42963681062536e635dd3ca401e1c7b0ca9f /client/src/app/menu/menu.component.ts | |
parent | 3ea9a1c311c3e3c55fb95560d4dd99a77c52df4a (diff) | |
download | PeerTube-8afc19a6121569da054462c7cb351a3f13030a32.tar.gz PeerTube-8afc19a6121569da054462c7cb351a3f13030a32.tar.zst PeerTube-8afc19a6121569da054462c7cb351a3f13030a32.zip |
Add ability to choose the language
Diffstat (limited to 'client/src/app/menu/menu.component.ts')
-rw-r--r-- | client/src/app/menu/menu.component.ts | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/client/src/app/menu/menu.component.ts b/client/src/app/menu/menu.component.ts index c0aea89b3..dded6b4d5 100644 --- a/client/src/app/menu/menu.component.ts +++ b/client/src/app/menu/menu.component.ts | |||
@@ -1,8 +1,8 @@ | |||
1 | import { Component, OnInit } from '@angular/core' | 1 | import { Component, OnInit, ViewChild } from '@angular/core' |
2 | import { Router } from '@angular/router' | ||
3 | import { UserRight } from '../../../../shared/models/users/user-right.enum' | 2 | import { UserRight } from '../../../../shared/models/users/user-right.enum' |
4 | import { AuthService, AuthStatus, RedirectService, ServerService } from '../core' | 3 | import { AuthService, AuthStatus, RedirectService, ServerService } from '../core' |
5 | import { User } from '../shared/users/user.model' | 4 | import { User } from '../shared/users/user.model' |
5 | import { LanguageChooserComponent } from '@app/menu/language-chooser.component' | ||
6 | 6 | ||
7 | @Component({ | 7 | @Component({ |
8 | selector: 'my-menu', | 8 | selector: 'my-menu', |
@@ -10,6 +10,8 @@ import { User } from '../shared/users/user.model' | |||
10 | styleUrls: [ './menu.component.scss' ] | 10 | styleUrls: [ './menu.component.scss' ] |
11 | }) | 11 | }) |
12 | export class MenuComponent implements OnInit { | 12 | export class MenuComponent implements OnInit { |
13 | @ViewChild('languageChooserModal') languageChooserModal: LanguageChooserComponent | ||
14 | |||
13 | user: User | 15 | user: User |
14 | isLoggedIn: boolean | 16 | isLoggedIn: boolean |
15 | userHasAdminAccess = false | 17 | userHasAdminAccess = false |
@@ -90,6 +92,10 @@ export class MenuComponent implements OnInit { | |||
90 | this.redirectService.redirectToHomepage() | 92 | this.redirectService.redirectToHomepage() |
91 | } | 93 | } |
92 | 94 | ||
95 | openLanguageChooser () { | ||
96 | this.languageChooserModal.show() | ||
97 | } | ||
98 | |||
93 | private computeIsUserHasAdminAccess () { | 99 | private computeIsUserHasAdminAccess () { |
94 | const right = this.getFirstAdminRightAvailable() | 100 | const right = this.getFirstAdminRightAvailable() |
95 | 101 | ||