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
@@ -1,6 +1,6 @@
|
||||
<footer>
|
||||
<p>© {{ currentYear }} itzMiney</p>
|
||||
<p><a href="/tos">Terms of Service</a> • <a href="/imprint">Imprint</a> • <a href="/privacy">Privacy Policy</a></p>
|
||||
<p><a href="/tos">{{ 'FOOTER_TOS' | translate }}</a> • <a href="/imprint">{{ 'FOOTER_IMP' | translate }}</a> • <a href="/privacy">{{ 'FOOTER_PRIV' | translate }}</a></p>
|
||||
|
||||
<div class="social-icons">
|
||||
<a href="https://linktr.ee/itzminey" target="_blank" aria-label="Twitter">
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
import {Component} from '@angular/core';
|
||||
import {TranslatePipe} from '@ngx-translate/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-footer',
|
||||
imports: [],
|
||||
imports: [
|
||||
TranslatePipe
|
||||
],
|
||||
templateUrl: './footer.component.html',
|
||||
styleUrl: './footer.component.css'
|
||||
})
|
||||
|
||||
@@ -82,3 +82,33 @@
|
||||
color: white;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.language-switch {
|
||||
position: absolute;
|
||||
bottom: 20px;
|
||||
}
|
||||
|
||||
.language-switch button {
|
||||
padding: 8px 16px;
|
||||
background: #362e51;
|
||||
color: #fff;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
font-family: Roboto, serif;
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
|
||||
.language-switch button.active {
|
||||
font-weight: bold;
|
||||
background: #fff;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.language-switch button.en {
|
||||
margin-left: 8px;
|
||||
border-radius: 25px 0 0 25px;
|
||||
}
|
||||
|
||||
.language-switch button.de {
|
||||
border-radius: 0 25px 25px 0;
|
||||
}
|
||||
@@ -9,11 +9,15 @@
|
||||
<div class="full-screen-menu" *ngIf="menuOpen">
|
||||
<button class="close-icon" (click)="toggleMenu()">✖</button>
|
||||
<ul>
|
||||
<li><a [routerLink]="'/'" [class.active]="activeLink === '/'"><i class="fa-solid fa-address-card"></i> About</a></li>
|
||||
<li><a [routerLink]="'/'" [class.active]="activeLink === '/'"><i class="fa-solid fa-address-card"></i> {{ 'NAV_ABOUT' | translate }}</a></li>
|
||||
<li><a [routerLink]="'/portfolio'" [class.active]="activeLink === '/portfolio'"><i class="fa-solid fa-image"></i> Portfolio</a></li>
|
||||
<li><a [routerLink]="'/socials'" [class.active]="activeLink === '/socials'"><i class="fa-solid fa-hashtag"></i> Socials</a></li>
|
||||
<li><a [routerLink]="'/services'" [class.active]="activeLink === '/services'"><i class="fa-solid fa-money-bill"></i> Services</a></li>
|
||||
<li><a [routerLink]="'/services'" [class.active]="activeLink === '/services'"><i class="fa-solid fa-money-bill"></i> {{ 'NAV_SERVICES' | translate }}</a></li>
|
||||
<li><a [routerLink]="'/blog'" [class.active]="activeLink === '/blog'"><i class="fa-solid fa-newspaper"></i> Blog</a></li>
|
||||
</ul>
|
||||
<div class="language-switch">
|
||||
<button (click)="switchLang('en')" [class.active]="currentLang === 'en'" class="en">EN</button>
|
||||
<button (click)="switchLang('de')" [class.active]="currentLang === 'de'" class="de">DE</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -2,24 +2,37 @@ import {Component, OnInit} from '@angular/core';
|
||||
import {DeviceDetectorService} from 'ngx-device-detector';
|
||||
import {NgIf} from '@angular/common';
|
||||
import {NavigationEnd, Router, RouterLink} from '@angular/router';
|
||||
import {TranslatePipe, TranslateService} from '@ngx-translate/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-mobile-navbar',
|
||||
imports: [
|
||||
RouterLink,
|
||||
NgIf
|
||||
NgIf,
|
||||
TranslatePipe
|
||||
],
|
||||
templateUrl: './mobile-navbar.component.html',
|
||||
styleUrl: './mobile-navbar.component.css'
|
||||
})
|
||||
|
||||
export class MobileNavbarComponent implements OnInit{
|
||||
currentLang: string;
|
||||
menuOpen = false;
|
||||
isMobile: boolean;
|
||||
activeLink: string = '';
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
toggleMenu() {
|
||||
|
||||
@@ -38,3 +38,32 @@
|
||||
color: #fff;
|
||||
transform: scale(1.1);
|
||||
}
|
||||
|
||||
.language-switch {
|
||||
position: absolute;
|
||||
right: -150px;
|
||||
}
|
||||
|
||||
.language-switch button {
|
||||
padding: 4px 8px;
|
||||
background: #362e51;
|
||||
color: #fff;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
font-family: Roboto, serif;
|
||||
}
|
||||
|
||||
.language-switch button.active {
|
||||
font-weight: bold;
|
||||
background: #fff;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.language-switch button.en {
|
||||
margin-left: 8px;
|
||||
border-radius: 25px 0 0 25px;
|
||||
}
|
||||
|
||||
.language-switch button.de {
|
||||
border-radius: 0 25px 25px 0;
|
||||
}
|
||||
@@ -1,9 +1,13 @@
|
||||
<nav class="navbar">
|
||||
<div class="navbar-links">
|
||||
<a [routerLink]="'/'" [class.active]="activeLink === '/'">About</a>
|
||||
<a [routerLink]="'/'" [class.active]="activeLink === '/'">{{ 'NAV_ABOUT' | translate }}</a>
|
||||
<a [routerLink]="'/portfolio'" [class.active]="activeLink === '/portfolio'">Portfolio</a>
|
||||
<a [routerLink]="'/socials'" [class.active]="activeLink === '/socials'">Socials</a>
|
||||
<a [routerLink]="'/services'" [class.active]="activeLink === '/services'">Services</a>
|
||||
<a [routerLink]="'/services'" [class.active]="activeLink === '/services'">{{ 'NAV_SERVICES' | translate }}</a>
|
||||
<a [routerLink]="'/blog'" [class.active]="activeLink === '/blog'">Blog</a>
|
||||
</div>
|
||||
<div class="language-switch">
|
||||
<button (click)="switchLang('en')" [class.active]="currentLang === 'en'" class="en">EN</button>
|
||||
<button (click)="switchLang('de')" [class.active]="currentLang === 'de'" class="de">DE</button>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -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