Changed everything to use translate pipeline instead of hardcoded text and added german translations
This commit is contained in:
1 parent
5c7f0074f3
commit
cfa971f856
33 files changed
+758
-321
No files matched your search
@@ -2,21 +2,34 @@ import {Component, OnInit} from '@angular/core';
|
||||
import {NavigationEnd, Router, RouterLink} from '@angular/router';
|
||||
import {DeviceDetectorService} from 'ngx-device-detector';
|
||||
import {filter} from 'rxjs/operators';
|
||||
import {TranslatePipe, TranslateService} from '@ngx-translate/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-navbar',
|
||||
templateUrl: './navbar.component.html',
|
||||
styleUrls: ['./navbar.component.css'],
|
||||
imports: [
|
||||
RouterLink
|
||||
RouterLink,
|
||||
TranslatePipe
|
||||
]
|
||||
})
|
||||
export class NavbarComponent implements OnInit {
|
||||
currentLang: string;
|
||||
activeLink: string = '';
|
||||
isMobile: boolean;
|
||||
|
||||
constructor(private router: Router, private deviceService: DeviceDetectorService) {
|
||||
constructor(
|
||||
private router: Router,
|
||||
private deviceService: DeviceDetectorService,
|
||||
private translate: TranslateService
|
||||
) {
|
||||
this.isMobile = this.deviceService.isMobile();
|
||||
this.currentLang = this.translate.currentLang || this.translate.getDefaultLang() || 'en';
|
||||
}
|
||||
|
||||
switchLang(lang: string) {
|
||||
this.translate.use(lang);
|
||||
this.currentLang = lang;
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
|
||||
Reference in new issue
Block a user