-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(i18n): Finalize translations (#57)
* createProjectDialog * project dashboard * edit project * project list * template variables 1 * template variable editor * edit version component * project version list * project service * user edit dialog * user list * me component * dialogs * . * language switcher * localized dates * update dependencies * review fixes Co-authored-by: Tom <[email protected]>
- Loading branch information
1 parent
214c9f6
commit f8c1a92
Showing
39 changed files
with
2,355 additions
and
1,949 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
frontend/src/app/components/i18n-switcher/i18n-switcher.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<button mat-icon-button [matMenuTriggerFor]="modeMenu"> | ||
<mat-icon svgIcon="language"></mat-icon> | ||
</button> | ||
<mat-menu #modeMenu class="i18n-switcher-menu"> | ||
<button mat-menu-item *ngFor="let locale of locales" (click)="setLocale(locale.locale)" [class.active]="(currentLocale$ | async) === locale.locale"> | ||
<mat-icon [svgIcon]="((currentLocale$ | async) === locale.locale) ? 'mdi:radiobox-marked' : 'mdi:radiobox-blank'"></mat-icon> | ||
<span>{{locale.label}}</span> | ||
</button> | ||
</mat-menu> |
5 changes: 5 additions & 0 deletions
5
frontend/src/app/components/i18n-switcher/i18n-switcher.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@import "src/styles/mixins"; | ||
|
||
.active { | ||
font-weight: 600; | ||
} |
12 changes: 12 additions & 0 deletions
12
frontend/src/app/components/i18n-switcher/i18n-switcher.component.theme.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
@use '~@angular/material' as mat; | ||
@import "src/styles/mixins"; | ||
|
||
@mixin i18n-switcher-component-theme($theme) { | ||
$primary: map-get($theme, primary); | ||
.i18n-switcher-menu { | ||
.active { | ||
font-weight: 600; | ||
color: mat.get-color-from-palette($primary, 600); | ||
} | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
frontend/src/app/components/i18n-switcher/i18n-switcher.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import {Component} from "@angular/core"; | ||
import {Select, Store} from "@ngxs/store"; | ||
import {Observable} from "rxjs"; | ||
import {I18nState, OnekoLocale, SetLocale} from "../../store/i18n/i18n.state"; | ||
|
||
@Component({ | ||
selector: 'on-i18n-switcher', | ||
templateUrl: './i18n-switcher.component.html', | ||
styleUrls: ['./i18n-switcher.component.scss'] | ||
}) | ||
export class I18nSwitcherComponent { | ||
|
||
locales: Array<{ label: string, locale: OnekoLocale }>; | ||
|
||
@Select(I18nState.locale) currentLocale$: Observable<OnekoLocale>; | ||
|
||
constructor(private store: Store) { | ||
this.locales = [ | ||
{ | ||
label: 'English', | ||
locale: 'en' | ||
}, { | ||
label: 'Deutsch', | ||
locale: 'de' | ||
} | ||
]; | ||
} | ||
|
||
setLocale(locale: OnekoLocale) { | ||
this.store.dispatch(new SetLocale(locale)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.