Compare commits

...
Author SHA1 Message Date
farajollahi 470b9095c4 implement multi language function
LocationBasedServices/smartguide/pipeline/head There was a failure building this commit
2026-08-04 08:50:07 +02:00
142 changed files with 4410 additions and 1430 deletions
@@ -16,15 +16,15 @@
<mat-divider /> <mat-divider />
<mat-tab-group> <mat-tab-group>
<mat-tab label="Einstellungen"> <mat-tab [label]="'account.settings' | translate">
<div class="settings-tab"> <div class="settings-tab">
<h5>Passwort ändern</h5> <h5>{{ 'account.changePassword' | translate }}</h5>
<form class="change-password-form" [formRoot]="changePasswordForm"> <form class="change-password-form" [formRoot]="changePasswordForm">
<mat-form-field subscriptSizing="dynamic"> <mat-form-field subscriptSizing="dynamic">
<mat-label>Altes Passwort</mat-label> <mat-label>{{ 'account.currentPassword' | translate }}</mat-label>
<input <input
matInput matInput
aria-label="Altes Passwort" [attr.aria-label]="'account.currentPassword' | translate"
[type]="inputFieldType()" [type]="inputFieldType()"
[formField]="changePasswordForm.oldPassword" /> [formField]="changePasswordForm.oldPassword" />
@if (oldPasswordErrorMessage()) { @if (oldPasswordErrorMessage()) {
@@ -34,10 +34,10 @@
<div class="new-password-fields"> <div class="new-password-fields">
<mat-form-field subscriptSizing="dynamic"> <mat-form-field subscriptSizing="dynamic">
<mat-label>Neues Passwort</mat-label> <mat-label>{{ 'accounts.newPassword' | translate }}</mat-label>
<input <input
matInput matInput
aria-label="Neues Passwort" [attr.aria-label]="'accounts.newPassword' | translate"
[type]="inputFieldType()" [type]="inputFieldType()"
[formField]="changePasswordForm.newPassword" /> [formField]="changePasswordForm.newPassword" />
@if (newPasswordErrorMessage()) { @if (newPasswordErrorMessage()) {
@@ -46,10 +46,10 @@
</mat-form-field> </mat-form-field>
<mat-form-field subscriptSizing="dynamic"> <mat-form-field subscriptSizing="dynamic">
<mat-label>Neues Passwort wiederholen</mat-label> <mat-label>{{ 'account.repeatNewPassword' | translate }}</mat-label>
<input <input
matInput matInput
aria-label="Neues Passwort wiederholen" [attr.aria-label]="'account.repeatNewPassword' | translate"
[type]="inputFieldType()" [type]="inputFieldType()"
[formField]="changePasswordForm.newPasswordRepeat" /> [formField]="changePasswordForm.newPasswordRepeat" />
@if (newPasswordRepeatErrorMessage()) { @if (newPasswordRepeatErrorMessage()) {
@@ -61,7 +61,7 @@
<mat-slide-toggle <mat-slide-toggle
labelPosition="before" labelPosition="before"
[formField]="changePasswordForm.showPasswords" [formField]="changePasswordForm.showPasswords"
>Passwörter anzeigen</mat-slide-toggle >{{ 'account.showPasswords' | translate }}</mat-slide-toggle
> >
<button <button
mat-raised-button mat-raised-button
@@ -70,7 +70,7 @@
[disabled]=" [disabled]="
changePasswordForm().invalid() || changePasswordForm().submitting() changePasswordForm().invalid() || changePasswordForm().submitting()
"> ">
Passwort ändern {{ 'account.changePassword' | translate }}
</button> </button>
</form> </form>
<mat-divider /> <mat-divider />
@@ -29,6 +29,9 @@ import { MatSlideToggleModule } from '@angular/material/slide-toggle';
import { CredentialService } from '../../shared/services/credential.service'; import { CredentialService } from '../../shared/services/credential.service';
import { MatSnackBar } from '@angular/material/snack-bar'; import { MatSnackBar } from '@angular/material/snack-bar';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
import { LanguageService } from '../../shared/i18n/language.service';
import { TranslatePipe } from '../../shared/i18n/translate.pipe';
import { TranslationKey } from '../../shared/i18n/translations';
interface ChangePasswordForm { interface ChangePasswordForm {
oldPassword: string; oldPassword: string;
@@ -54,6 +57,7 @@ interface ChangePasswordForm {
MatSlideToggleModule, MatSlideToggleModule,
FormField, FormField,
FormRoot, FormRoot,
TranslatePipe,
], ],
templateUrl: './account.component.html', templateUrl: './account.component.html',
styleUrl: './account.component.scss', styleUrl: './account.component.scss',
@@ -64,6 +68,7 @@ export class AccountComponent {
private readonly _credentialService = inject(CredentialService); private readonly _credentialService = inject(CredentialService);
private readonly _snackBar = inject(MatSnackBar); private readonly _snackBar = inject(MatSnackBar);
private readonly _router = inject(Router); private readonly _router = inject(Router);
private readonly languageService = inject(LanguageService);
roles: UserRole[] = []; roles: UserRole[] = [];
@@ -76,37 +81,37 @@ export class AccountComponent {
oldPasswordErrorMessage = computed<string | null>(() => { oldPasswordErrorMessage = computed<string | null>(() => {
const errors = this.changePasswordForm.oldPassword().errors(); const errors = this.changePasswordForm.oldPassword().errors();
return errors.length > 0 && errors[0].message ? errors[0].message : null; return this.translateValidationError(errors[0]?.message);
}); });
newPasswordErrorMessage = computed<string | null>(() => { newPasswordErrorMessage = computed<string | null>(() => {
const errors = this.changePasswordForm.newPassword().errors(); const errors = this.changePasswordForm.newPassword().errors();
return errors.length > 0 && errors[0].message ? errors[0].message : null; return this.translateValidationError(errors[0]?.message);
}); });
newPasswordRepeatErrorMessage = computed<string | null>(() => { newPasswordRepeatErrorMessage = computed<string | null>(() => {
const errors = this.changePasswordForm.newPasswordRepeat().errors(); const errors = this.changePasswordForm.newPasswordRepeat().errors();
return errors.length > 0 && errors[0].message ? errors[0].message : null; return this.translateValidationError(errors[0]?.message);
}); });
changePasswordForm = form( changePasswordForm = form(
this.changePasswordModel, this.changePasswordModel,
(schemaPath) => { (schemaPath) => {
required(schemaPath.oldPassword, { required(schemaPath.oldPassword, {
message: 'Altes Passwort ist erforderlich.', message: 'account.currentPasswordRequired',
}); });
required(schemaPath.newPassword, { required(schemaPath.newPassword, {
message: 'Neues Passwort ist erforderlich.', message: 'account.newPasswordRequired',
}); });
required(schemaPath.newPasswordRepeat, { required(schemaPath.newPasswordRepeat, {
message: 'Neues Passwort wiederholen ist erforderlich.', message: 'account.repeatPasswordRequired',
}); });
minLength(schemaPath.newPassword, 8, { minLength(schemaPath.newPassword, 8, {
message: 'Neues Passwort muss mindestens 8 Zeichen lang sein.', message: 'account.passwordMinLength',
}); });
maxLength(schemaPath.newPassword, 64, { maxLength(schemaPath.newPassword, 64, {
message: 'Neues Passwort darf maximal 64 Zeichen lang sein.', message: 'account.passwordMaxLength',
}); });
validate(schemaPath.newPasswordRepeat, ({ value, valueOf }) => { validate(schemaPath.newPasswordRepeat, ({ value, valueOf }) => {
@@ -116,7 +121,7 @@ export class AccountComponent {
if (newPassword !== newPasswordRepeat) { if (newPassword !== newPasswordRepeat) {
return { return {
kind: 'passwordMismatch', kind: 'passwordMismatch',
message: 'Passwörter stimmen nicht überein.', message: 'account.passwordMismatch',
}; };
} }
@@ -130,8 +135,7 @@ export class AccountComponent {
if (oldPassword && newPassword && oldPassword === newPassword) { if (oldPassword && newPassword && oldPassword === newPassword) {
return { return {
kind: 'passwordSameAsOld', kind: 'passwordSameAsOld',
message: message: 'account.passwordSameAsOld',
'Neues Passwort darf nicht dasselbe wie das alte Passwort sein.',
}; };
} }
@@ -157,8 +161,10 @@ export class AccountComponent {
}, },
error: (error) => { error: (error) => {
this._snackBar.open( this._snackBar.open(
'Fehler beim Aktualisieren des Zugriffstokens. Bitte melden Sie sich erneut an.', this.languageService.translate(
'OK', 'account.tokenRefreshError',
),
this.languageService.translate('common.ok'),
{ duration: 7000 }, { duration: 7000 },
); );
}, },
@@ -167,8 +173,10 @@ export class AccountComponent {
error: (error) => { error: (error) => {
console.error('Error changing password:', error); console.error('Error changing password:', error);
this._snackBar.open( this._snackBar.open(
'Fehler beim Ändern des Passworts. Bitte versuchen Sie es erneut.', this.languageService.translate(
'OK', 'account.changePasswordError',
),
this.languageService.translate('common.ok'),
{ duration: 7000 }, { duration: 7000 },
); );
}, },
@@ -184,6 +192,11 @@ export class AccountComponent {
this.changePasswordModel().showPasswords ? 'text' : 'password', this.changePasswordModel().showPasswords ? 'text' : 'password',
); );
private translateValidationError(message?: string): string | null {
if (!message) return null;
return this.languageService.translate(message as TranslationKey);
}
constructor() { constructor() {
effect(() => { effect(() => {
this.roles = this.accountProfile().roles; this.roles = this.accountProfile().roles;
@@ -1,29 +1,33 @@
<h2 mat-dialog-title> <h2 mat-dialog-title>
{{ data.mode === 'create' ? 'Account erstellen' : 'Account bearbeiten' }} {{
data.mode === 'create'
? ('accounts.create' | translate)
: ('accounts.edit' | translate)
}}
</h2> </h2>
<mat-dialog-content> <mat-dialog-content>
<form class="account-form" [formGroup]="form" (ngSubmit)="submit()"> <form class="account-form" [formGroup]="form" (ngSubmit)="submit()">
<mat-form-field appearance="outline"> <mat-form-field appearance="outline">
<mat-label>E-Mail</mat-label> <mat-label>{{ 'accounts.email' | translate }}</mat-label>
<input matInput type="email" formControlName="email" /> <input matInput type="email" formControlName="email" />
@if (form.controls.email.hasError('required')) { @if (form.controls.email.hasError('required')) {
<mat-error>E-Mail ist erforderlich.</mat-error> <mat-error>{{ 'accounts.emailRequired' | translate }}</mat-error>
} @else if (form.controls.email.hasError('email')) { } @else if (form.controls.email.hasError('email')) {
<mat-error>Bitte gültige E-Mail eingeben.</mat-error> <mat-error>{{ 'accounts.emailInvalid' | translate }}</mat-error>
} }
</mat-form-field> </mat-form-field>
<mat-form-field appearance="outline"> <mat-form-field appearance="outline">
<mat-label>Name</mat-label> <mat-label>{{ 'organizations.name' | translate }}</mat-label>
<input matInput formControlName="name" /> <input matInput formControlName="name" />
@if (form.controls.name.hasError('required')) { @if (form.controls.name.hasError('required')) {
<mat-error>Name ist erforderlich.</mat-error> <mat-error>{{ 'accounts.nameRequired' | translate }}</mat-error>
} }
</mat-form-field> </mat-form-field>
<mat-form-field appearance="outline"> <mat-form-field appearance="outline">
<mat-label>Rolle</mat-label> <mat-label>{{ 'accounts.role' | translate }}</mat-label>
<mat-select formControlName="roles" multiple> <mat-select formControlName="roles" multiple>
@for (role of data.roles; track role) { @for (role of data.roles; track role) {
<mat-option [value]="role">{{ role }}</mat-option> <mat-option [value]="role">{{ role }}</mat-option>
@@ -33,7 +37,7 @@
@if (data.canSelectOrganization) { @if (data.canSelectOrganization) {
<mat-form-field appearance="outline"> <mat-form-field appearance="outline">
<mat-label>Organisation</mat-label> <mat-label>{{ 'accounts.organization' | translate }}</mat-label>
<mat-select formControlName="organizationId"> <mat-select formControlName="organizationId">
@for (organization of data.organizations; track organization.id) { @for (organization of data.organizations; track organization.id) {
<mat-option [value]="organization.id"> <mat-option [value]="organization.id">
@@ -46,22 +50,28 @@
<mat-form-field appearance="outline"> <mat-form-field appearance="outline">
<mat-label> <mat-label>
{{ data.mode === 'create' ? 'Initiales Passwort' : 'Neues Passwort' }} {{
data.mode === 'create'
? ('accounts.initialPassword' | translate)
: ('accounts.newPassword' | translate)
}}
</mat-label> </mat-label>
<input matInput type="password" formControlName="password" /> <input matInput type="password" formControlName="password" />
@if (form.controls.password.hasError('required')) { @if (form.controls.password.hasError('required')) {
<mat-error>Passwort ist erforderlich.</mat-error> <mat-error>{{ 'accounts.passwordRequired' | translate }}</mat-error>
} @else if (form.controls.password.hasError('minlength')) { } @else if (form.controls.password.hasError('minlength')) {
<mat-error>Mindestens 8 Zeichen.</mat-error> <mat-error>{{ 'accounts.passwordMinLength' | translate }}</mat-error>
} }
</mat-form-field> </mat-form-field>
</form> </form>
</mat-dialog-content> </mat-dialog-content>
<mat-dialog-actions align="end"> <mat-dialog-actions align="end">
<button mat-button type="button" (click)="close()">Abbrechen</button> <button mat-button type="button" (click)="close()">
{{ 'common.cancel' | translate }}
</button>
<button mat-flat-button color="primary" type="button" (click)="submit()"> <button mat-flat-button color="primary" type="button" (click)="submit()">
<mat-icon>save</mat-icon> <mat-icon>save</mat-icon>
Speichern {{ 'common.save' | translate }}
</button> </button>
</mat-dialog-actions> </mat-dialog-actions>
@@ -21,6 +21,7 @@ import {
InseAccountManagementModelOrganizationProfile, InseAccountManagementModelOrganizationProfile,
UserRole, UserRole,
} from '../../api'; } from '../../api';
import { TranslatePipe } from '../../shared/i18n/translate.pipe';
export type AccountDialogMode = 'create' | 'edit'; export type AccountDialogMode = 'create' | 'edit';
@@ -65,6 +66,7 @@ export type AccountDialogResult =
MatIconModule, MatIconModule,
MatInputModule, MatInputModule,
MatSelectModule, MatSelectModule,
TranslatePipe,
], ],
templateUrl: './account-dialog.component.html', templateUrl: './account-dialog.component.html',
styleUrl: './account-dialog.component.scss', styleUrl: './account-dialog.component.scss',
@@ -1,12 +1,12 @@
<section class="accounts-page"> <section class="accounts-page">
<header class="page-header"> <header class="page-header">
<div> <div>
<h1>Accounts</h1> <h1>{{ 'accounts.title' | translate }}</h1>
<p> <p>
{{ {{
isReadOnly isReadOnly
? 'Personen der eigenen Organisation ansehen.' ? ('accounts.readOnlyDescription' | translate)
: 'Account-Zugänge verwalten, Rollen setzen und Impersonation starten.' : ('accounts.description' | translate)
}} }}
</p> </p>
</div> </div>
@@ -15,10 +15,10 @@
mat-flat-button mat-flat-button
color="primary" color="primary"
type="button" type="button"
matTooltip="Neuen Account anlegen" [matTooltip]="'accounts.newTooltip' | translate"
(click)="startCreate()"> (click)="startCreate()">
<mat-icon>person_add</mat-icon> <mat-icon>person_add</mat-icon>
Neuer Account {{ 'accounts.new' | translate }}
</button> </button>
} }
</header> </header>
@@ -26,12 +26,12 @@
<section style="display: flex; gap: 1rem; align-items: center"> <section style="display: flex; gap: 1rem; align-items: center">
<app-query-param-input <app-query-param-input
queryParamKey="search" queryParamKey="search"
label="Nach Name oder E-Mail suchen" [label]="'accounts.search' | translate"
style="width: 35%" /> style="width: 35%" />
<app-query-param-selector <app-query-param-selector
queryParamKey="organization_id" queryParamKey="organization_id"
[options]="selectorOptions()" [options]="selectorOptions()"
label="Organisation" [label]="'accounts.organization' | translate"
[allowEmptyValue]="true" [allowEmptyValue]="true"
style="width: 25%" /> style="width: 25%" />
</section> </section>
@@ -65,14 +65,14 @@
<button <button
mat-icon-button mat-icon-button
type="button" type="button"
aria-label="Bearbeiten" [attr.aria-label]="'common.edit' | translate"
(click)="startEdit(row)"> (click)="startEdit(row)">
<mat-icon>edit</mat-icon> <mat-icon>edit</mat-icon>
</button> </button>
<button <button
mat-icon-button mat-icon-button
type="button" type="button"
aria-label="Impersonate" [attr.aria-label]="'accounts.impersonate' | translate"
[disabled]="!canImpersonate(row)" [disabled]="!canImpersonate(row)"
(click)="impersonate(row)"> (click)="impersonate(row)">
<mat-icon>switch_account</mat-icon> <mat-icon>switch_account</mat-icon>
@@ -80,7 +80,11 @@
<button <button
mat-icon-button mat-icon-button
type="button" type="button"
[attr.aria-label]="row.activated ? 'Deaktivieren' : 'Aktivieren'" [attr.aria-label]="
row.activated
? ('common.deactivate' | translate)
: ('common.activate' | translate)
"
[disabled]="row.is_current || row.deleted" [disabled]="row.is_current || row.deleted"
(click)="toggleAccountActivation(row)"> (click)="toggleAccountActivation(row)">
<mat-icon>{{ row.activated ? 'person_off' : 'person_check' }}</mat-icon> <mat-icon>{{ row.activated ? 'person_off' : 'person_check' }}</mat-icon>
@@ -88,7 +92,7 @@
<button <button
mat-icon-button mat-icon-button
type="button" type="button"
aria-label="Deaktivieren" [attr.aria-label]="'common.deactivate' | translate"
[disabled]="row.is_current || row.deleted" [disabled]="row.is_current || row.deleted"
(click)="deleteAccount(row)"> (click)="deleteAccount(row)">
<mat-icon>delete</mat-icon> <mat-icon>delete</mat-icon>
@@ -4,7 +4,9 @@ import {
OnInit, OnInit,
TemplateRef, TemplateRef,
computed, computed,
effect,
inject, inject,
Injector,
input, input,
viewChild, viewChild,
} from '@angular/core'; } from '@angular/core';
@@ -44,6 +46,8 @@ import {
UserRole, UserRole,
} from '../../api'; } from '../../api';
import { StatusPipe } from '../../shared/pipes/status.pipe'; import { StatusPipe } from '../../shared/pipes/status.pipe';
import { LanguageService } from '../../shared/i18n/language.service';
import { TranslatePipe } from '../../shared/i18n/translate.pipe';
@Component({ @Component({
selector: 'app-accounts', selector: 'app-accounts',
@@ -65,6 +69,7 @@ import { StatusPipe } from '../../shared/pipes/status.pipe';
QueryParamSelectorComponent, QueryParamSelectorComponent,
MatCardModule, MatCardModule,
StatusPipe, StatusPipe,
TranslatePipe,
], ],
templateUrl: './accounts.component.html', templateUrl: './accounts.component.html',
styleUrl: './accounts.component.scss', styleUrl: './accounts.component.scss',
@@ -76,6 +81,8 @@ export class AccountsComponent implements OnInit {
private readonly router = inject(Router); private readonly router = inject(Router);
private readonly dialog = inject(MatDialog); private readonly dialog = inject(MatDialog);
private readonly authService = inject(AuthService); private readonly authService = inject(AuthService);
private readonly languageService = inject(LanguageService);
private readonly injector = inject(Injector);
protected get isReadOnly(): boolean { protected get isReadOnly(): boolean {
return this.credentialService.isEffectiveManager(); return this.credentialService.isEffectiveManager();
@@ -106,41 +113,51 @@ export class AccountsComponent implements OnInit {
input.required<InseAccountManagementModelOrganizationProfile[]>(); input.required<InseAccountManagementModelOrganizationProfile[]>();
ngOnInit(): void { ngOnInit(): void {
effect(
() => {
this.languageService.language();
this.setAccountColumns();
},
{ injector: this.injector },
);
}
private setAccountColumns(): void {
this.accountColumns = [ this.accountColumns = [
{ {
id: 'name', id: 'name',
header: 'Name', header: this.languageService.translate('organizations.name'),
type: 'accessor', type: 'accessor',
accessorKey: 'name', accessorKey: 'name',
}, },
{ {
id: 'email', id: 'email',
header: 'E-Mail', header: this.languageService.translate('accounts.email'),
type: 'accessor', type: 'accessor',
accessorKey: 'email', accessorKey: 'email',
}, },
{ {
id: 'organization_name', id: 'organization_name',
header: 'Organisation', header: this.languageService.translate('accounts.organization'),
type: 'accessor', type: 'accessor',
accessorKey: 'organization_name', accessorKey: 'organization_name',
}, },
{ {
id: 'roles', id: 'roles',
header: 'Rolle', header: this.languageService.translate('accounts.role'),
type: 'accessor', type: 'accessor',
accessorKey: 'roles', accessorKey: 'roles',
cellTemplate: this.accountRoleTmp(), cellTemplate: this.accountRoleTmp(),
}, },
{ {
id: 'status', id: 'status',
header: 'Status', header: this.languageService.translate('common.status'),
type: 'display', type: 'display',
cellTemplate: this.accountStatusTmp(), cellTemplate: this.accountStatusTmp(),
}, },
{ {
id: 'actions', id: 'actions',
header: 'Aktionen', header: this.languageService.translate('common.actions'),
type: 'display', type: 'display',
cellTemplate: this.accountActionsTmp(), cellTemplate: this.accountActionsTmp(),
}, },
@@ -163,9 +180,13 @@ export class AccountsComponent implements OnInit {
request.subscribe({ request.subscribe({
next: () => { next: () => {
this.snackBar.open('Account wurde gespeichert.', 'OK', { this.snackBar.open(
this.languageService.translate('accounts.saved'),
this.languageService.translate('common.ok'),
{
duration: 3000, duration: 3000,
}); },
);
this.router.navigate([], { this.router.navigate([], {
queryParams: { page: 0 }, queryParams: { page: 0 },
queryParamsHandling: 'merge', queryParamsHandling: 'merge',
@@ -174,9 +195,13 @@ export class AccountsComponent implements OnInit {
error: (error) => { error: (error) => {
const message = const message =
error.status === 409 error.status === 409
? 'Diese E-Mail-Adresse wird bereits verwendet.' ? this.languageService.translate('accounts.emailConflict')
: 'Account konnte nicht gespeichert werden.'; : this.languageService.translate('accounts.saveError');
this.snackBar.open(message, 'OK', { duration: 5000 }); this.snackBar.open(
message,
this.languageService.translate('common.ok'),
{ duration: 5000 },
);
}, },
}); });
} }
@@ -222,18 +247,24 @@ export class AccountsComponent implements OnInit {
this.authService.deleteAccount(account.id).subscribe({ this.authService.deleteAccount(account.id).subscribe({
next: () => { next: () => {
this.snackBar.open('Account wurde deaktiviert.', 'OK', { this.snackBar.open(
this.languageService.translate('accounts.deactivated'),
this.languageService.translate('common.ok'),
{
duration: 3000, duration: 3000,
}); },
);
this.router.navigate([], { this.router.navigate([], {
queryParams: { page: 0 }, queryParams: { page: 0 },
queryParamsHandling: 'merge', queryParamsHandling: 'merge',
}); });
}, },
error: () => { error: () => {
this.snackBar.open('Account konnte nicht deaktiviert werden.', 'OK', { this.snackBar.open(
duration: 5000, this.languageService.translate('accounts.deactivateError'),
}); this.languageService.translate('common.ok'),
{ duration: 5000 },
);
}, },
}); });
} }
@@ -248,16 +279,25 @@ export class AccountsComponent implements OnInit {
} }
const activated = !account.activated; const activated = !account.activated;
const action = activated ? 'aktivieren' : 'deaktivieren';
import('../../shared/ui/confirmation-dialog/confirmation-dialog.component').then( import('../../shared/ui/confirmation-dialog/confirmation-dialog.component').then(
({ ConfirmationDialogComponent }) => { ({ ConfirmationDialogComponent }) => {
const dialogRef = this.dialog.open(ConfirmationDialogComponent, { const dialogRef = this.dialog.open(ConfirmationDialogComponent, {
data: { data: {
title: activated ? 'Account aktivieren' : 'Account deaktivieren', title: this.languageService.translate(
message: `Möchtest Du den Account „${account.name}“ wirklich ${action}?`, activated
confirmText: activated ? 'Aktivieren' : 'Deaktivieren', ? 'accounts.activateTitle'
cancelText: 'Abbrechen', : 'accounts.deactivateTitle',
),
message: this.languageService.translate(
activated
? 'accounts.activateQuestion'
: 'accounts.deactivateQuestion',
{ name: account.name },
),
confirmText: this.languageService.translate(
activated ? 'common.activate' : 'common.deactivate',
),
cancelText: this.languageService.translate('common.cancel'),
}, },
}); });
@@ -275,8 +315,10 @@ export class AccountsComponent implements OnInit {
this.authService.updateAccount(account.id, { activated }).subscribe({ this.authService.updateAccount(account.id, { activated }).subscribe({
next: () => { next: () => {
this.snackBar.open( this.snackBar.open(
activated ? 'Account wurde aktiviert.' : 'Account wurde deaktiviert.', this.languageService.translate(
'OK', activated ? 'accounts.activated' : 'accounts.deactivated',
),
this.languageService.translate('common.ok'),
{ duration: 3000 }, { duration: 3000 },
); );
this.router.navigate([], { this.router.navigate([], {
@@ -286,8 +328,8 @@ export class AccountsComponent implements OnInit {
}, },
error: () => { error: () => {
this.snackBar.open( this.snackBar.open(
'Account-Status konnte nicht geändert werden.', this.languageService.translate('accounts.statusError'),
'OK', this.languageService.translate('common.ok'),
{ duration: 5000 }, { duration: 5000 },
); );
}, },
@@ -301,15 +343,21 @@ export class AccountsComponent implements OnInit {
try { try {
await this.credentialService.impersonateAccount(account.id); await this.credentialService.impersonateAccount(account.id);
this.snackBar.open(`Impersonation aktiv: ${account.name}`, 'OK', { this.snackBar.open(
duration: 4000, this.languageService.translate('accounts.impersonationActive', {
}); name: account.name,
}),
this.languageService.translate('common.ok'),
{ duration: 4000 },
);
this.router.navigate(['/dashboard']); this.router.navigate(['/dashboard']);
} catch (error) { } catch (error) {
console.error('Impersonation failed:', error); console.error('Impersonation failed:', error);
this.snackBar.open('Impersonation konnte nicht gestartet werden.', 'OK', { this.snackBar.open(
duration: 5000, this.languageService.translate('accounts.impersonationError'),
}); this.languageService.translate('common.ok'),
{ duration: 5000 },
);
return; return;
} }
} }
@@ -1,23 +1,22 @@
<section class="login-page"> <section class="login-page">
<div class="login-panel"> <div class="login-panel">
<div class="brand-block"> <div class="brand-block">
<span class="eyebrow">SmartGuide Account Portal</span> <span class="eyebrow">{{ 'login.portal' | translate }}</span>
<h1>Login</h1> <h1>{{ 'login.title' | translate }}</h1>
<p> <p>
Melde Dich mit Deiner Organisation an. Nach den Zugangsdaten erhältst Du {{ 'login.description' | translate }}
einen einmaligen Code per E-Mail.
</p> </p>
</div> </div>
<div class="stepper" aria-label="Login-Fortschritt"> <div class="stepper" [attr.aria-label]="'login.progress' | translate">
<div class="step" [class.step--active]="currentStep === 'credentials'"> <div class="step" [class.step--active]="currentStep === 'credentials'">
<span>1</span> <span>1</span>
<strong>Zugangsdaten</strong> <strong>{{ 'login.credentials' | translate }}</strong>
</div> </div>
<div class="step-line"></div> <div class="step-line"></div>
<div class="step" [class.step--active]="currentStep === 'otk'"> <div class="step" [class.step--active]="currentStep === 'otk'">
<span>2</span> <span>2</span>
<strong>OTK-Code</strong> <strong>{{ 'login.otkCode' | translate }}</strong>
</div> </div>
</div> </div>
@@ -27,7 +26,7 @@
[formGroup]="credentialsForm" [formGroup]="credentialsForm"
(ngSubmit)="requestOtk()"> (ngSubmit)="requestOtk()">
<mat-form-field class="field" appearance="outline"> <mat-form-field class="field" appearance="outline">
<mat-label>E-Mail-Adresse</mat-label> <mat-label>{{ 'login.email' | translate }}</mat-label>
<input <input
id="login-email" id="login-email"
matInput matInput
@@ -35,14 +34,14 @@
autocomplete="email" autocomplete="email"
formControlName="email" /> formControlName="email" />
@if (credentialsForm.controls.email.hasError('required')) { @if (credentialsForm.controls.email.hasError('required')) {
<mat-error>E-Mail-Adresse ist erforderlich.</mat-error> <mat-error>{{ 'login.emailRequired' | translate }}</mat-error>
} @else if (credentialsForm.controls.email.hasError('email')) { } @else if (credentialsForm.controls.email.hasError('email')) {
<mat-error>Bitte gib eine gültige E-Mail-Adresse ein.</mat-error> <mat-error>{{ 'login.emailInvalid' | translate }}</mat-error>
} }
</mat-form-field> </mat-form-field>
<mat-form-field class="field" appearance="outline"> <mat-form-field class="field" appearance="outline">
<mat-label>Passwort</mat-label> <mat-label>{{ 'login.password' | translate }}</mat-label>
<input <input
id="login-password" id="login-password"
matInput matInput
@@ -54,7 +53,7 @@
matSuffix matSuffix
type="button" type="button"
[attr.aria-label]=" [attr.aria-label]="
showPassword ? 'Passwort verbergen' : 'Passwort anzeigen' (showPassword ? 'login.hidePassword' : 'login.showPassword') | translate
" "
(click)="showPassword = !showPassword"> (click)="showPassword = !showPassword">
<mat-icon>{{ <mat-icon>{{
@@ -62,9 +61,9 @@
}}</mat-icon> }}</mat-icon>
</button> </button>
@if (credentialsForm.controls.password.hasError('required')) { @if (credentialsForm.controls.password.hasError('required')) {
<mat-error>Passwort ist erforderlich.</mat-error> <mat-error>{{ 'login.passwordRequired' | translate }}</mat-error>
} @else if (credentialsForm.controls.password.hasError('minlength')) { } @else if (credentialsForm.controls.password.hasError('minlength')) {
<mat-error>Passwort muss mindestens 8 Zeichen haben.</mat-error> <mat-error>{{ 'login.passwordLength' | translate }}</mat-error>
} }
</mat-form-field> </mat-form-field>
@@ -75,16 +74,16 @@
type="submit" type="submit"
[disabled]="credentialsForm.invalid || isSubmitting"> [disabled]="credentialsForm.invalid || isSubmitting">
@if (isSubmitting) { @if (isSubmitting) {
Code wird gesendet... {{ 'login.sendingCode' | translate }}
} @else { } @else {
Code per E-Mail senden {{ 'login.sendCode' | translate }}
} }
</button> </button>
<div class="form-actions"> <div class="form-actions">
<span></span> <span></span>
<a class="auth-link" routerLink="/forgot-password" <a class="auth-link" routerLink="/forgot-password"
>Passwort vergessen?</a >{{ 'login.forgotPassword' | translate }}</a
> >
</div> </div>
</form> </form>
@@ -93,19 +92,19 @@
<div class="code-intro"> <div class="code-intro">
<mat-icon>mark_email_unread</mat-icon> <mat-icon>mark_email_unread</mat-icon>
<div> <div>
<strong>Code eingeben</strong> <strong>{{ 'login.enterCode' | translate }}</strong>
<span> <span>
Wir haben den Code an {{ 'login.sentTo' | translate }}
{{ {{
credentialsForm.controls.email.value || 'Deine E-Mail-Adresse' credentialsForm.controls.email.value || ('login.yourEmail' | translate)
}} }}
gesendet. {{ 'login.sentSuffix' | translate }}
</span> </span>
</div> </div>
</div> </div>
<mat-form-field class="field" appearance="outline"> <mat-form-field class="field" appearance="outline">
<mat-label>OTK-Code</mat-label> <mat-label>{{ 'login.otkCode' | translate }}</mat-label>
<input <input
id="login-otk" id="login-otk"
matInput matInput
@@ -113,9 +112,9 @@
autocomplete="one-time-code" autocomplete="one-time-code"
formControlName="code" /> formControlName="code" />
@if (otkForm.controls.code.hasError('required')) { @if (otkForm.controls.code.hasError('required')) {
<mat-error>OTK-Code ist erforderlich.</mat-error> <mat-error>{{ 'login.codeRequired' | translate }}</mat-error>
} @else if (otkForm.controls.code.hasError('pattern')) { } @else if (otkForm.controls.code.hasError('pattern')) {
<mat-error>Bitte gib den Code aus der E-Mail ein.</mat-error> <mat-error>{{ 'login.codeInvalid' | translate }}</mat-error>
} }
</mat-form-field> </mat-form-field>
@@ -125,9 +124,9 @@
aria-live="polite"> aria-live="polite">
<mat-icon>timer</mat-icon> <mat-icon>timer</mat-icon>
@if (codeExpiresIn > 0) { @if (codeExpiresIn > 0) {
<span>Code läuft in {{ formatCountdown() }} ab.</span> <span>{{ 'login.codeExpiresIn' | translate }} {{ formatCountdown() }}.</span>
} @else { } @else {
<span>Code ist abgelaufen. Bitte neuen Code anfordern.</span> <span>{{ 'login.codeExpired' | translate }}</span>
} }
</div> </div>
@@ -138,9 +137,9 @@
type="submit" type="submit"
[disabled]="otkForm.invalid || isSubmitting || codeExpiresIn === 0"> [disabled]="otkForm.invalid || isSubmitting || codeExpiresIn === 0">
@if (isSubmitting) { @if (isSubmitting) {
Anmeldung wird geprüft... {{ 'login.checking' | translate }}
} @else { } @else {
Anmelden {{ 'login.signIn' | translate }}
} }
</button> </button>
@@ -150,10 +149,10 @@
type="button" type="button"
(click)="resendCode()" (click)="resendCode()"
[disabled]="isSubmitting"> [disabled]="isSubmitting">
Code erneut senden {{ 'login.resend' | translate }}
</button> </button>
<button mat-button type="button" (click)="editCredentials()"> <button mat-button type="button" (click)="editCredentials()">
E-Mail ändern {{ 'login.changeEmail' | translate }}
</button> </button>
</div> </div>
</form> </form>
@@ -15,6 +15,8 @@ import { finalize, Subscription } from 'rxjs';
import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar'; import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar';
import { Router, RouterLink } from '@angular/router'; import { Router, RouterLink } from '@angular/router';
import { HttpErrorResponse } from '@angular/common/http'; import { HttpErrorResponse } from '@angular/common/http';
import { LanguageService } from '../../shared/i18n/language.service';
import { TranslatePipe } from '../../shared/i18n/translate.pipe';
type LoginStep = 'credentials' | 'otk'; type LoginStep = 'credentials' | 'otk';
@@ -29,6 +31,7 @@ type LoginStep = 'credentials' | 'otk';
MatIconModule, MatIconModule,
MatSnackBarModule, MatSnackBarModule,
RouterLink, RouterLink,
TranslatePipe,
], ],
templateUrl: './app-login.component.html', templateUrl: './app-login.component.html',
styleUrl: './app-login.component.scss', styleUrl: './app-login.component.scss',
@@ -64,6 +67,7 @@ export class AppLoginComponent implements OnDestroy {
protected credentialService: CredentialService, protected credentialService: CredentialService,
protected router: Router, protected router: Router,
protected snackBar: MatSnackBar, protected snackBar: MatSnackBar,
private readonly languageService: LanguageService,
) { ) {
effect(() => { effect(() => {
if (this.credentialService.isValidating()) { if (this.credentialService.isValidating()) {
@@ -119,7 +123,7 @@ export class AppLoginComponent implements OnDestroy {
this.otkForm.reset(); this.otkForm.reset();
this.startCountdown(); this.startCountdown();
this.snackBar.open( this.snackBar.open(
'OTK-Code wurde an die E-Mail-Adresse gesendet.', this.languageService.translate('login.codeSent'),
'OK', 'OK',
{ {
duration: 4000, duration: 4000,
@@ -154,7 +158,7 @@ export class AppLoginComponent implements OnDestroy {
if (this.codeExpiresIn <= 0) { if (this.codeExpiresIn <= 0) {
this.snackBar.open( this.snackBar.open(
'Der Code ist abgelaufen. Bitte fordere einen neuen Code an.', this.languageService.translate('login.codeExpiredRequest'),
'OK', 'OK',
{ duration: 5000 }, { duration: 5000 },
); );
@@ -162,7 +166,7 @@ export class AppLoginComponent implements OnDestroy {
} }
if (!this.accountId) { if (!this.accountId) {
this.snackBar.open('Bitte fordere zuerst einen neuen Code an.', 'OK', { this.snackBar.open(this.languageService.translate('login.requestFirst'), 'OK', {
duration: 5000, duration: 5000,
}); });
return; return;
@@ -242,13 +246,13 @@ export class AppLoginComponent implements OnDestroy {
private getLoginErrorMessage(error: HttpErrorResponse): string { private getLoginErrorMessage(error: HttpErrorResponse): string {
console.error('Login error:', error); console.error('Login error:', error);
if (error.status === 401) { if (error.status === 401) {
return 'E-Mail, Passwort oder OTK-Code ist ungültig.'; return this.languageService.translate('login.invalidCredentials');
} }
if (error.status === 403) { if (error.status === 403) {
return 'Dieser Account ist deaktiviert und kann sich nicht anmelden.'; return this.languageService.translate('login.accountDisabled');
} }
return 'Die Anmeldung konnte nicht abgeschlossen werden. Bitte versuche es erneut.'; return this.languageService.translate('login.failed');
} }
} }
@@ -1,24 +1,26 @@
<main class="bookmarks-page"> <main class="bookmarks-page">
<header class="page-header"> <header class="page-header">
<div> <div>
<p class="eyebrow">Meine Sammlung</p> <p class="eyebrow">{{ 'bookmarks.eyebrow' | translate }}</p>
<h1>Bookmarks</h1> <h1>{{ 'bookmarks.title' | translate }}</h1>
<p>Gespeicherte Personen für den schnellen Zugriff.</p> <p>{{ 'bookmarks.description' | translate }}</p>
</div> </div>
<div class="bookmark-count"> <div class="bookmark-count">
<mat-icon>bookmarks</mat-icon> <mat-icon>bookmarks</mat-icon>
<strong>{{ persons().length }}</strong> <strong>{{ persons().length }}</strong>
<span>Personen</span> <span>{{ 'bookmarks.people' | translate }}</span>
</div> </div>
</header> </header>
@if (loading()) { @if (loading()) {
<div class="loading-state"> <div class="loading-state">
<mat-spinner diameter="42"></mat-spinner> <mat-spinner diameter="42"></mat-spinner>
<p>Bookmarks werden geladen …</p> <p>{{ 'bookmarks.loading' | translate }}</p>
</div> </div>
} @else if (persons().length) { } @else if (persons().length) {
<section class="person-grid" aria-label="Gespeicherte Personen"> <section
class="person-grid"
[attr.aria-label]="'bookmarks.savedPeopleLabel' | translate">
@for (person of persons(); track person.id) { @for (person of persons(); track person.id) {
<app-person-card <app-person-card
[person]="person" [person]="person"
@@ -30,10 +32,8 @@
} @else { } @else {
<section class="empty-state"> <section class="empty-state">
<mat-icon>bookmark_border</mat-icon> <mat-icon>bookmark_border</mat-icon>
<h2>Noch keine Bookmarks</h2> <h2>{{ 'bookmarks.emptyTitle' | translate }}</h2>
<p> <p>{{ 'bookmarks.emptyDescription' | translate }}</p>
Speichere Personen über das Bookmark-Symbol auf einer Personenkarte.
</p>
</section> </section>
} }
</main> </main>
@@ -8,6 +8,7 @@ import { catchError, forkJoin, map, of, switchMap } from 'rxjs';
import { CustomAuthor, PersonsService } from '../../api'; import { CustomAuthor, PersonsService } from '../../api';
import { BookmarkService } from '../../shared/services/bookmark.service'; import { BookmarkService } from '../../shared/services/bookmark.service';
import { PersonCardComponent } from '../person-card/person-card.component'; import { PersonCardComponent } from '../person-card/person-card.component';
import { TranslatePipe } from '../../shared/i18n/translate.pipe';
const PERSON_INCLUDE_TAGS = const PERSON_INCLUDE_TAGS =
'display_name,works_count,cited_by_count,summary_stats,ids,' + 'display_name,works_count,cited_by_count,summary_stats,ids,' +
@@ -22,6 +23,7 @@ const PERSON_INCLUDE_TAGS =
MatIconModule, MatIconModule,
MatProgressSpinnerModule, MatProgressSpinnerModule,
PersonCardComponent, PersonCardComponent,
TranslatePipe,
], ],
templateUrl: './bookmarks.component.html', templateUrl: './bookmarks.component.html',
styleUrl: './bookmarks.component.scss', styleUrl: './bookmarks.component.scss',
@@ -4,6 +4,7 @@ import { EChartsCoreOption } from 'echarts';
import { MatIconModule } from '@angular/material/icon'; import { MatIconModule } from '@angular/material/icon';
import { NgxEchartsDirective } from 'ngx-echarts'; import { NgxEchartsDirective } from 'ngx-echarts';
import { ChartThemeService } from '../../shared/services/chart-theme.service'; import { ChartThemeService } from '../../shared/services/chart-theme.service';
import { LanguageService } from '../../shared/i18n/language.service';
import * as echarts from 'echarts/core'; import * as echarts from 'echarts/core';
import { import {
@@ -49,13 +50,14 @@ export class CollaborationGraphComponent {
handleNodeClick = output<NodeClickEvent>(); handleNodeClick = output<NodeClickEvent>();
private readonly chartTheme = inject(ChartThemeService); private readonly chartTheme = inject(ChartThemeService);
private readonly languageService = inject(LanguageService);
categoryLabels: Record<string, string> = { categoryLabels = computed<Record<string, string>>(() => ({
author: 'Autor', author: this.languageService.translate('publications.author'),
collaborator: 'Kollaborierender', collaborator: this.languageService.translate('personNetwork.collaborator'),
institution: 'Institution', institution: this.languageService.translate('publications.institution'),
work: 'Publikation', work: this.languageService.translate('researchTimeline.publication'),
}; }));
private readonly graphNodes = computed<GraphNode[]>(() => { private readonly graphNodes = computed<GraphNode[]>(() => {
const graph = this.collaborationGraph(); const graph = this.collaborationGraph();
@@ -151,7 +153,7 @@ export class CollaborationGraphComponent {
data: categories.map((category) => category.name), data: categories.map((category) => category.name),
bottom: 0, bottom: 0,
orient: 'horizontal', orient: 'horizontal',
formatter: (name: string) => this.categoryLabels[name] || name, formatter: (name: string) => this.categoryLabels()[name] || name,
itemGap: 20, itemGap: 20,
textStyle: { color: textColor }, textStyle: { color: textColor },
inactiveColor: colors.mutedTextColor, inactiveColor: colors.mutedTextColor,
@@ -1,23 +1,25 @@
<div class="dashboard-wrapper"> <div class="dashboard-wrapper">
<section class="dashboard-period-filter" aria-label="Dashboard-Zeitraum"> <section
class="dashboard-period-filter"
[attr.aria-label]="'dashboard.period' | translate">
<div class="dashboard-period-presets"> <div class="dashboard-period-presets">
<button <button
type="button" type="button"
[class.active]="dashboardPeriodMode === 'all_time'" [class.active]="dashboardPeriodMode === 'all_time'"
(click)="setDashboardPeriodMode('all_time')"> (click)="setDashboardPeriodMode('all_time')">
Alle Zeiten {{ 'dashboard.allTime' | translate }}
</button> </button>
<button <button
type="button" type="button"
[class.active]="dashboardPeriodMode === 'last_10_years'" [class.active]="dashboardPeriodMode === 'last_10_years'"
(click)="setDashboardPeriodMode('last_10_years')"> (click)="setDashboardPeriodMode('last_10_years')">
Letzte 10 Jahre {{ 'dashboard.last10Years' | translate }}
</button> </button>
<button <button
type="button" type="button"
[class.active]="dashboardPeriodMode === 'last_5_years'" [class.active]="dashboardPeriodMode === 'last_5_years'"
(click)="setDashboardPeriodMode('last_5_years')"> (click)="setDashboardPeriodMode('last_5_years')">
Letzte 5 Jahre {{ 'dashboard.last5Years' | translate }}
</button> </button>
</div> </div>
<div class="dashboard-period-slider"> <div class="dashboard-period-slider">
@@ -32,20 +34,24 @@
</div> </div>
</section> </section>
<section class="statistics-grid" aria-label="Kennzahlen"> <section
class="statistics-grid"
[attr.aria-label]="'dashboard.metrics' | translate">
<a <a
class="statistics-card" class="statistics-card"
[routerLink]="['/institution', institutionRouteId(), 'publications']" [routerLink]="['/institution', institutionRouteId(), 'publications']"
[class.disabled]="!institutionRouteId()" [class.disabled]="!institutionRouteId()"
[attr.aria-disabled]="!institutionRouteId()" [attr.aria-disabled]="!institutionRouteId()"
[attr.aria-label]=" [attr.aria-label]="
'Publikationen von ' + organizationName() + ' anzeigen' languageService.translate('dashboard.showPublications', {
name: organizationName(),
})
"> ">
<div class="statistics-icon statistics-icon--publications"> <div class="statistics-icon statistics-icon--publications">
<mat-icon>menu_book</mat-icon> <mat-icon>menu_book</mat-icon>
</div> </div>
<div> <div>
<span>Publikationen</span> <span>{{ 'dashboard.publications' | translate }}</span>
<strong> <strong>
{{ {{
isStatisticLoading('publications') isStatisticLoading('publications')
@@ -60,12 +66,16 @@
class="statistics-card" class="statistics-card"
routerLink="/persons" routerLink="/persons"
[queryParams]="personListQueryParams()" [queryParams]="personListQueryParams()"
[attr.aria-label]="'Personen von ' + organizationName() + ' anzeigen'"> [attr.aria-label]="
languageService.translate('dashboard.showPeople', {
name: organizationName(),
})
">
<div class="statistics-icon statistics-icon--persons"> <div class="statistics-icon statistics-icon--persons">
<mat-icon>groups</mat-icon> <mat-icon>groups</mat-icon>
</div> </div>
<div> <div>
<span>Personen</span> <span>{{ 'dashboard.people' | translate }}</span>
<strong> <strong>
{{ {{
isStatisticLoading('persons') isStatisticLoading('persons')
@@ -81,12 +91,16 @@
[routerLink]="['/institution', institutionRouteId(), 'patents']" [routerLink]="['/institution', institutionRouteId(), 'patents']"
[class.disabled]="!institutionRouteId()" [class.disabled]="!institutionRouteId()"
[attr.aria-disabled]="!institutionRouteId()" [attr.aria-disabled]="!institutionRouteId()"
[attr.aria-label]="'Patente von ' + organizationName() + ' anzeigen'"> [attr.aria-label]="
languageService.translate('dashboard.showPatents', {
name: organizationName(),
})
">
<div class="statistics-icon statistics-icon--patents"> <div class="statistics-icon statistics-icon--patents">
<mat-icon>description</mat-icon> <mat-icon>description</mat-icon>
</div> </div>
<div> <div>
<span>Patente</span> <span>{{ 'dashboard.patents' | translate }}</span>
<strong> <strong>
{{ {{
isStatisticLoading('patents') isStatisticLoading('patents')
@@ -101,12 +115,12 @@
class="statistics-card" class="statistics-card"
routerLink="/projects" routerLink="/projects"
[queryParams]="{ selected_project_types: 'eu' }" [queryParams]="{ selected_project_types: 'eu' }"
aria-label="EU-Projekte anzeigen"> [attr.aria-label]="'dashboard.showEuProjects' | translate">
<div class="statistics-icon statistics-icon--eu-projects"> <div class="statistics-icon statistics-icon--eu-projects">
<mat-icon>public</mat-icon> <mat-icon>public</mat-icon>
</div> </div>
<div> <div>
<span>EU-Projekte</span> <span>{{ 'dashboard.euProjects' | translate }}</span>
<strong> <strong>
{{ {{
isStatisticLoading('eu_projects') isStatisticLoading('eu_projects')
@@ -121,12 +135,12 @@
class="statistics-card" class="statistics-card"
routerLink="/projects" routerLink="/projects"
[queryParams]="{ selected_project_types: 'bund' }" [queryParams]="{ selected_project_types: 'bund' }"
aria-label="Bund-Projekte anzeigen"> [attr.aria-label]="'dashboard.showFederalProjects' | translate">
<div class="statistics-icon statistics-icon--bund-projects"> <div class="statistics-icon statistics-icon--bund-projects">
<mat-icon>account_balance</mat-icon> <mat-icon>account_balance</mat-icon>
</div> </div>
<div> <div>
<span>Bund-Projekte</span> <span>{{ 'dashboard.federalProjects' | translate }}</span>
<strong> <strong>
{{ {{
isStatisticLoading('bmbf_projects') isStatisticLoading('bmbf_projects')
@@ -141,12 +155,12 @@
class="statistics-card" class="statistics-card"
routerLink="/projects" routerLink="/projects"
[queryParams]="{ selected_project_types: 'dfg' }" [queryParams]="{ selected_project_types: 'dfg' }"
aria-label="DFG-Projekte anzeigen"> [attr.aria-label]="'dashboard.showDfgProjects' | translate">
<div class="statistics-icon statistics-icon--dfg-projects"> <div class="statistics-icon statistics-icon--dfg-projects">
<mat-icon>science</mat-icon> <mat-icon>science</mat-icon>
</div> </div>
<div> <div>
<span>DFG-Projekte</span> <span>{{ 'dashboard.dfgProjects' | translate }}</span>
<strong> <strong>
{{ {{
isStatisticLoading('dfg_projects') isStatisticLoading('dfg_projects')
@@ -159,7 +173,7 @@
</section> </section>
@if (statisticsError) { @if (statisticsError) {
<p class="statistics-error">Die Kennzahlen konnten nicht geladen werden.</p> <p class="statistics-error">{{ 'dashboard.metricsError' | translate }}</p>
} }
@if ( @if (
@@ -174,11 +188,8 @@
<section class="topic-heatmap-section"> <section class="topic-heatmap-section">
<header class="topic-heatmap-header"> <header class="topic-heatmap-header">
<div> <div>
<h2>Projektstatus nach Fördergeber</h2> <h2>{{ 'dashboard.projectStatusTitle' | translate }}</h2>
<p> <p>{{ 'dashboard.projectStatusDescription' | translate }}</p>
Laufende, kommende und abgeschlossene EU-, Bund- und DFG-Projekte
Ihrer Organisation.
</p>
</div> </div>
@if (euProjectStatuses && bmbfProjectStatuses && dfgProjectStatuses) { @if (euProjectStatuses && bmbfProjectStatuses && dfgProjectStatuses) {
<div class="project-status-summary"> <div class="project-status-summary">
@@ -217,7 +228,7 @@
) { ) {
<div class="project-status-loading" role="status" aria-live="polite"> <div class="project-status-loading" role="status" aria-live="polite">
<app-loading <app-loading
text="Projektstatus wird geladen …" [text]="'dashboard.projectStatusLoading' | translate"
icon="stacked_bar_chart" icon="stacked_bar_chart"
size="64" size="64"
diameter="64"></app-loading> diameter="64"></app-loading>
@@ -228,8 +239,7 @@
dfgProjectStatusesError dfgProjectStatusesError
) { ) {
<p class="statistics-error"> <p class="statistics-error">
Der Status der EU-, Bund- und DFG-Projekte konnte nicht geladen {{ 'dashboard.projectStatusError' | translate }}
werden.
</p> </p>
} @else if ( } @else if (
euProjectStatuses && bmbfProjectStatuses && dfgProjectStatuses euProjectStatuses && bmbfProjectStatuses && dfgProjectStatuses
@@ -246,22 +256,22 @@
<section class="topic-heatmap-section"> <section class="topic-heatmap-section">
<header class="topic-heatmap-header"> <header class="topic-heatmap-header">
<div> <div>
<h2>Field Treemap</h2> <h2>{{ 'dashboard.treemapTitle' | translate }}</h2>
<p>Publikationen Ihrer Organisation nach Field.</p> <p>{{ 'dashboard.treemapDescription' | translate }}</p>
</div> </div>
</header> </header>
@if (topicTreemapLoading) { @if (topicTreemapLoading) {
<div class="topic-heatmap-loading" role="status" aria-live="polite"> <div class="topic-heatmap-loading" role="status" aria-live="polite">
<app-loading <app-loading
text="Treemap-Daten für den gewählten Zeitraum werden geladen …" [text]="'dashboard.treemapLoading' | translate"
icon="account_tree" icon="account_tree"
size="72" size="72"
diameter="72"></app-loading> diameter="72"></app-loading>
</div> </div>
} @else if (topicTreemapError) { } @else if (topicTreemapError) {
<p class="statistics-error"> <p class="statistics-error">
Die Field-Treemap konnte nicht geladen werden. {{ 'dashboard.treemapError' | translate }}
</p> </p>
} @else { } @else {
<app-topic-treemap <app-topic-treemap
@@ -278,16 +288,17 @@
<section class="topic-heatmap-section"> <section class="topic-heatmap-section">
<header class="topic-heatmap-header"> <header class="topic-heatmap-header">
<div> <div>
<h2>DFG-Projekt-Topics</h2> <h2>{{ 'dashboard.dfgTopicsTitle' | translate }}</h2>
<p> <p>{{ 'dashboard.dfgTopicsDescription' | translate }}</p>
Gematchte DFG-Projekte nach Field, Subfield und Topic. Ein Klick
auf ein Topic zeigt die zugehörigen Keywords.
</p>
</div> </div>
@if (dfgProjectTopics) { @if (dfgProjectTopics) {
<p class="dfg-topic-summary"> <p class="dfg-topic-summary">
{{ dfgProjectTopics.matched_project_count | number }} von {{
{{ dfgProjectTopics.project_count | number }} Projekten gematcht languageService.translate('dashboard.dfgMatched', {
matched: dfgProjectTopics.matched_project_count,
total: dfgProjectTopics.project_count,
})
}}
</p> </p>
} }
</header> </header>
@@ -295,20 +306,20 @@
@if (dfgTopicsLoading) { @if (dfgTopicsLoading) {
<div class="topic-heatmap-loading" role="status" aria-live="polite"> <div class="topic-heatmap-loading" role="status" aria-live="polite">
<app-loading <app-loading
text="DFG-Topics werden geladen …" [text]="'dashboard.dfgTopicsLoading' | translate"
icon="account_tree" icon="account_tree"
size="72" size="72"
diameter="72"></app-loading> diameter="72"></app-loading>
</div> </div>
} @else if (dfgTopicsError) { } @else if (dfgTopicsError) {
<p class="statistics-error"> <p class="statistics-error">
Die DFG-Topic-Treemap konnte nicht geladen werden. {{ 'dashboard.dfgTopicsError' | translate }}
</p> </p>
} @else { } @else {
<app-topic-treemap <app-topic-treemap
[data]="dfgTopicTreemap" [data]="dfgTopicTreemap"
[selectedNodeId]="selectedDfgTopicTreemapNode" [selectedNodeId]="selectedDfgTopicTreemapNode"
countLabel="DFG-Projekte" [countLabel]="'dashboard.dfgProjects' | translate"
[showCountInTooltip]="false" [showCountInTooltip]="false"
(selectedNodeIdChange)="onDfgTopicTreemapNodeChange($event)" (selectedNodeIdChange)="onDfgTopicTreemapNodeChange($event)"
(topicSelect)="onDfgTopicTreemapTopicSelect($event)"> (topicSelect)="onDfgTopicTreemapTopicSelect($event)">
@@ -321,17 +332,14 @@
<section class="top-authors-section"> <section class="top-authors-section">
<header class="top-authors-header"> <header class="top-authors-header">
<div> <div>
<h2>Top 10 Personen</h2> <h2>{{ 'dashboard.topPeopleTitle' | translate }}</h2>
<p> <p>{{ 'dashboard.topPeopleDescription' | translate }}</p>
Nach Anzahl der Works, DFG-Projekte, Patente und News Ihrer
Organisation.
</p>
</div> </div>
</header> </header>
@if (topAuthorsError) { @if (topAuthorsError) {
<p class="statistics-error"> <p class="statistics-error">
Die Autorenstatistiken konnten nicht geladen werden. {{ 'dashboard.topPeopleError' | translate }}
</p> </p>
} @else { } @else {
<div class="top-authors-grid" [class.loading]="topAuthorsLoading"> <div class="top-authors-grid" [class.loading]="topAuthorsLoading">
@@ -380,8 +388,8 @@
<p class="empty-chart"> <p class="empty-chart">
{{ {{
topAuthorsLoading topAuthorsLoading
? 'Wird geladen …' ? ('dashboard.loading' | translate)
: 'Keine Daten vorhanden.' : ('dashboard.noData' | translate)
}} }}
</p> </p>
} }
@@ -1,4 +1,4 @@
import { Component, OnInit } from '@angular/core'; import { Component, inject, OnInit } from '@angular/core';
import { DecimalPipe } from '@angular/common'; import { DecimalPipe } from '@angular/common';
import { MatIconModule } from '@angular/material/icon'; import { MatIconModule } from '@angular/material/icon';
import { Observable, finalize } from 'rxjs'; import { Observable, finalize } from 'rxjs';
@@ -33,6 +33,8 @@ import {
institutionPersonListQueryParamsForPeriod, institutionPersonListQueryParamsForPeriod,
PersonListQueryParams, PersonListQueryParams,
} from '../../shared/person-list-query-params'; } from '../../shared/person-list-query-params';
import { LanguageService } from '../../shared/i18n/language.service';
import { TranslatePipe } from '../../shared/i18n/translate.pipe';
type DashboardStatisticKey = type DashboardStatisticKey =
| 'publications' | 'publications'
| 'persons' | 'persons'
@@ -61,11 +63,13 @@ type DashboardPeriodMode =
EuProjectStatusChartComponent, EuProjectStatusChartComponent,
TopicTreemapComponent, TopicTreemapComponent,
YearRangeSliderComponent, YearRangeSliderComponent,
TranslatePipe,
], ],
templateUrl: './dashboard.component.html', templateUrl: './dashboard.component.html',
styleUrl: './dashboard.component.scss', styleUrl: './dashboard.component.scss',
}) })
export class DashboardComponent implements OnInit { export class DashboardComponent implements OnInit {
protected readonly languageService = inject(LanguageService);
statistics?: Partial<DashboardStatistics>; statistics?: Partial<DashboardStatistics>;
statisticsLoading = false; statisticsLoading = false;
statisticsError = false; statisticsError = false;
@@ -169,22 +173,22 @@ export class DashboardComponent implements OnInit {
topAuthorDatasets(): TopAuthorDataset[] { topAuthorDatasets(): TopAuthorDataset[] {
return [ return [
{ {
title: 'Publikationen', title: this.languageService.translate('dashboard.publications'),
icon: 'menu_book', icon: 'menu_book',
entries: this.topAuthors?.works ?? [], entries: this.topAuthors?.works ?? [],
}, },
{ {
title: 'EU-Projekte', title: this.languageService.translate('dashboard.euProjects'),
icon: 'public', icon: 'public',
entries: this.topAuthors?.eu_projects ?? [], entries: this.topAuthors?.eu_projects ?? [],
}, },
{ {
title: 'Patente', title: this.languageService.translate('dashboard.patents'),
icon: 'description', icon: 'description',
entries: this.topAuthors?.patents ?? [], entries: this.topAuthors?.patents ?? [],
}, },
{ {
title: 'DFG Projekte', title: this.languageService.translate('dashboard.dfgProjects'),
icon: 'account_tree', icon: 'account_tree',
entries: this.topAuthors?.projects ?? [], entries: this.topAuthors?.projects ?? [],
stripAuthorTitle: true, stripAuthorTitle: true,
@@ -225,8 +229,12 @@ export class DashboardComponent implements OnInit {
Map<string, { topics: DfgProjectTopic[] }> Map<string, { topics: DfgProjectTopic[] }>
>(); >();
for (const topic of projectTopics.topics) { for (const topic of projectTopics.topics) {
const fieldName = topic.field?.trim() || 'Ohne Field'; const fieldName =
const subfieldName = topic.subfield?.trim() || 'Ohne Subfield'; topic.field?.trim() ||
this.languageService.translate('dashboard.withoutField');
const subfieldName =
topic.subfield?.trim() ||
this.languageService.translate('dashboard.withoutSubfield');
const subfields = const subfields =
fields.get(fieldName) ?? fields.get(fieldName) ??
new Map<string, { topics: DfgProjectTopic[] }>(); new Map<string, { topics: DfgProjectTopic[] }>();
@@ -310,7 +318,10 @@ export class DashboardComponent implements OnInit {
} }
organizationName(): string { organizationName(): string {
return this.statistics?.organization_name ?? 'Ihre Organisation'; return (
this.statistics?.organization_name ??
this.languageService.translate('dashboard.yourOrganization')
);
} }
institutionRouteId(): string { institutionRouteId(): string {
@@ -1,5 +1,7 @@
@if (topics.length) { @if (topics.length) {
<div echarts [options]="options" class="dfg-topic-donut-chart"></div> <div echarts [options]="options" class="dfg-topic-donut-chart"></div>
} @else { } @else {
<p class="dfg-topic-donut-empty">Keine gematchten DFG-Topics vorhanden.</p> <p class="dfg-topic-donut-empty">
{{ 'dashboard.noDfgTopics' | translate }}
</p>
} }
@@ -2,12 +2,14 @@ import { Component, Input, OnChanges, effect, inject } from '@angular/core';
import { EChartsOption } from 'echarts'; import { EChartsOption } from 'echarts';
import { NgxEchartsDirective } from 'ngx-echarts'; import { NgxEchartsDirective } from 'ngx-echarts';
import { ChartThemeService } from '../../../shared/services/chart-theme.service'; import { ChartThemeService } from '../../../shared/services/chart-theme.service';
import { LanguageService } from '../../../shared/i18n/language.service';
import { TranslatePipe } from '../../../shared/i18n/translate.pipe';
import { DfgProjectTopic } from '../dashboard-statistics.service'; import { DfgProjectTopic } from '../dashboard-statistics.service';
@Component({ @Component({
selector: 'app-dfg-topic-donut', selector: 'app-dfg-topic-donut',
imports: [NgxEchartsDirective], imports: [NgxEchartsDirective, TranslatePipe],
templateUrl: './dfg-topic-donut.component.html', templateUrl: './dfg-topic-donut.component.html',
styleUrl: './dfg-topic-donut.component.scss', styleUrl: './dfg-topic-donut.component.scss',
}) })
@@ -15,6 +17,7 @@ export class DfgTopicDonutComponent implements OnChanges {
@Input() topics: DfgProjectTopic[] = []; @Input() topics: DfgProjectTopic[] = [];
private chartTheme = inject(ChartThemeService); private chartTheme = inject(ChartThemeService);
private languageService = inject(LanguageService);
options: EChartsOption = {}; options: EChartsOption = {};
constructor() { constructor() {
@@ -51,7 +54,9 @@ export class DfgTopicDonutComponent implements OnChanges {
borderColor: theme.tooltipBorder, borderColor: theme.tooltipBorder,
textStyle: { color: theme.tooltipTextColor }, textStyle: { color: theme.tooltipTextColor },
formatter: (params: any) => formatter: (params: any) =>
`<strong>${this.escapeHtml(String(params.name ?? ''))}</strong><br>${Number(params.value ?? 0).toLocaleString('de-DE')} DFG-Projekte`, `<strong>${this.escapeHtml(String(params.name ?? ''))}</strong><br>${Number(params.value ?? 0).toLocaleString(
this.languageService.language() === 'de' ? 'de-DE' : 'en-US',
)} ${this.languageService.translate('dashboard.dfgProjects')}`,
}, },
legend: { legend: {
type: 'scroll', type: 'scroll',
@@ -68,7 +73,7 @@ export class DfgTopicDonutComponent implements OnChanges {
left: '30%', left: '30%',
top: '46%', top: '46%',
style: { style: {
text: `${this.topics.length}\nTopics`, text: `${this.topics.length}\n${this.languageService.translate('nav.topics')}`,
align: 'center', align: 'center',
fill: theme.textColor, fill: theme.textColor,
fontSize: 18, fontSize: 18,
@@ -79,7 +84,7 @@ export class DfgTopicDonutComponent implements OnChanges {
], ],
series: [ series: [
{ {
name: 'DFG-Topics', name: this.languageService.translate('dashboard.dfgTopicsTitle'),
type: 'pie', type: 'pie',
radius: ['42%', '72%'], radius: ['42%', '72%'],
center: ['32%', '50%'], center: ['32%', '50%'],
@@ -95,7 +100,7 @@ export class DfgTopicDonutComponent implements OnChanges {
scaleSize: 8, scaleSize: 8,
label: { label: {
show: true, show: true,
formatter: '{b}\n{c} Projekte', formatter: `{b}\n{c} ${this.languageService.translate('dashboard.projects')}`,
fontWeight: 700, fontWeight: 700,
}, },
}, },
@@ -3,4 +3,4 @@
[options]="options" [options]="options"
class="eu-project-status-chart" class="eu-project-status-chart"
role="img" role="img"
aria-label="Gestapeltes Balkendiagramm zum Status der EU- und Bund-Projekte"></div> [attr.aria-label]="'dashboard.projectStatusChartLabel' | translate"></div>
@@ -2,6 +2,8 @@ import { Component, Input, OnChanges, effect, inject } from '@angular/core';
import { EChartsOption } from 'echarts'; import { EChartsOption } from 'echarts';
import { NgxEchartsDirective } from 'ngx-echarts'; import { NgxEchartsDirective } from 'ngx-echarts';
import { ChartThemeService } from '../../../shared/services/chart-theme.service'; import { ChartThemeService } from '../../../shared/services/chart-theme.service';
import { LanguageService } from '../../../shared/i18n/language.service';
import { TranslatePipe } from '../../../shared/i18n/translate.pipe';
import { import {
BmbfProjectStatusStatistics, BmbfProjectStatusStatistics,
@@ -11,7 +13,7 @@ import {
@Component({ @Component({
selector: 'app-eu-project-status-chart', selector: 'app-eu-project-status-chart',
imports: [NgxEchartsDirective], imports: [NgxEchartsDirective, TranslatePipe],
templateUrl: './eu-project-status-chart.component.html', templateUrl: './eu-project-status-chart.component.html',
styleUrl: './eu-project-status-chart.component.scss', styleUrl: './eu-project-status-chart.component.scss',
}) })
@@ -21,6 +23,7 @@ export class EuProjectStatusChartComponent implements OnChanges {
@Input({ required: true }) dfgStatuses!: DfgProjectStatusStatistics; @Input({ required: true }) dfgStatuses!: DfgProjectStatusStatistics;
private chartTheme = inject(ChartThemeService); private chartTheme = inject(ChartThemeService);
private languageService = inject(LanguageService);
options: EChartsOption = {}; options: EChartsOption = {};
constructor() { constructor() {
@@ -39,7 +42,7 @@ export class EuProjectStatusChartComponent implements OnChanges {
const values = [ const values = [
{ {
name: 'Laufend', name: this.languageService.translate('dashboard.ongoing'),
data: [ data: [
this.statuses?.ongoing ?? 0, this.statuses?.ongoing ?? 0,
this.bmbfStatuses?.ongoing ?? 0, this.bmbfStatuses?.ongoing ?? 0,
@@ -48,7 +51,7 @@ export class EuProjectStatusChartComponent implements OnChanges {
color: '#2563eb', color: '#2563eb',
}, },
{ {
name: 'Kommend', name: this.languageService.translate('dashboard.upcoming'),
data: [ data: [
this.statuses?.upcoming ?? 0, this.statuses?.upcoming ?? 0,
this.bmbfStatuses?.upcoming ?? 0, this.bmbfStatuses?.upcoming ?? 0,
@@ -57,7 +60,7 @@ export class EuProjectStatusChartComponent implements OnChanges {
color: '#f59e0b', color: '#f59e0b',
}, },
{ {
name: 'Abgeschlossen', name: this.languageService.translate('dashboard.completed'),
data: [ data: [
this.statuses?.completed ?? 0, this.statuses?.completed ?? 0,
this.bmbfStatuses?.completed ?? 0, this.bmbfStatuses?.completed ?? 0,
@@ -79,7 +82,9 @@ export class EuProjectStatusChartComponent implements OnChanges {
borderColor: theme.tooltipBorder, borderColor: theme.tooltipBorder,
textStyle: { color: theme.tooltipTextColor }, textStyle: { color: theme.tooltipTextColor },
valueFormatter: (value) => valueFormatter: (value) =>
`${Number(value ?? 0).toLocaleString('de-DE')} Projekte`, `${Number(value ?? 0).toLocaleString(
this.languageService.language() === 'de' ? 'de-DE' : 'en-US',
)} ${this.languageService.translate('dashboard.projects')}`,
}, },
legend: { legend: {
top: 0, top: 0,
@@ -91,7 +96,7 @@ export class EuProjectStatusChartComponent implements OnChanges {
xAxis: { xAxis: {
type: 'value', type: 'value',
minInterval: 1, minInterval: 1,
name: 'Anzahl Projekte', name: this.languageService.translate('dashboard.projectCount'),
nameLocation: 'middle', nameLocation: 'middle',
nameGap: 28, nameGap: 28,
axisLabel: { color: theme.mutedTextColor }, axisLabel: { color: theme.mutedTextColor },
@@ -100,7 +105,11 @@ export class EuProjectStatusChartComponent implements OnChanges {
}, },
yAxis: { yAxis: {
type: 'category', type: 'category',
data: ['EU-Projekte', 'Bund-Projekte', 'DFG-Projekte'], data: [
this.languageService.translate('dashboard.euProjects'),
this.languageService.translate('dashboard.federalProjects'),
this.languageService.translate('dashboard.dfgProjects'),
],
axisTick: { show: false }, axisTick: { show: false },
axisLine: { show: false }, axisLine: { show: false },
axisLabel: { color: theme.textColor, fontWeight: 600 }, axisLabel: { color: theme.textColor, fontWeight: 600 },
@@ -1,17 +1,19 @@
<div class="dialog-title" mat-dialog-title> <div class="dialog-title" mat-dialog-title>
<div class="dialog-heading"> <div class="dialog-heading">
<div> <div>
<span class="dialog-eyebrow">Topic Insights</span> <span class="dialog-eyebrow">{{ 'wordcloud.insights' | translate }}</span>
<h2> <h2>
{{ {{
data.source === 'dfg' ? 'DFG-Keyword Wordcloud' : 'Keyword Wordcloud' data.source === 'dfg'
? ('wordcloud.dfgTitle' | translate)
: ('wordcloud.title' | translate)
}} }}
</h2> </h2>
<p> <p>
{{ {{
data.source === 'dfg' data.source === 'dfg'
? 'Keywords der DFG-Projekte zum ausgewählten Topic' ? ('wordcloud.dfgDescription' | translate)
: 'Die wichtigsten Begriffe zum ausgewählten Forschungsthema' : ('wordcloud.description' | translate)
}} }}
</p> </p>
</div> </div>
@@ -20,14 +22,16 @@
class="dialog-close" class="dialog-close"
mat-icon-button mat-icon-button
type="button" type="button"
aria-label="Dialog schließen" [attr.aria-label]="'wordcloud.close' | translate"
mat-dialog-close> mat-dialog-close>
<mat-icon>close</mat-icon> <mat-icon>close</mat-icon>
</button> </button>
</div> </div>
<mat-dialog-content> <mat-dialog-content>
<div class="topic-context-card" aria-label="Ausgewählte Themenhierarchie"> <div
class="topic-context-card"
[attr.aria-label]="'wordcloud.hierarchy' | translate">
<div class="topic-context-item"> <div class="topic-context-item">
<span <span
class="topic-context-icon topic-context-icon--field" class="topic-context-icon topic-context-icon--field"
@@ -76,14 +80,20 @@
<section class="word-cloud-panel" aria-labelledby="word-cloud-heading"> <section class="word-cloud-panel" aria-labelledby="word-cloud-heading">
<div class="word-cloud-panel-header"> <div class="word-cloud-panel-header">
<div> <div>
<h3 id="word-cloud-heading">Top Keywords</h3> <h3 id="word-cloud-heading">
{{ 'wordcloud.topKeywords' | translate }}
</h3>
<p> <p>
Die Schriftgröße entspricht der Anzahl der {{
{{ data.source === 'dfg' ? 'DFG-Projekte' : 'Publikationen' }}. (data.source === 'dfg'
? 'wordcloud.sizeDescriptionDfg'
: 'wordcloud.sizeDescriptionPublications'
) | translate
}}
</p> </p>
</div> </div>
@if (!loading && !loadFailed && words.length) { @if (!loading && !loadFailed && words.length) {
<span class="word-count">{{ words.length }} Begriffe</span> <span class="word-count">{{ termCountLabel() }}</span>
} }
</div> </div>
@@ -92,27 +102,26 @@
<span class="state-icon state-icon--loading" aria-hidden="true"> <span class="state-icon state-icon--loading" aria-hidden="true">
<mat-icon>hourglass_top</mat-icon> <mat-icon>hourglass_top</mat-icon>
</span> </span>
<strong>Wordcloud wird erstellt</strong> <strong>{{ 'wordcloud.creating' | translate }}</strong>
<span>Die wichtigsten Keywords werden geladen …</span> <span>{{ 'wordcloud.loading' | translate }}</span>
</div> </div>
} @else if (loadFailed) { } @else if (loadFailed) {
<div class="word-cloud-state word-cloud-state--error"> <div class="word-cloud-state word-cloud-state--error">
<span class="state-icon" aria-hidden="true" <span class="state-icon" aria-hidden="true"
><mat-icon>cloud_off</mat-icon></span ><mat-icon>cloud_off</mat-icon></span
> >
<strong>Wordcloud nicht verfügbar</strong> <strong>{{ 'wordcloud.unavailable' | translate }}</strong>
<span>Die Keywords konnten nicht geladen werden.</span> <span>{{ 'wordcloud.loadError' | translate }}</span>
</div> </div>
} @else if (words.length) { } @else if (words.length) {
<div class="keyword-toolbar" aria-label="Ausgewählte Keywords"> <div
class="keyword-toolbar"
[attr.aria-label]="'wordcloud.selectedKeywords' | translate">
<div class="keyword-toolbar-label"> <div class="keyword-toolbar-label">
<mat-icon aria-hidden="true">tune</mat-icon> <mat-icon aria-hidden="true">tune</mat-icon>
<span> <span>
<strong>Keyword-Auswahl</strong> <strong>{{ 'wordcloud.selection' | translate }}</strong>
<small <small>{{ 'wordcloud.selectionHelp' | translate }}</small>
>Klicken Sie auf Begriffe in der Wordcloud, um sie
auszuwählen.</small
>
</span> </span>
</div> </div>
@@ -121,13 +130,15 @@
<button <button
type="button" type="button"
class="keyword-chip" class="keyword-chip"
[attr.aria-label]="word.name + ' aus Auswahl entfernen'" [attr.aria-label]="removeWordLabel(word.name)"
(click)="toggleWord(word)"> (click)="toggleWord(word)">
{{ word.name }} {{ word.name }}
<mat-icon aria-hidden="true">close</mat-icon> <mat-icon aria-hidden="true">close</mat-icon>
</button> </button>
} @empty { } @empty {
<span class="keyword-selection-empty">Noch nichts ausgewählt</span> <span class="keyword-selection-empty">
{{ 'wordcloud.nothingSelected' | translate }}
</span>
} }
</div> </div>
@@ -138,7 +149,7 @@
type="button" type="button"
class="keyword-clear" class="keyword-clear"
(click)="clearSelection()"> (click)="clearSelection()">
Auswahl löschen {{ 'wordcloud.clearSelection' | translate }}
</button> </button>
} }
<a <a
@@ -158,7 +169,7 @@
: closeForSearchNavigation() : closeForSearchNavigation()
"> ">
<mat-icon aria-hidden="true">manage_search</mat-icon> <mat-icon aria-hidden="true">manage_search</mat-icon>
Suche in Keywords {{ 'wordcloud.searchKeywords' | translate }}
</a> </a>
<a <a
mat-flat-button mat-flat-button
@@ -179,12 +190,14 @@
: closeForSearchNavigation() : closeForSearchNavigation()
"> ">
<mat-icon aria-hidden="true">search</mat-icon> <mat-icon aria-hidden="true">search</mat-icon>
Suche in Themen {{ 'wordcloud.searchTopics' | translate }}
</a> </a>
</div> </div>
</div> </div>
<div class="word-cloud-chart" aria-label="Wordcloud verwandter Themen"> <div
class="word-cloud-chart"
[attr.aria-label]="'wordcloud.relatedTopics' | translate">
@for (word of words; track word.id) { @for (word of words; track word.id) {
<button <button
type="button" type="button"
@@ -198,7 +211,9 @@
word.name + word.name +
': ' + ': ' +
word.count + word.count +
(data.source === 'dfg' ? ' DFG-Projekte' : ' Publikationen') (data.source === 'dfg'
? ' ' + languageService.translate('dashboard.dfgProjects')
: ' ' + languageService.translate('dashboard.publications'))
" "
(click)="toggleWord(word)"> (click)="toggleWord(word)">
{{ word.name }} {{ word.name }}
@@ -210,11 +225,8 @@
<span class="state-icon" aria-hidden="true" <span class="state-icon" aria-hidden="true"
><mat-icon>search_off</mat-icon></span ><mat-icon>search_off</mat-icon></span
> >
<strong>Keine Keywords gefunden</strong> <strong>{{ 'wordcloud.noKeywords' | translate }}</strong>
<span <span>{{ 'wordcloud.noData' | translate }}</span>
>Für dieses Topic sind im gewählten Zeitraum keine Daten
vorhanden.</span
>
</div> </div>
} }
</section> </section>
@@ -14,6 +14,8 @@ import {
DashboardStatisticsService, DashboardStatisticsService,
TopicWordCloudWord, TopicWordCloudWord,
} from '../dashboard-statistics.service'; } from '../dashboard-statistics.service';
import { LanguageService } from '../../../shared/i18n/language.service';
import { TranslatePipe } from '../../../shared/i18n/translate.pipe';
export interface TopicWordCloudDialogData { export interface TopicWordCloudDialogData {
topicId: string; topicId: string;
@@ -41,6 +43,7 @@ interface DisplayWord extends TopicWordCloudWord {
MatDialogModule, MatDialogModule,
MatIconModule, MatIconModule,
RouterLink, RouterLink,
TranslatePipe,
], ],
templateUrl: './topic-wordcloud-dialog.component.html', templateUrl: './topic-wordcloud-dialog.component.html',
styleUrl: './topic-wordcloud-dialog.component.scss', styleUrl: './topic-wordcloud-dialog.component.scss',
@@ -52,6 +55,7 @@ export class TopicWordCloudDialogComponent {
); );
private readonly statisticsService = inject(DashboardStatisticsService); private readonly statisticsService = inject(DashboardStatisticsService);
private readonly destroyRef = inject(DestroyRef); private readonly destroyRef = inject(DestroyRef);
protected readonly languageService = inject(LanguageService);
words: DisplayWord[] = []; words: DisplayWord[] = [];
selectedWordIds = new Set<string>(); selectedWordIds = new Set<string>();
@@ -122,6 +126,18 @@ export class TopicWordCloudDialogComponent {
return this.selectedWords().map((word) => word.name); return this.selectedWords().map((word) => word.name);
} }
termCountLabel(): string {
return this.languageService.translate('wordcloud.termCount', {
count: this.words.length,
});
}
removeWordLabel(name: string): string {
return this.languageService.translate('wordcloud.removeFromSelection', {
name,
});
}
clearSelection(): void { clearSelection(): void {
this.selectedWordIds = new Set<string>(); this.selectedWordIds = new Set<string>();
} }
@@ -5,9 +5,9 @@
<mat-icon class="error-icon">warning</mat-icon> <mat-icon class="error-icon">warning</mat-icon>
</div> </div>
<span class="status-code">Fehler {{ statusCode() }}</span> <span class="status-code">{{ 'errorPage.error' | translate }} {{ statusCode() }}</span>
<h1 class="error-title">{{ title() }}</h1> <h1 class="error-title">{{ localizedTitle() }}</h1>
<p class="error-message">{{ message() }}</p> <p class="error-message">{{ localizedMessage() }}</p>
<button <button
class="back-button" class="back-button"
@@ -15,7 +15,7 @@
color="primary" color="primary"
(click)="goBack()"> (click)="goBack()">
<mat-icon>arrow_back</mat-icon> <mat-icon>arrow_back</mat-icon>
Zurück {{ 'common.back' | translate }}
</button> </button>
@if (errorDetails()) { @if (errorDetails()) {
@@ -25,7 +25,7 @@
appearance="outlined"> appearance="outlined">
<mat-expansion-panel-header> <mat-expansion-panel-header>
<mat-panel-title class="diagnostics-title"> <mat-panel-title class="diagnostics-title">
ERWEITERTE DIAGNOSE {{ 'errorPage.diagnostics' | translate }}
</mat-panel-title> </mat-panel-title>
</mat-expansion-panel-header> </mat-expansion-panel-header>
@@ -4,20 +4,20 @@ import { MatCardModule } from '@angular/material/card';
import { MatExpansionModule } from '@angular/material/expansion'; import { MatExpansionModule } from '@angular/material/expansion';
import { MatIconModule } from '@angular/material/icon'; import { MatIconModule } from '@angular/material/icon';
import { ErrorService } from '../../shared/services/error.service'; import { ErrorService } from '../../shared/services/error.service';
import { TranslatePipe } from '../../shared/i18n/translate.pipe';
import { LanguageService } from '../../shared/i18n/language.service';
@Component({ @Component({
selector: 'app-error-page', selector: 'app-error-page',
standalone: true, standalone: true,
imports: [MatButtonModule, MatCardModule, MatIconModule, MatExpansionModule], imports: [MatButtonModule, MatCardModule, MatIconModule, MatExpansionModule, TranslatePipe],
templateUrl: './error-page.component.html', templateUrl: './error-page.component.html',
styleUrl: './error-page.component.scss', styleUrl: './error-page.component.scss',
}) })
export class ErrorPageComponent implements OnInit { export class ErrorPageComponent implements OnInit {
routeStatusCode = input<number>(500); routeStatusCode = input<number>(500);
routeTitle = input<string>('Da ist was schiefgelaufen'); routeTitle = input<string | undefined>(undefined);
routeMessage = input<string>( routeMessage = input<string | undefined>(undefined);
'Ein unerwarteter Fehler ist aufgetreten. Bitte versuchen Sie es später erneut.',
);
routeErrorDetails = input<string | undefined>(undefined); routeErrorDetails = input<string | undefined>(undefined);
statusCode = signal<number>(500); statusCode = signal<number>(500);
@@ -28,6 +28,27 @@ export class ErrorPageComponent implements OnInit {
isDetailsOpen = signal<boolean>(false); isDetailsOpen = signal<boolean>(false);
private readonly errorService = inject(ErrorService); private readonly errorService = inject(ErrorService);
private readonly languageService = inject(LanguageService);
localizedTitle(): string {
if (this.statusCode() === 404) {
return this.languageService.translate('errorPage.notFound');
}
if (!this.title()) {
return this.languageService.translate('errorPage.title');
}
return this.title();
}
localizedMessage(): string {
if (this.statusCode() === 404) {
return this.languageService.translate('errorPage.notFoundMessage');
}
if (!this.message()) {
return this.languageService.translate('errorPage.message');
}
return this.message();
}
ngOnInit() { ngOnInit() {
const savedError = this.errorService.getError(); const savedError = this.errorService.getError();
@@ -37,11 +58,11 @@ export class ErrorPageComponent implements OnInit {
this.title.set(savedError.title); this.title.set(savedError.title);
this.message.set(savedError.message); this.message.set(savedError.message);
this.errorDetails.set(savedError.errorDetails); this.errorDetails.set(savedError.errorDetails);
this.errorService.clearError(); // Speicher aufräumen this.errorService.clearError();
} else { } else {
this.statusCode.set(this.routeStatusCode()); this.statusCode.set(this.routeStatusCode());
this.title.set(this.routeTitle()); this.title.set(this.routeTitle() ?? '');
this.message.set(this.routeMessage()); this.message.set(this.routeMessage() ?? '');
this.errorDetails.set(this.routeErrorDetails()); this.errorDetails.set(this.routeErrorDetails());
} }
} }
@@ -1,11 +1,10 @@
<section class="login-page"> <section class="login-page">
<div class="login-panel"> <div class="login-panel">
<div class="brand-block"> <div class="brand-block">
<span class="eyebrow">SmartGuide Account Portal</span> <span class="eyebrow">{{ 'login.portal' | translate }}</span>
<h1>Passwort vergessen</h1> <h1>{{ 'forgotPassword.title' | translate }}</h1>
<p> <p>
Gib Deine E-Mail-Adresse ein. Wenn ein Konto existiert, senden wir Dir {{ 'forgotPassword.description' | translate }}
einen Link zum Zurücksetzen des Passworts.
</p> </p>
</div> </div>
@@ -17,17 +16,14 @@
</mat-icon> </mat-icon>
<div> <div>
@if (rateLimited()) { @if (rateLimited()) {
<strong>Zu viele Anfragen</strong> <strong>{{ 'forgotPassword.tooMany' | translate }}</strong>
<span> <span>
Es wurden bereits mehrere Links angefordert. Bitte prüfe Dein {{ 'forgotPassword.rateLimitPrefix' | translate }} {{ retryAfterText() }} {{ 'forgotPassword.retrySuffix' | translate }}
Postfach oder versuche es in {{ retryAfterText() }} erneut.
</span> </span>
} @else { } @else {
<strong>E-Mail wurde versendet</strong> <strong>{{ 'forgotPassword.emailSent' | translate }}</strong>
<span> <span>
Falls ein Konto mit dieser E-Mail-Adresse existiert, wurde ein {{ 'forgotPassword.emailSentMessage' | translate }}
Link zum Zurücksetzen des Passworts versendet. Bitte prüfe Dein
Postfach.
</span> </span>
} }
</div> </div>
@@ -37,20 +33,20 @@
<div class="code-intro"> <div class="code-intro">
<mat-icon>error_outline</mat-icon> <mat-icon>error_outline</mat-icon>
<div> <div>
<strong>Fehler</strong> <strong>{{ 'errorPage.error' | translate }}</strong>
<span>{{ errorMessage() }}</span> <span>{{ errorMessage() }}</span>
</div> </div>
</div> </div>
} }
<div class="form-actions"> <div class="form-actions">
<a class="auth-link" routerLink="/login">Zurück zum Login</a> <a class="auth-link" routerLink="/login">{{ 'forgotPassword.backLogin' | translate }}</a>
<a <a
class="auth-link" class="auth-link"
href="#" href="#"
(click)="$event.preventDefault(); requestPasswordResetAgain()"> (click)="$event.preventDefault(); requestPasswordResetAgain()">
E-Mail nicht bekommen? {{ 'forgotPassword.notReceived' | translate }}
</a> </a>
</div> </div>
</div> </div>
@@ -60,16 +56,16 @@
[formGroup]="form" [formGroup]="form"
(ngSubmit)="requestPasswordReset()"> (ngSubmit)="requestPasswordReset()">
<mat-form-field class="field" appearance="outline"> <mat-form-field class="field" appearance="outline">
<mat-label>E-Mail-Adresse</mat-label> <mat-label>{{ 'login.email' | translate }}</mat-label>
<input <input
matInput matInput
type="email" type="email"
autocomplete="email" autocomplete="email"
formControlName="email" /> formControlName="email" />
@if (form.controls.email.hasError('required')) { @if (form.controls.email.hasError('required')) {
<mat-error>E-Mail-Adresse ist erforderlich.</mat-error> <mat-error>{{ 'login.emailRequired' | translate }}</mat-error>
} @else if (form.controls.email.hasError('email')) { } @else if (form.controls.email.hasError('email')) {
<mat-error>Bitte gib eine gültige E-Mail-Adresse ein.</mat-error> <mat-error>{{ 'login.emailInvalid' | translate }}</mat-error>
} }
</mat-form-field> </mat-form-field>
@@ -77,7 +73,7 @@
<div class="code-intro"> <div class="code-intro">
<mat-icon>error_outline</mat-icon> <mat-icon>error_outline</mat-icon>
<div> <div>
<strong>Fehler</strong> <strong>{{ 'errorPage.error' | translate }}</strong>
<span>{{ errorMessage() }}</span> <span>{{ errorMessage() }}</span>
</div> </div>
</div> </div>
@@ -90,14 +86,14 @@
type="submit" type="submit"
[disabled]="form.invalid || isSubmitting()"> [disabled]="form.invalid || isSubmitting()">
@if (isSubmitting()) { @if (isSubmitting()) {
Link wird gesendet... {{ 'forgotPassword.sending' | translate }}
} @else { } @else {
Link zum Zurücksetzen senden {{ 'forgotPassword.send' | translate }}
} }
</button> </button>
<div class="form-actions"> <div class="form-actions">
<a class="auth-link" routerLink="/login">Zurück zum Login</a> <a class="auth-link" routerLink="/login">{{ 'forgotPassword.backLogin' | translate }}</a>
</div> </div>
</form> </form>
} }
@@ -13,6 +13,8 @@ import { MatInputModule } from '@angular/material/input';
import { MatIconModule } from '@angular/material/icon'; import { MatIconModule } from '@angular/material/icon';
import { CredentialService } from '../../shared/services/credential.service'; import { CredentialService } from '../../shared/services/credential.service';
import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar'; import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar';
import { TranslatePipe } from '../../shared/i18n/translate.pipe';
import { LanguageService } from '../../shared/i18n/language.service';
@Component({ @Component({
selector: 'app-forgot-password', selector: 'app-forgot-password',
@@ -24,6 +26,7 @@ import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar';
MatButtonModule, MatButtonModule,
MatIconModule, MatIconModule,
MatSnackBarModule, MatSnackBarModule,
TranslatePipe,
], ],
templateUrl: './forgot-password.component.html', templateUrl: './forgot-password.component.html',
styleUrl: '../app-login/app-login.component.scss', styleUrl: '../app-login/app-login.component.scss',
@@ -32,6 +35,7 @@ import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar';
export class ForgotPasswordComponent { export class ForgotPasswordComponent {
private readonly credentialService = inject(CredentialService); private readonly credentialService = inject(CredentialService);
private readonly snackBar = inject(MatSnackBar); private readonly snackBar = inject(MatSnackBar);
private readonly languageService = inject(LanguageService);
form = new FormGroup({ form = new FormGroup({
email: new FormControl<string>('', [Validators.required, Validators.email]), email: new FormControl<string>('', [Validators.required, Validators.email]),
@@ -68,11 +72,14 @@ export class ForgotPasswordComponent {
const seconds = this.retryAfterSeconds(); const seconds = this.retryAfterSeconds();
if (!seconds) { if (!seconds) {
return 'einigen Minuten'; return this.languageService.translate('forgotPassword.someMinutes');
} }
const minutes = Math.max(1, Math.ceil(seconds / 60)); const minutes = Math.max(1, Math.ceil(seconds / 60));
return `${minutes} ${minutes === 1 ? 'Minute' : 'Minuten'}`; return this.languageService.translate(
minutes === 1 ? 'forgotPassword.minute' : 'forgotPassword.minutes',
{ count: minutes },
);
} }
private sendPasswordResetRequest(email: string): void { private sendPasswordResetRequest(email: string): void {
@@ -102,7 +109,7 @@ export class ForgotPasswordComponent {
if (response.rate_limited) { if (response.rate_limited) {
this.snackBar.open( this.snackBar.open(
`Es wurden bereits mehrere Links angefordert. Bitte versuche es in ${this.retryAfterText()} erneut.`, this.languageService.translate('forgotPassword.rateLimitMessage', { time: this.retryAfterText() }),
'OK', 'OK',
{ duration: 7000 }, { duration: 7000 },
); );
@@ -111,7 +118,7 @@ export class ForgotPasswordComponent {
if (wasAlreadySent) { if (wasAlreadySent) {
this.snackBar.open( this.snackBar.open(
'Wir haben Dir einen neuen Link zum Zurücksetzen des Passworts gesendet.', this.languageService.translate('forgotPassword.newLinkSent'),
'OK', 'OK',
{ duration: 5000 }, { duration: 5000 },
); );
@@ -119,7 +126,7 @@ export class ForgotPasswordComponent {
}, },
error: () => { error: () => {
this.errorMessage.set( this.errorMessage.set(
'Der Link zum Zurücksetzen des Passworts konnte nicht angefordert werden. Bitte versuche es später erneut.', this.languageService.translate('forgotPassword.requestError'),
); );
if (!wasAlreadySent) { if (!wasAlreadySent) {
@@ -127,7 +134,7 @@ export class ForgotPasswordComponent {
} }
this.snackBar.open( this.snackBar.open(
'Die Anfrage konnte nicht gesendet werden. Bitte versuche es später erneut.', this.languageService.translate('forgotPassword.sendError'),
'OK', 'OK',
{ duration: 7000 }, { duration: 7000 },
); );
@@ -1 +1 @@
<p>institution-overview works!</p> <p>{{ 'institutionOverview.placeholder' | translate }}</p>
@@ -1,8 +1,9 @@
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { TranslatePipe } from '../../shared/i18n/translate.pipe';
@Component({ @Component({
selector: 'app-institution-overview', selector: 'app-institution-overview',
imports: [], imports: [TranslatePipe],
templateUrl: './institution-overview.component.html', templateUrl: './institution-overview.component.html',
styleUrl: './institution-overview.component.scss', styleUrl: './institution-overview.component.scss',
}) })
@@ -1,17 +1,17 @@
@if (loading) { @if (loading) {
<app-loading <app-loading
text="Patentdaten werden geladen..." [text]="'personPatents.loading' | translate"
icon="workspace_premium" icon="workspace_premium"
[size]="150" [size]="150"
[diameter]="150" /> [diameter]="150" />
} @else if (error) { } @else if (error) {
<p class="message">Fehler beim Laden der Patente.</p> <p class="message">{{ 'personPatents.loadError' | translate }}</p>
} @else if (patents.length === 0) { } @else if (patents.length === 0) {
<p class="message"> <p class="message">
Keine Patente in org_patents für diese Institution gefunden. {{ 'institutionPatents.empty' | translate }}
</p> </p>
<p class="message message-hint"> <p class="message message-hint">
Der Index muss zuerst befüllt werden: {{ 'institutionPatents.indexHint' | translate }}
<code <code
>python service/scripts/index_org_patents.py --institution-id >python service/scripts/index_org_patents.py --institution-id
{{ institutionId }}</code {{ institutionId }}</code
@@ -30,10 +30,10 @@
[value]="activeMatchType" [value]="activeMatchType"
(selectionChange)="setMatchType($event.value)"> (selectionChange)="setMatchType($event.value)">
<mat-select-trigger>Matching</mat-select-trigger> <mat-select-trigger>Matching</mat-select-trigger>
<mat-option value="all">Alle</mat-option> <mat-option value="all">{{ 'common.all' | translate }}</mat-option>
<mat-option value="institution">Institution</mat-option> <mat-option value="institution">{{ 'publications.institution' | translate }}</mat-option>
<mat-option value="name">Name</mat-option> <mat-option value="name">{{ 'jobs.name' | translate }}</mat-option>
<mat-option value="both">Beides</mat-option> <mat-option value="both">{{ 'institutionPatents.both' | translate }}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field <mat-form-field
@@ -43,8 +43,8 @@
<mat-select <mat-select
[value]="activeFilter" [value]="activeFilter"
(selectionChange)="setFilter($event.value)"> (selectionChange)="setFilter($event.value)">
<mat-select-trigger>Filter nach Quelle</mat-select-trigger> <mat-select-trigger>{{ 'personPatents.filterSource' | translate }}</mat-select-trigger>
<mat-option value="all">Alle</mat-option> <mat-option value="all">{{ 'common.all' | translate }}</mat-option>
<mat-option value="EPO">EPO</mat-option> <mat-option value="EPO">EPO</mat-option>
<mat-option value="USPTO">USPTO</mat-option> <mat-option value="USPTO">USPTO</mat-option>
</mat-select> </mat-select>
@@ -56,9 +56,9 @@
<mat-select <mat-select
[value]="sortMode" [value]="sortMode"
(selectionChange)="setSortMode($event.value)"> (selectionChange)="setSortMode($event.value)">
<mat-select-trigger>Sortieren nach</mat-select-trigger> <mat-select-trigger>{{ 'personPatents.sortBy' | translate }}</mat-select-trigger>
<mat-option value="date">Datum</mat-option> <mat-option value="date">{{ 'publicationDetail.date' | translate }}</mat-option>
<mat-option value="title">Titel</mat-option> <mat-option value="title">{{ 'projects.columnTitle' | translate }}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
</div> </div>
@@ -66,13 +66,13 @@
<table> <table>
<thead> <thead>
<tr> <tr>
<th>Patent</th> <th>{{ 'personPatents.patent' | translate }}</th>
<th>Quelle</th> <th>{{ 'patents.source' | translate }}</th>
<th>Jahr</th> <th>{{ 'publications.year' | translate }}</th>
<th>Erfinder</th> <th>{{ 'patents.inventors' | translate }}</th>
<th>Applicant/Assignee</th> <th>{{ 'institutionPatents.applicantAssignee' | translate }}</th>
<th>Match-Typ</th> <th>{{ 'institutionPatents.matchType' | translate }}</th>
<th>Personen</th> <th>{{ 'nav.people' | translate }}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@@ -140,7 +140,7 @@
<h3>{{ selectedPatent.title ?? selectedPatent.patent_id }}</h3> <h3>{{ selectedPatent.title ?? selectedPatent.patent_id }}</h3>
<div class="detail-stats"> <div class="detail-stats">
<div class="stat"> <div class="stat">
<span class="stat-label">Quelle</span> <span class="stat-label">{{ 'patents.source' | translate }}</span>
<span class="stat-value"> <span class="stat-value">
<span <span
class="source-badge source-badge--{{ class="source-badge source-badge--{{
@@ -151,11 +151,11 @@
</span> </span>
</div> </div>
<div class="stat"> <div class="stat">
<span class="stat-label">Patent-Nr.</span> <span class="stat-label">{{ 'patents.number' | translate }}</span>
<span class="stat-value">{{ selectedPatent.patent_id }}</span> <span class="stat-value">{{ selectedPatent.patent_id }}</span>
</div> </div>
<div class="stat"> <div class="stat">
<span class="stat-label">Datum</span> <span class="stat-label">{{ 'publicationDetail.date' | translate }}</span>
@if (selectedPatent.publication_date) { @if (selectedPatent.publication_date) {
<span class="stat-value">{{ <span class="stat-value">{{
formatDate(selectedPatent.publication_date) formatDate(selectedPatent.publication_date)
@@ -163,7 +163,7 @@
} }
</div> </div>
<div class="stat"> <div class="stat">
<span class="stat-label">Match-Typ</span> <span class="stat-label">{{ 'institutionPatents.matchType' | translate }}</span>
<span class="stat-value"> <span class="stat-value">
<span <span
class="match-badge match-badge--{{ class="match-badge match-badge--{{
@@ -175,7 +175,7 @@
</div> </div>
@if (getPublicationStageLabel(selectedPatent); as stageLabel) { @if (getPublicationStageLabel(selectedPatent); as stageLabel) {
<div class="stat"> <div class="stat">
<span class="stat-label">Publikationsstufe</span> <span class="stat-label">{{ 'patents.publicationStage' | translate }}</span>
<span class="stat-value">{{ stageLabel }}</span> <span class="stat-value">{{ stageLabel }}</span>
</div> </div>
} }
@@ -183,7 +183,7 @@
@if (selectedPatent.matched_authors?.length) { @if (selectedPatent.matched_authors?.length) {
<div class="detail-section"> <div class="detail-section">
<h4>Verknüpfte Personen</h4> <h4>{{ 'institutionPatents.linkedPeople' | translate }}</h4>
<ul class="tag-list tag-list--compact"> <ul class="tag-list tag-list--compact">
@for ( @for (
author of selectedPatent.matched_authors; author of selectedPatent.matched_authors;
@@ -213,46 +213,46 @@
class="patent-detail-action" class="patent-detail-action"
(click)="openDetail()"> (click)="openDetail()">
<span class="patent-detail-action__label" <span class="patent-detail-action__label"
>Patentdetails anzeigen</span >{{ 'personPatents.showDetails' | translate }}</span
> >
<mat-icon aria-hidden="true">chevron_right</mat-icon> <mat-icon aria-hidden="true">chevron_right</mat-icon>
</button> </button>
<p class="patent-detail-hint"> <p class="patent-detail-hint">
Abstract, Erfinder, Anmelder und IPC/CPC-Klassifikation {{ 'personPatents.detailHint' | translate }}
</p> </p>
</div> </div>
} @else { } @else {
<div class="patent-detail overview"> <div class="patent-detail overview">
<p class="overview-title">Patentübersicht</p> <p class="overview-title">{{ 'personPatents.overview' | translate }}</p>
<p class="overview-subtitle"> <p class="overview-subtitle">
@if (institutionName) { @if (institutionName) {
Alle Patente von {{ institutionName }} im Überblick. {{ 'institutionPatents.allBy' | translate }} {{ institutionName }}.
} @else { } @else {
Alle Patente dieser Institution im Überblick. {{ 'institutionPatents.allInstitution' | translate }}
} }
</p> </p>
<div class="overview-stats"> <div class="overview-stats">
<div class="overview-stat overview-stat--total"> <div class="overview-stat overview-stat--total">
<span class="overview-value">{{ totalPatents }}</span> <span class="overview-value">{{ totalPatents }}</span>
<span class="overview-label">Patente</span> <span class="overview-label">{{ 'patents.title' | translate }}</span>
</div> </div>
<div class="overview-stat overview-stat--institution"> <div class="overview-stat overview-stat--institution">
<span class="overview-value">{{ <span class="overview-value">{{
getInstitutionMatchCount() getInstitutionMatchCount()
}}</span> }}</span>
<span class="overview-label">Institution</span> <span class="overview-label">{{ 'publications.institution' | translate }}</span>
</div> </div>
<div class="overview-stat overview-stat--name"> <div class="overview-stat overview-stat--name">
<span class="overview-value">{{ getNameMatchCount() }}</span> <span class="overview-value">{{ getNameMatchCount() }}</span>
<span class="overview-label">Name</span> <span class="overview-label">{{ 'jobs.name' | translate }}</span>
</div> </div>
<div class="overview-stat overview-stat--both"> <div class="overview-stat overview-stat--both">
<span class="overview-value">{{ getBothMatchCount() }}</span> <span class="overview-value">{{ getBothMatchCount() }}</span>
<span class="overview-label">Beides</span> <span class="overview-label">{{ 'institutionPatents.both' | translate }}</span>
</div> </div>
</div> </div>
<p class="overview-hint"> <p class="overview-hint">
Wähle links ein Patent aus, um Kurzinfos und Details zu sehen. {{ 'institutionPatents.selectHint' | translate }}
</p> </p>
</div> </div>
} }
@@ -13,6 +13,8 @@ import {
import { LoadingComponent } from '../../shared/ui/loading/loading.component'; import { LoadingComponent } from '../../shared/ui/loading/loading.component';
import { PageEvent } from '@angular/material/paginator'; import { PageEvent } from '@angular/material/paginator';
import { QueryParamPaginatorComponent } from '../../shared/ui/query-param-paginator/query-param-paginator.component'; import { QueryParamPaginatorComponent } from '../../shared/ui/query-param-paginator/query-param-paginator.component';
import { TranslatePipe } from '../../shared/i18n/translate.pipe';
import { LanguageService } from '../../shared/i18n/language.service';
type SortMode = 'date' | 'title'; type SortMode = 'date' | 'title';
type SourceFilter = 'all' | 'EPO' | 'USPTO'; type SourceFilter = 'all' | 'EPO' | 'USPTO';
@@ -28,6 +30,7 @@ type OrgPatentMatchTypeFilter = 'all' | 'institution' | 'name' | 'both';
MatSelectModule, MatSelectModule,
MatIconModule, MatIconModule,
QueryParamPaginatorComponent, QueryParamPaginatorComponent,
TranslatePipe,
], ],
templateUrl: './institution-patents.component.html', templateUrl: './institution-patents.component.html',
styleUrl: './institution-patents.component.scss', styleUrl: './institution-patents.component.scss',
@@ -36,6 +39,7 @@ export class InstitutionPatentsComponent implements OnInit {
private route = inject(ActivatedRoute); private route = inject(ActivatedRoute);
private router = inject(Router); private router = inject(Router);
private patentsApi = inject(PatentsService); private patentsApi = inject(PatentsService);
private languageService = inject(LanguageService);
patents: OrgPatentEntry[] = []; patents: OrgPatentEntry[] = [];
filteredPatents: OrgPatentEntry[] = []; filteredPatents: OrgPatentEntry[] = [];
@@ -170,7 +174,7 @@ export class InstitutionPatentsComponent implements OnInit {
private sortPatents(patents: OrgPatentEntry[]): OrgPatentEntry[] { private sortPatents(patents: OrgPatentEntry[]): OrgPatentEntry[] {
if (this.sortMode === 'title') { if (this.sortMode === 'title') {
return [...patents].sort((a, b) => return [...patents].sort((a, b) =>
(a.title ?? '').localeCompare(b.title ?? '', 'de', { (a.title ?? '').localeCompare(b.title ?? '', this.languageService.language(), {
sensitivity: 'base', sensitivity: 'base',
}), }),
); );
@@ -223,7 +227,7 @@ export class InstitutionPatentsComponent implements OnInit {
} }
formatDate(date: string | null | undefined): string { formatDate(date: string | null | undefined): string {
return formatPatentDate(date); return formatPatentDate(date, this.languageService.language() === 'de' ? 'de-DE' : 'en-US');
} }
getEpoCount(): number { getEpoCount(): number {
@@ -277,11 +281,11 @@ export class InstitutionPatentsComponent implements OnInit {
getMatchTypeLabel(patent: OrgPatentEntry): string { getMatchTypeLabel(patent: OrgPatentEntry): string {
switch (patent.match_type) { switch (patent.match_type) {
case 'institution': case 'institution':
return 'Institution'; return this.languageService.translate('publications.institution');
case 'name': case 'name':
return 'Name'; return this.languageService.translate('jobs.name');
case 'both': case 'both':
return 'Beides'; return this.languageService.translate('institutionPatents.both');
default: default:
return patent.match_type; return patent.match_type;
} }
@@ -1,4 +1,4 @@
import { Component, effect, input } from '@angular/core'; import { Component, effect, inject, input } from '@angular/core';
import * as echarts from 'echarts/core'; import * as echarts from 'echarts/core';
import { EChartsOption } from 'echarts'; import { EChartsOption } from 'echarts';
@@ -7,6 +7,7 @@ import { GridComponent, LegendComponent } from 'echarts/components';
import { CanvasRenderer } from 'echarts/renderers'; import { CanvasRenderer } from 'echarts/renderers';
import { NgxEchartsDirective } from 'ngx-echarts'; import { NgxEchartsDirective } from 'ngx-echarts';
import { InstitutionFunderSummary } from '../../api'; import { InstitutionFunderSummary } from '../../api';
import { LanguageService } from '../../shared/i18n/language.service';
echarts.use([GridComponent, CanvasRenderer, LegendComponent]); echarts.use([GridComponent, CanvasRenderer, LegendComponent]);
@@ -22,6 +23,7 @@ type FunderData = {
styleUrl: './institution-projects-funding-graph.component.scss', styleUrl: './institution-projects-funding-graph.component.scss',
}) })
export class InstitutionProjectsFundingGraphComponent { export class InstitutionProjectsFundingGraphComponent {
private readonly languageService = inject(LanguageService);
options!: EChartsOption; options!: EChartsOption;
fundings = input.required<InstitutionFunderSummary[]>(); fundings = input.required<InstitutionFunderSummary[]>();
@@ -36,7 +38,7 @@ export class InstitutionProjectsFundingGraphComponent {
generateChartOptions(fundings: InstitutionFunderSummary[]): void { generateChartOptions(fundings: InstitutionFunderSummary[]): void {
const floorToTwoDecimals = (value: number): string => { const floorToTwoDecimals = (value: number): string => {
const floored = Math.floor(value * 100) / 100; const floored = Math.floor(value * 100) / 100;
return floored.toLocaleString(undefined, { return floored.toLocaleString(this.languageService.language() === 'de' ? 'de-DE' : 'en-US', {
style: 'currency', style: 'currency',
currency: 'EUR', currency: 'EUR',
minimumFractionDigits: 2, minimumFractionDigits: 2,
@@ -83,7 +85,7 @@ export class InstitutionProjectsFundingGraphComponent {
label: { label: {
show: true, show: true,
position: 'end', position: 'end',
formatter: 'Aktuelles Jahr', formatter: this.languageService.translate('institutionProjects.currentYear'),
backgroundColor: '#333', backgroundColor: '#333',
color: '#fff', color: '#fff',
padding: [4, 6], padding: [4, 6],
@@ -139,7 +141,7 @@ export class InstitutionProjectsFundingGraphComponent {
type: 'value', type: 'value',
axisLabel: { axisLabel: {
formatter: (value: number) => formatter: (value: number) =>
value.toLocaleString(undefined, { value.toLocaleString(this.languageService.language() === 'de' ? 'de-DE' : 'en-US', {
style: 'currency', style: 'currency',
currency: 'EUR', currency: 'EUR',
maximumFractionDigits: 0, maximumFractionDigits: 0,
@@ -1,5 +1,5 @@
<div class="content"> <div class="content">
<h3>Projekte</h3> <h3>{{ 'nav.projects' | translate }}</h3>
<div class="funding-area"> <div class="funding-area">
<div class="person-projects"> <div class="person-projects">
@@ -12,7 +12,7 @@
routerLinkActive routerLinkActive
#rla="routerLinkActive" #rla="routerLinkActive"
[active]="rla.isActive"> [active]="rla.isActive">
{{ route.label }} {{ route.labelKey | translate }}
</a> </a>
} }
</nav> </nav>
@@ -23,7 +23,7 @@
<div class="funding-info-section"> <div class="funding-info-section">
<mat-card appearance="outlined"> <mat-card appearance="outlined">
<mat-card-header> <mat-card-header>
<mat-card-title>Förderung über Zeit</mat-card-title> <mat-card-title>{{ 'institutionProjects.fundingOverTime' | translate }}</mat-card-title>
</mat-card-header> </mat-card-header>
<mat-card-content> <mat-card-content>
<app-institution-projects-funding-graph <app-institution-projects-funding-graph
@@ -33,28 +33,28 @@
<div class="funding-info-cards"> <div class="funding-info-cards">
<app-info-card <app-info-card
[description]="'Gesamte Förderung durch Bund'" [description]="'institutionProjects.totalFederal' | translate"
[value]=" [value]="
(bundTotalFunding() (bundTotalFunding()
| currency: 'EUR' : 'symbol' : '1.0-0' : 'de') ?? undefined | currency: 'EUR' : 'symbol' : '1.0-0' : locale()) ?? undefined
" /> " />
<app-info-card <app-info-card
[description]="'Durchschnittliche jährliche Förderung durch Bund'" [description]="'institutionProjects.averageFederal' | translate"
[value]=" [value]="
(bundAverageAnnualFunding() (bundAverageAnnualFunding()
| currency: 'EUR' : 'symbol' : '1.0-0' : 'de') ?? undefined | currency: 'EUR' : 'symbol' : '1.0-0' : locale()) ?? undefined
" /> " />
<app-info-card <app-info-card
[description]="'Gesamte Förderung durch die Europäische Union'" [description]="'institutionProjects.totalEu' | translate"
[value]=" [value]="
(euTotalFunding() (euTotalFunding()
| currency: 'EUR' : 'symbol' : '1.0-0' : 'de') ?? undefined | currency: 'EUR' : 'symbol' : '1.0-0' : locale()) ?? undefined
" /> " />
<app-info-card <app-info-card
[description]="'Durchschnittliche jährliche Förderung durch die Europäische Union'" [description]="'institutionProjects.averageEu' | translate"
[value]=" [value]="
(euAverageAnnualFunding() (euAverageAnnualFunding()
| currency: 'EUR' : 'symbol' : '1.0-0' : 'de') ?? undefined | currency: 'EUR' : 'symbol' : '1.0-0' : locale()) ?? undefined
" /> " />
</div> </div>
</div> </div>
@@ -68,7 +68,7 @@
{{ row.funding_end | date: 'dd.MM.yyyy' }} {{ row.funding_end | date: 'dd.MM.yyyy' }}
</ng-template> </ng-template>
<ng-template #fundingAmountTmp let-row> <ng-template #fundingAmountTmp let-row>
{{ row.funding_amount | currency: 'EUR' : 'symbol' : '1.0-0' : 'de' }} {{ row.funding_amount | currency: 'EUR' : 'symbol' : '1.0-0' : locale() }}
</ng-template> </ng-template>
<ng-template #euProjectActionsTmp let-row> <ng-template #euProjectActionsTmp let-row>
@@ -6,6 +6,7 @@ import {
OnInit, OnInit,
TemplateRef, TemplateRef,
viewChild, viewChild,
inject,
} from '@angular/core'; } from '@angular/core';
import { ActivatedRoute, Router, RouterModule } from '@angular/router'; import { ActivatedRoute, Router, RouterModule } from '@angular/router';
import { import {
@@ -27,6 +28,9 @@ import { MatIconModule } from '@angular/material/icon';
import { MatButtonModule } from '@angular/material/button'; import { MatButtonModule } from '@angular/material/button';
import { InstitutionProjectsFundingGraphComponent } from '../institution-projects-funding-graph/institution-projects-funding-graph.component'; import { InstitutionProjectsFundingGraphComponent } from '../institution-projects-funding-graph/institution-projects-funding-graph.component';
import { AppInfoCardComponent } from '../../shared/ui/app-info-card/app-info-card.component'; import { AppInfoCardComponent } from '../../shared/ui/app-info-card/app-info-card.component';
import { TranslatePipe } from '../../shared/i18n/translate.pipe';
import { LanguageService } from '../../shared/i18n/language.service';
import { TranslationKey } from '../../shared/i18n/translations';
type BundProjectRow = { type BundProjectRow = {
id: string; id: string;
@@ -60,11 +64,14 @@ type EuProjectRow = {
InstitutionProjectsFundingGraphComponent, InstitutionProjectsFundingGraphComponent,
AppInfoCardComponent, AppInfoCardComponent,
RouterModule, RouterModule,
TranslatePipe,
], ],
templateUrl: './institution-projects.component.html', templateUrl: './institution-projects.component.html',
styleUrl: './institution-projects.component.scss', styleUrl: './institution-projects.component.scss',
}) })
export class InstitutionProjectsComponent implements OnInit { export class InstitutionProjectsComponent implements OnInit {
private readonly languageService = inject(LanguageService);
locale = computed(() => this.languageService.language() === 'de' ? 'de-DE' : 'en-US');
fundingStartTmp = viewChild.required<TemplateRef<any>>('fundingStartTmp'); fundingStartTmp = viewChild.required<TemplateRef<any>>('fundingStartTmp');
fundingEndTmp = viewChild.required<TemplateRef<any>>('fundingEndTmp'); fundingEndTmp = viewChild.required<TemplateRef<any>>('fundingEndTmp');
fundingAmountTmp = viewChild.required<TemplateRef<any>>('fundingAmountTmp'); fundingAmountTmp = viewChild.required<TemplateRef<any>>('fundingAmountTmp');
@@ -111,15 +118,15 @@ export class InstitutionProjectsComponent implements OnInit {
readonly childRoutes = [ readonly childRoutes = [
{ {
path: 'dfg', path: 'dfg',
label: 'DFG-Projekte', labelKey: 'personProjects.dfg' as TranslationKey,
}, },
{ {
path: 'eu', path: 'eu',
label: 'EU-Projekte', labelKey: 'personProjects.eu' as TranslationKey,
}, },
{ {
path: 'bund', path: 'bund',
label: 'BUND-Projekte', labelKey: 'institutionProjects.federalProjects' as TranslationKey,
}, },
]; ];
constructor( constructor(
@@ -168,28 +175,28 @@ export class InstitutionProjectsComponent implements OnInit {
this.euProjectColumns = [ this.euProjectColumns = [
{ {
id: 'title', id: 'title',
header: 'Titel', header: this.languageService.translate('projects.columnTitle'),
type: 'accessor', type: 'accessor',
accessorKey: 'topic', accessorKey: 'topic',
}, },
{ {
id: 'funding_start', id: 'funding_start',
header: 'Förderbeginn', header: this.languageService.translate('projects.fundingStart'),
type: 'accessor', type: 'accessor',
accessorKey: 'funding_start', accessorKey: 'funding_start',
cellTemplate: this.fundingStartTmp(), cellTemplate: this.fundingStartTmp(),
}, },
{ {
id: 'funding_end', id: 'funding_end',
header: 'Förderende', header: this.languageService.translate('projects.fundingEnd'),
type: 'accessor', type: 'accessor',
accessorKey: 'funding_end', accessorKey: 'funding_end',
cellTemplate: this.fundingEndTmp(), cellTemplate: this.fundingEndTmp(),
}, },
{ {
id: 'funding_amount', id: 'funding_amount',
header: 'Fördersumme (EC)', header: this.languageService.translate('institutionProjects.fundingAmountEc'),
type: 'accessor', type: 'accessor',
accessorKey: 'funding_amount', accessorKey: 'funding_amount',
cellTemplate: this.fundingAmountTmp(), cellTemplate: this.fundingAmountTmp(),
@@ -204,27 +211,27 @@ export class InstitutionProjectsComponent implements OnInit {
this.bundProjectColumns = [ this.bundProjectColumns = [
{ {
id: 'title', id: 'title',
header: 'Titel', header: this.languageService.translate('projects.columnTitle'),
type: 'accessor', type: 'accessor',
accessorKey: 'topic', accessorKey: 'topic',
}, },
{ {
id: 'funding_start', id: 'funding_start',
header: 'Förderbeginn', header: this.languageService.translate('projects.fundingStart'),
type: 'accessor', type: 'accessor',
accessorKey: 'funding_start', accessorKey: 'funding_start',
cellTemplate: this.fundingStartTmp(), cellTemplate: this.fundingStartTmp(),
}, },
{ {
id: 'funding_end', id: 'funding_end',
header: 'Fördersende', header: this.languageService.translate('projects.fundingEnd'),
type: 'accessor', type: 'accessor',
accessorKey: 'funding_end', accessorKey: 'funding_end',
cellTemplate: this.fundingEndTmp(), cellTemplate: this.fundingEndTmp(),
}, },
{ {
id: 'funding_amount', id: 'funding_amount',
header: 'Fördersumme', header: this.languageService.translate('institutionProjects.fundingAmount'),
type: 'accessor', type: 'accessor',
accessorKey: 'funding_amount', accessorKey: 'funding_amount',
cellTemplate: this.fundingAmountTmp(), cellTemplate: this.fundingAmountTmp(),
@@ -1,13 +1,13 @@
<div class="content"> <div class="content">
<div> <div>
<h6>Publikationen</h6> <h6>{{ 'publications.publications' | translate }}</h6>
<p>Übersicht der wissenschaftlichen Veröffentlichungen.</p> <p>{{ 'institutionPublications.description' | translate }}</p>
</div> </div>
@if (canViewClassificationChart()) { @if (canViewClassificationChart()) {
<mat-accordion multi> <mat-accordion multi>
<mat-expansion-panel class="mat-elevation-z1"> <mat-expansion-panel class="mat-elevation-z1">
<mat-expansion-panel-header> <mat-expansion-panel-header>
<mat-panel-title>Forschungszwecke</mat-panel-title> <mat-panel-title>{{ 'publications.researchPurposes' | translate }}</mat-panel-title>
</mat-expansion-panel-header> </mat-expansion-panel-header>
<app-primary-category-year-aggregation-chart <app-primary-category-year-aggregation-chart
[page]="primaryCategoryYearAggregationPage()" /> [page]="primaryCategoryYearAggregationPage()" />
@@ -15,10 +15,10 @@
<mat-expansion-panel class="mat-elevation-z1" [expanded]="true"> <mat-expansion-panel class="mat-elevation-z1" [expanded]="true">
<mat-expansion-panel-header> <mat-expansion-panel-header>
<mat-panel-title>Publikationsliste</mat-panel-title> <mat-panel-title>{{ 'publications.list' | translate }}</mat-panel-title>
<mat-panel-description <mat-panel-description
>{{ total() >= 10000 ? 'mehr als' : '' }} >{{ total() >= 10000 ? ('publications.moreThan' | translate) : '' }}
{{ total() }} Publikationen</mat-panel-description {{ total() }} {{ 'publications.publications' | translate }}</mat-panel-description
> >
</mat-expansion-panel-header> </mat-expansion-panel-header>
<ng-container *ngTemplateOutlet="filterTableAndPaginator" /> <ng-container *ngTemplateOutlet="filterTableAndPaginator" />
@@ -12,6 +12,7 @@ import { PrimaryCategoryYearAggregationChartComponent } from '../../shared/ui/pr
import { MatExpansionModule } from '@angular/material/expansion'; import { MatExpansionModule } from '@angular/material/expansion';
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { ActivatedRoute } from '@angular/router'; import { ActivatedRoute } from '@angular/router';
import { TranslatePipe } from '../../shared/i18n/translate.pipe';
@Component({ @Component({
selector: 'app-institution-publications', selector: 'app-institution-publications',
@@ -22,6 +23,7 @@ import { ActivatedRoute } from '@angular/router';
PrimaryCategoryYearAggregationChartComponent, PrimaryCategoryYearAggregationChartComponent,
MatExpansionModule, MatExpansionModule,
CommonModule, CommonModule,
TranslatePipe,
], ],
templateUrl: './institution-publications.component.html', templateUrl: './institution-publications.component.html',
styleUrl: './institution-publications.component.scss', styleUrl: './institution-publications.component.scss',
@@ -4,7 +4,7 @@
<mat-card-content> <mat-card-content>
<p>{{ institution.homepage_url }}</p> <p>{{ institution.homepage_url }}</p>
<p>{{ institution.display_name_alternatives }}</p> <p>{{ institution.display_name_alternatives }}</p>
<p>And many more useful details...</p> <p>{{ 'institution.moreDetails' | translate }}</p>
</mat-card-content> </mat-card-content>
</mat-card> </mat-card>
@@ -18,7 +18,7 @@
#rla="routerLinkActive" #rla="routerLinkActive"
[active]="rla.isActive" [active]="rla.isActive"
[disabled]="link.disabled"> [disabled]="link.disabled">
{{ link.label }} {{ link.labelKey | translate }}
</a> </a>
} }
</nav> </nav>
@@ -9,8 +9,10 @@ import { Institution } from '../../api';
import { PatentsService } from '../../api/api/patents.service'; import { PatentsService } from '../../api/api/patents.service';
import { MatCardModule } from '@angular/material/card'; import { MatCardModule } from '@angular/material/card';
import { MatTabsModule } from '@angular/material/tabs'; import { MatTabsModule } from '@angular/material/tabs';
import { TranslatePipe } from '../../shared/i18n/translate.pipe';
import { TranslationKey } from '../../shared/i18n/translations';
const PATENTS_LINK = { label: 'Patente', path: 'patents', disabled: false }; const PATENTS_LINK = { labelKey: 'patents.title' as TranslationKey, path: 'patents', disabled: false };
@Component({ @Component({
selector: 'app-institution', selector: 'app-institution',
@@ -20,6 +22,7 @@ const PATENTS_LINK = { label: 'Patente', path: 'patents', disabled: false };
RouterLink, RouterLink,
RouterOutlet, RouterOutlet,
RouterLinkActive, RouterLinkActive,
TranslatePipe,
], ],
templateUrl: './institution.component.html', templateUrl: './institution.component.html',
styleUrl: './institution.component.scss', styleUrl: './institution.component.scss',
@@ -30,10 +33,10 @@ export class InstitutionComponent implements OnInit {
institution!: Institution; institution!: Institution;
links = [ links = [
{ label: 'Übersicht', path: 'overview', disabled: false }, { labelKey: 'personCard.overview' as TranslationKey, path: 'overview', disabled: false },
{ label: 'Publikationen', path: 'publications', disabled: false }, { labelKey: 'publications.publications' as TranslationKey, path: 'publications', disabled: false },
{ {
label: 'Projekte', labelKey: 'nav.projects' as TranslationKey,
path: 'projects', path: 'projects',
disabled: false, disabled: false,
queryParams: { queryParams: {
@@ -1,5 +1,5 @@
<div class="content"> <div class="content">
<h1>Passende Institutionen finden</h1> <h1>{{ 'institutions.title' | translate }}</h1>
<mat-divider /> <mat-divider />
@@ -9,9 +9,11 @@
[cardTmp]="cardTmp" [cardTmp]="cardTmp"
[observers]="observers" [observers]="observers"
[cardMinWidth]="550" [cardMinWidth]="550"
searchLabel="Suche nach Namen" [searchLabel]="'institutions.searchName' | translate"
[sortingOptions]="sortingOptions" [sortingOptions]="sortingOptions()"
[sortingDirectionOptions]="sortingDirectionOptions" /> [sortByLabel]="'personPatents.sortBy' | translate"
[sortingDirectionOptions]="sortingDirectionOptions()"
[sortingDirectionLabel]="'persons.sortOrder' | translate" />
</div> </div>
<ng-template #cardTmp let-institution> <ng-template #cardTmp let-institution>
@@ -1,4 +1,4 @@
import { Component, computed, input } from '@angular/core'; import { Component, computed, inject, input } from '@angular/core';
import { InstitutionPage } from '../../api'; import { InstitutionPage } from '../../api';
import { MatButtonModule } from '@angular/material/button'; import { MatButtonModule } from '@angular/material/button';
import { MatCardModule } from '@angular/material/card'; import { MatCardModule } from '@angular/material/card';
@@ -13,6 +13,8 @@ import {
} from '../../shared/ui/card-search/card-search.component'; } from '../../shared/ui/card-search/card-search.component';
import { FilterObserver } from '../../shared/ui/selected-filters/selected-filters.component'; import { FilterObserver } from '../../shared/ui/selected-filters/selected-filters.component';
import { AppInstitutionCardComponent } from '../../shared/ui/app-institution-card/app-institution-card.component'; import { AppInstitutionCardComponent } from '../../shared/ui/app-institution-card/app-institution-card.component';
import { TranslatePipe } from '../../shared/i18n/translate.pipe';
import { LanguageService } from '../../shared/i18n/language.service';
@Component({ @Component({
selector: 'app-institutions', selector: 'app-institutions',
@@ -24,11 +26,13 @@ import { AppInstitutionCardComponent } from '../../shared/ui/app-institution-car
RouterModule, RouterModule,
CardSearchComponent, CardSearchComponent,
AppInstitutionCardComponent, AppInstitutionCardComponent,
TranslatePipe,
], ],
templateUrl: './institutions.component.html', templateUrl: './institutions.component.html',
styleUrl: './institutions.component.scss', styleUrl: './institutions.component.scss',
}) })
export class InstitutionsComponent { export class InstitutionsComponent {
private readonly languageService = inject(LanguageService);
institutionPage = input.required<InstitutionPage>(); institutionPage = input.required<InstitutionPage>();
observers: FilterObserver[] = [ observers: FilterObserver[] = [
@@ -46,14 +50,14 @@ export class InstitutionsComponent {
elements: this.institutionPage().elements || [], elements: this.institutionPage().elements || [],
})); }));
sortingOptions: SelectorOption[] = [ sortingOptions = computed<SelectorOption[]>(() => [
{ value: 'relevance', display_name: 'Relevanz' }, { value: 'relevance', display_name: this.languageService.translate('institutions.relevance') },
{ value: 'name', display_name: 'Name' }, { value: 'name', display_name: this.languageService.translate('jobs.name') },
{ value: 'works_count', display_name: 'Anzahl Publikationen' }, { value: 'works_count', display_name: this.languageService.translate('institutions.publicationCount') },
{ value: 'citations_count', display_name: 'Anzahl Zitationen' }, { value: 'citations_count', display_name: this.languageService.translate('institutions.citationCount') },
]; ]);
sortingDirectionOptions: SelectorOption[] = [ sortingDirectionOptions = computed<SelectorOption[]>(() => [
{ value: 'asc', display_name: 'Aufsteigend' }, { value: 'asc', display_name: this.languageService.translate('persons.ascending') },
{ value: 'desc', display_name: 'Absteigend' }, { value: 'desc', display_name: this.languageService.translate('persons.descending') },
]; ]);
} }
@@ -6,15 +6,15 @@
<mat-progress-spinner <mat-progress-spinner
diameter="24" diameter="24"
mode="indeterminate"></mat-progress-spinner> mode="indeterminate"></mat-progress-spinner>
<span>Läufe werden geladen …</span> <span>{{ 'jobs.runsLoading' | translate }}</span>
</div> </div>
} @else if (runsError()) { } @else if (runsError()) {
<p class="logs-error">{{ runsError() }}</p> <p class="logs-error">{{ runsError() }}</p>
} @else if (runs().length === 0) { } @else if (runs().length === 0) {
<p class="no-logs">Für diesen Job liegt noch kein Lauf vor.</p> <p class="no-logs">{{ 'jobs.noRuns' | translate }}</p>
} @else { } @else {
<mat-form-field appearance="outline" class="run-select"> <mat-form-field appearance="outline" class="run-select">
<mat-label>Lauf auswählen</mat-label> <mat-label>{{ 'jobs.selectRun' | translate }}</mat-label>
<mat-select <mat-select
[value]="selectedRunId()" [value]="selectedRunId()"
(selectionChange)="onRunSelected($event.value)"> (selectionChange)="onRunSelected($event.value)">
@@ -35,7 +35,7 @@
<div class="logs-header"> <div class="logs-header">
<div class="run-meta"> <div class="run-meta">
<span>Lauf #{{ selectedRunId() }}</span> <span>{{ 'jobs.run' | translate }} #{{ selectedRunId() }}</span>
@if (runStatus()) { @if (runStatus()) {
<span <span
class="task-status" class="task-status"
@@ -47,13 +47,13 @@
@if (selectedRun(); as run) { @if (selectedRun(); as run) {
@if (runStatus() === 'running' || runStatus() === 'stopping') { @if (runStatus() === 'running' || runStatus() === 'stopping') {
@if (formatRunElapsed(run, nowMs()); as elapsed) { @if (formatRunElapsed(run, nowMs()); as elapsed) {
<span class="run-duration">läuft seit {{ elapsed }}</span> <span class="run-duration">{{ runningSinceLabel(elapsed) }}</span>
} }
} @else if (formatRunDuration(run); as dur) { } @else if (formatRunDuration(run); as dur) {
<span class="run-duration">Dauer: {{ dur }}</span> <span class="run-duration">{{ durationLabel(dur) }}</span>
} }
} }
<span class="logs-hint">zeigt letzte 200 Zeilen</span> <span class="logs-hint">{{ 'jobs.lastLines' | translate }}</span>
</div> </div>
<div class="logs-actions"> <div class="logs-actions">
<button <button
@@ -62,13 +62,13 @@
[disabled]="selectedRunId() == null" [disabled]="selectedRunId() == null"
(click)="downloadLogs()"> (click)="downloadLogs()">
<mat-icon>download</mat-icon> <mat-icon>download</mat-icon>
Herunterladen {{ 'jobs.download' | translate }}
</button> </button>
<button <button
mat-icon-button mat-icon-button
type="button" type="button"
aria-label="Logs aktualisieren" [attr.aria-label]="'jobs.refreshLogs' | translate"
matTooltip="Logs aktualisieren" [matTooltip]="'jobs.refreshLogs' | translate"
matTooltipPosition="above" matTooltipPosition="above"
[disabled]="loading() || runsLoading()" [disabled]="loading() || runsLoading()"
(click)="loadRuns()"> (click)="loadRuns()">
@@ -83,7 +83,7 @@
<mat-progress-spinner <mat-progress-spinner
diameter="20" diameter="20"
mode="indeterminate"></mat-progress-spinner> mode="indeterminate"></mat-progress-spinner>
<span>Logs werden geladen …</span> <span>{{ 'jobs.logsLoading' | translate }}</span>
</div> </div>
} @else { } @else {
<pre>{{ logs() }}</pre> <pre>{{ logs() }}</pre>
@@ -93,5 +93,5 @@
</mat-dialog-content> </mat-dialog-content>
<mat-dialog-actions align="end"> <mat-dialog-actions align="end">
<button mat-button type="button" (click)="close()">Schließen</button> <button mat-button type="button" (click)="close()">{{ 'common.close' | translate }}</button>
</mat-dialog-actions> </mat-dialog-actions>
@@ -29,6 +29,8 @@ import {
formatUtcDateAsLocal, formatUtcDateAsLocal,
statusMeta, statusMeta,
} from '../jobs.utils'; } from '../jobs.utils';
import { LanguageService } from '../../../shared/i18n/language.service';
import { TranslatePipe } from '../../../shared/i18n/translate.pipe';
export interface JobLogsDialogData { export interface JobLogsDialogData {
task: BackgroundJobTask; task: BackgroundJobTask;
@@ -45,6 +47,7 @@ export interface JobLogsDialogData {
MatProgressSpinnerModule, MatProgressSpinnerModule,
MatSelectModule, MatSelectModule,
MatTooltipModule, MatTooltipModule,
TranslatePipe,
], ],
templateUrl: './job-logs-dialog.component.html', templateUrl: './job-logs-dialog.component.html',
styleUrl: './job-logs-dialog.component.scss', styleUrl: './job-logs-dialog.component.scss',
@@ -54,10 +57,9 @@ export class JobLogsDialogComponent implements OnInit {
private readonly dialogRef = inject(MatDialogRef<JobLogsDialogComponent>); private readonly dialogRef = inject(MatDialogRef<JobLogsDialogComponent>);
private readonly backgroundJobsService = inject(BackgroundJobsService); private readonly backgroundJobsService = inject(BackgroundJobsService);
private readonly destroyRef = inject(DestroyRef); private readonly destroyRef = inject(DestroyRef);
private readonly languageService = inject(LanguageService);
protected readonly data = inject<JobLogsDialogData>(MAT_DIALOG_DATA); protected readonly data = inject<JobLogsDialogData>(MAT_DIALOG_DATA);
protected readonly statusMeta = statusMeta;
protected readonly formatUtcDateAsLocal = formatUtcDateAsLocal;
protected readonly formatRunDuration = formatRunDuration; protected readonly formatRunDuration = formatRunDuration;
protected readonly formatRunElapsed = formatRunElapsed; protected readonly formatRunElapsed = formatRunElapsed;
@@ -114,7 +116,7 @@ export class JobLogsDialogComponent implements OnInit {
} }
}, },
error: () => { error: () => {
this.runsError.set('Läufe konnten nicht geladen werden.'); this.runsError.set(this.languageService.translate('jobs.runsError'));
}, },
}); });
} }
@@ -162,15 +164,15 @@ export class JobLogsDialogComponent implements OnInit {
.subscribe({ .subscribe({
next: (result) => { next: (result) => {
if (!result) { if (!result) {
this.logs.set('Die Log-Anfrage hat keine Daten zurückgegeben.'); this.logs.set(this.languageService.translate('jobs.emptyLogResponse'));
return; return;
} }
this.logs.set(result.logs || 'Keine Logs vorhanden.'); this.logs.set(result.logs || this.languageService.translate('jobs.noLogs'));
this.runStatus.set(result.status); this.runStatus.set(result.status);
if (this.followTail) this.scrollToBottom(); if (this.followTail) this.scrollToBottom();
}, },
error: () => { error: () => {
this.logs.set('Logs konnten nicht geladen werden.'); this.logs.set(this.languageService.translate('jobs.logsError'));
}, },
}); });
} }
@@ -193,4 +195,26 @@ export class JobLogsDialogComponent implements OnInit {
protected close(): void { protected close(): void {
this.dialogRef.close(); this.dialogRef.close();
} }
protected statusMeta(status: string) {
const meta = statusMeta(status);
const keys: Record<string, 'jobs.statusRunning' | 'jobs.statusStopping' | 'jobs.statusSucceeded' | 'jobs.statusFailed' | 'jobs.statusStopped' | 'jobs.statusIdle'> = {
running: 'jobs.statusRunning', stopping: 'jobs.statusStopping',
succeeded: 'jobs.statusSucceeded', failed: 'jobs.statusFailed',
stopped: 'jobs.statusStopped', idle: 'jobs.statusIdle',
};
return { ...meta, label: this.languageService.translate(keys[status] ?? 'jobs.statusIdle') };
}
protected formatUtcDateAsLocal(value: string | null | undefined): string {
return formatUtcDateAsLocal(value, this.languageService.language() === 'de' ? 'de-DE' : 'en-US');
}
protected runningSinceLabel(duration: string): string {
return this.languageService.translate('jobs.runningSince', { duration });
}
protected durationLabel(duration: string): string {
return this.languageService.translate('jobs.duration', { duration });
}
} }
+38 -35
View File
@@ -1,11 +1,8 @@
<section class="jobs-page"> <section class="jobs-page">
<header class="page-header"> <header class="page-header">
<div> <div>
<h1>Jobs</h1> <h1>{{ 'jobs.title' | translate }}</h1>
<p> <p>{{ 'jobs.description' | translate }}</p>
Background-Jobs zur Aufbereitung und Indizierung der Daten manuell
ausführen oder per Cron-Zeitplan automatisieren.
</p>
</div> </div>
<button <button
mat-flat-button mat-flat-button
@@ -14,7 +11,7 @@
class="new-job-button" class="new-job-button"
(click)="openCreateDialog()"> (click)="openCreateDialog()">
<mat-icon>add</mat-icon> <mat-icon>add</mat-icon>
Neuer Job {{ 'jobs.new' | translate }}
</button> </button>
</header> </header>
@@ -33,7 +30,9 @@
<strong>Docker-Daemon</strong> <strong>Docker-Daemon</strong>
<div class="health-detail"> <div class="health-detail">
{{ {{
dockerHealth()?.reachable ? 'Erreichbar' : 'Nicht erreichbar' dockerHealth()?.reachable
? ('jobs.reachable' | translate)
: ('jobs.unreachable' | translate)
}} }}
@if (dockerHealth()?.detail) { @if (dockerHealth()?.detail) {
<span> · {{ dockerHealth()?.detail }}</span> <span> · {{ dockerHealth()?.detail }}</span>
@@ -44,8 +43,8 @@
<button <button
mat-icon-button mat-icon-button
type="button" type="button"
aria-label="Docker-Status aktualisieren" [attr.aria-label]="'jobs.refreshDocker' | translate"
matTooltip="Docker-Status aktualisieren" [matTooltip]="'jobs.refreshDocker' | translate"
[disabled]="dockerHealthLoading()" [disabled]="dockerHealthLoading()"
(click)="refreshDockerHealth()"> (click)="refreshDockerHealth()">
<mat-icon>refresh</mat-icon> <mat-icon>refresh</mat-icon>
@@ -72,12 +71,12 @@
</div> </div>
<div class="health-detail"> <div class="health-detail">
@if (registryHealthLoading() && !registryHealth()) { @if (registryHealthLoading() && !registryHealth()) {
<span>Wird geprüft …</span> <span>{{ 'jobs.checking' | translate }}</span>
} @else { } @else {
{{ {{
registryHealth()?.reachable registryHealth()?.reachable
? 'Erreichbar' ? ('jobs.reachable' | translate)
: 'Nicht erreichbar' : ('jobs.unreachable' | translate)
}} }}
@if (registryHealth()?.detail) { @if (registryHealth()?.detail) {
<span> · {{ registryHealth()?.detail }}</span> <span> · {{ registryHealth()?.detail }}</span>
@@ -89,8 +88,8 @@
<button <button
mat-icon-button mat-icon-button
type="button" type="button"
aria-label="Nexus-Status aktualisieren" [attr.aria-label]="'jobs.refreshNexus' | translate"
matTooltip="Nexus-Status aktualisieren" [matTooltip]="'jobs.refreshNexus' | translate"
[disabled]="registryHealthLoading()" [disabled]="registryHealthLoading()"
(click)="refreshRegistryHealth()"> (click)="refreshRegistryHealth()">
<mat-icon>refresh</mat-icon> <mat-icon>refresh</mat-icon>
@@ -111,8 +110,8 @@
<button <button
type="button" type="button"
class="edit-name-action" class="edit-name-action"
aria-label="Job bearbeiten" [attr.aria-label]="'jobs.edit' | translate"
matTooltip="Job bearbeiten" [matTooltip]="'jobs.edit' | translate"
matTooltipPosition="above" matTooltipPosition="above"
[disabled]="row.status === 'running' || row.status === 'stopping'" [disabled]="row.status === 'running' || row.status === 'stopping'"
(click)="openEditDialog(row)"> (click)="openEditDialog(row)">
@@ -131,16 +130,20 @@
@if (row.schedule) { @if (row.schedule) {
<span class="schedule-cron">{{ row.schedule }}</span> <span class="schedule-cron">{{ row.schedule }}</span>
} @else { } @else {
<span>Nur manuell</span> <span>{{ 'jobs.manualOnly' | translate }}</span>
} }
@if (row.next_run_at) { @if (row.next_run_at) {
<span class="next-run"> <span class="next-run">
Nächster Lauf: {{ formatUtcDateAsLocal(row.next_run_at) }} {{ nextRunLabel(row.next_run_at) }}
</span> </span>
} }
@if (row.schedule) { @if (row.schedule) {
<span class="enabled-badge" [class.enabled-badge--on]="row.enabled"> <span class="enabled-badge" [class.enabled-badge--on]="row.enabled">
{{ row.enabled ? 'Aktiv' : 'Inaktiv' }} {{
row.enabled
? ('status.active' | translate)
: ('status.inactive' | translate)
}}
</span> </span>
} }
</div> </div>
@@ -165,10 +168,10 @@
<span>{{ formatUtcDateAsLocal(row.last_run.started_at) }}</span> <span>{{ formatUtcDateAsLocal(row.last_run.started_at) }}</span>
@if (row.status === 'running' || row.status === 'stopping') { @if (row.status === 'running' || row.status === 'stopping') {
@if (formatRunElapsed(row.last_run, nowMs()); as elapsed) { @if (formatRunElapsed(row.last_run, nowMs()); as elapsed) {
<span class="last-run-message">läuft seit {{ elapsed }}</span> <span class="last-run-message">{{ runningSinceLabel(elapsed) }}</span>
} }
} @else if (formatRunDuration(row.last_run); as duration) { } @else if (formatRunDuration(row.last_run); as duration) {
<span class="last-run-message">Dauer: {{ duration }}</span> <span class="last-run-message">{{ durationLabel(duration) }}</span>
} }
@if (row.last_run.exit_code != null) { @if (row.last_run.exit_code != null) {
<span class="last-run-message" <span class="last-run-message"
@@ -177,18 +180,18 @@
} }
</div> </div>
} @else { } @else {
<span class="last-run-empty">Noch nicht ausgeführt</span> <span class="last-run-empty">{{ 'jobs.neverRun' | translate }}</span>
} }
</ng-template> </ng-template>
<ng-template #taskActionsHeaderTmp> <ng-template #taskActionsHeaderTmp>
<div class="actions-header"> <div class="actions-header">
<span>Aktionen</span> <span>{{ 'common.actions' | translate }}</span>
<button <button
mat-icon-button mat-icon-button
type="button" type="button"
aria-label="Jobs aktualisieren" [attr.aria-label]="'jobs.refresh' | translate"
matTooltip="Jobs aktualisieren" [matTooltip]="'jobs.refresh' | translate"
matTooltipPosition="above" matTooltipPosition="above"
(click)="refreshTasks()"> (click)="refreshTasks()">
<mat-icon>refresh</mat-icon> <mat-icon>refresh</mat-icon>
@@ -201,8 +204,8 @@
<button <button
mat-icon-button mat-icon-button
type="button" type="button"
aria-label="Jetzt ausführen" [attr.aria-label]="'jobs.runNow' | translate"
matTooltip="Jetzt ausführen" [matTooltip]="'jobs.runNow' | translate"
matTooltipPosition="above" matTooltipPosition="above"
[disabled]="row.status === 'running' || row.status === 'stopping'" [disabled]="row.status === 'running' || row.status === 'stopping'"
(click)="runNow(row)"> (click)="runNow(row)">
@@ -211,8 +214,8 @@
<button <button
mat-icon-button mat-icon-button
type="button" type="button"
aria-label="Stoppen" [attr.aria-label]="'jobs.stop' | translate"
matTooltip="Stoppen" [matTooltip]="'jobs.stop' | translate"
matTooltipPosition="above" matTooltipPosition="above"
[disabled]="row.status !== 'running'" [disabled]="row.status !== 'running'"
(click)="stopNow(row)"> (click)="stopNow(row)">
@@ -221,8 +224,8 @@
<button <button
mat-icon-button mat-icon-button
type="button" type="button"
aria-label="Logs anzeigen" [attr.aria-label]="'jobs.showLogs' | translate"
matTooltip="Logs anzeigen" [matTooltip]="'jobs.showLogs' | translate"
matTooltipPosition="above" matTooltipPosition="above"
[disabled]="!row.last_run" [disabled]="!row.last_run"
(click)="openLogsDialog(row)"> (click)="openLogsDialog(row)">
@@ -231,8 +234,8 @@
<button <button
mat-icon-button mat-icon-button
type="button" type="button"
aria-label="Zeitplan bearbeiten" [attr.aria-label]="'jobs.editSchedule' | translate"
matTooltip="Zeitplan bearbeiten" [matTooltip]="'jobs.editSchedule' | translate"
matTooltipPosition="above" matTooltipPosition="above"
(click)="openScheduleDialog(row)"> (click)="openScheduleDialog(row)">
<mat-icon>edit_calendar</mat-icon> <mat-icon>edit_calendar</mat-icon>
@@ -241,8 +244,8 @@
mat-icon-button mat-icon-button
type="button" type="button"
class="delete-action" class="delete-action"
aria-label="Job löschen" [attr.aria-label]="'jobs.delete' | translate"
matTooltip="Job löschen" [matTooltip]="'jobs.delete' | translate"
matTooltipPosition="above" matTooltipPosition="above"
[disabled]=" [disabled]="
row.status === 'running' || row.status === 'running' ||
+77 -32
View File
@@ -2,6 +2,8 @@ import { CommonModule } from '@angular/common';
import { import {
Component, Component,
DestroyRef, DestroyRef,
effect,
Injector,
OnInit, OnInit,
TemplateRef, TemplateRef,
inject, inject,
@@ -58,6 +60,8 @@ import {
TaskEditDialogComponent, TaskEditDialogComponent,
TaskEditDialogData, TaskEditDialogData,
} from './task-edit-dialog/task-edit-dialog.component'; } from './task-edit-dialog/task-edit-dialog.component';
import { LanguageService } from '../../shared/i18n/language.service';
import { TranslatePipe } from '../../shared/i18n/translate.pipe';
const MAX_IDLE_POLL_WAIT_MS = 60000; const MAX_IDLE_POLL_WAIT_MS = 60000;
@@ -73,6 +77,7 @@ const MAX_IDLE_POLL_WAIT_MS = 60000;
MatSnackBarModule, MatSnackBarModule,
MatTooltipModule, MatTooltipModule,
DataTableComponent, DataTableComponent,
TranslatePipe,
], ],
templateUrl: './jobs.component.html', templateUrl: './jobs.component.html',
styleUrl: './jobs.component.scss', styleUrl: './jobs.component.scss',
@@ -83,6 +88,8 @@ export class JobsComponent implements OnInit {
private readonly snackBar = inject(MatSnackBar); private readonly snackBar = inject(MatSnackBar);
private readonly backgroundJobsService = inject(BackgroundJobsService); private readonly backgroundJobsService = inject(BackgroundJobsService);
private readonly destroyRef = inject(DestroyRef); private readonly destroyRef = inject(DestroyRef);
private readonly languageService = inject(LanguageService);
private readonly injector = inject(Injector);
tasksInput = input.required<BackgroundJobTask[]>({ alias: 'tasks' }); tasksInput = input.required<BackgroundJobTask[]>({ alias: 'tasks' });
dockerHealthInput = input.required<DockerHealth>({ alias: 'dockerHealth' }); dockerHealthInput = input.required<DockerHealth>({ alias: 'dockerHealth' });
@@ -95,9 +102,7 @@ export class JobsComponent implements OnInit {
protected readonly deletingTaskIds = signal<ReadonlySet<number>>(new Set()); protected readonly deletingTaskIds = signal<ReadonlySet<number>>(new Set());
protected readonly nowMs = signal(Date.now()); protected readonly nowMs = signal(Date.now());
protected readonly statusMeta = statusMeta;
protected readonly formatScheduleCron = formatScheduleCron; protected readonly formatScheduleCron = formatScheduleCron;
protected readonly formatUtcDateAsLocal = formatUtcDateAsLocal;
protected readonly formatRunDuration = formatRunDuration; protected readonly formatRunDuration = formatRunDuration;
protected readonly formatRunElapsed = formatRunElapsed; protected readonly formatRunElapsed = formatRunElapsed;
@@ -137,7 +142,9 @@ export class JobsComponent implements OnInit {
}) })
.pipe( .pipe(
catchError(() => { catchError(() => {
this.showError('Jobs konnten nicht aktualisiert werden.'); this.showError(
this.languageService.translate('jobs.refreshError'),
);
return EMPTY; return EMPTY;
}), }),
), ),
@@ -151,34 +158,44 @@ export class JobsComponent implements OnInit {
this.syncBackgroundWork(); this.syncBackgroundWork();
effect(
() => {
this.languageService.language();
this.setTaskColumns();
},
{ injector: this.injector },
);
}
private setTaskColumns(): void {
this.taskColumns = [ this.taskColumns = [
{ {
id: 'name', id: 'name',
header: 'Job', header: this.languageService.translate('jobs.columnJob'),
type: 'display', type: 'display',
cellTemplate: this.taskNameTmp(), cellTemplate: this.taskNameTmp(),
}, },
{ {
id: 'schedule', id: 'schedule',
header: 'Zeitplan', header: this.languageService.translate('jobs.columnSchedule'),
type: 'display', type: 'display',
cellTemplate: this.taskScheduleTmp(), cellTemplate: this.taskScheduleTmp(),
}, },
{ {
id: 'status', id: 'status',
header: 'Status', header: this.languageService.translate('common.status'),
type: 'display', type: 'display',
cellTemplate: this.taskStatusTmp(), cellTemplate: this.taskStatusTmp(),
}, },
{ {
id: 'lastRun', id: 'lastRun',
header: 'Letzter Lauf', header: this.languageService.translate('jobs.columnLastRun'),
type: 'display', type: 'display',
cellTemplate: this.taskLastRunTmp(), cellTemplate: this.taskLastRunTmp(),
}, },
{ {
id: 'actions', id: 'actions',
header: 'Aktionen', header: this.languageService.translate('common.actions'),
type: 'display', type: 'display',
headerTemplate: this.taskActionsHeaderTmp(), headerTemplate: this.taskActionsHeaderTmp(),
cellTemplate: this.taskActionsTmp(), cellTemplate: this.taskActionsTmp(),
@@ -248,7 +265,7 @@ export class JobsComponent implements OnInit {
}, },
error: () => { error: () => {
this.dockerHealthLoading.set(false); this.dockerHealthLoading.set(false);
this.showError('Docker-Status konnte nicht abgerufen werden.'); this.showError(this.languageService.translate('jobs.dockerError'));
}, },
}); });
} }
@@ -265,7 +282,7 @@ export class JobsComponent implements OnInit {
}, },
error: () => { error: () => {
this.registryHealthLoading.set(false); this.registryHealthLoading.set(false);
this.showError('Nexus-Status konnte nicht abgerufen werden.'); this.showError(this.languageService.translate('jobs.nexusError'));
}, },
}); });
} }
@@ -279,7 +296,9 @@ export class JobsComponent implements OnInit {
this.registryHealth.set(health); this.registryHealth.set(health);
if (!health.reachable) { if (!health.reachable) {
this.showError( this.showError(
`Nexus-Registry nicht erreichbar: ${health.detail}. Die Image-Auswahl bleibt leer.`, this.languageService.translate('jobs.registryDown', {
detail: health.detail,
}),
); );
} }
}, },
@@ -299,11 +318,11 @@ export class JobsComponent implements OnInit {
})); }));
if (status === 'failed') { if (status === 'failed') {
this.showError( this.showError(
`„${task.name}“ ist fehlgeschlagen — Details in den Logs.`, this.languageService.translate('jobs.runFailed', { name: task.name }),
); );
this.refreshRegistryHealth(); this.refreshRegistryHealth();
} else { } else {
this.snackBar.open(`„${task.name}“ wurde gestartet.`, 'OK', { this.snackBar.open(this.languageService.translate('jobs.started', { name: task.name }), this.languageService.translate('common.ok'), {
duration: 3000, duration: 3000,
horizontalPosition: 'center', horizontalPosition: 'center',
verticalPosition: 'bottom', verticalPosition: 'bottom',
@@ -314,8 +333,8 @@ export class JobsComponent implements OnInit {
error: (error) => error: (error) =>
this.showError( this.showError(
error.status === 409 error.status === 409
? `„${task.name}“ läuft bereits.` ? this.languageService.translate('jobs.alreadyRunning', { name: task.name })
: `„${task.name}“ konnte nicht gestartet werden.`, : this.languageService.translate('jobs.startError', { name: task.name }),
), ),
}); });
} }
@@ -340,9 +359,9 @@ export class JobsComponent implements OnInit {
})); }));
const message = const message =
run.status === 'stopped' run.status === 'stopped'
? `„${task.name}“ wurde gestoppt.` ? this.languageService.translate('jobs.stopped', { name: task.name })
: `„${task.name}“ war bereits beendet.`; : this.languageService.translate('jobs.alreadyFinished', { name: task.name });
this.snackBar.open(message, 'OK', { this.snackBar.open(message, this.languageService.translate('common.ok'), {
duration: 3000, duration: 3000,
horizontalPosition: 'center', horizontalPosition: 'center',
verticalPosition: 'bottom', verticalPosition: 'bottom',
@@ -357,8 +376,8 @@ export class JobsComponent implements OnInit {
})); }));
this.showError( this.showError(
error.status === 409 error.status === 409
? `„${task.name}“ läuft nicht.` ? this.languageService.translate('jobs.notRunning', { name: task.name })
: `„${task.name}“ konnte nicht gestoppt werden.`, : this.languageService.translate('jobs.stopError', { name: task.name }),
); );
this.refreshTasks(); this.refreshTasks();
}, },
@@ -394,7 +413,7 @@ export class JobsComponent implements OnInit {
if (!task) return; if (!task) return;
this.tasks.update((tasks) => [...tasks, task]); this.tasks.update((tasks) => [...tasks, task]);
this.snackBar.open(`„${task.name}“ wurde angelegt.`, 'OK', { this.snackBar.open(this.languageService.translate('jobs.created', { name: task.name }), this.languageService.translate('common.ok'), {
duration: 3000, duration: 3000,
horizontalPosition: 'center', horizontalPosition: 'center',
verticalPosition: 'bottom', verticalPosition: 'bottom',
@@ -422,7 +441,7 @@ export class JobsComponent implements OnInit {
if (!updatedTask) return; if (!updatedTask) return;
this.updateTask(updatedTask.id, () => updatedTask); this.updateTask(updatedTask.id, () => updatedTask);
this.snackBar.open(`„${updatedTask.name}“ wurde gespeichert.`, 'OK', { this.snackBar.open(this.languageService.translate('jobs.saved', { name: updatedTask.name }), this.languageService.translate('common.ok'), {
duration: 3000, duration: 3000,
horizontalPosition: 'center', horizontalPosition: 'center',
verticalPosition: 'bottom', verticalPosition: 'bottom',
@@ -452,7 +471,7 @@ export class JobsComponent implements OnInit {
.subscribe({ .subscribe({
next: (updatedTask) => { next: (updatedTask) => {
this.updateTask(result.taskId, () => updatedTask); this.updateTask(result.taskId, () => updatedTask);
this.snackBar.open('Zeitplan wurde gespeichert.', 'OK', { this.snackBar.open(this.languageService.translate('jobs.scheduleSaved'), this.languageService.translate('common.ok'), {
duration: 3000, duration: 3000,
horizontalPosition: 'center', horizontalPosition: 'center',
verticalPosition: 'bottom', verticalPosition: 'bottom',
@@ -461,7 +480,7 @@ export class JobsComponent implements OnInit {
error: (error) => error: (error) =>
this.showError( this.showError(
error?.error?.detail ?? error?.error?.detail ??
'Zeitplan konnte nicht gespeichert werden.', this.languageService.translate('jobs.scheduleSaveError'),
), ),
}); });
}); });
@@ -481,10 +500,10 @@ export class JobsComponent implements OnInit {
width: '520px', width: '520px',
maxWidth: 'calc(100vw - 32px)', maxWidth: 'calc(100vw - 32px)',
data: { data: {
title: 'Job löschen', title: this.languageService.translate('jobs.delete'),
message: `Möchtest Du „${task.name}“ wirklich löschen? Alle Laufdaten und gespeicherten Logs werden dauerhaft gelöscht.`, message: this.languageService.translate('jobs.deleteQuestion', { name: task.name }),
confirmText: 'Löschen', confirmText: this.languageService.translate('common.remove'),
cancelText: 'Abbrechen', cancelText: this.languageService.translate('common.cancel'),
}, },
}); });
@@ -514,7 +533,7 @@ export class JobsComponent implements OnInit {
this.tasks.update((tasks) => this.tasks.update((tasks) =>
tasks.filter((current) => current.id !== task.id), tasks.filter((current) => current.id !== task.id),
); );
this.snackBar.open(`„${task.name}“ wurde gelöscht.`, 'OK', { this.snackBar.open(this.languageService.translate('jobs.deleted', { name: task.name }), this.languageService.translate('common.ok'), {
duration: 3000, duration: 3000,
horizontalPosition: 'center', horizontalPosition: 'center',
verticalPosition: 'bottom', verticalPosition: 'bottom',
@@ -525,8 +544,8 @@ export class JobsComponent implements OnInit {
this.finishDeletingTask(task.id); this.finishDeletingTask(task.id);
this.showError( this.showError(
error.status === 409 error.status === 409
? `„${task.name}“ läuft noch und kann nicht gelöscht werden.` ? this.languageService.translate('jobs.deleteRunningError', { name: task.name })
: `„${task.name}“ konnte nicht gelöscht werden.`, : this.languageService.translate('jobs.deleteError', { name: task.name }),
); );
this.refreshTasks(); this.refreshTasks();
}, },
@@ -552,10 +571,36 @@ export class JobsComponent implements OnInit {
} }
private showError(message: string): void { private showError(message: string): void {
this.snackBar.open(message, 'OK', { this.snackBar.open(message, this.languageService.translate('common.ok'), {
duration: 5000, duration: 5000,
horizontalPosition: 'center', horizontalPosition: 'center',
verticalPosition: 'bottom', verticalPosition: 'bottom',
}); });
} }
protected statusMeta(status: string) {
const meta = statusMeta(status);
const keys: Record<string, 'jobs.statusRunning' | 'jobs.statusStopping' | 'jobs.statusSucceeded' | 'jobs.statusFailed' | 'jobs.statusStopped' | 'jobs.statusIdle'> = {
running: 'jobs.statusRunning', stopping: 'jobs.statusStopping',
succeeded: 'jobs.statusSucceeded', failed: 'jobs.statusFailed',
stopped: 'jobs.statusStopped', idle: 'jobs.statusIdle',
};
return { ...meta, label: this.languageService.translate(keys[status] ?? 'jobs.statusIdle') };
}
protected formatUtcDateAsLocal(value: string | null | undefined): string {
return formatUtcDateAsLocal(value, this.languageService.language() === 'de' ? 'de-DE' : 'en-US');
}
protected nextRunLabel(value: string | null | undefined): string {
return this.languageService.translate('jobs.nextRun', { date: this.formatUtcDateAsLocal(value) });
}
protected runningSinceLabel(duration: string): string {
return this.languageService.translate('jobs.runningSince', { duration });
}
protected durationLabel(duration: string): string {
return this.languageService.translate('jobs.duration', { duration });
}
} }
+5 -2
View File
@@ -47,9 +47,12 @@ export function toUtcMs(value: string): number {
return new Date(appendUtcZ(value)).getTime(); return new Date(appendUtcZ(value)).getTime();
} }
export function formatUtcDateAsLocal(value: string | null | undefined): string { export function formatUtcDateAsLocal(
value: string | null | undefined,
locale = 'de-DE',
): string {
if (!value) return ''; if (!value) return '';
return new Intl.DateTimeFormat('de-DE', { return new Intl.DateTimeFormat(locale, {
day: '2-digit', day: '2-digit',
month: '2-digit', month: '2-digit',
year: 'numeric', year: 'numeric',
@@ -1,23 +1,23 @@
<h2 mat-dialog-title>Neuer Job</h2> <h2 mat-dialog-title>{{ 'jobs.new' | translate }}</h2>
<mat-dialog-content> <mat-dialog-content>
<form class="create-form" [formGroup]="form"> <form class="create-form" [formGroup]="form">
<mat-form-field appearance="outline"> <mat-form-field appearance="outline">
<mat-label>Name</mat-label> <mat-label>{{ 'jobs.name' | translate }}</mat-label>
<input matInput formControlName="name" /> <input matInput formControlName="name" />
<mat-icon <mat-icon
matSuffix matSuffix
class="field-info" class="field-info"
matTooltip="Eindeutiger Anzeigename des Jobs, z.B. „News-Themen-Mapping (Testlauf)“." [matTooltip]="'jobs.nameHelp' | translate"
>info_outline</mat-icon >info_outline</mat-icon
> >
@if (form.controls.name.invalid) { @if (form.controls.name.invalid) {
<mat-error>Bitte einen Namen eingeben.</mat-error> <mat-error>{{ 'jobs.nameRequired' | translate }}</mat-error>
} }
</mat-form-field> </mat-form-field>
<mat-form-field appearance="outline"> <mat-form-field appearance="outline">
<mat-label>Befehl</mat-label> <mat-label>{{ 'jobs.command' | translate }}</mat-label>
<textarea <textarea
matInput matInput
class="command-input" class="command-input"
@@ -27,13 +27,13 @@
<mat-icon <mat-icon
matSuffix matSuffix
class="field-info" class="field-info"
matTooltip="Wird beim Start direkt im Container ausgeführt — wie in einem Terminal, z.B. „python sync.py --update-keywords --target-index docker-job_test“. Leer = Standard-Befehl des Images." [matTooltip]="'jobs.commandHelp' | translate"
>info_outline</mat-icon >info_outline</mat-icon
> >
</mat-form-field> </mat-form-field>
<mat-form-field appearance="outline"> <mat-form-field appearance="outline">
<mat-label>Image</mat-label> <mat-label>{{ 'jobs.image' | translate }}</mat-label>
<input <input
matInput matInput
class="image-input" class="image-input"
@@ -47,39 +47,39 @@
<mat-icon <mat-icon
matSuffix matSuffix
class="field-info" class="field-info"
matTooltip="Docker-Image für den Job. Tippen filtert die aus Nexus verfügbaren Images; du kannst auch einen eigenen Wert eingeben. Images aus unserer Registry (docker.nes.uni-due.de) erhalten die INSE-Zugangsdaten (Elasticsearch/LLM) automatisch, fremde Images nicht." [matTooltip]="'jobs.imageHelp' | translate"
>info_outline</mat-icon >info_outline</mat-icon
> >
@if (form.controls.image.invalid && form.controls.image.touched) { @if (form.controls.image.invalid && form.controls.image.touched) {
<mat-error>Bitte ein Image auswählen oder eingeben.</mat-error> <mat-error>{{ 'jobs.imageRequired' | translate }}</mat-error>
} }
<mat-hint>Aus Nexus wählen oder eigenes Image eingeben.</mat-hint> <mat-hint>{{ 'jobs.imageHint' | translate }}</mat-hint>
</mat-form-field> </mat-form-field>
<mat-form-field appearance="outline"> <mat-form-field appearance="outline">
<mat-label>Beschreibung (optional)</mat-label> <mat-label>{{ 'jobs.descriptionOptional' | translate }}</mat-label>
<textarea matInput rows="2" formControlName="description"></textarea> <textarea matInput rows="2" formControlName="description"></textarea>
<mat-icon <mat-icon
matSuffix matSuffix
class="field-info" class="field-info"
matTooltip="Freitext für die Job-Tabelle: Was macht der Job, was sollte man vor dem Start wissen?" [matTooltip]="'jobs.descriptionHelp' | translate"
>info_outline</mat-icon >info_outline</mat-icon
> >
</mat-form-field> </mat-form-field>
<mat-form-field appearance="outline"> <mat-form-field appearance="outline">
<mat-label>Ziel-Index (optional)</mat-label> <mat-label>{{ 'jobs.targetIndexOptional' | translate }}</mat-label>
<input matInput formControlName="targetIndex" /> <input matInput formControlName="targetIndex" />
<mat-icon <mat-icon
matSuffix matSuffix
class="field-info" class="field-info"
matTooltip="Reine Anzeige-Info in der Tabelle. In welchen Index der Job wirklich schreibt, bestimmt allein der Befehl (z.B. --target-index / --output-index)." [matTooltip]="'jobs.targetHelp' | translate"
>info_outline</mat-icon >info_outline</mat-icon
> >
</mat-form-field> </mat-form-field>
<mat-form-field appearance="outline"> <mat-form-field appearance="outline">
<mat-label>Umgebungsvariablen (optional)</mat-label> <mat-label>{{ 'jobs.environmentOptional' | translate }}</mat-label>
<textarea <textarea
matInput matInput
rows="3" rows="3"
@@ -88,12 +88,12 @@
<mat-icon <mat-icon
matSuffix matSuffix
class="field-info" class="field-info"
matTooltip="Zusätzliche Umgebungsvariablen für den Container, eine pro Zeile im Format KEY=value. Das Standard-Image bekommt die INSE-Zugangsdaten (Elasticsearch/LLM) automatisch — hier ist nur Spezielles nötig." [matTooltip]="'jobs.envHelp' | translate"
>info_outline</mat-icon >info_outline</mat-icon
> >
<mat-hint>Eine Variable pro Zeile im Format KEY=value.</mat-hint> <mat-hint>{{ 'jobs.envHint' | translate }}</mat-hint>
@if (form.controls.env.hasError('invalidEnv')) { @if (form.controls.env.hasError('invalidEnv')) {
<mat-error>Ungültige Zeile — Format: KEY=value.</mat-error> <mat-error>{{ 'jobs.envInvalid' | translate }}</mat-error>
} }
</mat-form-field> </mat-form-field>
</form> </form>
@@ -104,7 +104,7 @@
</mat-dialog-content> </mat-dialog-content>
<mat-dialog-actions align="end"> <mat-dialog-actions align="end">
<button mat-button type="button" (click)="close()">Abbrechen</button> <button mat-button type="button" (click)="close()">{{ 'common.cancel' | translate }}</button>
<button <button
mat-flat-button mat-flat-button
color="primary" color="primary"
@@ -112,6 +112,6 @@
[disabled]="creating()" [disabled]="creating()"
(click)="submit()"> (click)="submit()">
<mat-icon>add</mat-icon> <mat-icon>add</mat-icon>
Anlegen {{ 'jobs.create' | translate }}
</button> </button>
</mat-dialog-actions> </mat-dialog-actions>
@@ -15,6 +15,8 @@ import { MatIconModule } from '@angular/material/icon';
import { MatInputModule } from '@angular/material/input'; import { MatInputModule } from '@angular/material/input';
import { MatTooltipModule } from '@angular/material/tooltip'; import { MatTooltipModule } from '@angular/material/tooltip';
import { BackgroundJobTask, BackgroundJobsService } from '../../../api'; import { BackgroundJobTask, BackgroundJobsService } from '../../../api';
import { LanguageService } from '../../../shared/i18n/language.service';
import { TranslatePipe } from '../../../shared/i18n/translate.pipe';
const ENV_LINE_PATTERN = /^[A-Za-z_][A-Za-z0-9_]*=.*$/; const ENV_LINE_PATTERN = /^[A-Za-z_][A-Za-z0-9_]*=.*$/;
@@ -30,6 +32,7 @@ const ENV_LINE_PATTERN = /^[A-Za-z_][A-Za-z0-9_]*=.*$/;
MatIconModule, MatIconModule,
MatInputModule, MatInputModule,
MatTooltipModule, MatTooltipModule,
TranslatePipe,
], ],
templateUrl: './task-create-dialog.component.html', templateUrl: './task-create-dialog.component.html',
styleUrl: './task-create-dialog.component.scss', styleUrl: './task-create-dialog.component.scss',
@@ -41,6 +44,7 @@ export class TaskCreateDialogComponent implements OnInit {
MatDialogRef<TaskCreateDialogComponent, BackgroundJobTask | undefined> MatDialogRef<TaskCreateDialogComponent, BackgroundJobTask | undefined>
>(MatDialogRef); >(MatDialogRef);
private readonly backgroundJobsService = inject(BackgroundJobsService); private readonly backgroundJobsService = inject(BackgroundJobsService);
private readonly languageService = inject(LanguageService);
protected readonly creating = signal(false); protected readonly creating = signal(false);
protected readonly serverError = signal(''); protected readonly serverError = signal('');
@@ -119,7 +123,7 @@ export class TaskCreateDialogComponent implements OnInit {
this.serverError.set( this.serverError.set(
typeof detail === 'string' typeof detail === 'string'
? detail ? detail
: 'Der Job konnte nicht angelegt werden.', : this.languageService.translate('jobs.createError'),
); );
}, },
}); });
@@ -1,23 +1,23 @@
<h2 mat-dialog-title>Job bearbeiten</h2> <h2 mat-dialog-title>{{ 'jobs.edit' | translate }}</h2>
<mat-dialog-content> <mat-dialog-content>
<form class="edit-form" [formGroup]="form"> <form class="edit-form" [formGroup]="form">
<mat-form-field appearance="outline"> <mat-form-field appearance="outline">
<mat-label>Name</mat-label> <mat-label>{{ 'jobs.name' | translate }}</mat-label>
<input matInput formControlName="name" /> <input matInput formControlName="name" />
<mat-icon <mat-icon
matSuffix matSuffix
class="field-info" class="field-info"
matTooltip="Eindeutiger Anzeigename des Jobs, z.B. „News-Themen-Mapping (Testlauf)“." [matTooltip]="'jobs.nameHelp' | translate"
>info_outline</mat-icon >info_outline</mat-icon
> >
@if (form.controls.name.invalid) { @if (form.controls.name.invalid) {
<mat-error>Bitte einen Namen eingeben.</mat-error> <mat-error>{{ 'jobs.nameRequired' | translate }}</mat-error>
} }
</mat-form-field> </mat-form-field>
<mat-form-field appearance="outline"> <mat-form-field appearance="outline">
<mat-label>Befehl</mat-label> <mat-label>{{ 'jobs.command' | translate }}</mat-label>
<textarea <textarea
matInput matInput
class="command-input" class="command-input"
@@ -27,13 +27,13 @@
<mat-icon <mat-icon
matSuffix matSuffix
class="field-info" class="field-info"
matTooltip="Wird beim Start direkt im Container ausgeführt — wie in einem Terminal, z.B. „python sync.py --update-keywords --target-index docker-job_test“. Leer = Standard-Befehl des Images." [matTooltip]="'jobs.commandHelp' | translate"
>info_outline</mat-icon >info_outline</mat-icon
> >
</mat-form-field> </mat-form-field>
<mat-form-field appearance="outline"> <mat-form-field appearance="outline">
<mat-label>Image</mat-label> <mat-label>{{ 'jobs.image' | translate }}</mat-label>
<input <input
matInput matInput
class="image-input" class="image-input"
@@ -47,39 +47,39 @@
<mat-icon <mat-icon
matSuffix matSuffix
class="field-info" class="field-info"
matTooltip="Docker-Image für den Job. Tippen filtert die aus Nexus verfügbaren Images; du kannst auch einen eigenen Wert eingeben. Images aus unserer Registry (docker.nes.uni-due.de) erhalten die INSE-Zugangsdaten (Elasticsearch/LLM) automatisch, fremde Images nicht." [matTooltip]="'jobs.imageHelp' | translate"
>info_outline</mat-icon >info_outline</mat-icon
> >
@if (form.controls.image.invalid && form.controls.image.touched) { @if (form.controls.image.invalid && form.controls.image.touched) {
<mat-error>Bitte ein Image auswählen oder eingeben.</mat-error> <mat-error>{{ 'jobs.imageRequired' | translate }}</mat-error>
} }
<mat-hint>Aus Nexus wählen oder eigenes Image eingeben.</mat-hint> <mat-hint>{{ 'jobs.imageHint' | translate }}</mat-hint>
</mat-form-field> </mat-form-field>
<mat-form-field appearance="outline"> <mat-form-field appearance="outline">
<mat-label>Beschreibung (optional)</mat-label> <mat-label>{{ 'jobs.descriptionOptional' | translate }}</mat-label>
<textarea matInput rows="2" formControlName="description"></textarea> <textarea matInput rows="2" formControlName="description"></textarea>
<mat-icon <mat-icon
matSuffix matSuffix
class="field-info" class="field-info"
matTooltip="Freitext für die Job-Tabelle: Was macht der Job, was sollte man vor dem Start wissen?" [matTooltip]="'jobs.descriptionHelp' | translate"
>info_outline</mat-icon >info_outline</mat-icon
> >
</mat-form-field> </mat-form-field>
<mat-form-field appearance="outline"> <mat-form-field appearance="outline">
<mat-label>Ziel-Index (optional)</mat-label> <mat-label>{{ 'jobs.targetIndexOptional' | translate }}</mat-label>
<input matInput formControlName="targetIndex" /> <input matInput formControlName="targetIndex" />
<mat-icon <mat-icon
matSuffix matSuffix
class="field-info" class="field-info"
matTooltip="Reine Anzeige-Info in der Tabelle. In welchen Index der Job wirklich schreibt, bestimmt allein der Befehl (z.B. --target-index / --output-index)." [matTooltip]="'jobs.targetHelp' | translate"
>info_outline</mat-icon >info_outline</mat-icon
> >
</mat-form-field> </mat-form-field>
<mat-form-field appearance="outline"> <mat-form-field appearance="outline">
<mat-label>Umgebungsvariablen (optional)</mat-label> <mat-label>{{ 'jobs.environmentOptional' | translate }}</mat-label>
<textarea <textarea
matInput matInput
rows="3" rows="3"
@@ -88,12 +88,12 @@
<mat-icon <mat-icon
matSuffix matSuffix
class="field-info" class="field-info"
matTooltip="Zusätzliche Umgebungsvariablen für den Container, eine pro Zeile im Format KEY=value. Das Standard-Image bekommt die INSE-Zugangsdaten (Elasticsearch/LLM) automatisch — hier ist nur Spezielles nötig." [matTooltip]="'jobs.envHelp' | translate"
>info_outline</mat-icon >info_outline</mat-icon
> >
<mat-hint>Eine Variable pro Zeile im Format KEY=value.</mat-hint> <mat-hint>{{ 'jobs.envHint' | translate }}</mat-hint>
@if (form.controls.env.hasError('invalidEnv')) { @if (form.controls.env.hasError('invalidEnv')) {
<mat-error>Ungültige Zeile — Format: KEY=value.</mat-error> <mat-error>{{ 'jobs.envInvalid' | translate }}</mat-error>
} }
</mat-form-field> </mat-form-field>
</form> </form>
@@ -104,7 +104,7 @@
</mat-dialog-content> </mat-dialog-content>
<mat-dialog-actions align="end"> <mat-dialog-actions align="end">
<button mat-button type="button" (click)="close()">Abbrechen</button> <button mat-button type="button" (click)="close()">{{ 'common.cancel' | translate }}</button>
<button <button
mat-flat-button mat-flat-button
color="primary" color="primary"
@@ -112,6 +112,6 @@
[disabled]="saving()" [disabled]="saving()"
(click)="submit()"> (click)="submit()">
<mat-icon>save</mat-icon> <mat-icon>save</mat-icon>
Speichern {{ 'common.save' | translate }}
</button> </button>
</mat-dialog-actions> </mat-dialog-actions>
@@ -19,6 +19,8 @@ import { MatIconModule } from '@angular/material/icon';
import { MatInputModule } from '@angular/material/input'; import { MatInputModule } from '@angular/material/input';
import { MatTooltipModule } from '@angular/material/tooltip'; import { MatTooltipModule } from '@angular/material/tooltip';
import { BackgroundJobTask, BackgroundJobsService } from '../../../api'; import { BackgroundJobTask, BackgroundJobsService } from '../../../api';
import { LanguageService } from '../../../shared/i18n/language.service';
import { TranslatePipe } from '../../../shared/i18n/translate.pipe';
const ENV_LINE_PATTERN = /^[A-Za-z_][A-Za-z0-9_]*=.*$/; const ENV_LINE_PATTERN = /^[A-Za-z_][A-Za-z0-9_]*=.*$/;
@@ -38,6 +40,7 @@ export interface TaskEditDialogData {
MatIconModule, MatIconModule,
MatInputModule, MatInputModule,
MatTooltipModule, MatTooltipModule,
TranslatePipe,
], ],
templateUrl: './task-edit-dialog.component.html', templateUrl: './task-edit-dialog.component.html',
styleUrl: './task-edit-dialog.component.scss', styleUrl: './task-edit-dialog.component.scss',
@@ -49,6 +52,7 @@ export class TaskEditDialogComponent implements OnInit {
MatDialogRef<TaskEditDialogComponent, BackgroundJobTask | undefined> MatDialogRef<TaskEditDialogComponent, BackgroundJobTask | undefined>
>(MatDialogRef); >(MatDialogRef);
private readonly backgroundJobsService = inject(BackgroundJobsService); private readonly backgroundJobsService = inject(BackgroundJobsService);
private readonly languageService = inject(LanguageService);
protected readonly data = inject<TaskEditDialogData>(MAT_DIALOG_DATA); protected readonly data = inject<TaskEditDialogData>(MAT_DIALOG_DATA);
protected readonly saving = signal(false); protected readonly saving = signal(false);
@@ -135,7 +139,7 @@ export class TaskEditDialogComponent implements OnInit {
this.serverError.set( this.serverError.set(
typeof detail === 'string' typeof detail === 'string'
? detail ? detail
: 'Der Job konnte nicht gespeichert werden.', : this.languageService.translate('jobs.saveError'),
); );
}, },
}); });
@@ -5,30 +5,30 @@
<form class="schedule-form" [formGroup]="form"> <form class="schedule-form" [formGroup]="form">
<mat-form-field appearance="outline"> <mat-form-field appearance="outline">
<mat-label>Ausführung</mat-label> <mat-label>{{ 'jobs.scheduleExecution' | translate }}</mat-label>
<mat-select formControlName="mode" panelClass="schedule-mode-panel"> <mat-select formControlName="mode" panelClass="schedule-mode-panel">
<mat-option value="manual">Nur manuell</mat-option> <mat-option value="manual">{{ 'jobs.manualOnly' | translate }}</mat-option>
<mat-option value="hourly">Stündlich</mat-option> <mat-option value="hourly">{{ 'jobs.hourly' | translate }}</mat-option>
<mat-option value="daily">Täglich</mat-option> <mat-option value="daily">{{ 'jobs.daily' | translate }}</mat-option>
<mat-option value="weekly">Wöchentlich</mat-option> <mat-option value="weekly">{{ 'jobs.weekly' | translate }}</mat-option>
<mat-option value="monthly">Monatlich</mat-option> <mat-option value="monthly">{{ 'jobs.monthly' | translate }}</mat-option>
<mat-option value="advanced">Erweiterter Cron-Ausdruck</mat-option> <mat-option value="advanced">{{ 'jobs.advancedCron' | translate }}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
@switch (form.controls.mode.value) { @switch (form.controls.mode.value) {
@case ('hourly') { @case ('hourly') {
<mat-form-field appearance="outline"> <mat-form-field appearance="outline">
<mat-label>Minute der Stunde</mat-label> <mat-label>{{ 'jobs.minute' | translate }}</mat-label>
<input <input
matInput matInput
type="number" type="number"
min="0" min="0"
max="59" max="59"
formControlName="minute" /> formControlName="minute" />
<mat-hint>Angabe in UTC, zwischen 0 und 59.</mat-hint> <mat-hint>{{ 'jobs.minuteHint' | translate }}</mat-hint>
@if (form.controls.minute.invalid) { @if (form.controls.minute.invalid) {
<mat-error>Bitte eine Minute zwischen 0 und 59 eingeben.</mat-error> <mat-error>{{ 'jobs.minuteError' | translate }}</mat-error>
} }
</mat-form-field> </mat-form-field>
} }
@@ -38,9 +38,9 @@
@case ('weekly') { @case ('weekly') {
<div class="schedule-fields"> <div class="schedule-fields">
<mat-form-field appearance="outline"> <mat-form-field appearance="outline">
<mat-label>Wochentag</mat-label> <mat-label>{{ 'jobs.weekday' | translate }}</mat-label>
<mat-select formControlName="weekday"> <mat-select formControlName="weekday">
@for (weekday of weekdays; track weekday.value) { @for (weekday of weekdays(); track weekday.value) {
<mat-option [value]="weekday.value"> <mat-option [value]="weekday.value">
{{ weekday.label }} {{ weekday.label }}
</mat-option> </mat-option>
@@ -53,7 +53,7 @@
@case ('monthly') { @case ('monthly') {
<div class="schedule-fields"> <div class="schedule-fields">
<mat-form-field appearance="outline"> <mat-form-field appearance="outline">
<mat-label>Tag des Monats</mat-label> <mat-label>{{ 'jobs.monthDay' | translate }}</mat-label>
<input <input
matInput matInput
type="number" type="number"
@@ -61,7 +61,7 @@
max="31" max="31"
formControlName="monthDay" /> formControlName="monthDay" />
@if (form.controls.monthDay.invalid) { @if (form.controls.monthDay.invalid) {
<mat-error>Bitte einen Tag zwischen 1 und 31 eingeben.</mat-error> <mat-error>{{ 'jobs.monthDayError' | translate }}</mat-error>
} }
</mat-form-field> </mat-form-field>
<ng-container *ngTemplateOutlet="timeField"></ng-container> <ng-container *ngTemplateOutlet="timeField"></ng-container>
@@ -72,14 +72,14 @@
} }
@case ('advanced') { @case ('advanced') {
<mat-form-field appearance="outline"> <mat-form-field appearance="outline">
<mat-label>Cron-Ausdruck (UTC)</mat-label> <mat-label>{{ 'jobs.cron' | translate }}</mat-label>
<input <input
matInput matInput
formControlName="cronExpression" formControlName="cronExpression"
placeholder="0 3 * * *" /> placeholder="0 3 * * *" />
<mat-hint>Minute · Stunde · Tag · Monat · Wochentag</mat-hint> <mat-hint>{{ 'jobs.cronHint' | translate }}</mat-hint>
@if (form.controls.cronExpression.hasError('invalidCron')) { @if (form.controls.cronExpression.hasError('invalidCron')) {
<mat-error>Ungültiger Cron-Ausdruck, z. B. „0 3 * * *“.</mat-error> <mat-error>{{ 'jobs.cronError' | translate }}</mat-error>
} }
</mat-form-field> </mat-form-field>
} }
@@ -92,12 +92,12 @@
class="enabled-toggle" class="enabled-toggle"
[class.enabled-toggle--on]="form.controls.enabled.value" [class.enabled-toggle--on]="form.controls.enabled.value"
[attr.aria-checked]="form.controls.enabled.value" [attr.aria-checked]="form.controls.enabled.value"
aria-label="Automatische Ausführung" [attr.aria-label]="'jobs.autoExecution' | translate"
(click)="form.controls.enabled.setValue(!form.controls.enabled.value)"> (click)="form.controls.enabled.setValue(!form.controls.enabled.value)">
<span class="enabled-toggle__track"> <span class="enabled-toggle__track">
<span class="enabled-toggle__thumb"></span> <span class="enabled-toggle__thumb"></span>
</span> </span>
<span class="enabled-toggle__label">Automatische Ausführung aktiv</span> <span class="enabled-toggle__label">{{ 'jobs.autoExecutionActive' | translate }}</span>
</button> </button>
} }
@@ -110,10 +110,10 @@
<ng-template #timeField> <ng-template #timeField>
<mat-form-field appearance="outline"> <mat-form-field appearance="outline">
<mat-label>Uhrzeit (UTC)</mat-label> <mat-label>{{ 'jobs.timeUtc' | translate }}</mat-label>
<input matInput type="time" formControlName="time" /> <input matInput type="time" formControlName="time" />
@if (form.controls.time.invalid) { @if (form.controls.time.invalid) {
<mat-error>Bitte eine gültige Uhrzeit eingeben.</mat-error> <mat-error>{{ 'jobs.timeError' | translate }}</mat-error>
} }
</mat-form-field> </mat-form-field>
</ng-template> </ng-template>
@@ -121,9 +121,9 @@
</mat-dialog-content> </mat-dialog-content>
<mat-dialog-actions align="end"> <mat-dialog-actions align="end">
<button mat-button type="button" (click)="close()">Abbrechen</button> <button mat-button type="button" (click)="close()">{{ 'common.cancel' | translate }}</button>
<button mat-flat-button color="primary" type="button" (click)="submit()"> <button mat-flat-button color="primary" type="button" (click)="submit()">
<mat-icon>save</mat-icon> <mat-icon>save</mat-icon>
Speichern {{ 'common.save' | translate }}
</button> </button>
</mat-dialog-actions> </mat-dialog-actions>
@@ -1,5 +1,5 @@
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { Component, inject } from '@angular/core'; import { Component, computed, inject } from '@angular/core';
import { import {
FormControl, FormControl,
FormGroup, FormGroup,
@@ -18,6 +18,8 @@ import { MatInputModule } from '@angular/material/input';
import { MatSelectModule } from '@angular/material/select'; import { MatSelectModule } from '@angular/material/select';
import { BackgroundJobTask } from '../../../api'; import { BackgroundJobTask } from '../../../api';
import { formatUtcDateAsLocal } from '../jobs.utils'; import { formatUtcDateAsLocal } from '../jobs.utils';
import { LanguageService } from '../../../shared/i18n/language.service';
import { TranslatePipe } from '../../../shared/i18n/translate.pipe';
export interface TaskScheduleDialogData { export interface TaskScheduleDialogData {
task: BackgroundJobTask; task: BackgroundJobTask;
@@ -121,12 +123,14 @@ function toTime(hour: string, minute: string): string {
MatIconModule, MatIconModule,
MatInputModule, MatInputModule,
MatSelectModule, MatSelectModule,
TranslatePipe,
], ],
templateUrl: './task-schedule-dialog.component.html', templateUrl: './task-schedule-dialog.component.html',
styleUrl: './task-schedule-dialog.component.scss', styleUrl: './task-schedule-dialog.component.scss',
standalone: true, standalone: true,
}) })
export class TaskScheduleDialogComponent { export class TaskScheduleDialogComponent {
private readonly languageService = inject(LanguageService);
private readonly dialogRef = private readonly dialogRef =
inject< inject<
MatDialogRef< MatDialogRef<
@@ -135,7 +139,19 @@ export class TaskScheduleDialogComponent {
> >
>(MatDialogRef); >(MatDialogRef);
protected readonly data = inject<TaskScheduleDialogData>(MAT_DIALOG_DATA); protected readonly data = inject<TaskScheduleDialogData>(MAT_DIALOG_DATA);
protected readonly weekdays = WEEKDAYS; protected readonly weekdays = computed(() =>
WEEKDAYS.map((day, index) => ({
...day,
label: this.languageService.translate(
[
'jobs.monday', 'jobs.tuesday', 'jobs.wednesday', 'jobs.thursday',
'jobs.friday', 'jobs.saturday', 'jobs.sunday',
][index] as
| 'jobs.monday' | 'jobs.tuesday' | 'jobs.wednesday'
| 'jobs.thursday' | 'jobs.friday' | 'jobs.saturday' | 'jobs.sunday',
),
})),
);
protected readonly formatUtcDateAsLocal = formatUtcDateAsLocal; protected readonly formatUtcDateAsLocal = formatUtcDateAsLocal;
private readonly initialSchedule = parseSchedule(this.data.task.schedule); private readonly initialSchedule = parseSchedule(this.data.task.schedule);
@@ -423,16 +423,16 @@ export class KeywordsSearchComponent {
limit: undefined, limit: undefined,
}; };
this.statusMessage.set('Files uploaded. Extracting keywords...'); this.statusMessage.set('Dateien hochgeladen. Keywords werden extrahiert...');
this.websocketService this.websocketService
.sendRequest(keywordsRequest) .sendRequest(keywordsRequest)
.then(() => { .then(() => {
this.statusMessage.set('Extracting keywords...'); this.statusMessage.set('Keywords werden extrahiert...');
}) })
.catch((err) => { .catch((err) => {
console.error('WebSocket error: OPA', err); console.error('WebSocket error: OPA', err);
this.errorMessage.set('Failed to send content'); this.errorMessage.set('Inhalt konnte nicht gesendet werden');
this.isExtracting.set(false); this.isExtracting.set(false);
}); });
} }
@@ -3,22 +3,24 @@
type="button" type="button"
class="back-link" class="back-link"
(click)="navigateBack()" (click)="navigateBack()"
aria-label="Zurück zu den Nachrichten"> [attr.aria-label]="'news.back' | translate">
<mat-icon>arrow_back</mat-icon> <mat-icon>arrow_back</mat-icon>
Alle Nachrichten {{ 'news.all' | translate }}
</button> </button>
@if (loading) { @if (loading) {
<div class="state"> <div class="state">
<mat-spinner diameter="42"></mat-spinner> <mat-spinner diameter="42"></mat-spinner>
<p>Nachricht wird geladen...</p> <p>{{ 'news.loading' | translate }}</p>
</div> </div>
} @else if (notFound || !article) { } @else if (notFound || !article) {
<div class="state error-state"> <div class="state error-state">
<mat-icon>search_off</mat-icon> <mat-icon>search_off</mat-icon>
<h2>Nachricht nicht gefunden</h2> <h2>{{ 'news.notFound' | translate }}</h2>
<p>Der Artikel konnte nicht geladen werden.</p> <p>{{ 'news.articleLoadError' | translate }}</p>
<a mat-stroked-button routerLink="/persons">Zur Personensuche</a> <a mat-stroked-button routerLink="/persons">
{{ 'news.peopleSearch' | translate }}
</a>
</div> </div>
} @else { } @else {
<div class="detail-layout"> <div class="detail-layout">
@@ -32,22 +34,24 @@
<span>{{ formatDate(article.date) }}</span> <span>{{ formatDate(article.date) }}</span>
} }
</div> </div>
<p class="article-heading">{{ article.maintitle || 'Kein Titel' }}</p> <p class="article-heading">
{{ article.maintitle || ('news.noTitle' | translate) }}
</p>
@if (article.relevant === true) { @if (article.relevant === true) {
<span class="relevance-badge is-relevant"> <span class="relevance-badge is-relevant">
<mat-icon>check_circle</mat-icon> <mat-icon>check_circle</mat-icon>
Relevant {{ 'news.relevant' | translate }}
</span> </span>
} @else if (article.relevant === false) { } @else if (article.relevant === false) {
<span class="relevance-badge not-relevant"> <span class="relevance-badge not-relevant">
<mat-icon>cancel</mat-icon> <mat-icon>cancel</mat-icon>
Nicht relevant {{ 'news.notRelevant' | translate }}
</span> </span>
} @else { } @else {
<span class="relevance-badge undetermined"> <span class="relevance-badge undetermined">
<mat-icon>help</mat-icon> <mat-icon>help</mat-icon>
Relevanz nicht bestimmt {{ 'news.relevanceUndetermined' | translate }}
</span> </span>
} }
</header> </header>
@@ -59,7 +63,7 @@
class="content" class="content"
[innerHTML]="highlightedContent"></p> [innerHTML]="highlightedContent"></p>
} @else { } @else {
<p class="placeholder">Kein Inhalt verfügbar.</p> <p class="placeholder">{{ 'news.noContent' | translate }}</p>
} }
</div> </div>
@@ -71,7 +75,7 @@
target="_blank" target="_blank"
rel="noopener"> rel="noopener">
<mat-icon>open_in_new</mat-icon> <mat-icon>open_in_new</mat-icon>
Originalartikel öffnen {{ 'news.openOriginal' | translate }}
</a> </a>
</div> </div>
} }
@@ -86,10 +90,12 @@
(click)="openPanel = openPanel === 'persons' ? null : 'persons'" (click)="openPanel = openPanel === 'persons' ? null : 'persons'"
[attr.aria-expanded]="openPanel === 'persons'"> [attr.aria-expanded]="openPanel === 'persons'">
<mat-icon>group</mat-icon> <mat-icon>group</mat-icon>
<span class="accordion-title">Erwähnte Personen</span> <span class="accordion-title">
{{ 'news.mentionedPeople' | translate }}
</span>
<mat-icon <mat-icon
class="info-icon" class="info-icon"
matTooltip="Personen, die im Text erwähnt wurden. Klicke auf eine der UDE angehörige Person, um zu ihrem Profil zu gelangen." [matTooltip]="'news.mentionedPeopleHelp' | translate"
matTooltipPosition="above" matTooltipPosition="above"
(click)="$event.stopPropagation()" (click)="$event.stopPropagation()"
>info_outline</mat-icon >info_outline</mat-icon
@@ -154,7 +160,9 @@
</div> </div>
} }
} @else { } @else {
<p class="placeholder">Keine erwähnten Personen gefunden.</p> <p class="placeholder">
{{ 'news.noMentionedPeople' | translate }}
</p>
} }
</div> </div>
} }
@@ -169,10 +177,12 @@
(click)="openPanel = openPanel === 'topics' ? null : 'topics'" (click)="openPanel = openPanel === 'topics' ? null : 'topics'"
[attr.aria-expanded]="openPanel === 'topics'"> [attr.aria-expanded]="openPanel === 'topics'">
<mat-icon>label</mat-icon> <mat-icon>label</mat-icon>
<span class="accordion-title">Themen & Schlüsselwörter</span> <span class="accordion-title">
{{ 'news.topicsAndKeywords' | translate }}
</span>
<mat-icon <mat-icon
class="info-icon" class="info-icon"
matTooltip="Themen, die mit den extrahierten Schlüsselwörtern des Artikels assoziiert werden. Klicke auf ein Schlüsselwort, um zum hervorgehobenen Begriff im Text zu springen." [matTooltip]="'news.topicsHelp' | translate"
matTooltipPosition="above" matTooltipPosition="above"
(click)="$event.stopPropagation()" (click)="$event.stopPropagation()"
>info_outline</mat-icon >info_outline</mat-icon
@@ -213,12 +223,12 @@
<div class="topic-item-body"> <div class="topic-item-body">
@if (topic.source_keyword) { @if (topic.source_keyword) {
<p class="kw-suggestion-label"> <p class="kw-suggestion-label">
Vorgeschlagen durch das Schlüsselwort im Text: {{ 'news.suggestedByKeyword' | translate }}
</p> </p>
<button <button
mat-icon-button mat-icon-button
class="analyse-btn" class="analyse-btn"
matTooltip="Suche nach dem Schlüsselwort" [matTooltip]="'news.searchKeyword' | translate"
(click)="analyseKeyword(topic.source_keyword)"> (click)="analyseKeyword(topic.source_keyword)">
<mat-icon>search</mat-icon> <mat-icon>search</mat-icon>
</button> </button>
@@ -229,12 +239,11 @@
»{{ topic.source_keyword }}« »{{ topic.source_keyword }}«
</button> </button>
<p class="kw-hint"> <p class="kw-hint">
Im Artikel hervorgehoben · klicken zum Suche zu {{ 'news.keywordHint' | translate }}
öffnen
</p> </p>
} @else { } @else {
<p class="placeholder"> <p class="placeholder">
Kein Schlüsselwort verknüpft. {{ 'news.noLinkedKeyword' | translate }}
</p> </p>
} }
</div> </div>
@@ -244,7 +253,7 @@
</div> </div>
} @else { } @else {
<p class="placeholder"> <p class="placeholder">
Keine Themen oder Schlüsselwörter gefunden. {{ 'news.noTopicsOrKeywords' | translate }}
</p> </p>
} }
</div> </div>
@@ -18,6 +18,8 @@ import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
import { WorksService } from '../../api'; import { WorksService } from '../../api';
import { topicHierarchyColor } from '../../resolvers/utils/topic-colors'; import { topicHierarchyColor } from '../../resolvers/utils/topic-colors';
import { LanguageService } from '../../shared/i18n/language.service';
import { TranslatePipe } from '../../shared/i18n/translate.pipe';
interface MentionedPerson { interface MentionedPerson {
name: string; name: string;
@@ -55,6 +57,7 @@ interface NewsArticleDetail {
MatProgressSpinnerModule, MatProgressSpinnerModule,
MatTooltipModule, MatTooltipModule,
RouterLink, RouterLink,
TranslatePipe,
], ],
templateUrl: './news-detail.component.html', templateUrl: './news-detail.component.html',
styleUrl: './news-detail.component.scss', styleUrl: './news-detail.component.scss',
@@ -68,6 +71,7 @@ export class NewsDetailComponent implements OnInit {
private readonly worksService = inject(WorksService); private readonly worksService = inject(WorksService);
private readonly location = inject(Location); private readonly location = inject(Location);
private readonly sanitizer = inject(DomSanitizer); private readonly sanitizer = inject(DomSanitizer);
private readonly languageService = inject(LanguageService);
article: NewsArticleDetail | null = null; article: NewsArticleDetail | null = null;
highlightedContent: SafeHtml = this.sanitizer.bypassSecurityTrustHtml(''); highlightedContent: SafeHtml = this.sanitizer.bypassSecurityTrustHtml('');
@@ -157,11 +161,14 @@ export class NewsDetailComponent implements OnInit {
if (!dateStr) return '-'; if (!dateStr) return '-';
const date = new Date(dateStr); const date = new Date(dateStr);
if (isNaN(date.getTime())) return dateStr; if (isNaN(date.getTime())) return dateStr;
return new Intl.DateTimeFormat('de-DE', { return new Intl.DateTimeFormat(
this.languageService.language() === 'de' ? 'de-DE' : 'en-US',
{
day: '2-digit', day: '2-digit',
month: 'long', month: 'long',
year: 'numeric', year: 'numeric',
}).format(date); },
).format(date);
} }
private fetchArticle(id: string): void { private fetchArticle(id: string): void {
+14 -12
View File
@@ -1,7 +1,7 @@
<div class="page"> <div class="page">
<div class="page-header"> <div class="page-header">
<h1>Nachrichten</h1> <h1>{{ 'news.title' | translate }}</h1>
<p>Aktuelle Nachrichten aus Campus-Aktuell.</p> <p>{{ 'news.description' | translate }}</p>
</div> </div>
<ng-template #snippetTpl let-article> <ng-template #snippetTpl let-article>
@@ -21,16 +21,18 @@
<mat-form-field appearance="outline" class="relevance-field"> <mat-form-field appearance="outline" class="relevance-field">
<mat-select <mat-select
[formControl]="relevanceFilter" [formControl]="relevanceFilter"
placeholder="Relevanz" [placeholder]="'news.relevance' | translate"
multiple> multiple>
<mat-option value="relevant">Relevant</mat-option> <mat-option value="relevant">{{ 'news.relevant' | translate }}</mat-option>
<mat-option value="not_relevant">Nicht relevant</mat-option> <mat-option value="not_relevant">
{{ 'news.notRelevant' | translate }}
</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<div class="year-field"> <div class="year-field">
<div class="year-field__head"> <div class="year-field__head">
<span class="year-field__label">Datum</span> <span class="year-field__label">{{ 'news.date' | translate }}</span>
<span class="year-field__range"> <span class="year-field__range">
{{ yearFrom.value }} – {{ yearTo.value }} {{ yearFrom.value }} – {{ yearTo.value }}
</span> </span>
@@ -46,9 +48,9 @@
mat-stroked-button mat-stroked-button
type="button" type="button"
(click)="resetFilters()" (click)="resetFilters()"
aria-label="Filter zurücksetzen"> [attr.aria-label]="'news.resetFilters' | translate">
<mat-icon>filter_alt_off</mat-icon> <mat-icon>filter_alt_off</mat-icon>
<span>Zurücksetzen</span> <span>{{ 'news.reset' | translate }}</span>
</button> </button>
</div> </div>
</ng-template> </ng-template>
@@ -56,9 +58,9 @@
<ng-template #noResultsTmp> <ng-template #noResultsTmp>
<div class="no-results"> <div class="no-results">
@if (isSearching()) { @if (isSearching()) {
<span>Keine Ergebnisse für „{{ searchQuery().trim() }}" gefunden.</span> <span>{{ noSearchResultsLabel() }}</span>
} @else { } @else {
<span>Keine Nachrichten gefunden.</span> <span>{{ 'news.noResults' | translate }}</span>
} }
</div> </div>
</ng-template> </ng-template>
@@ -71,6 +73,6 @@
[noResultsTmp]="noResultsTmp" [noResultsTmp]="noResultsTmp"
[cardMinWidth]="380" [cardMinWidth]="380"
[sortingDirectionOptions]="sortingDirectionOptions()" [sortingDirectionOptions]="sortingDirectionOptions()"
sortingDirectionLabel="Sortierung" [sortingDirectionLabel]="'news.sorting' | translate"
searchLabel="Nachrichten durchsuchen" /> [searchLabel]="'news.search' | translate" />
</div> </div>
+23 -5
View File
@@ -28,6 +28,8 @@ import {
NEWS_MIN_YEAR, NEWS_MIN_YEAR,
} from '../../shared/ui/news-card/news-card.component'; } from '../../shared/ui/news-card/news-card.component';
import { SelectorOption } from '../../shared/ui/query-param-selector/query-param-selector.component'; import { SelectorOption } from '../../shared/ui/query-param-selector/query-param-selector.component';
import { LanguageService } from '../../shared/i18n/language.service';
import { TranslatePipe } from '../../shared/i18n/translate.pipe';
interface NewsArticle extends NewsArticleBase { interface NewsArticle extends NewsArticleBase {
author?: string | null; author?: string | null;
@@ -54,6 +56,7 @@ type SortOrder = 'desc' | 'asc';
MatIconModule, MatIconModule,
CardSearchComponent, CardSearchComponent,
NewsCardComponent, NewsCardComponent,
TranslatePipe,
], ],
templateUrl: './news.component.html', templateUrl: './news.component.html',
styleUrl: './news.component.scss', styleUrl: './news.component.scss',
@@ -64,14 +67,23 @@ export class NewsComponent implements OnInit {
private readonly router = inject(Router); private readonly router = inject(Router);
private readonly httpClient = inject(HttpClient); private readonly httpClient = inject(HttpClient);
private readonly worksService = inject(WorksService); private readonly worksService = inject(WorksService);
private readonly languageService = inject(LanguageService);
readonly minYear = NEWS_MIN_YEAR; readonly minYear = NEWS_MIN_YEAR;
readonly maxYear = new Date().getFullYear(); readonly maxYear = new Date().getFullYear();
private readonly sortingDirectionOptionsAll: SelectorOption[] = [ private readonly sortingDirectionOptionsAll = computed<SelectorOption[]>(
{ value: 'desc', display_name: 'Neueste zuerst' }, () => [
{ value: 'asc', display_name: 'Älteste zuerst' }, {
]; value: 'desc',
display_name: this.languageService.translate('news.newestFirst'),
},
{
value: 'asc',
display_name: this.languageService.translate('news.oldestFirst'),
},
],
);
readonly relevanceFilter = new FormControl<string[]>([], { readonly relevanceFilter = new FormControl<string[]>([], {
nonNullable: true, nonNullable: true,
@@ -90,7 +102,13 @@ export class NewsComponent implements OnInit {
readonly isSearching = computed(() => this.searchQuery().trim().length > 0); readonly isSearching = computed(() => this.searchQuery().trim().length > 0);
readonly sortingDirectionOptions = computed<SelectorOption[]>(() => readonly sortingDirectionOptions = computed<SelectorOption[]>(() =>
this.isSearching() ? [] : this.sortingDirectionOptionsAll, this.isSearching() ? [] : this.sortingDirectionOptionsAll(),
);
readonly noSearchResultsLabel = computed(() =>
this.languageService.translate('news.noSearchResults', {
query: this.searchQuery().trim(),
}),
); );
readonly page = computed<Page>(() => ({ readonly page = computed<Page>(() => ({
@@ -1,38 +1,42 @@
<h2 mat-dialog-title> <h2 mat-dialog-title>
{{ {{
data.mode === 'create' data.mode === 'create'
? 'Organisation erstellen' ? ('organizations.create' | translate)
: 'Organisation bearbeiten' : ('organizations.edit' | translate)
}} }}
</h2> </h2>
<mat-dialog-content> <mat-dialog-content>
<form class="organization-form" [formGroup]="form" (ngSubmit)="submit()"> <form class="organization-form" [formGroup]="form" (ngSubmit)="submit()">
<mat-form-field appearance="outline"> <mat-form-field appearance="outline">
<mat-label>Name</mat-label> <mat-label>{{ 'organizations.name' | translate }}</mat-label>
<input matInput formControlName="name" /> <input matInput formControlName="name" />
@if (form.controls.name.hasError('required')) { @if (form.controls.name.hasError('required')) {
<mat-error>Name ist erforderlich.</mat-error> <mat-error>{{ 'organizations.nameRequired' | translate }}</mat-error>
} }
</mat-form-field> </mat-form-field>
<mat-form-field appearance="outline"> <mat-form-field appearance="outline">
<mat-label>Externe Institutions-ID</mat-label> <mat-label>
{{ 'organizations.externalInstitutionId' | translate }}
</mat-label>
<input matInput formControlName="otherInstId" /> <input matInput formControlName="otherInstId" />
</mat-form-field> </mat-form-field>
@if (data.mode === 'edit') { @if (data.mode === 'edit') {
<mat-checkbox formControlName="deleted"> <mat-checkbox formControlName="deleted">
Organisation als gelöscht markieren {{ 'organizations.markDeleted' | translate }}
</mat-checkbox> </mat-checkbox>
} }
</form> </form>
</mat-dialog-content> </mat-dialog-content>
<mat-dialog-actions align="end"> <mat-dialog-actions align="end">
<button mat-button type="button" (click)="close()">Abbrechen</button> <button mat-button type="button" (click)="close()">
{{ 'common.cancel' | translate }}
</button>
<button mat-flat-button color="primary" type="button" (click)="submit()"> <button mat-flat-button color="primary" type="button" (click)="submit()">
<mat-icon>save</mat-icon> <mat-icon>save</mat-icon>
Speichern {{ 'common.save' | translate }}
</button> </button>
</mat-dialog-actions> </mat-dialog-actions>
@@ -17,6 +17,7 @@ import { MatFormFieldModule } from '@angular/material/form-field';
import { MatIconModule } from '@angular/material/icon'; import { MatIconModule } from '@angular/material/icon';
import { MatInputModule } from '@angular/material/input'; import { MatInputModule } from '@angular/material/input';
import { InseOrganizationManagementModelOrganizationProfile } from '../../../api'; import { InseOrganizationManagementModelOrganizationProfile } from '../../../api';
import { TranslatePipe } from '../../../shared/i18n/translate.pipe';
export interface CreateOrganizationPayload { export interface CreateOrganizationPayload {
name: string; name: string;
@@ -53,6 +54,7 @@ export type OrganizationDialogResult =
MatFormFieldModule, MatFormFieldModule,
MatIconModule, MatIconModule,
MatInputModule, MatInputModule,
TranslatePipe,
], ],
templateUrl: './organization-dialog.component.html', templateUrl: './organization-dialog.component.html',
styleUrl: './organization-dialog.component.scss', styleUrl: './organization-dialog.component.scss',
@@ -1,8 +1,8 @@
<section class="organizations-page"> <section class="organizations-page">
<header class="page-header"> <header class="page-header">
<div> <div>
<h1>Organisationen</h1> <h1>{{ 'organizations.title' | translate }}</h1>
<p>Mandanten, externe Institutions-IDs und Status verwalten.</p> <p>{{ 'organizations.description' | translate }}</p>
<!-- Was meinte die KI mit Mandanten? --> <!-- Was meinte die KI mit Mandanten? -->
</div> </div>
<button <button
@@ -11,7 +11,7 @@
type="button" type="button"
(click)="startCreate()"> (click)="startCreate()">
<mat-icon>add_business</mat-icon> <mat-icon>add_business</mat-icon>
Neue Organisation {{ 'organizations.new' | translate }}
</button> </button>
</header> </header>
@@ -36,14 +36,14 @@
<button <button
mat-icon-button mat-icon-button
type="button" type="button"
aria-label="Bearbeiten" [attr.aria-label]="'common.edit' | translate"
(click)="startEdit(row)"> (click)="startEdit(row)">
<mat-icon>edit</mat-icon> <mat-icon>edit</mat-icon>
</button> </button>
<button <button
mat-icon-button mat-icon-button
type="button" type="button"
aria-label="Deaktivieren" [attr.aria-label]="'common.deactivate' | translate"
[disabled]="row.deleted" [disabled]="row.deleted"
(click)="deleteOrganization(row)"> (click)="deleteOrganization(row)">
<mat-icon>delete</mat-icon> <mat-icon>delete</mat-icon>
@@ -1,7 +1,9 @@
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { import {
Component, Component,
effect,
inject, inject,
Injector,
input, input,
OnInit, OnInit,
TemplateRef, TemplateRef,
@@ -29,6 +31,8 @@ import { MatCardModule } from '@angular/material/card';
import { StatusPipe } from '../../shared/pipes/status.pipe'; import { StatusPipe } from '../../shared/pipes/status.pipe';
import { QueryParamPaginatorComponent } from '../../shared/ui/query-param-paginator/query-param-paginator.component'; import { QueryParamPaginatorComponent } from '../../shared/ui/query-param-paginator/query-param-paginator.component';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
import { LanguageService } from '../../shared/i18n/language.service';
import { TranslatePipe } from '../../shared/i18n/translate.pipe';
@Component({ @Component({
selector: 'app-organizations', selector: 'app-organizations',
@@ -42,6 +46,7 @@ import { Router } from '@angular/router';
MatCardModule, MatCardModule,
StatusPipe, StatusPipe,
QueryParamPaginatorComponent, QueryParamPaginatorComponent,
TranslatePipe,
], ],
templateUrl: './organizations.component.html', templateUrl: './organizations.component.html',
styleUrl: './organizations.component.scss', styleUrl: './organizations.component.scss',
@@ -52,6 +57,8 @@ export class OrganizationsComponent implements OnInit {
private readonly dialog = inject(MatDialog); private readonly dialog = inject(MatDialog);
private readonly snackBar = inject(MatSnackBar); private readonly snackBar = inject(MatSnackBar);
private readonly organizationService = inject(OrganizationService); private readonly organizationService = inject(OrganizationService);
private readonly languageService = inject(LanguageService);
private readonly injector = inject(Injector);
organizationPage = input.required<OrganizationPage>(); organizationPage = input.required<OrganizationPage>();
organizationColumns: GenericColumn<InseOrganizationManagementModelOrganizationProfile>[] = organizationColumns: GenericColumn<InseOrganizationManagementModelOrganizationProfile>[] =
@@ -65,35 +72,45 @@ export class OrganizationsComponent implements OnInit {
); );
ngOnInit(): void { ngOnInit(): void {
effect(
() => {
this.languageService.language();
this.setOrganizationColumns();
},
{ injector: this.injector },
);
}
private setOrganizationColumns(): void {
this.organizationColumns = [ this.organizationColumns = [
{ {
id: 'name', id: 'name',
header: 'Name', header: this.languageService.translate('organizations.name'),
type: 'accessor', type: 'accessor',
accessorKey: 'name', accessorKey: 'name',
}, },
{ {
id: 'other_inst_id', id: 'other_inst_id',
header: 'Externe ID', header: this.languageService.translate('organizations.externalId'),
type: 'accessor', type: 'accessor',
accessorKey: 'other_inst_id', accessorKey: 'other_inst_id',
}, },
{ {
id: 'member_count', id: 'member_count',
header: 'Mitglieder', header: this.languageService.translate('organizations.members'),
type: 'accessor', type: 'accessor',
accessorKey: 'member_count', accessorKey: 'member_count',
}, },
{ {
id: 'deleted', id: 'deleted',
header: 'Status', header: this.languageService.translate('common.status'),
type: 'accessor', type: 'accessor',
accessorKey: 'deleted', accessorKey: 'deleted',
cellTemplate: this.organizationStatusTmp(), cellTemplate: this.organizationStatusTmp(),
}, },
{ {
id: 'actions', id: 'actions',
header: 'Aktionen', header: this.languageService.translate('common.actions'),
type: 'display', type: 'display',
cellTemplate: this.organizationActionsTmp(), cellTemplate: this.organizationActionsTmp(),
}, },
@@ -119,10 +136,15 @@ export class OrganizationsComponent implements OnInit {
({ ConfirmationDialogComponent }) => { ({ ConfirmationDialogComponent }) => {
const dialogRef = this.dialog.open(ConfirmationDialogComponent, { const dialogRef = this.dialog.open(ConfirmationDialogComponent, {
data: { data: {
title: 'Organisation deaktivieren', title: this.languageService.translate(
message: `Möchtest Du die Organisation „${organization.name}“ wirklich deaktivieren?`, 'organizations.deactivateTitle',
confirmText: 'Deaktivieren', ),
cancelText: 'Abbrechen', message: this.languageService.translate(
'organizations.deactivateQuestion',
{ name: organization.name },
),
confirmText: this.languageService.translate('common.deactivate'),
cancelText: this.languageService.translate('common.cancel'),
}, },
}); });
@@ -138,16 +160,22 @@ export class OrganizationsComponent implements OnInit {
): void { ): void {
this.organizationService.deleteOrganisation(organization.id).subscribe({ this.organizationService.deleteOrganisation(organization.id).subscribe({
next: () => { next: () => {
this.snackBar.open('Organisation wurde deaktiviert.', 'OK', { this.snackBar.open(
this.languageService.translate('organizations.deactivated'),
this.languageService.translate('common.ok'),
{
duration: 3000, duration: 3000,
}); },
);
this.router.navigate([], { this.router.navigate([], {
queryParams: { page: 0 }, queryParams: { page: 0 },
queryParamsHandling: 'merge', queryParamsHandling: 'merge',
}); });
}, },
error: () => error: () =>
this.showError('Organisation konnte nicht deaktiviert werden.'), this.showError(
this.languageService.translate('organizations.deactivateError'),
),
}); });
} }
@@ -182,9 +210,13 @@ export class OrganizationsComponent implements OnInit {
request.subscribe({ request.subscribe({
next: () => { next: () => {
this.snackBar.open('Organisation wurde gespeichert.', 'OK', { this.snackBar.open(
this.languageService.translate('organizations.saved'),
this.languageService.translate('common.ok'),
{
duration: 3000, duration: 3000,
}); },
);
this.router.navigate([], { this.router.navigate([], {
queryParams: { page: 0 }, queryParams: { page: 0 },
queryParamsHandling: 'merge', queryParamsHandling: 'merge',
@@ -193,13 +225,17 @@ export class OrganizationsComponent implements OnInit {
error: (error) => error: (error) =>
this.showError( this.showError(
error.status === 409 error.status === 409
? 'Eine Organisation mit diesem Namen existiert bereits.' ? this.languageService.translate('organizations.nameConflict')
: 'Organisation konnte nicht gespeichert werden.', : this.languageService.translate('organizations.saveError'),
), ),
}); });
} }
private showError(message: string): void { private showError(message: string): void {
this.snackBar.open(message, 'OK', { duration: 5000 }); this.snackBar.open(
message,
this.languageService.translate('common.ok'),
{ duration: 5000 },
);
} }
} }
@@ -3,22 +3,24 @@
type="button" type="button"
class="back-link" class="back-link"
(click)="navigateBack()" (click)="navigateBack()"
aria-label="Zurück zu den Patenten"> [attr.aria-label]="'patents.back' | translate">
<mat-icon>arrow_back</mat-icon> <mat-icon>arrow_back</mat-icon>
Alle Patente {{ 'patents.all' | translate }}
</button> </button>
@if (loading) { @if (loading) {
<div class="state"> <div class="state">
<mat-spinner diameter="42"></mat-spinner> <mat-spinner diameter="42"></mat-spinner>
<p>Patent wird geladen...</p> <p>{{ 'patents.loadingOne' | translate }}</p>
</div> </div>
} @else if (notFound || !patent) { } @else if (notFound || !patent) {
<div class="state error-state"> <div class="state error-state">
<mat-icon>search_off</mat-icon> <mat-icon>search_off</mat-icon>
<h2>Patent nicht gefunden</h2> <h2>{{ 'patents.notFound' | translate }}</h2>
<p>Das Patent konnte nicht geladen werden.</p> <p>{{ 'patents.notFoundDescription' | translate }}</p>
<a mat-stroked-button routerLink="/patents"> Zur Patentübersicht </a> <a mat-stroked-button routerLink="/patents">
{{ 'patents.overviewLink' | translate }}
</a>
</div> </div>
} @else { } @else {
<header class="hero"> <header class="hero">
@@ -37,7 +39,9 @@
<span>{{ stage }}</span> <span>{{ stage }}</span>
} }
</div> </div>
<h1>{{ patent.title || patent.patent_id || 'Ohne Titel' }}</h1> <h1>
{{ patent.title || patent.patent_id || ('patents.noTitle' | translate) }}
</h1>
<p class="meta-line"> <p class="meta-line">
<span>{{ patent.patent_id }}</span> <span>{{ patent.patent_id }}</span>
@if (patent.publication_date) { @if (patent.publication_date) {
@@ -60,23 +64,23 @@
</div> </div>
</div> </div>
<div class="metrics" aria-label="Patentkennzahlen"> <div class="metrics" [attr.aria-label]="'patents.metrics' | translate">
<div> <div>
<mat-icon>groups</mat-icon> <mat-icon>groups</mat-icon>
<strong>{{ patent.inventors?.length ?? 0 }}</strong> <strong>{{ patent.inventors?.length ?? 0 }}</strong>
<span>Erfinder</span> <span>{{ 'patents.inventors' | translate }}</span>
</div> </div>
<div> <div>
<mat-icon>business</mat-icon> <mat-icon>business</mat-icon>
<strong>{{ patent.assignees?.length ?? 0 }}</strong> <strong>{{ patent.assignees?.length ?? 0 }}</strong>
<span>Anmelder</span> <span>{{ 'patents.assignees' | translate }}</span>
</div> </div>
<div> <div>
<mat-icon>category</mat-icon> <mat-icon>category</mat-icon>
<strong>{{ <strong>{{
(patent.ipc?.length ?? 0) + (patent.cpc?.length ?? 0) (patent.ipc?.length ?? 0) + (patent.cpc?.length ?? 0)
}}</strong> }}</strong>
<span>Klassifikationen</span> <span>{{ 'patents.classifications' | translate }}</span>
</div> </div>
</div> </div>
</header> </header>
@@ -87,7 +91,7 @@
<section class="card abstract-card"> <section class="card abstract-card">
<div class="section-title"> <div class="section-title">
<mat-icon>subject</mat-icon> <mat-icon>subject</mat-icon>
<h2>Abstract</h2> <h2>{{ 'patents.abstract' | translate }}</h2>
</div> </div>
<p>{{ patent.abstract }}</p> <p>{{ patent.abstract }}</p>
</section> </section>
@@ -96,14 +100,14 @@
<section class="card"> <section class="card">
<div class="section-title"> <div class="section-title">
<mat-icon>engineering</mat-icon> <mat-icon>engineering</mat-icon>
<h2>Erfinder</h2> <h2>{{ 'patents.inventors' | translate }}</h2>
<span>{{ patent.inventors?.length ?? 0 }}</span> <span>{{ patent.inventors?.length ?? 0 }}</span>
</div> </div>
<div class="tags"> <div class="tags">
@for (inventor of patent.inventors; track inventor) { @for (inventor of patent.inventors; track inventor) {
<span>{{ inventor }}</span> <span>{{ inventor }}</span>
} @empty { } @empty {
<p class="empty">Keine Angaben vorhanden.</p> <p class="empty">{{ 'patents.noInformation' | translate }}</p>
} }
</div> </div>
</section> </section>
@@ -112,7 +116,7 @@
<section class="card"> <section class="card">
<div class="section-title"> <div class="section-title">
<mat-icon>account_balance</mat-icon> <mat-icon>account_balance</mat-icon>
<h2>Anmelder</h2> <h2>{{ 'patents.assignees' | translate }}</h2>
<span>{{ patent.assignees?.length ?? 0 }}</span> <span>{{ patent.assignees?.length ?? 0 }}</span>
</div> </div>
<div class="compact-list"> <div class="compact-list">
@@ -129,7 +133,7 @@
<section class="card"> <section class="card">
<div class="section-title"> <div class="section-title">
<mat-icon>topic</mat-icon> <mat-icon>topic</mat-icon>
<h2>OpenAlex Themen</h2> <h2>{{ 'patents.openAlexTopics' | translate }}</h2>
</div> </div>
<div class="tags"> <div class="tags">
@for ( @for (
@@ -153,7 +157,7 @@
class="card classification-card-section classification-card-section--ipc"> class="card classification-card-section classification-card-section--ipc">
<div class="section-title"> <div class="section-title">
<mat-icon>label</mat-icon> <mat-icon>label</mat-icon>
<h2>Klassifikation (IPC)</h2> <h2>{{ 'patents.ipcClassification' | translate }}</h2>
</div> </div>
<div class="classification-cards"> <div class="classification-cards">
@for ( @for (
@@ -203,8 +207,8 @@
(click)="toggleClassificationExpanded(card.key)"> (click)="toggleClassificationExpanded(card.key)">
{{ {{
isClassificationExpanded(card.key) isClassificationExpanded(card.key)
? 'Weniger anzeigen' ? ('patents.showLess' | translate)
: 'Mehr anzeigen' : ('patents.showMore' | translate)
}} }}
</button> </button>
} }
@@ -227,7 +231,7 @@
<section class="card"> <section class="card">
<div class="section-title"> <div class="section-title">
<mat-icon>label</mat-icon> <mat-icon>label</mat-icon>
<h2>Klassifikation (IPC)</h2> <h2>{{ 'patents.ipcClassification' | translate }}</h2>
</div> </div>
<div class="tags"> <div class="tags">
@for (ipc of patent.ipc; track ipc) { @for (ipc of patent.ipc; track ipc) {
@@ -242,7 +246,7 @@
class="card classification-card-section classification-card-section--cpc"> class="card classification-card-section classification-card-section--cpc">
<div class="section-title"> <div class="section-title">
<mat-icon>label</mat-icon> <mat-icon>label</mat-icon>
<h2>Klassifikation (CPC)</h2> <h2>{{ 'patents.cpcClassification' | translate }}</h2>
</div> </div>
<div class="classification-cards"> <div class="classification-cards">
@for ( @for (
@@ -292,8 +296,8 @@
(click)="toggleClassificationExpanded(card.key)"> (click)="toggleClassificationExpanded(card.key)">
{{ {{
isClassificationExpanded(card.key) isClassificationExpanded(card.key)
? 'Weniger anzeigen' ? ('patents.showLess' | translate)
: 'Mehr anzeigen' : ('patents.showMore' | translate)
}} }}
</button> </button>
} }
@@ -316,7 +320,7 @@
<section class="card"> <section class="card">
<div class="section-title"> <div class="section-title">
<mat-icon>label</mat-icon> <mat-icon>label</mat-icon>
<h2>Klassifikation (CPC)</h2> <h2>{{ 'patents.cpcClassification' | translate }}</h2>
</div> </div>
<div class="tags"> <div class="tags">
@for (cpc of patent.cpc; track cpc) { @for (cpc of patent.cpc; track cpc) {
@@ -331,7 +335,7 @@
<section class="card facts-card"> <section class="card facts-card">
<div class="section-title"> <div class="section-title">
<mat-icon>info</mat-icon> <mat-icon>info</mat-icon>
<h2>Patentdaten</h2> <h2>{{ 'patents.data' | translate }}</h2>
</div> </div>
<dl> <dl>
@for (row of metadataRows(); track row.label) { @for (row of metadataRows(); track row.label) {
@@ -358,7 +362,7 @@
<section class="card"> <section class="card">
<div class="section-title"> <div class="section-title">
<mat-icon>link</mat-icon> <mat-icon>link</mat-icon>
<h2>Externe Links</h2> <h2>{{ 'patents.externalLinks' | translate }}</h2>
</div> </div>
<div class="link-list"> <div class="link-list">
@for (link of externalLinks(); track link.url) { @for (link of externalLinks(); track link.url) {
@@ -26,6 +26,8 @@ import {
isLongDescription, isLongDescription,
patentExternalLinks, patentExternalLinks,
} from './patent-detail.utils'; } from './patent-detail.utils';
import { LanguageService } from '../../shared/i18n/language.service';
import { TranslatePipe } from '../../shared/i18n/translate.pipe';
@Component({ @Component({
selector: 'app-patent-detail', selector: 'app-patent-detail',
@@ -35,6 +37,7 @@ import {
MatProgressSpinnerModule, MatProgressSpinnerModule,
RouterLink, RouterLink,
TopicChipComponent, TopicChipComponent,
TranslatePipe,
], ],
templateUrl: './patent-detail.component.html', templateUrl: './patent-detail.component.html',
styleUrl: './patent-detail.component.scss', styleUrl: './patent-detail.component.scss',
@@ -44,6 +47,7 @@ export class PatentDetailComponent implements OnInit {
private readonly route = inject(ActivatedRoute); private readonly route = inject(ActivatedRoute);
private readonly patentsService = inject(PatentsService); private readonly patentsService = inject(PatentsService);
private readonly location = inject(Location); private readonly location = inject(Location);
private readonly languageService = inject(LanguageService);
patent: PatentEntry | null = null; patent: PatentEntry | null = null;
loading = true; loading = true;
@@ -76,11 +80,20 @@ export class PatentDetailComponent implements OnInit {
} }
formatDate(date: string | null | undefined): string { formatDate(date: string | null | undefined): string {
return formatPatentDate(date); return formatPatentDate(
date,
this.languageService.language() === 'de' ? 'de-DE' : 'en-US',
);
} }
metadataRows() { metadataRows() {
return this.patent ? getPatentMetadataRows(this.patent) : []; return this.patent
? getPatentMetadataRows(
this.patent,
(key) => this.languageService.translate(key),
this.languageService.language() === 'de' ? 'de-DE' : 'en-US',
)
: [];
} }
stageLabel(): string | null { stageLabel(): string | null {
@@ -95,7 +108,9 @@ export class PatentDetailComponent implements OnInit {
entries: PatentEntry['ipc_descriptions'], entries: PatentEntry['ipc_descriptions'],
system: ClassificationSystem, system: ClassificationSystem,
): ClassificationCard[] { ): ClassificationCard[] {
return getClassificationCards(entries, system); return getClassificationCards(entries, system, (key) =>
this.languageService.translate(key),
);
} }
topicColor(topic: OpenAlexTopicTag): string { topicColor(topic: OpenAlexTopicTag): string {
@@ -1,5 +1,8 @@
import { PatentEntry } from '../../api/model/patentEntry'; import { PatentEntry } from '../../api/model/patentEntry';
import { IpcClassification } from '../../api/model/ipcClassification'; import { IpcClassification } from '../../api/model/ipcClassification';
import { TranslationKey } from '../../shared/i18n/translations';
type PatentTranslator = (key: TranslationKey) => string;
export type ClassificationSystem = 'IPC' | 'CPC'; export type ClassificationSystem = 'IPC' | 'CPC';
@@ -21,12 +24,15 @@ export interface PatentMetadataRow {
const DESCRIPTION_PREVIEW_LENGTH = 140; const DESCRIPTION_PREVIEW_LENGTH = 140;
export function formatPatentDate(date: string | null | undefined): string { export function formatPatentDate(
date: string | null | undefined,
locale = 'de-DE',
): string {
if (!date) return '-'; if (!date) return '-';
const normalized = date.replace(/(\d{4})(\d{2})(\d{2})/, '$1-$2-$3'); const normalized = date.replace(/(\d{4})(\d{2})(\d{2})/, '$1-$2-$3');
const parsed = new Date(normalized); const parsed = new Date(normalized);
if (isNaN(parsed.getTime())) return date; if (isNaN(parsed.getTime())) return date;
return new Intl.DateTimeFormat('de-DE').format(parsed); return new Intl.DateTimeFormat(locale).format(parsed);
} }
export function formatMetadataLabel(value: string): string { export function formatMetadataLabel(value: string): string {
@@ -42,40 +48,59 @@ export function getPublicationStageLabel(patent: PatentEntry): string | null {
export function getPatentMetadataRows( export function getPatentMetadataRows(
patent: PatentEntry, patent: PatentEntry,
translate?: PatentTranslator,
locale = 'de-DE',
): PatentMetadataRow[] { ): PatentMetadataRow[] {
const label = (key: TranslationKey, fallback: string) =>
translate?.(key) ?? fallback;
const rows: PatentMetadataRow[] = [ const rows: PatentMetadataRow[] = [
{ label: 'Quelle', value: patent.source, variant: 'source' }, {
{ label: 'Patent-Nr.', value: patent.patent_id }, label: label('patents.source', 'Quelle'),
value: patent.source,
variant: 'source',
},
{ label: label('patents.number', 'Patent-Nr.'), value: patent.patent_id },
]; ];
if (patent.publication_date) { if (patent.publication_date) {
rows.push({ rows.push({
label: 'Veröffentlichungsdatum', label: label('patents.publicationDate', 'Veröffentlichungsdatum'),
value: formatPatentDate(patent.publication_date), value: formatPatentDate(patent.publication_date, locale),
}); });
} }
if (patent.application_number) { if (patent.application_number) {
rows.push({ label: 'Anmeldungsnummer', value: patent.application_number }); rows.push({
label: label('patents.applicationNumber', 'Anmeldungsnummer'),
value: patent.application_number,
});
} }
if (patent.application_date) { if (patent.application_date) {
rows.push({ rows.push({
label: 'Anmeldedatum', label: label('patents.applicationDate', 'Anmeldedatum'),
value: formatPatentDate(patent.application_date), value: formatPatentDate(patent.application_date, locale),
}); });
} }
const stageLabel = getPublicationStageLabel(patent); const stageLabel = getPublicationStageLabel(patent);
if (stageLabel) { if (stageLabel) {
rows.push({ rows.push({
label: patent.kind ? 'Publikationsstufe' : 'Anmeldungstyp', label: patent.kind
? label('patents.publicationStage', 'Publikationsstufe')
: label('patents.applicationType', 'Anmeldungstyp'),
value: patent.kind ? stageLabel : formatMetadataLabel(stageLabel), value: patent.kind ? stageLabel : formatMetadataLabel(stageLabel),
}); });
} }
if (patent.number_of_claims != null) { if (patent.number_of_claims != null) {
rows.push({ label: 'Ansprüche', value: String(patent.number_of_claims) }); rows.push({
label: label('patents.claims', 'Ansprüche'),
value: String(patent.number_of_claims),
});
} }
if (patent.status) { if (patent.status) {
rows.push({ label: 'Status', value: formatMetadataLabel(patent.status) }); rows.push({
label: label('patents.status', 'Status'),
value: formatMetadataLabel(patent.status),
});
} }
return rows; return rows;
@@ -84,13 +109,14 @@ export function getPatentMetadataRows(
export function getClassificationCards( export function getClassificationCards(
entries: IpcClassification[] | undefined, entries: IpcClassification[] | undefined,
system: ClassificationSystem, system: ClassificationSystem,
translate?: PatentTranslator,
): ClassificationCard[] { ): ClassificationCard[] {
if (!entries?.length) return []; if (!entries?.length) return [];
const merged = new Map<string, ClassificationCard>(); const merged = new Map<string, ClassificationCard>();
for (const entry of entries) { for (const entry of entries) {
const card = buildClassificationCard(entry, system); const card = buildClassificationCard(entry, system, translate);
const mergeKey = const mergeKey =
card.primaryDescription?.toLocaleLowerCase('en') ?? card.primaryDescription?.toLocaleLowerCase('en') ??
card.symbols[0] ?? card.symbols[0] ??
@@ -147,8 +173,9 @@ export function patentExternalLinks(
function buildClassificationCard( function buildClassificationCard(
entry: IpcClassification, entry: IpcClassification,
system: ClassificationSystem, system: ClassificationSystem,
translate?: PatentTranslator,
): ClassificationCard { ): ClassificationCard {
const level = getClassificationLevel(entry); const level = getClassificationLevel(entry, translate);
const primaryDescription = extractDescriptionText(entry[level.field]); const primaryDescription = extractDescriptionText(entry[level.field]);
return { return {
@@ -157,25 +184,33 @@ function buildClassificationCard(
system, system,
levelLabel: level.label, levelLabel: level.label,
primaryDescription, primaryDescription,
hierarchy: buildHierarchyRows(entry, primaryDescription), hierarchy: buildHierarchyRows(entry, primaryDescription, translate),
sectionName: entry.section ?? null, sectionName: entry.section ?? null,
}; };
} }
function getClassificationLevel(entry: IpcClassification): { function getClassificationLevel(
entry: IpcClassification,
translate?: PatentTranslator,
): {
label: string; label: string;
field: keyof IpcClassification; field: keyof IpcClassification;
} { } {
if (entry.subgroup) return { label: 'Untergruppe', field: 'subgroup' }; if (entry.subgroup)
if (entry.main_group) return { label: 'Hauptgruppe', field: 'main_group' }; return { label: translate?.('patents.subgroup') ?? 'Untergruppe', field: 'subgroup' };
if (entry.subclass) return { label: 'Unterklasse', field: 'subclass' }; if (entry.main_group)
if (entry.section) return { label: 'Sektion', field: 'section' }; return { label: translate?.('patents.mainGroup') ?? 'Hauptgruppe', field: 'main_group' };
return { label: 'Code', field: 'symbol' }; if (entry.subclass)
return { label: translate?.('patents.subclass') ?? 'Unterklasse', field: 'subclass' };
if (entry.section)
return { label: translate?.('patents.section') ?? 'Sektion', field: 'section' };
return { label: translate?.('patents.code') ?? 'Code', field: 'symbol' };
} }
function buildHierarchyRows( function buildHierarchyRows(
entry: IpcClassification, entry: IpcClassification,
primaryDescription: string | null, primaryDescription: string | null,
translate?: PatentTranslator,
): { label: string; value: string }[] { ): { label: string; value: string }[] {
const rows: { label: string; value: string }[] = []; const rows: { label: string; value: string }[] = [];
const seen = new Set<string>(); const seen = new Set<string>();
@@ -194,9 +229,12 @@ function buildHierarchyRows(
rows.push({ label, value }); rows.push({ label, value });
}; };
addRow('Sektion', entry.section ?? null); addRow(translate?.('patents.section') ?? 'Sektion', entry.section ?? null);
addRow('Klasse', entry.class ?? null); addRow(translate?.('patents.class') ?? 'Klasse', entry.class ?? null);
addRow('Unterklasse', entry.subclass ?? null); addRow(
translate?.('patents.subclass') ?? 'Unterklasse',
entry.subclass ?? null,
);
return rows; return rows;
} }
@@ -1,11 +1,11 @@
<div class="content"> <div class="content">
<h1>Patente</h1> <h1>{{ 'patents.title' | translate }}</h1>
<mat-divider /> <mat-divider />
<div class="search-and-filter"> <div class="search-and-filter">
<mat-form-field style="width: 100%"> <mat-form-field style="width: 100%">
<mat-label>Suche nach Titel oder Patent-Nr.</mat-label> <mat-label>{{ 'patents.search' | translate }}</mat-label>
<input <input
matInput matInput
type="search" type="search"
@@ -28,10 +28,11 @@
<div class="year-filter"> <div class="year-filter">
<div class="year-filter-top"> <div class="year-filter-top">
<span class="year-filter-label">Zeitraum</span> <span class="year-filter-label">{{ 'range.period' | translate }}</span>
<span class="year-filter-values"> <span class="year-filter-values">
{{ selectedStartYear }} bis {{ selectedEndYear }} {{ selectedStartYear }} {{ 'range.to' | translate }}
{{ selectedEndYear }}
</span> </span>
<button <button
@@ -39,7 +40,7 @@
class="reset-range-button" class="reset-range-button"
[disabled]="!canResetYearRange" [disabled]="!canResetYearRange"
(click)="resetYearRange()"> (click)="resetYearRange()">
Zurücksetzen {{ 'range.reset' | translate }}
</button> </button>
</div> </div>
@@ -57,7 +58,7 @@
[style.z-index]="selectedStartYear >= selectedEndYear - 5 ? 4 : 2" [style.z-index]="selectedStartYear >= selectedEndYear - 5 ? 4 : 2"
(input)="onStartYearDrag($event)" (input)="onStartYearDrag($event)"
(change)="onStartYearInput($event)" (change)="onStartYearInput($event)"
aria-label="Startjahr" /> [attr.aria-label]="'range.startYear' | translate" />
<input <input
class="range-input range-input-end" class="range-input range-input-end"
type="range" type="range"
@@ -66,7 +67,7 @@
[value]="selectedEndYear" [value]="selectedEndYear"
(input)="onEndYearDrag($event)" (input)="onEndYearDrag($event)"
(change)="onEndYearInput($event)" (change)="onEndYearInput($event)"
aria-label="Endjahr" /> [attr.aria-label]="'range.endYear' | translate" />
</div> </div>
<div class="year-filter-bounds"> <div class="year-filter-bounds">
@@ -81,16 +82,16 @@
@if (loading) { @if (loading) {
<app-loading <app-loading
text="Patentdaten werden geladen..." [text]="'patents.loading' | translate"
icon="workspace_premium" icon="workspace_premium"
[size]="150" [size]="150"
[diameter]="150" /> [diameter]="150" />
} @else if (error) { } @else if (error) {
<p class="state-message error">Fehler beim Laden der Patente.</p> <p class="state-message error">{{ 'patents.loadError' | translate }}</p>
} @else if (showDetail && selectedPatent) { } @else if (showDetail && selectedPatent) {
<div class="detail-view"> <div class="detail-view">
<button type="button" class="back-btn" (click)="closeDetail()"> <button type="button" class="back-btn" (click)="closeDetail()">
← Zurück zu den Patenten ← {{ 'patents.back' | translate }}
</button> </button>
<h2>{{ selectedPatent.title ?? selectedPatent.patent_id }}</h2> <h2>{{ selectedPatent.title ?? selectedPatent.patent_id }}</h2>
@@ -117,13 +118,13 @@
@if (selectedPatent.abstract) { @if (selectedPatent.abstract) {
<div class="detail-section"> <div class="detail-section">
<h4>Abstract</h4> <h4>{{ 'patents.abstract' | translate }}</h4>
<p>{{ selectedPatent.abstract }}</p> <p>{{ selectedPatent.abstract }}</p>
</div> </div>
} }
<div class="detail-section"> <div class="detail-section">
<h4>Erfinder</h4> <h4>{{ 'patents.inventors' | translate }}</h4>
<ul class="tag-list"> <ul class="tag-list">
@for (inv of selectedPatent.inventors; track inv) { @for (inv of selectedPatent.inventors; track inv) {
<li class="tag">{{ inv }}</li> <li class="tag">{{ inv }}</li>
@@ -133,7 +134,7 @@
@if ((selectedPatent.assignees?.length ?? 0) > 0) { @if ((selectedPatent.assignees?.length ?? 0) > 0) {
<div class="detail-section"> <div class="detail-section">
<h4>Anmelder</h4> <h4>{{ 'patents.assignees' | translate }}</h4>
<ul class="tag-list"> <ul class="tag-list">
@for (a of selectedPatent.assignees; track a) { @for (a of selectedPatent.assignees; track a) {
<li class="tag">{{ a }}</li> <li class="tag">{{ a }}</li>
@@ -144,7 +145,7 @@
@if ((selectedPatent.openalex_topics?.length ?? 0) > 0) { @if ((selectedPatent.openalex_topics?.length ?? 0) > 0) {
<div class="detail-section"> <div class="detail-section">
<h4>OpenAlex Themen</h4> <h4>{{ 'patents.openAlexTopics' | translate }}</h4>
<div class="tag-list"> <div class="tag-list">
@for ( @for (
topic of selectedPatent.openalex_topics; topic of selectedPatent.openalex_topics;
@@ -165,7 +166,7 @@
@if ((selectedPatent.ipc_descriptions?.length ?? 0) > 0) { @if ((selectedPatent.ipc_descriptions?.length ?? 0) > 0) {
<div <div
class="detail-section classification-section classification-section--ipc"> class="detail-section classification-section classification-section--ipc">
<h4>Klassifikation (IPC)</h4> <h4>{{ 'patents.ipcClassification' | translate }}</h4>
<div class="classification-cards"> <div class="classification-cards">
@for ( @for (
card of getClassificationCards( card of getClassificationCards(
@@ -217,8 +218,8 @@
(click)="toggleClassificationExpanded(card.key)"> (click)="toggleClassificationExpanded(card.key)">
{{ {{
isClassificationExpanded(card.key) isClassificationExpanded(card.key)
? 'Weniger anzeigen' ? ('patents.showLess' | translate)
: 'Mehr anzeigen' : ('patents.showMore' | translate)
}} }}
</button> </button>
} }
@@ -239,7 +240,7 @@
</div> </div>
} @else if ((selectedPatent.ipc?.length ?? 0) > 0) { } @else if ((selectedPatent.ipc?.length ?? 0) > 0) {
<div class="detail-section"> <div class="detail-section">
<h4>Klassifikation (IPC)</h4> <h4>{{ 'patents.ipcClassification' | translate }}</h4>
<ul class="tag-list tag-list--compact"> <ul class="tag-list tag-list--compact">
@for (ipc of selectedPatent.ipc; track ipc) { @for (ipc of selectedPatent.ipc; track ipc) {
<li class="tag">{{ ipc }}</li> <li class="tag">{{ ipc }}</li>
@@ -251,7 +252,7 @@
@if ((selectedPatent.cpc_descriptions?.length ?? 0) > 0) { @if ((selectedPatent.cpc_descriptions?.length ?? 0) > 0) {
<div <div
class="detail-section classification-section classification-section--cpc"> class="detail-section classification-section classification-section--cpc">
<h4>Klassifikation (CPC)</h4> <h4>{{ 'patents.cpcClassification' | translate }}</h4>
<div class="classification-cards"> <div class="classification-cards">
@for ( @for (
card of getClassificationCards( card of getClassificationCards(
@@ -303,8 +304,8 @@
(click)="toggleClassificationExpanded(card.key)"> (click)="toggleClassificationExpanded(card.key)">
{{ {{
isClassificationExpanded(card.key) isClassificationExpanded(card.key)
? 'Weniger anzeigen' ? ('patents.showLess' | translate)
: 'Mehr anzeigen' : ('patents.showMore' | translate)
}} }}
</button> </button>
} }
@@ -325,7 +326,7 @@
</div> </div>
} @else if ((selectedPatent.cpc?.length ?? 0) > 0) { } @else if ((selectedPatent.cpc?.length ?? 0) > 0) {
<div class="detail-section"> <div class="detail-section">
<h4>Klassifikation (CPC)</h4> <h4>{{ 'patents.cpcClassification' | translate }}</h4>
<ul class="tag-list tag-list--compact"> <ul class="tag-list tag-list--compact">
@for (cpc of selectedPatent.cpc; track cpc) { @for (cpc of selectedPatent.cpc; track cpc) {
<li class="tag">{{ cpc }}</li> <li class="tag">{{ cpc }}</li>
@@ -336,7 +337,7 @@
</div> </div>
} @else if (patents.length === 0) { } @else if (patents.length === 0) {
<div class="no-results"> <div class="no-results">
<p>Keine Patente gefunden.</p> <p>{{ 'patents.noResults' | translate }}</p>
</div> </div>
} @else { } @else {
<div class="cards"> <div class="cards">
@@ -375,7 +376,7 @@
mat-button mat-button
(click)="selectPatent(patent); $event.stopPropagation()"> (click)="selectPatent(patent); $event.stopPropagation()">
<mat-icon>info</mat-icon> <mat-icon>info</mat-icon>
Übersicht {{ 'patents.overview' | translate }}
</button> </button>
</mat-card-actions> </mat-card-actions>
</mat-card-footer> </mat-card-footer>
@@ -21,6 +21,8 @@ import {
classificationSectionColor, classificationSectionColor,
topicHierarchyColor, topicHierarchyColor,
} from '../../resolvers/utils/topic-colors'; } from '../../resolvers/utils/topic-colors';
import { LanguageService } from '../../shared/i18n/language.service';
import { TranslatePipe } from '../../shared/i18n/translate.pipe';
type PatentSource = 'EPO' | 'USPTO'; type PatentSource = 'EPO' | 'USPTO';
@@ -54,6 +56,7 @@ const MIN_YEAR = 1978;
MatDividerModule, MatDividerModule,
TopicChipComponent, TopicChipComponent,
LoadingComponent, LoadingComponent,
TranslatePipe,
], ],
templateUrl: './patents.component.html', templateUrl: './patents.component.html',
styleUrl: './patents.component.scss', styleUrl: './patents.component.scss',
@@ -62,6 +65,7 @@ export class PatentsComponent implements OnInit {
private router = inject(Router); private router = inject(Router);
private route = inject(ActivatedRoute); private route = inject(ActivatedRoute);
private patentsApi = inject(PatentsService); private patentsApi = inject(PatentsService);
private languageService = inject(LanguageService);
patents: PatentEntry[] = []; patents: PatentEntry[] = [];
total = 0; total = 0;
@@ -301,7 +305,9 @@ export class PatentsComponent implements OnInit {
const d = date.replace(/(\d{4})(\d{2})(\d{2})/, '$1-$2-$3'); const d = date.replace(/(\d{4})(\d{2})(\d{2})/, '$1-$2-$3');
const parsed = new Date(d); const parsed = new Date(d);
if (isNaN(parsed.getTime())) return date; if (isNaN(parsed.getTime())) return date;
return new Intl.DateTimeFormat('de-DE').format(parsed); return new Intl.DateTimeFormat(
this.languageService.language() === 'de' ? 'de-DE' : 'en-US',
).format(parsed);
} }
getPublicationStageLabel(patent: PatentEntry): string | null { getPublicationStageLabel(patent: PatentEntry): string | null {
@@ -310,34 +316,48 @@ export class PatentsComponent implements OnInit {
getPatentMetadataRows(patent: PatentEntry) { getPatentMetadataRows(patent: PatentEntry) {
const rows: { label: string; value: string; variant?: 'source' }[] = []; const rows: { label: string; value: string; variant?: 'source' }[] = [];
rows.push({ label: 'Quelle', value: patent.source, variant: 'source' }); rows.push({
rows.push({ label: 'Patent-Nr.', value: patent.patent_id }); label: this.languageService.translate('patents.source'),
value: patent.source,
variant: 'source',
});
rows.push({
label: this.languageService.translate('patents.number'),
value: patent.patent_id,
});
if (patent.publication_date) if (patent.publication_date)
rows.push({ rows.push({
label: 'Veröffentlichungsdatum', label: this.languageService.translate('patents.publicationDate'),
value: this.formatDate(patent.publication_date), value: this.formatDate(patent.publication_date),
}); });
if (patent.application_number) if (patent.application_number)
rows.push({ rows.push({
label: 'Anmeldungsnummer', label: this.languageService.translate('patents.applicationNumber'),
value: patent.application_number, value: patent.application_number,
}); });
if (patent.application_date) if (patent.application_date)
rows.push({ rows.push({
label: 'Anmeldedatum', label: this.languageService.translate('patents.applicationDate'),
value: this.formatDate(patent.application_date), value: this.formatDate(patent.application_date),
}); });
const stage = this.getPublicationStageLabel(patent); const stage = this.getPublicationStageLabel(patent);
if (stage) if (stage)
rows.push({ rows.push({
label: patent.kind ? 'Publikationsstufe' : 'Anmeldungstyp', label: this.languageService.translate(
patent.kind
? 'patents.publicationStage'
: 'patents.applicationType',
),
value: this.formatMetadataLabel(stage), value: this.formatMetadataLabel(stage),
}); });
if (patent.number_of_claims != null) if (patent.number_of_claims != null)
rows.push({ label: 'Ansprüche', value: String(patent.number_of_claims) }); rows.push({
label: this.languageService.translate('patents.claims'),
value: String(patent.number_of_claims),
});
if (patent.status) if (patent.status)
rows.push({ rows.push({
label: 'Status', label: this.languageService.translate('patents.status'),
value: this.formatMetadataLabel(patent.status), value: this.formatMetadataLabel(patent.status),
}); });
return rows; return rows;
@@ -429,11 +449,30 @@ export class PatentsComponent implements OnInit {
label: string; label: string;
field: keyof IpcClassification; field: keyof IpcClassification;
} { } {
if (entry.subgroup) return { label: 'Untergruppe', field: 'subgroup' }; if (entry.subgroup)
if (entry.main_group) return { label: 'Hauptgruppe', field: 'main_group' }; return {
if (entry.subclass) return { label: 'Unterklasse', field: 'subclass' }; label: this.languageService.translate('patents.subgroup'),
if (entry.section) return { label: 'Sektion', field: 'section' }; field: 'subgroup',
return { label: 'Code', field: 'symbol' }; };
if (entry.main_group)
return {
label: this.languageService.translate('patents.mainGroup'),
field: 'main_group',
};
if (entry.subclass)
return {
label: this.languageService.translate('patents.subclass'),
field: 'subclass',
};
if (entry.section)
return {
label: this.languageService.translate('patents.section'),
field: 'section',
};
return {
label: this.languageService.translate('patents.code'),
field: 'symbol',
};
} }
private buildHierarchyRows( private buildHierarchyRows(
@@ -454,9 +493,18 @@ export class PatentsComponent implements OnInit {
seen.add(norm); seen.add(norm);
rows.push({ label, value }); rows.push({ label, value });
}; };
addRow('Sektion', entry.section ?? null); addRow(
addRow('Klasse', entry.class ?? null); this.languageService.translate('patents.section'),
addRow('Unterklasse', entry.subclass ?? null); entry.section ?? null,
);
addRow(
this.languageService.translate('patents.class'),
entry.class ?? null,
);
addRow(
this.languageService.translate('patents.subclass'),
entry.subclass ?? null,
);
return rows; return rows;
} }
@@ -20,10 +20,14 @@
" "
[class.bookmarked]="isBookmarked()" [class.bookmarked]="isBookmarked()"
[attr.aria-label]=" [attr.aria-label]="
isBookmarked() ? 'Bookmark entfernen' : 'Person speichern' isBookmarked()
? ('bookmarks.removeTooltip' | translate)
: ('bookmarks.saveTooltip' | translate)
" "
[matTooltip]=" [matTooltip]="
isBookmarked() ? 'Bookmark entfernen' : 'Person speichern' isBookmarked()
? ('bookmarks.removeTooltip' | translate)
: ('bookmarks.saveTooltip' | translate)
"> ">
<mat-icon>{{ <mat-icon>{{
isBookmarked() ? 'bookmark' : 'bookmark_border' isBookmarked() ? 'bookmark' : 'bookmark_border'
@@ -42,7 +46,7 @@
@if (!loading()) { @if (!loading()) {
@if (careerStage(); as careerStage) { @if (careerStage(); as careerStage) {
<div [skText]="loading()" class="career-stage-line"> <div [skText]="loading()" class="career-stage-line">
<span class="career-stage-label">Career Stage:</span> <span class="career-stage-label">{{ 'personCard.careerStage' | translate }}</span>
<span <span
class="career-stage-chip" class="career-stage-chip"
[matTooltip]="getCareerStageTooltip(careerStage)" [matTooltip]="getCareerStageTooltip(careerStage)"
@@ -102,7 +106,7 @@
<mat-icon <mat-icon
class="institution-open-icon" class="institution-open-icon"
(click)="openInstitutionPage($event)" (click)="openInstitutionPage($event)"
aria-label="Institutionsseite öffnen" [attr.aria-label]="'persons.openInstitution' | translate"
>open_in_new</mat-icon >open_in_new</mat-icon
> >
} }
@@ -133,17 +137,17 @@
<div class="action-buttons"> <div class="action-buttons">
<a [routerLink]="['/person', person().id, 'overview']" class="action-btn"> <a [routerLink]="['/person', person().id, 'overview']" class="action-btn">
<mat-icon>visibility</mat-icon> <mat-icon>visibility</mat-icon>
<span>Übersicht</span> <span>{{ 'personCard.overview' | translate }}</span>
</a> </a>
<a <a
[routerLink]="['/person', person().id, 'publications']" [routerLink]="['/person', person().id, 'publications']"
class="action-btn"> class="action-btn">
<mat-icon>menu_book</mat-icon> <mat-icon>menu_book</mat-icon>
<span>Publikationen</span> <span>{{ 'publications.publications' | translate }}</span>
</a> </a>
<a [routerLink]="['/person', person().id, 'network']" class="action-btn"> <a [routerLink]="['/person', person().id, 'network']" class="action-btn">
<mat-icon>share</mat-icon> <mat-icon>share</mat-icon>
<span>Netzwerk</span> <span>{{ 'personCard.network' | translate }}</span>
</a> </a>
</div> </div>
</div> </div>
@@ -7,6 +7,8 @@ import { CustomAuthor, DehydratedInstitution, WorkTopic } from '../../api';
import { SkTextDirective } from '../../custom-directives/sk-text.directive'; import { SkTextDirective } from '../../custom-directives/sk-text.directive';
import { TopicChipComponent } from '../../shared/ui/topic-chip/topic-chip.component'; import { TopicChipComponent } from '../../shared/ui/topic-chip/topic-chip.component';
import { topicHierarchyColor } from '../../resolvers/utils/topic-colors'; import { topicHierarchyColor } from '../../resolvers/utils/topic-colors';
import { TranslatePipe } from '../../shared/i18n/translate.pipe';
import { LanguageService } from '../../shared/i18n/language.service';
@Component({ @Component({
selector: 'app-person-card', selector: 'app-person-card',
@@ -18,12 +20,14 @@ import { topicHierarchyColor } from '../../resolvers/utils/topic-colors';
SkTextDirective, SkTextDirective,
MatTooltipModule, MatTooltipModule,
TopicChipComponent, TopicChipComponent,
TranslatePipe,
], ],
templateUrl: './person-card.component.html', templateUrl: './person-card.component.html',
styleUrl: './person-card.component.scss', styleUrl: './person-card.component.scss',
}) })
export class PersonCardComponent { export class PersonCardComponent {
private readonly router = inject(Router); private readonly router = inject(Router);
private readonly languageService = inject(LanguageService);
person = input.required<CustomAuthor>(); person = input.required<CustomAuthor>();
isBookmarked = input<boolean>(false); isBookmarked = input<boolean>(false);
@@ -109,11 +113,11 @@ export class PersonCardComponent {
const hasCitations = citations !== undefined && citations !== null; const hasCitations = citations !== undefined && citations !== null;
if (hasWorks && hasCitations) { if (hasWorks && hasCitations) {
return `Publikationen: ${works} · Zitationen: ${citations}`; return this.languageService.translate('personCard.stats', { works, citations });
} else if (hasWorks) { } else if (hasWorks) {
return `Publikationen: ${works}`; return this.languageService.translate('personCard.works', { works });
} else if (hasCitations) { } else if (hasCitations) {
return `Zitationen: ${citations}`; return this.languageService.translate('personCard.citations', { citations });
} }
return ''; return '';
}); });
@@ -175,18 +179,10 @@ export class PersonCardComponent {
getCareerStageTooltip(careerStage: string): string { getCareerStageTooltip(careerStage: string): string {
const activeYears = this.person().career_metrics?.active_years ?? '-'; const activeYears = this.person().career_metrics?.active_years ?? '-';
return [ return this.languageService.translate('personCard.careerTooltip', {
`Aktuell: ${careerStage.replace(' Researcher', '')}`, stage: careerStage.replace(' Researcher', ''),
`Aktive Publikationsjahre: ${activeYears}`, years: activeYears,
'', });
'Einteilung:',
'Early: 1-4 aktive Publikationsjahre',
'Emerging: 5-9 aktive Publikationsjahre',
'Established: 10-14 aktive Publikationsjahre',
'Senior: ab 15 aktiven Publikationsjahren',
'',
'Diese Einschätzung basiert ausschließlich auf OpenAlex-Publikationsdaten und ist kein offizieller akademischer Status.',
].join('\n');
} }
toggleBookmark(): void { toggleBookmark(): void {
@@ -1,13 +1,13 @@
@if (loading) { @if (loading) {
<app-loading <app-loading
text="Förderdaten werden geladen..." [text]="'personFunding.loading' | translate"
icon="volunteer_activism" icon="volunteer_activism"
[size]="150" [size]="150"
[diameter]="150" /> [diameter]="150" />
} @else if (error) { } @else if (error) {
<p class="message">Fehler beim Laden der Förderungen.</p> <p class="message">{{ 'personFunding.loadError' | translate }}</p>
} @else if (funders.length === 0) { } @else if (funders.length === 0) {
<p class="message">Keine Förderungen gefunden.</p> <p class="message">{{ 'personFunding.empty' | translate }}</p>
} @else { } @else {
<div class="funding-container"> <div class="funding-container">
<div class="funding-content"> <div class="funding-content">
@@ -21,11 +21,11 @@
<mat-select <mat-select
[value]="activeFilter" [value]="activeFilter"
(selectionChange)="setFilter($event.value)"> (selectionChange)="setFilter($event.value)">
<mat-select-trigger>Filter nach Position</mat-select-trigger> <mat-select-trigger>{{ 'personFunding.filterPosition' | translate }}</mat-select-trigger>
<mat-option value="all">Alle</mat-option> <mat-option value="all">{{ 'common.all' | translate }}</mat-option>
<mat-option value="first">Erstautor</mat-option> <mat-option value="first">{{ 'personFunding.firstAuthor' | translate }}</mat-option>
<mat-option value="middle">Mitautor</mat-option> <mat-option value="middle">{{ 'personFunding.coauthor' | translate }}</mat-option>
<mat-option value="last">Letztautor</mat-option> <mat-option value="last">{{ 'personFunding.lastAuthor' | translate }}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field <mat-form-field
@@ -35,20 +35,20 @@
<mat-select <mat-select
[value]="sortMode" [value]="sortMode"
(selectionChange)="setSortMode($event.value)"> (selectionChange)="setSortMode($event.value)">
<mat-select-trigger>Sortieren nach</mat-select-trigger> <mat-select-trigger>{{ 'personPatents.sortBy' | translate }}</mat-select-trigger>
<mat-option value="name">Name</mat-option> <mat-option value="name">{{ 'jobs.name' | translate }}</mat-option>
<mat-option value="top">Top Förderer</mat-option> <mat-option value="top">{{ 'personFunding.topFunders' | translate }}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
</div> </div>
<table> <table>
<thead> <thead>
<tr> <tr>
<th>Förderer</th> <th>{{ 'personFunding.funder' | translate }}</th>
<th class="text-center">Publikationen</th> <th class="text-center">{{ 'publications.publications' | translate }}</th>
<th class="text-center">Erstautor</th> <th class="text-center">{{ 'personFunding.firstAuthor' | translate }}</th>
<th class="text-center">Mitautor</th> <th class="text-center">{{ 'personFunding.coauthor' | translate }}</th>
<th class="text-center">Letztautor</th> <th class="text-center">{{ 'personFunding.lastAuthor' | translate }}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@@ -96,7 +96,7 @@
<div class="position-stats"> <div class="position-stats">
@if (shouldShowPosition('first')) { @if (shouldShowPosition('first')) {
<div class="stat stat-first"> <div class="stat stat-first">
<span class="stat-label">Erstautor</span> <span class="stat-label">{{ 'personFunding.firstAuthor' | translate }}</span>
<span class="stat-value">{{ <span class="stat-value">{{
selectedFunder.author_position_count.first selectedFunder.author_position_count.first
}}</span> }}</span>
@@ -104,7 +104,7 @@
} }
@if (shouldShowPosition('middle')) { @if (shouldShowPosition('middle')) {
<div class="stat stat-middle"> <div class="stat stat-middle">
<span class="stat-label">Mitautor</span> <span class="stat-label">{{ 'personFunding.coauthor' | translate }}</span>
<span class="stat-value">{{ <span class="stat-value">{{
selectedFunder.author_position_count.middle selectedFunder.author_position_count.middle
}}</span> }}</span>
@@ -112,7 +112,7 @@
} }
@if (shouldShowPosition('last')) { @if (shouldShowPosition('last')) {
<div class="stat stat-last"> <div class="stat stat-last">
<span class="stat-label">Letztautor</span> <span class="stat-label">{{ 'personFunding.lastAuthor' | translate }}</span>
<span class="stat-value">{{ <span class="stat-value">{{
selectedFunder.author_position_count.last selectedFunder.author_position_count.last
}}</span> }}</span>
@@ -120,7 +120,7 @@
} }
</div> </div>
<h4>Publikationen</h4> <h4>{{ 'publications.publications' | translate }}</h4>
<ul class="publication-list"> <ul class="publication-list">
@for (id of getSelectedPublicationIdsPage(); track id) { @for (id of getSelectedPublicationIdsPage(); track id) {
<li class="publication-item" (click)="togglePublication(id)"> <li class="publication-item" (click)="togglePublication(id)">
@@ -129,11 +129,11 @@
@if (expandedPublicationId === id) { @if (expandedPublicationId === id) {
<a <a
class="publication-more-info" class="publication-more-info"
title="Publikationsdetails öffnen" [title]="'personFunding.openPublication' | translate"
[routerLink]="['/publication', getShortPublicationId(id)]" [routerLink]="['/publication', getShortPublicationId(id)]"
[state]="{ [state]="{
returnUrl: getCurrentUrl(), returnUrl: getCurrentUrl(),
returnLabel: 'Förderungen', returnLabel: fundingReturnLabel,
}" }"
(click)="$event.stopPropagation()"> (click)="$event.stopPropagation()">
<span class="material-icons">open_in_new</span> <span class="material-icons">open_in_new</span>
@@ -157,15 +157,15 @@
<span <span
class="empty-overview__filter" class="empty-overview__filter"
[ngClass]="getPositionBadgeClass(activeFilter)"> [ngClass]="getPositionBadgeClass(activeFilter)">
Filter: {{ getPositionLabel(activeFilter) }} {{ 'personFunding.filter' | translate }}: {{ getPositionLabel(activeFilter) }}
</span> </span>
} }
<h3 class="empty-overview__title">Förderübersicht</h3> <h3 class="empty-overview__title">{{ 'personFunding.overview' | translate }}</h3>
<p class="empty-overview__subtitle"> <p class="empty-overview__subtitle">
@if (activeFilter === 'all') { @if (activeFilter === 'all') {
Alle geförderten Publikationen dieser Person im Überblick. {{ 'personFunding.allOverview' | translate }}
} @else { } @else {
Nur Publikationen mit der gewählten Autorenposition. {{ 'personFunding.filteredOverview' | translate }}
} }
</p> </p>
<div class="empty-overview__stats"> <div class="empty-overview__stats">
@@ -175,20 +175,19 @@
getUniquePublicationCount() getUniquePublicationCount()
}}</span> }}</span>
<span class="empty-overview__stat-label" <span class="empty-overview__stat-label"
>Einzigartige Publikationen</span >{{ 'personFunding.uniquePublications' | translate }}</span
> >
</div> </div>
<div class="empty-overview__stat empty-overview__stat--funders"> <div class="empty-overview__stat empty-overview__stat--funders">
<span class="empty-overview__stat-value">{{ <span class="empty-overview__stat-value">{{
filteredFunders.length filteredFunders.length
}}</span> }}</span>
<span class="empty-overview__stat-label">Förderer</span> <span class="empty-overview__stat-label">{{ 'personFunding.funder' | translate }}</span>
</div> </div>
</div> </div>
<div class="empty-overview__hint"> <div class="empty-overview__hint">
<p> <p>
Wähle links einen Förderer aus, um die zugehörigen Publikationen {{ 'personFunding.selectHint' | translate }}
anzuzeigen.
</p> </p>
</div> </div>
</div> </div>
@@ -9,6 +9,8 @@ import { PageEvent } from '@angular/material/paginator';
import { FundingService } from '../../api'; import { FundingService } from '../../api';
import { LoadingComponent } from '../../shared/ui/loading/loading.component'; import { LoadingComponent } from '../../shared/ui/loading/loading.component';
import { QueryParamPaginatorComponent } from '../../shared/ui/query-param-paginator/query-param-paginator.component'; import { QueryParamPaginatorComponent } from '../../shared/ui/query-param-paginator/query-param-paginator.component';
import { TranslatePipe } from '../../shared/i18n/translate.pipe';
import { LanguageService } from '../../shared/i18n/language.service';
type SortMode = 'name' | 'top'; type SortMode = 'name' | 'top';
type AuthorPosition = 'first' | 'middle' | 'last' | 'unknown'; type AuthorPosition = 'first' | 'middle' | 'last' | 'unknown';
@@ -31,6 +33,7 @@ type FundingPublicationDetail = {
MatIconModule, MatIconModule,
LoadingComponent, LoadingComponent,
QueryParamPaginatorComponent, QueryParamPaginatorComponent,
TranslatePipe,
], ],
templateUrl: './person-funding.component.html', templateUrl: './person-funding.component.html',
styleUrl: './person-funding.component.scss', styleUrl: './person-funding.component.scss',
@@ -39,6 +42,7 @@ export class PersonFundingComponent implements OnInit {
private route = inject(ActivatedRoute); private route = inject(ActivatedRoute);
private router = inject(Router); private router = inject(Router);
private fundingApi = inject(FundingService); private fundingApi = inject(FundingService);
private languageService = inject(LanguageService);
private initialSelectedFunderKey: string | null = null; private initialSelectedFunderKey: string | null = null;
private initialFunderPageIndex = 0; private initialFunderPageIndex = 0;
private initialFunderPageSize = 10; private initialFunderPageSize = 10;
@@ -265,13 +269,13 @@ export class PersonFundingComponent implements OnInit {
} }
getPositionLabel(position: string): string { getPositionLabel(position: string): string {
const labels: Record<string, string> = { const labels: Record<string, Parameters<LanguageService['translate']>[0]> = {
first: 'Erstautor', first: 'personFunding.firstAuthor',
middle: 'Mitautor', middle: 'personFunding.coauthor',
last: 'Letztautor', last: 'personFunding.lastAuthor',
unknown: 'Unbekannt', unknown: 'common.unknown',
}; };
return labels[position] ?? position; return labels[position] ? this.languageService.translate(labels[position]) : position;
} }
shouldShowPosition(position: 'first' | 'middle' | 'last'): boolean { shouldShowPosition(position: 'first' | 'middle' | 'last'): boolean {
@@ -307,7 +311,7 @@ export class PersonFundingComponent implements OnInit {
return this.getSortableFunderName(first).localeCompare( return this.getSortableFunderName(first).localeCompare(
this.getSortableFunderName(second), this.getSortableFunderName(second),
'de', this.languageService.language(),
{ sensitivity: 'base' }, { sensitivity: 'base' },
); );
}); });
@@ -353,6 +357,10 @@ export class PersonFundingComponent implements OnInit {
return this.router.url; return this.router.url;
} }
get fundingReturnLabel(): string {
return this.languageService.translate('personFunding.funding');
}
getPublicationDetail(publicationId: string): FundingPublicationDetail | null { getPublicationDetail(publicationId: string): FundingPublicationDetail | null {
const detail = this.selectedFunder?.publication_details?.[publicationId]; const detail = this.selectedFunder?.publication_details?.[publicationId];
if (detail) { if (detail) {
@@ -1,10 +1,10 @@
<aside class="interest-card" [class.interest-card-loading]="loading()"> <aside class="interest-card" [class.interest-card-loading]="loading()">
<div class="interest-header"> <div class="interest-header">
<h3>Interessant für</h3> <h3>{{ 'personInteresting.title' | translate }}</h3>
@if (tags().length > 0) { @if (tags().length > 0) {
<span class="interest-footnote"> <span class="interest-footnote">
<mat-icon class="footnote-icon">article</mat-icon> <mat-icon class="footnote-icon">article</mat-icon>
Anzahl Publikationen zum Thema {{ 'personInteresting.publicationCount' | translate }}
</span> </span>
} }
</div> </div>
@@ -26,7 +26,7 @@
@if (loading()) { @if (loading()) {
<div class="interest-state interest-state-loading" aria-live="polite"> <div class="interest-state interest-state-loading" aria-live="polite">
<mat-spinner diameter="36"></mat-spinner> <mat-spinner diameter="36"></mat-spinner>
<span>Themen werden geladen ...</span> <span>{{ 'personInteresting.loading' | translate }}</span>
</div> </div>
} @else if (tags().length > 0) { } @else if (tags().length > 0) {
@for (tag of tags(); track tag.label) { @for (tag of tags(); track tag.label) {
@@ -46,7 +46,7 @@
</app-topic-chip> </app-topic-chip>
} }
} @else { } @else {
<span class="interest-empty">Keine Themen gefunden</span> <span class="interest-empty">{{ 'personInteresting.empty' | translate }}</span>
} }
</div> </div>
</aside> </aside>
@@ -27,6 +27,7 @@ import {
toggleTopicLegendFieldSelection, toggleTopicLegendFieldSelection,
toggleTopicLegendSubfieldSelection, toggleTopicLegendSubfieldSelection,
} from '../../resolvers/utils/topic-legend'; } from '../../resolvers/utils/topic-legend';
import { TranslatePipe } from '../../shared/i18n/translate.pipe';
interface InterestTag { interface InterestTag {
id: string; id: string;
@@ -55,6 +56,7 @@ const MAX_TAGS = 5;
MatProgressSpinnerModule, MatProgressSpinnerModule,
TopicChipComponent, TopicChipComponent,
TopicLegendComponent, TopicLegendComponent,
TranslatePipe,
], ],
templateUrl: './person-interesting.component.html', templateUrl: './person-interesting.component.html',
styleUrl: './person-interesting.component.scss', styleUrl: './person-interesting.component.scss',
@@ -4,23 +4,22 @@
<main class="results-column"> <main class="results-column">
<header class="page-header"> <header class="page-header">
<div> <div>
<h1>Passende Personen finden</h1> <h1>{{ 'persons.title' | translate }}</h1>
<p> <p>
Durchsuchen Sie OpenAlex-Autorinnen und -Autoren nach Namen, Themen {{ 'persons.description' | translate }}
oder Kennungen.
</p> </p>
</div> </div>
@if (searchValue()) { @if (searchValue()) {
<div class="selection-summary"> <div class="selection-summary">
<div> <div>
<strong>Aktive Suche</strong> <strong>{{ 'persons.activeSearch' | translate }}</strong>
<span [skText]="loading">„{{ searchValue() }}“</span> <span [skText]="loading">„{{ searchValue() }}“</span>
</div> </div>
<button <button
mat-icon-button mat-icon-button
(click)="clearSearch()" (click)="clearSearch()"
matTooltip="Suche zurücksetzen" [matTooltip]="'persons.resetSearch' | translate"
aria-label="Suche zurücksetzen"> [attr.aria-label]="'persons.resetSearch' | translate">
<mat-icon>close</mat-icon> <mat-icon>close</mat-icon>
</button> </button>
</div> </div>
@@ -30,7 +29,7 @@
<!-- Active Filter Chips Row --> <!-- Active Filter Chips Row -->
@if (activeFilters.length) { @if (activeFilters.length) {
<div class="active-filters-row"> <div class="active-filters-row">
<span class="active-filters-label">Aktive Filter:</span> <span class="active-filters-label">{{ 'common.activeFilters' | translate }}</span>
<div class="chips-container"> <div class="chips-container">
@for ( @for (
filter of activeFilters; filter of activeFilters;
@@ -54,7 +53,7 @@
class="remove-chip-btn" class="remove-chip-btn"
(click)="removeFilter(filter)" (click)="removeFilter(filter)"
[attr.aria-label]=" [attr.aria-label]="
'Themenfilter ' + filter.value + ' entfernen' ('persons.removeTopicFilter' | translate) + ': ' + filter.value
"> ">
<mat-icon>close</mat-icon> <mat-icon>close</mat-icon>
</button> </button>
@@ -86,7 +85,7 @@
<mat-icon <mat-icon
class="institution-open-icon" class="institution-open-icon"
(click)="openInstitutionPage(filter.value, $event)" (click)="openInstitutionPage(filter.value, $event)"
aria-label="Institutionsseite öffnen" [attr.aria-label]="'persons.openInstitution' | translate"
>open_in_new</mat-icon >open_in_new</mat-icon
> >
} }
@@ -95,7 +94,7 @@
type="button" type="button"
class="remove-chip-btn" class="remove-chip-btn"
(click)="removeFilter(filter)" (click)="removeFilter(filter)"
aria-label="Institutionsfilter entfernen"> [attr.aria-label]="'persons.removeInstitutionFilter' | translate">
<mat-icon>close</mat-icon> <mat-icon>close</mat-icon>
</button> </button>
</span> </span>
@@ -106,7 +105,7 @@
type="button" type="button"
class="remove-chip-btn" class="remove-chip-btn"
(click)="removeFilter(filter)" (click)="removeFilter(filter)"
aria-label="Filter entfernen"> [attr.aria-label]="'common.removeFilter' | translate">
<mat-icon>close</mat-icon> <mat-icon>close</mat-icon>
</button> </button>
</span> </span>
@@ -115,8 +114,8 @@
<button <button
class="clear-all-btn" class="clear-all-btn"
(click)="clearAllFilters()" (click)="clearAllFilters()"
aria-label="Alle Filter zurücksetzen"> [attr.aria-label]="'common.resetAllFilters' | translate">
Filter zurücksetzen {{ 'common.resetFilters' | translate }}
</button> </button>
</div> </div>
</div> </div>
@@ -127,22 +126,22 @@
<div class="toolbar-actions"> <div class="toolbar-actions">
<div class="sort-selector"> <div class="sort-selector">
<span class="sort-label">Sortierung:</span> <span class="sort-label">{{ 'persons.sort' | translate }}</span>
<div class="select-wrapper"> <div class="select-wrapper">
<select <select
[formControl]="sortValueControl" [formControl]="sortValueControl"
aria-label="Sortierkriterium"> [attr.aria-label]="'persons.sortCriterion' | translate">
<option [ngValue]="null">Beste Treffer (Relevanz)</option> <option [ngValue]="null">{{ 'persons.relevance' | translate }}</option>
<option value="works_count">Publikationen</option> <option value="works_count">{{ 'publications.publications' | translate }}</option>
<option value="cited_by_count">Zitierungen</option> <option value="cited_by_count">{{ 'persons.citations' | translate }}</option>
<option value="summary_stats.h_index">h_index</option> <option value="summary_stats.h_index">h_index</option>
</select> </select>
<select <select
[formControl]="sortOrderControl" [formControl]="sortOrderControl"
aria-label="Sortierreihenfolge"> [attr.aria-label]="'persons.sortOrder' | translate">
<option value="desc">Absteigend</option> <option value="desc">{{ 'persons.descending' | translate }}</option>
<option value="asc">Aufsteigend</option> <option value="asc">{{ 'persons.ascending' | translate }}</option>
</select> </select>
</div> </div>
</div> </div>
@@ -152,7 +151,7 @@
<section class="results-panel"> <section class="results-panel">
<div class="results-head"> <div class="results-head">
<strong [skText]="loading" <strong [skText]="loading"
>{{ total | number: '1.0-0' }} Personen gefunden</strong >{{ total | number: '1.0-0' }} {{ 'persons.found' | translate }}</strong
> >
<!--><span>Sortiert nach Publikationen und Zitierungen</span>--> <!--><span>Sortiert nach Publikationen und Zitierungen</span>-->
</div> </div>
@@ -175,10 +174,9 @@
} @else { } @else {
<div class="empty-state"> <div class="empty-state">
<mat-icon>person_search</mat-icon> <mat-icon>person_search</mat-icon>
<h2>Keine Personen gefunden</h2> <h2>{{ 'persons.noneFound' | translate }}</h2>
<p> <p>
Versuchen Sie einen anderen Suchbegriff oder passen Sie die Filter {{ 'persons.noneHint' | translate }}
an.
</p> </p>
</div> </div>
} }
@@ -190,7 +188,7 @@
[pageSizeOptions]="paginationService.options" [pageSizeOptions]="paginationService.options"
[pageIndex]="currentPage - 1" [pageIndex]="currentPage - 1"
(page)="onPageChange($event)" (page)="onPageChange($event)"
aria-label="Ausgewählte Seite"> [attr.aria-label]="'persons.selectedPage' | translate">
</mat-paginator> </mat-paginator>
</section> </section>
</main> </main>
@@ -199,25 +197,25 @@
<aside class="filters-sidebar"> <aside class="filters-sidebar">
<div class="sidebar-header"> <div class="sidebar-header">
<mat-icon>filter_alt</mat-icon> <mat-icon>filter_alt</mat-icon>
<h2>Filter &amp; Suche</h2> <h2>{{ 'persons.filterSearch' | translate }}</h2>
</div> </div>
<!-- Section 1: Topics Search and Selection --> <!-- Section 1: Topics Search and Selection -->
<div class="filter-section"> <div class="filter-section">
<h3 class="filter-section-title">Themen &amp; Expertise</h3> <h3 class="filter-section-title">{{ 'persons.topicsExpertise' | translate }}</h3>
<div class="topic-search-wrapper"> <div class="topic-search-wrapper">
<mat-icon>search</mat-icon> <mat-icon>search</mat-icon>
<input <input
type="text" type="text"
[formControl]="topicSearchControl" [formControl]="topicSearchControl"
aria-label="Thema suchen" [attr.aria-label]="'persons.searchTopic' | translate"
placeholder="Thema suchen..." /> [placeholder]="'persons.searchTopicPlaceholder' | translate" />
@if (topicSearchControl.value) { @if (topicSearchControl.value) {
<button <button
class="clear-topic-search" class="clear-topic-search"
(click)="topicSearchControl.setValue('')" (click)="topicSearchControl.setValue('')"
aria-label="Themensuche zurücksetzen"> [attr.aria-label]="'persons.resetTopicSearch' | translate">
<mat-icon>close</mat-icon> <mat-icon>close</mat-icon>
</button> </button>
} }
@@ -234,15 +232,15 @@
<!-- Section 2: Institution Filter --> <!-- Section 2: Institution Filter -->
<div class="filter-section"> <div class="filter-section">
<h3 class="filter-section-title">Institution</h3> <h3 class="filter-section-title">{{ 'publications.institution' | translate }}</h3>
<div class="topic-search-wrapper" [class.is-loading]="loading"> <div class="topic-search-wrapper" [class.is-loading]="loading">
<mat-icon>apartment</mat-icon> <mat-icon>apartment</mat-icon>
<input <input
type="text" type="text"
[formControl]="institutionControl" [formControl]="institutionControl"
[matAutocomplete]="auto" [matAutocomplete]="auto"
aria-label="Institution suchen" [attr.aria-label]="'persons.searchInstitution' | translate"
placeholder="Institution suchen..." [placeholder]="'persons.searchInstitutionPlaceholder' | translate"
(keyup.enter)="applySidebarFilters()" /> (keyup.enter)="applySidebarFilters()" />
<mat-autocomplete <mat-autocomplete
#auto="matAutocomplete" #auto="matAutocomplete"
@@ -262,14 +260,14 @@
institutionControl.value && institutionControl.value &&
displayInstitution(institutionControl.value).trim().length >= 2 displayInstitution(institutionControl.value).trim().length >= 2
) { ) {
<mat-option disabled>Keine Institution gefunden</mat-option> <mat-option disabled>{{ 'persons.noInstitution' | translate }}</mat-option>
} }
</mat-autocomplete> </mat-autocomplete>
@if (institutionControl.value) { @if (institutionControl.value) {
<button <button
class="clear-topic-search" class="clear-topic-search"
(click)="clearInstitutionFilter()" (click)="clearInstitutionFilter()"
aria-label="Institution zurücksetzen"> [attr.aria-label]="'persons.resetInstitution' | translate">
<mat-icon>close</mat-icon> <mat-icon>close</mat-icon>
</button> </button>
} }
@@ -285,10 +283,10 @@
<mat-checkbox <mat-checkbox
[formControl]="yearFilterEnabledControl" [formControl]="yearFilterEnabledControl"
(change)="applySidebarFilters()" (change)="applySidebarFilters()"
aria-label="Institutionszugehörigkeit nach Jahr filtern"> [attr.aria-label]="'persons.filterMembershipYear' | translate">
<span <span
style="font-size: 12px; font-weight: 500; color: var(--sg-text)"> style="font-size: 12px; font-weight: 500; color: var(--sg-text)">
Institutionszugehörigkeit nach Jahr filtern {{ 'persons.filterMembershipYear' | translate }}
</span> </span>
</mat-checkbox> </mat-checkbox>
@@ -305,20 +303,20 @@
[formControl]="filterModeControl" [formControl]="filterModeControl"
(change)="applySidebarFilters()" (change)="applySidebarFilters()"
style="display: flex; gap: 16px" style="display: flex; gap: 16px"
aria-label="Modus für Jahresfilter"> [attr.aria-label]="'persons.yearFilterMode' | translate">
<mat-radio-button value="in"> <mat-radio-button value="in">
<span style="font-size: 12px; color: var(--sg-text)"> <span style="font-size: 12px; color: var(--sg-text)">
Genau im Jahr {{ 'persons.exactYear' | translate }}
</span> </span>
</mat-radio-button> </mat-radio-button>
<mat-radio-button value="from"> <mat-radio-button value="from">
<span style="font-size: 12px; color: var(--sg-text)"> <span style="font-size: 12px; color: var(--sg-text)">
Seit {{ 'persons.since' | translate }}
</span> </span>
</mat-radio-button> </mat-radio-button>
<mat-radio-button value="between"> <mat-radio-button value="between">
<span style="font-size: 12px; color: var(--sg-text)"> <span style="font-size: 12px; color: var(--sg-text)">
Zeitraum {{ 'persons.period' | translate }}
</span> </span>
</mat-radio-button> </mat-radio-button>
</mat-radio-group> </mat-radio-group>
@@ -333,7 +331,7 @@
margin-top: 4px; margin-top: 4px;
"> ">
<mat-label> <mat-label>
{{ filterModeControl.value === 'between' ? 'Von' : 'Jahr' }} {{ (filterModeControl.value === 'between' ? 'persons.from' : 'publications.year') | translate }}
</mat-label> </mat-label>
<input <input
matInput matInput
@@ -342,14 +340,14 @@
(change)="applySidebarFilters()" (change)="applySidebarFilters()"
(keyup.enter)="applySidebarFilters()" (keyup.enter)="applySidebarFilters()"
[attr.aria-label]=" [attr.aria-label]="
filterModeControl.value === 'between' ? 'Von' : 'Jahr' (filterModeControl.value === 'between' ? 'persons.from' : 'publications.year') | translate
" "
placeholder="Z. B. 2025" /> [placeholder]="'persons.yearExampleFrom' | translate" />
@if (filterYearControl.hasError('min')) { @if (filterYearControl.hasError('min')) {
<mat-error>Jahr muss ≥ 1900 sein</mat-error> <mat-error>{{ 'persons.yearMin' | translate }}</mat-error>
} }
@if (filterYearControl.hasError('max')) { @if (filterYearControl.hasError('max')) {
<mat-error>Zukünftige Jahre sind nicht erlaubt</mat-error> <mat-error>{{ 'persons.yearFuture' | translate }}</mat-error>
} }
</mat-form-field> </mat-form-field>
@@ -362,26 +360,26 @@
font-size: 13px; font-size: 13px;
margin-top: 4px; margin-top: 4px;
"> ">
<mat-label>Bis</mat-label> <mat-label>{{ 'persons.to' | translate }}</mat-label>
<input <input
matInput matInput
type="number" type="number"
[formControl]="filterYearToControl" [formControl]="filterYearToControl"
(change)="applySidebarFilters()" (change)="applySidebarFilters()"
(keyup.enter)="applySidebarFilters()" (keyup.enter)="applySidebarFilters()"
aria-label="Bis" [attr.aria-label]="'persons.to' | translate"
placeholder="Z. B. 2026" /> [placeholder]="'persons.yearExampleTo' | translate" />
@if (filterYearToControl.hasError('min')) { @if (filterYearToControl.hasError('min')) {
<mat-error>Jahr muss ≥ 1900 sein</mat-error> <mat-error>{{ 'persons.yearMin' | translate }}</mat-error>
} }
@if (filterYearToControl.hasError('max')) { @if (filterYearToControl.hasError('max')) {
<mat-error>Zukünftige Jahre sind nicht erlaubt</mat-error> <mat-error>{{ 'persons.yearFuture' | translate }}</mat-error>
} }
@if ( @if (
!filterYearToControl.invalid && !filterYearToControl.invalid &&
filterYearControl.value > filterYearToControl.value filterYearControl.value > filterYearToControl.value
) { ) {
<mat-error>„Bis“ muss ≥ „Von“ sein</mat-error> <mat-error>{{ 'persons.toAfterFrom' | translate }}</mat-error>
} }
</mat-form-field> </mat-form-field>
} }
@@ -396,9 +394,9 @@
<button <button
class="submit-btn" class="submit-btn"
(click)="applySidebarFilters()" (click)="applySidebarFilters()"
aria-label="Gefundene Personen anzeigen"> [attr.aria-label]="'persons.showFound' | translate">
<span [skText]="loading" <span [skText]="loading"
>{{ total | number: '1.0-0' }} Personen anzeigen</span >{{ total | number: '1.0-0' }} {{ 'persons.showPeople' | translate }}</span
> >
</button> </button>
</div> </div>
@@ -43,6 +43,8 @@ import {
} from '@angular/material/autocomplete'; } from '@angular/material/autocomplete';
import { SkTextDirective } from '../../custom-directives/sk-text.directive'; import { SkTextDirective } from '../../custom-directives/sk-text.directive';
import { BookmarkService } from '../../shared/services/bookmark.service'; import { BookmarkService } from '../../shared/services/bookmark.service';
import { TranslatePipe } from '../../shared/i18n/translate.pipe';
import { LanguageService } from '../../shared/i18n/language.service';
type InstitutionYearFilterMode = 'in' | 'from' | 'between'; type InstitutionYearFilterMode = 'in' | 'from' | 'between';
@@ -64,6 +66,7 @@ type InstitutionYearFilterMode = 'in' | 'from' | 'between';
PersonCardComponent, PersonCardComponent,
SkTextDirective, SkTextDirective,
MatAutocompleteModule, MatAutocompleteModule,
TranslatePipe,
], ],
templateUrl: './person-list.component.html', templateUrl: './person-list.component.html',
styleUrl: './person-list.component.scss', styleUrl: './person-list.component.scss',
@@ -77,6 +80,7 @@ export class PersonListComponent {
private readonly institutionsService = inject(InstitutionsService); private readonly institutionsService = inject(InstitutionsService);
private readonly destroyRef = inject(DestroyRef); private readonly destroyRef = inject(DestroyRef);
private readonly bookmarkService = inject(BookmarkService); private readonly bookmarkService = inject(BookmarkService);
private readonly languageService = inject(LanguageService);
public readonly state = inject(SharedStateService); public readonly state = inject(SharedStateService);
public readonly paginationService = inject(PaginationService); public readonly paginationService = inject(PaginationService);
public readonly resolverStateService = inject(ResolverStateService); public readonly resolverStateService = inject(ResolverStateService);
@@ -350,7 +354,7 @@ export class PersonListComponent {
countryCode?: string | null; countryCode?: string | null;
}> = []; }> = [];
this.selectedTopics().forEach((t) => { this.selectedTopics().forEach((t) => {
list.push({ category: 'topic', value: t, label: `Thema: ${t}` }); list.push({ category: 'topic', value: t, label: t });
}); });
if (this.appliedInstitutionId && this.appliedInstitutionName) { if (this.appliedInstitutionId && this.appliedInstitutionName) {
let label = `Institution: ${this.appliedInstitutionName}`; let label = `Institution: ${this.appliedInstitutionName}`;
@@ -546,10 +550,20 @@ export class PersonListComponent {
} }
resultRange(): string { resultRange(): string {
if (!this.total || !this.persons.length) return '0-0 von 0 Personen'; if (!this.total || !this.persons.length) {
return this.languageService.translate('persons.range', {
start: 0,
end: 0,
total: 0,
});
}
const start = (this.currentPage - 1) * this.paginationService.selection + 1; const start = (this.currentPage - 1) * this.paginationService.selection + 1;
const end = start + this.persons.length - 1; const end = start + this.persons.length - 1;
return `${start}-${end} von ${this.total} Personen`; return this.languageService.translate('persons.range', {
start,
end,
total: this.total,
});
} }
// Bookmarks // Bookmarks
@@ -1,10 +1,10 @@
<h2 mat-dialog-title>Netzwerkfilter</h2> <h2 mat-dialog-title>{{ 'personNetwork.dialogTitle' | translate }}</h2>
<mat-dialog-content> <mat-dialog-content>
<form> <form>
<div class="pair-field"> <div class="pair-field">
<mat-form-field [subscriptSizing]="'dynamic'"> <mat-form-field [subscriptSizing]="'dynamic'">
<mat-label>Startjahr (inklusive)</mat-label> <mat-label>{{ 'personNetwork.startYearInclusive' | translate }}</mat-label>
<input <input
matInput matInput
type="number" type="number"
@@ -12,7 +12,7 @@
[formField]="filterForm.startYear" /> [formField]="filterForm.startYear" />
</mat-form-field> </mat-form-field>
<mat-form-field [subscriptSizing]="'dynamic'"> <mat-form-field [subscriptSizing]="'dynamic'">
<mat-label>Endjahr (inklusive)</mat-label> <mat-label>{{ 'personNetwork.endYearInclusive' | translate }}</mat-label>
<input <input
matInput matInput
type="number" type="number"
@@ -21,7 +21,7 @@
</mat-form-field> </mat-form-field>
</div> </div>
<mat-form-field [subscriptSizing]="'dynamic'"> <mat-form-field [subscriptSizing]="'dynamic'">
<mat-label>Minimale Anzahl von Kollaborierenden (inklusiv)</mat-label> <mat-label>{{ 'personNetwork.minCollaboratorsInclusive' | translate }}</mat-label>
<input <input
matInput matInput
type="number" type="number"
@@ -29,7 +29,7 @@
[formField]="filterForm.minContributors" /> [formField]="filterForm.minContributors" />
</mat-form-field> </mat-form-field>
<mat-form-field [subscriptSizing]="'dynamic'"> <mat-form-field [subscriptSizing]="'dynamic'">
<mat-label>Maximale Anzahl von Kollaborierenden (exklusiv)</mat-label> <mat-label>{{ 'personNetwork.maxCollaboratorsExclusive' | translate }}</mat-label>
<input <input
matInput matInput
type="number" type="number"
@@ -47,8 +47,8 @@
</form> </form>
</mat-dialog-content> </mat-dialog-content>
<mat-dialog-actions align="end"> <mat-dialog-actions align="end">
<button mat-button (click)="onCancel()">Abbrechen</button> <button mat-button (click)="onCancel()">{{ 'common.cancel' | translate }}</button>
<button mat-flat-button color="primary" (click)="onApply()" cdkFocusInitial> <button mat-flat-button color="primary" (click)="onApply()" cdkFocusInitial>
Anwenden {{ 'personNetwork.apply' | translate }}
</button> </button>
</mat-dialog-actions> </mat-dialog-actions>
@@ -14,6 +14,7 @@ import { MatTabsModule } from '@angular/material/tabs';
import { SearchableTopicSelectComponent } from '../../shared/ui/searchable-topic-select/searchable-topic-select.component'; import { SearchableTopicSelectComponent } from '../../shared/ui/searchable-topic-select/searchable-topic-select.component';
import { SearchableInstitutionSelectComponent } from '../../shared/ui/searchable-institution-select/searchable-institution-select.component'; import { SearchableInstitutionSelectComponent } from '../../shared/ui/searchable-institution-select/searchable-institution-select.component';
import { form, FormField } from '@angular/forms/signals'; import { form, FormField } from '@angular/forms/signals';
import { TranslatePipe } from '../../shared/i18n/translate.pipe';
export interface PersonNetworkFilterDialogData { export interface PersonNetworkFilterDialogData {
selectedInstitutions: Institution[]; selectedInstitutions: Institution[];
@@ -47,6 +48,7 @@ interface FilterData {
SearchableTopicSelectComponent, SearchableTopicSelectComponent,
SearchableInstitutionSelectComponent, SearchableInstitutionSelectComponent,
FormField, FormField,
TranslatePipe,
], ],
templateUrl: './person-network-filter-dialog.component.html', templateUrl: './person-network-filter-dialog.component.html',
styleUrl: './person-network-filter-dialog.component.scss', styleUrl: './person-network-filter-dialog.component.scss',
@@ -1,6 +1,6 @@
@if (this.isPending()) { @if (this.isPending()) {
<app-loading <app-loading
text="Das Netzwerk wird gebaut, kleinen Moment..." [text]="'personNetwork.building' | translate"
icon="graph_3" icon="graph_3"
[size]="150" [size]="150"
[diameter]="150" /> [diameter]="150" />
@@ -10,13 +10,13 @@
<span class="error-message">{{ <span class="error-message">{{
this.collaborationGraphError() this.collaborationGraphError()
? this.collaborationGraphError() ? this.collaborationGraphError()
: 'Fehler beim Laden des Netzwerks. Bitte versuchen Sie es später erneut.' : ('personNetwork.loadError' | translate)
}}</span> }}</span>
<app-selected-filters [observers]="observers" /> <app-selected-filters [observers]="observers" />
<button matButton="outlined" type="button" (click)="openFilterDialog()"> <button matButton="outlined" type="button" (click)="openFilterDialog()">
<mat-icon>filter_alt</mat-icon> <mat-icon>filter_alt</mat-icon>
Filter {{ 'personNetwork.filter' | translate }}
</button> </button>
</div> </div>
} @else { } @else {
@@ -34,18 +34,18 @@
<div class="toggle-group"> <div class="toggle-group">
<mat-button-toggle-group <mat-button-toggle-group
class="mat-button-toggle-group" class="mat-button-toggle-group"
aria-label="Select view" [attr.aria-label]="'personNetwork.selectView' | translate"
(change)="onToggleChange($event)" (change)="onToggleChange($event)"
[value]="displayedTable()" [value]="displayedTable()"
style="width: 100%"> style="width: 100%">
<mat-button-toggle value="collaborator"> <mat-button-toggle value="collaborator">
Kollaborierende {{ 'personNetwork.collaborators' | translate }}
</mat-button-toggle> </mat-button-toggle>
<mat-button-toggle value="publication" <mat-button-toggle value="publication"
>Publikationen</mat-button-toggle >{{ 'publications.publications' | translate }}</mat-button-toggle
> >
<mat-button-toggle value="institution"> <mat-button-toggle value="institution">
Institutionen {{ 'publications.columnInstitutions' | translate }}
</mat-button-toggle> </mat-button-toggle>
</mat-button-toggle-group> </mat-button-toggle-group>
<button <button
@@ -54,7 +54,7 @@
type="button" type="button"
(click)="openFilterDialog()"> (click)="openFilterDialog()">
<mat-icon>filter_alt</mat-icon> <mat-icon>filter_alt</mat-icon>
Filter {{ 'personNetwork.filter' | translate }}
</button> </button>
</div> </div>
@@ -69,21 +69,21 @@
<mat-card-content class="scroll-viewport-container"> <mat-card-content class="scroll-viewport-container">
@if (this.displayedTable() === 'collaborator') { @if (this.displayedTable() === 'collaborator') {
<app-data-table <app-data-table
[columns]="collaboratorsColumns" [columns]="collaboratorsColumns()"
[data]="collaboratorsData()" [data]="collaboratorsData()"
[filterTerm]="searchTerm()" [filterTerm]="searchTerm()"
[detailTemplate]="collaboratorsDetailRow" [detailTemplate]="collaboratorsDetailRow"
[maxHeight]="'100%'" /> [maxHeight]="'100%'" />
} @else if (this.displayedTable() === 'publication') { } @else if (this.displayedTable() === 'publication') {
<app-data-table <app-data-table
[columns]="publicationsColumns" [columns]="publicationsColumns()"
[data]="publicationsData()" [data]="publicationsData()"
[filterTerm]="searchTerm()" [filterTerm]="searchTerm()"
[detailTemplate]="publicationsDetailRow" [detailTemplate]="publicationsDetailRow"
[maxHeight]="'100%'" /> [maxHeight]="'100%'" />
} @else if (this.displayedTable() === 'institution') { } @else if (this.displayedTable() === 'institution') {
<app-data-table <app-data-table
[columns]="institutionsColumns" [columns]="institutionsColumns()"
[data]="institutionsData()" [data]="institutionsData()"
[filterTerm]="searchTerm()" [filterTerm]="searchTerm()"
[detailTemplate]="institutionsDetailRow" [detailTemplate]="institutionsDetailRow"
@@ -122,7 +122,7 @@
<ng-template #collaboratorsDetailRow let-element> <ng-template #collaboratorsDetailRow let-element>
<div class="detail-row"> <div class="detail-row">
@if (element.works.length > 0) { @if (element.works.length > 0) {
<span style="font-weight: bold">Publikationen:</span> <span style="font-weight: bold">{{ 'publications.publications' | translate }}:</span>
<ul> <ul>
@for (work of element.works; track $index) { @for (work of element.works; track $index) {
<a <a
@@ -138,7 +138,7 @@
</ul> </ul>
} }
@if (element.institutions.length > 0) { @if (element.institutions.length > 0) {
<span style="font-weight: bold">Institutionen:</span> <span style="font-weight: bold">{{ 'publications.columnInstitutions' | translate }}:</span>
<ul> <ul>
@for (institution of element.institutions; track $index) { @for (institution of element.institutions; track $index) {
<a <a
@@ -175,7 +175,7 @@
<ng-template #publicationsDetailRow let-element> <ng-template #publicationsDetailRow let-element>
<div class="detail-row"> <div class="detail-row">
@if (element.authors.length > 0) { @if (element.authors.length > 0) {
<span style="font-weight: bold">Mitwirkende:</span> <span style="font-weight: bold">{{ 'personNetwork.contributors' | translate }}:</span>
<ul> <ul>
@for (collaborator of element.authors; track $index) { @for (collaborator of element.authors; track $index) {
<li> <li>
@@ -214,7 +214,7 @@
<ng-template #institutionsDetailRow let-element> <ng-template #institutionsDetailRow let-element>
<div class="detail-row"> <div class="detail-row">
@if (element.authors.length > 0) { @if (element.authors.length > 0) {
<span style="font-weight: bold">Mitwirkende:</span> <span style="font-weight: bold">{{ 'personNetwork.contributors' | translate }}:</span>
<ul> <ul>
@for (collaborator of element.authors; track $index) { @for (collaborator of element.authors; track $index) {
<li> <li>
@@ -11,6 +11,7 @@ import {
DestroyRef, DestroyRef,
effect, effect,
input, input,
inject,
OnInit, OnInit,
signal, signal,
TemplateRef, TemplateRef,
@@ -69,6 +70,8 @@ import { ComponentTooltipDirective } from '../../directives/component-tooltip.di
import { AppAuthorTooltipComponent } from '../../shared/ui/app-author-tooltip/app-author-tooltip.component'; import { AppAuthorTooltipComponent } from '../../shared/ui/app-author-tooltip/app-author-tooltip.component';
import { AppInstitutionTooltipComponent } from '../../shared/ui/app-institution-tooltip/app-institution-tooltip.component'; import { AppInstitutionTooltipComponent } from '../../shared/ui/app-institution-tooltip/app-institution-tooltip.component';
import { AppPublicationTooltipComponent } from '../../shared/ui/app-publication-tooltip/app-publication-tooltip.component'; import { AppPublicationTooltipComponent } from '../../shared/ui/app-publication-tooltip/app-publication-tooltip.component';
import { TranslatePipe } from '../../shared/i18n/translate.pipe';
import { LanguageService } from '../../shared/i18n/language.service';
type DetailedWorkNode = WorkNode & { type DetailedWorkNode = WorkNode & {
authors: AuthorNode[]; authors: AuthorNode[];
@@ -116,12 +119,14 @@ interface FilterData {
LoadingComponent, LoadingComponent,
MatGridListModule, MatGridListModule,
ComponentTooltipDirective, ComponentTooltipDirective,
TranslatePipe,
], ],
templateUrl: './person-network.component.html', templateUrl: './person-network.component.html',
styleUrl: './person-network.component.scss', styleUrl: './person-network.component.scss',
providers: [], providers: [],
}) })
export class PersonNetworkComponent implements OnInit { export class PersonNetworkComponent implements OnInit {
private readonly languageService = inject(LanguageService);
readonly AppAuthorTooltipComponent = AppAuthorTooltipComponent; readonly AppAuthorTooltipComponent = AppAuthorTooltipComponent;
readonly AppInstitutionTooltipComponent = AppInstitutionTooltipComponent; readonly AppInstitutionTooltipComponent = AppInstitutionTooltipComponent;
readonly AppPublicationTooltipComponent = AppPublicationTooltipComponent; readonly AppPublicationTooltipComponent = AppPublicationTooltipComponent;
@@ -175,7 +180,7 @@ export class PersonNetworkComponent implements OnInit {
queryParamKey: collaborationGraphQueryParamKeys.yearFrom, queryParamKey: collaborationGraphQueryParamKeys.yearFrom,
icon: 'calendar_today', icon: 'calendar_today',
valueFormatter: (value: string) => { valueFormatter: (value: string) => {
return value ? `Ab ${value}` : null; return value ? this.languageService.translate('personNetwork.fromValue', { value }) : null;
}, },
}, },
{ {
@@ -183,7 +188,7 @@ export class PersonNetworkComponent implements OnInit {
queryParamKey: collaborationGraphQueryParamKeys.yearTo, queryParamKey: collaborationGraphQueryParamKeys.yearTo,
icon: 'calendar_today', icon: 'calendar_today',
valueFormatter: (value: string) => { valueFormatter: (value: string) => {
return value ? `Bis ${value}` : null; return value ? this.languageService.translate('personNetwork.toValue', { value }) : null;
}, },
}, },
{ {
@@ -191,7 +196,7 @@ export class PersonNetworkComponent implements OnInit {
queryParamKey: collaborationGraphQueryParamKeys.minCollaborators, queryParamKey: collaborationGraphQueryParamKeys.minCollaborators,
icon: 'person', icon: 'person',
valueFormatter: (value: string) => { valueFormatter: (value: string) => {
return value ? `Mindestens ${value} Autoren` : null; return value ? this.languageService.translate('personNetwork.minAuthors', { value }) : null;
}, },
}, },
{ {
@@ -199,7 +204,7 @@ export class PersonNetworkComponent implements OnInit {
queryParamKey: collaborationGraphQueryParamKeys.maxCollaborators, queryParamKey: collaborationGraphQueryParamKeys.maxCollaborators,
icon: 'group', icon: 'group',
valueFormatter: (value: string) => { valueFormatter: (value: string) => {
return value ? `Höchstens ${value} Autoren` : null; return value ? this.languageService.translate('personNetwork.maxAuthors', { value }) : null;
}, },
}, },
{ {
@@ -228,7 +233,6 @@ export class PersonNetworkComponent implements OnInit {
}, },
]; ];
collaboratorsColumns: GenericColumn<DetailedAuthorNode>[] = [];
collaboratorsData = computed<DetailedAuthorNode[]>( collaboratorsData = computed<DetailedAuthorNode[]>(
() => () =>
this.collaborationGraph()?.authors?.map((author) => ({ this.collaborationGraph()?.authors?.map((author) => ({
@@ -257,7 +261,6 @@ export class PersonNetworkComponent implements OnInit {
'collaboratorsDetailRow', 'collaboratorsDetailRow',
); );
publicationsColumns: GenericColumn<DetailedWorkNode>[] = [];
publicationsData = computed( publicationsData = computed(
() => () =>
this.collaborationGraph()?.works?.map((work) => ({ this.collaborationGraph()?.works?.map((work) => ({
@@ -279,7 +282,6 @@ export class PersonNetworkComponent implements OnInit {
'publicationsDetailRow', 'publicationsDetailRow',
); );
institutionsColumns: GenericColumn<DetailedInstitutionNode>[] = [];
institutionsData = computed( institutionsData = computed(
() => () =>
this.collaborationGraph()?.institutions?.map((institution) => ({ this.collaborationGraph()?.institutions?.map((institution) => ({
@@ -313,13 +315,13 @@ export class PersonNetworkComponent implements OnInit {
const displayedTable = this.displayedTable(); const displayedTable = this.displayedTable();
switch (displayedTable) { switch (displayedTable) {
case 'collaborator': case 'collaborator':
return 'Suche Kollaborierende nach Name'; return this.languageService.translate('personNetwork.searchCollaborators');
case 'publication': case 'publication':
return 'Suche Publikationen nach Titel'; return this.languageService.translate('personNetwork.searchPublications');
case 'institution': case 'institution':
return 'Suche Institutionen nach Name'; return this.languageService.translate('personNetwork.searchInstitutions');
default: default:
return 'Suchbegriff'; return this.languageService.translate('personNetwork.searchTerm');
} }
}); });
@@ -422,22 +424,22 @@ export class PersonNetworkComponent implements OnInit {
{ {
icon: 'person', icon: 'person',
value: this.persons(), value: this.persons(),
description: 'Personen', description: this.languageService.translate('nav.people'),
}, },
{ {
icon: 'apartment', icon: 'apartment',
value: this.institutions(), value: this.institutions(),
description: 'Institutionen', description: this.languageService.translate('publications.columnInstitutions'),
}, },
{ {
icon: 'menu_book', icon: 'menu_book',
value: this.publications(), value: this.publications(),
description: 'Gemeinsame Publikationen', description: this.languageService.translate('personNetwork.sharedPublications'),
}, },
{ {
icon: 'share', icon: 'share',
value: this.connections(), value: this.connections(),
description: 'Verbindungen im Netzwerk', description: this.languageService.translate('personNetwork.connections'),
}, },
]); ]);
@@ -447,6 +449,22 @@ export class PersonNetworkComponent implements OnInit {
searchTerm = computed(() => this.queryParamMap().get('search_term') || ''); searchTerm = computed(() => this.queryParamMap().get('search_term') || '');
collaboratorsColumns = computed<GenericColumn<DetailedAuthorNode>[]>(() => [
{ id: 'name', header: this.languageService.translate('jobs.name'), type: 'accessor', accessorKey: 'display_name' },
{ id: 'works', header: this.languageService.translate('personNetwork.frequency'), type: 'display', cellTemplate: this.collaboratorsFrequencyTmp() },
{ id: 'actions', header: '', type: 'display', cellTemplate: this.collaboratorsActionTmp() },
]);
publicationsColumns = computed<GenericColumn<DetailedWorkNode>[]>(() => [
{ id: 'title', header: this.languageService.translate('projects.columnTitle'), type: 'accessor', accessorKey: 'display_name' },
{ id: 'collaborators', header: this.languageService.translate('personNetwork.contributors'), type: 'display', cellTemplate: this.publicationsCollaborationFrequencyTmp() },
{ id: 'actions', header: '', type: 'display', cellTemplate: this.publicationsActionTmp() },
]);
institutionsColumns = computed<GenericColumn<DetailedInstitutionNode>[]>(() => [
{ id: 'name', header: this.languageService.translate('jobs.name'), type: 'accessor', accessorKey: 'display_name' },
{ id: 'collaborators', header: this.languageService.translate('personNetwork.contributors'), type: 'display', cellTemplate: this.institutionsFrequencyTmp() },
{ id: 'actions', header: '', type: 'display', cellTemplate: this.institutionsActionTmp() },
]);
private readonly POLL_INTERVAL_MS = 3000; private readonly POLL_INTERVAL_MS = 3000;
constructor( constructor(
@@ -566,66 +584,6 @@ export class PersonNetworkComponent implements OnInit {
institutions: this.selectedInstitutions().elements || [], institutions: this.selectedInstitutions().elements || [],
}); });
this.collaboratorsColumns = [
{
id: 'name',
header: 'Name',
type: 'accessor',
accessorKey: 'display_name',
},
{
id: 'works',
header: 'Häufigkeit',
type: 'display',
cellTemplate: this.collaboratorsFrequencyTmp(),
},
{
id: 'actions',
header: '',
type: 'display',
cellTemplate: this.collaboratorsActionTmp(),
},
];
this.publicationsColumns = [
{
id: 'title',
header: 'Titel',
type: 'accessor',
accessorKey: 'display_name',
},
{
id: 'collaborators',
header: 'Mitwirkende',
type: 'display',
cellTemplate: this.publicationsCollaborationFrequencyTmp(),
},
{
id: 'actions',
header: '',
type: 'display',
cellTemplate: this.publicationsActionTmp(),
},
];
this.institutionsColumns = [
{
id: 'name',
header: 'Name',
type: 'accessor',
accessorKey: 'display_name',
},
{
id: 'collaborators',
header: 'Mitwirkende',
type: 'display',
cellTemplate: this.institutionsFrequencyTmp(),
},
{
id: 'actions',
header: '',
type: 'display',
cellTemplate: this.institutionsActionTmp(),
},
];
} }
onToggleChange(event: any) { onToggleChange(event: any) {
@@ -4,9 +4,9 @@
[loading]="loading" [loading]="loading"
[cardTmp]="cardTmp" [cardTmp]="cardTmp"
[cardMinWidth]="380" [cardMinWidth]="380"
[sortingDirectionOptions]="sortingDirectionOptions" [sortingDirectionOptions]="sortingDirectionOptions()"
sortingDirectionLabel="Sortierung" [sortingDirectionLabel]="'personNews.sorting' | translate"
searchLabel="Nachrichten durchsuchen" /> [searchLabel]="'personNews.search' | translate" />
</div> </div>
<ng-template #cardTmp let-article> <ng-template #cardTmp let-article>
@@ -17,10 +17,12 @@ import {
} from '../../shared/ui/card-search/card-search.component'; } from '../../shared/ui/card-search/card-search.component';
import { NewsCardComponent } from '../../shared/ui/news-card/news-card.component'; import { NewsCardComponent } from '../../shared/ui/news-card/news-card.component';
import { SelectorOption } from '../../shared/ui/query-param-selector/query-param-selector.component'; import { SelectorOption } from '../../shared/ui/query-param-selector/query-param-selector.component';
import { TranslatePipe } from '../../shared/i18n/translate.pipe';
import { LanguageService } from '../../shared/i18n/language.service';
@Component({ @Component({
selector: 'app-person-news', selector: 'app-person-news',
imports: [CardSearchComponent, NewsCardComponent], imports: [CardSearchComponent, NewsCardComponent, TranslatePipe],
templateUrl: './person-news.component.html', templateUrl: './person-news.component.html',
styleUrl: './person-news.component.scss', styleUrl: './person-news.component.scss',
}) })
@@ -28,11 +30,12 @@ export class PersonNewsComponent implements OnInit {
private readonly destroyRef = inject(DestroyRef); private readonly destroyRef = inject(DestroyRef);
private readonly route = inject(ActivatedRoute); private readonly route = inject(ActivatedRoute);
private readonly resolverStateService = inject(ResolverStateService); private readonly resolverStateService = inject(ResolverStateService);
private readonly languageService = inject(LanguageService);
readonly sortingDirectionOptions: SelectorOption[] = [ readonly sortingDirectionOptions = computed<SelectorOption[]>(() => [
{ value: 'desc', display_name: 'Neueste zuerst' }, { value: 'desc', display_name: this.languageService.translate('personNews.newestFirst') },
{ value: 'asc', display_name: 'Älteste zuerst' }, { value: 'asc', display_name: this.languageService.translate('personNews.oldestFirst') },
]; ]);
private readonly articles = signal<NewsArticle[]>([]); private readonly articles = signal<NewsArticle[]>([]);
private readonly total = signal(0); private readonly total = signal(0);
@@ -1,10 +1,10 @@
<section class="research-timeline-card"> <section class="research-timeline-card">
<div class="timeline-header"> <div class="timeline-header">
<div class="timeline-title"> <div class="timeline-title">
<h2>Forschungstimeline</h2> <h2>{{ 'researchTimeline.title' | translate }}</h2>
<p> <p>
Entwicklung der Forschungsthemen im Zeitverlauf {{ 'researchTimeline.subtitle' | translate }}
<span>(basierend auf Publikationen)</span> <span>{{ 'researchTimeline.basedOn' | translate }}</span>
</p> </p>
<span <span
@@ -14,7 +14,7 @@
!loadingEarlierYears !loadingEarlierYears
" "
class="no-topics"> class="no-topics">
Frühere Jahre konnten nicht geladen werden. {{ 'researchTimeline.earlierFailed' | translate }}
</span> </span>
</div> </div>
@@ -33,38 +33,38 @@
(expandedChange)="onSubfieldLegendExpandedChange($event)"> (expandedChange)="onSubfieldLegendExpandedChange($event)">
</app-topic-legend> </app-topic-legend>
<div class="view-toggle" aria-label="Ansicht wechseln"> <div class="view-toggle" [attr.aria-label]="'researchTimeline.changeView' | translate">
<button <button
type="button" type="button"
[class.active]="timelineViewMode === 'years'" [class.active]="timelineViewMode === 'years'"
(click)="setTimelineViewMode('years')"> (click)="setTimelineViewMode('years')">
Jahre {{ 'researchTimeline.years' | translate }}
</button> </button>
<button <button
type="button" type="button"
[class.active]="timelineViewMode === 'compact'" [class.active]="timelineViewMode === 'compact'"
(click)="setTimelineViewMode('compact')"> (click)="setTimelineViewMode('compact')">
Kompakt {{ 'researchTimeline.compact' | translate }}
</button> </button>
<button <button
type="button" type="button"
[class.active]="timelineViewMode === 'wordcloud'" [class.active]="timelineViewMode === 'wordcloud'"
(click)="setTimelineViewMode('wordcloud')"> (click)="setTimelineViewMode('wordcloud')">
Wordcloud {{ 'researchTimeline.wordCloud' | translate }}
</button> </button>
</div> </div>
<div <div
*ngIf="hasYearRange" *ngIf="hasYearRange"
class="year-filter" class="year-filter"
aria-label="Zeitraum eingrenzen"> [attr.aria-label]="'researchTimeline.limitPeriod' | translate">
<div class="year-filter-top"> <div class="year-filter-top">
<span class="year-filter-label">Zeitraum</span> <span class="year-filter-label">{{ 'persons.period' | translate }}</span>
<span class="year-filter-values"> <span class="year-filter-values">
{{ selectedStartYear }} bis {{ selectedEndYear }} {{ selectedStartYear }} {{ 'researchTimeline.to' | translate }} {{ selectedEndYear }}
</span> </span>
<button <button
@@ -72,7 +72,7 @@
class="reset-range-button" class="reset-range-button"
[disabled]="!canResetYearRange" [disabled]="!canResetYearRange"
(click)="resetYearRange()"> (click)="resetYearRange()">
Zurücksetzen {{ 'researchTimeline.reset' | translate }}
</button> </button>
</div> </div>
@@ -89,7 +89,7 @@
[max]="maxYear" [max]="maxYear"
[value]="selectedStartYear" [value]="selectedStartYear"
(input)="onStartYearInput($event)" (input)="onStartYearInput($event)"
aria-label="Startjahr" /> [attr.aria-label]="'researchTimeline.startYear' | translate" />
<input <input
class="range-input range-input-end" class="range-input range-input-end"
@@ -98,7 +98,7 @@
[max]="maxYear" [max]="maxYear"
[value]="selectedEndYear" [value]="selectedEndYear"
(input)="onEndYearInput($event)" (input)="onEndYearInput($event)"
aria-label="Endjahr" /> [attr.aria-label]="'researchTimeline.endYear' | translate" />
</div> </div>
<div class="year-filter-bounds"> <div class="year-filter-bounds">
@@ -118,13 +118,13 @@
class="timeline-state timeline-state-loading" class="timeline-state timeline-state-loading"
aria-live="polite"> aria-live="polite">
<mat-spinner diameter="36"></mat-spinner> <mat-spinner diameter="36"></mat-spinner>
<span>Forschungstimeline wird geladen ...</span> <span>{{ 'researchTimeline.loading' | translate }}</span>
</div> </div>
<div <div
*ngIf="!loading && loadFailed" *ngIf="!loading && loadFailed"
class="timeline-state timeline-state-error"> class="timeline-state timeline-state-error">
Forschungstimeline konnte nicht geladen werden. {{ 'researchTimeline.loadFailed' | translate }}
</div> </div>
<ng-container *ngIf="!loading && !loadFailed"> <ng-container *ngIf="!loading && !loadFailed">
@@ -146,7 +146,7 @@
class="year-button" class="year-button"
[disabled]="loadingEarlierYears" [disabled]="loadingEarlierYears"
(click)="requestEarlierYears()" (click)="requestEarlierYears()"
aria-label="Frühere Jahre der Forschungstimeline laden"> [attr.aria-label]="'researchTimeline.loadEarlierAria' | translate">
‹ ‹
</button> </button>
<span class="dot"></span> <span class="dot"></span>
@@ -163,7 +163,7 @@
class="year-button" class="year-button"
(click)="selectYears([item.year])" (click)="selectYears([item.year])"
[attr.aria-label]=" [attr.aria-label]="
'Publikationen aus dem Jahr ' + item.year + ' anzeigen' yearPublicationsAria(item.year)
"> ">
{{ item.year }} {{ item.year }}
</button> </button>
@@ -195,7 +195,7 @@
<span <span
*ngIf="earlierYearsLoadFailed && !loadingEarlierYears" *ngIf="earlierYearsLoadFailed && !loadingEarlierYears"
class="no-topics"> class="no-topics">
Laden fehlgeschlagen. {{ 'researchTimeline.loadingFailed' | translate }}
</span> </span>
</article> </article>
@@ -229,12 +229,7 @@
class="publication-count publication-count-button" class="publication-count publication-count-button"
[matTooltip]="getYearPublicationTooltip(item)" [matTooltip]="getYearPublicationTooltip(item)"
(click)="selectYears([item.year])"> (click)="selectYears([item.year])">
{{ item.publication_count }} {{ item.publication_count }} {{ publicationLabel(item.publication_count) }}
{{
item.publication_count === 1
? 'Publikation'
: 'Publikationen'
}}
</button> </button>
<div class="topic-list"> <div class="topic-list">
@@ -264,7 +259,7 @@
</ng-container> </ng-container>
<ng-template #noTopicsForYear> <ng-template #noTopicsForYear>
<span class="no-topics"> Keine weiteren Topics </span> <span class="no-topics">{{ 'researchTimeline.noMoreTopics' | translate }}</span>
</ng-template> </ng-template>
</div> </div>
</article> </article>
@@ -304,9 +299,7 @@
class="phase-years phase-years-button" class="phase-years phase-years-button"
(click)="selectYears(getPhaseYears(phase))" (click)="selectYears(getPhaseYears(phase))"
[attr.aria-label]=" [attr.aria-label]="
'Publikationen im Zeitraum ' + periodPublicationsAria(getPhaseYearLabel(phase))
getPhaseYearLabel(phase) +
' anzeigen'
"> ">
{{ getPhaseYearLabel(phase) }} {{ getPhaseYearLabel(phase) }}
</button> </button>
@@ -316,12 +309,7 @@
class="phase-publications phase-publications-button" class="phase-publications phase-publications-button"
[matTooltip]="getPhasePublicationTooltip(phase)" [matTooltip]="getPhasePublicationTooltip(phase)"
(click)="selectYears(getPhaseYears(phase))"> (click)="selectYears(getPhaseYears(phase))">
{{ phase.publication_count }} {{ phase.publication_count }} {{ publicationLabel(phase.publication_count) }}
{{
phase.publication_count === 1
? 'Publikation'
: 'Publikationen'
}}
</button> </button>
</div> </div>
@@ -365,7 +353,7 @@
</ng-container> </ng-container>
<ng-template #noPhaseTopics> <ng-template #noPhaseTopics>
<span class="no-topics"> Keine weiteren Topics </span> <span class="no-topics">{{ 'researchTimeline.noMoreTopics' | translate }}</span>
</ng-template> </ng-template>
</div> </div>
@@ -376,8 +364,8 @@
(click)="togglePhase(phase)"> (click)="togglePhase(phase)">
{{ {{
isPhaseExpanded(phase) isPhaseExpanded(phase)
? 'Details ausblenden' ? ('researchTimeline.hideDetails' | translate)
: 'Details anzeigen' : ('researchTimeline.showDetails' | translate)
}} }}
</button> </button>
@@ -391,7 +379,7 @@
class="phase-year-button" class="phase-year-button"
(click)="selectYears([year.year])" (click)="selectYears([year.year])"
[attr.aria-label]=" [attr.aria-label]="
'Publikationen aus dem Jahr ' + year.year + ' anzeigen' yearPublicationsAria(year.year)
"> ">
{{ year.year }} {{ year.year }}
</button> </button>
@@ -401,12 +389,7 @@
class="phase-year-publication-button" class="phase-year-publication-button"
[matTooltip]="getYearPublicationTooltip(year)" [matTooltip]="getYearPublicationTooltip(year)"
(click)="selectYears([year.year])"> (click)="selectYears([year.year])">
{{ year.publication_count }} {{ year.publication_count }} {{ publicationLabel(year.publication_count) }}
{{
year.publication_count === 1
? 'Publikation'
: 'Publikationen'
}}
</button> </button>
</div> </div>
@@ -443,7 +426,7 @@
</ng-container> </ng-container>
<ng-template #noPhaseYearTopics> <ng-template #noPhaseYearTopics>
<span class="no-topics"> Keine weiteren Topics </span> <span class="no-topics">{{ 'researchTimeline.noMoreTopics' | translate }}</span>
</ng-template> </ng-template>
</div> </div>
</div> </div>
@@ -454,13 +437,13 @@
<div class="timeline-note"> <div class="timeline-note">
<span class="note-dot"></span> <span class="note-dot"></span>
<span> Hauptforschungsschwerpunkte im jeweiligen Zeitraum </span> <span>{{ 'researchTimeline.note' | translate }}</span>
</div> </div>
</ng-container> </ng-container>
</ng-container> </ng-container>
</ng-template> </ng-template>
<ng-template #emptyTimeline> <ng-template #emptyTimeline>
<div class="timeline-state">Keine Timeline-Daten vorhanden.</div> <div class="timeline-state">{{ 'researchTimeline.empty' | translate }}</div>
</ng-template> </ng-template>
</section> </section>
@@ -11,6 +11,7 @@ import {
Output, Output,
SimpleChanges, SimpleChanges,
ViewChild, ViewChild,
inject,
} from '@angular/core'; } from '@angular/core';
import { TopicChipComponent } from '../../../../shared/ui/topic-chip/topic-chip.component'; import { TopicChipComponent } from '../../../../shared/ui/topic-chip/topic-chip.component';
import { TopicLegendComponent } from '../../../../shared/ui/topic-legend/topic-legend.component'; import { TopicLegendComponent } from '../../../../shared/ui/topic-legend/topic-legend.component';
@@ -26,6 +27,8 @@ import {
toggleTopicLegendSubfieldSelection, toggleTopicLegendSubfieldSelection,
} from '../../../../resolvers/utils/topic-legend'; } from '../../../../resolvers/utils/topic-legend';
import { buildTopicHierarchyTooltip } from '../../../../resolvers/utils/topic-tooltip'; import { buildTopicHierarchyTooltip } from '../../../../resolvers/utils/topic-tooltip';
import { TranslatePipe } from '../../../../shared/i18n/translate.pipe';
import { LanguageService } from '../../../../shared/i18n/language.service';
export interface TopicTimelineTopic { export interface TopicTimelineTopic {
id?: string; id?: string;
@@ -97,11 +100,13 @@ interface TimelineScrollAnchor {
MatTooltipModule, MatTooltipModule,
TopicChipComponent, TopicChipComponent,
TopicLegendComponent, TopicLegendComponent,
TranslatePipe,
], ],
templateUrl: './research-timeline.component.html', templateUrl: './research-timeline.component.html',
styleUrl: './research-timeline.component.scss', styleUrl: './research-timeline.component.scss',
}) })
export class ResearchTimelineComponent implements OnChanges, AfterViewChecked { export class ResearchTimelineComponent implements OnChanges, AfterViewChecked {
private readonly languageService = inject(LanguageService);
@ViewChild('timelineWrapper') @ViewChild('timelineWrapper')
private readonly timelineWrapper?: ElementRef<HTMLDivElement>; private readonly timelineWrapper?: ElementRef<HTMLDivElement>;
@Input() elements: TopicTimelineElement[] = []; @Input() elements: TopicTimelineElement[] = [];
@@ -213,14 +218,14 @@ export class ResearchTimelineComponent implements OnChanges, AfterViewChecked {
get earlierYearsLabel(): string { get earlierYearsLabel(): string {
if (this.loadingEarlierYears) { if (this.loadingEarlierYears) {
return 'Frühere Jahre werden geladen ...'; return this.languageService.translate('researchTimeline.earlierLoading');
} }
if (this.earlierYearsLoadFailed) { if (this.earlierYearsLoadFailed) {
return 'Frühere Jahre erneut laden'; return this.languageService.translate('researchTimeline.earlierRetry');
} }
return 'Frühere Jahre anzeigen'; return this.languageService.translate('researchTimeline.earlierShow');
} }
get rangeStartPercent(): string { get rangeStartPercent(): string {
@@ -322,7 +327,7 @@ export class ResearchTimelineComponent implements OnChanges, AfterViewChecked {
} }
getMainTopic(item: TopicTimelineElement): string { getMainTopic(item: TopicTimelineElement): string {
return this.getMainTopicItem(item)?.name ?? 'Keine Topics'; return this.getMainTopicItem(item)?.name ?? this.languageService.translate('researchTimeline.noTopicsShort');
} }
getMainTopicItem(item: TopicTimelineElement): TopicTimelineTopic | undefined { getMainTopicItem(item: TopicTimelineElement): TopicTimelineTopic | undefined {
@@ -356,10 +361,24 @@ export class ResearchTimelineComponent implements OnChanges, AfterViewChecked {
return phase.years.map((year) => year.year); return phase.years.map((year) => year.year);
} }
publicationLabel(count: number): string {
return this.languageService.translate(
count === 1 ? 'researchTimeline.publication' : 'researchTimeline.publications',
);
}
yearPublicationsAria(year: number): string {
return this.languageService.translate('researchTimeline.showYearPublications', { year });
}
periodPublicationsAria(period: string): string {
return this.languageService.translate('researchTimeline.showPeriodPublications', { period });
}
getYearPublicationTooltip(item: TopicTimelineElement): string { getYearPublicationTooltip(item: TopicTimelineElement): string {
return this.getPublicationTooltip( return this.getPublicationTooltip(
item.publication_count, item.publication_count,
`im Jahr ${item.year}`, this.languageService.translate('researchTimeline.inYear', { year: item.year }),
); );
} }
@@ -392,7 +411,7 @@ export class ResearchTimelineComponent implements OnChanges, AfterViewChecked {
topic: TopicTimelineTopic, topic: TopicTimelineTopic,
item: TopicTimelineElement, item: TopicTimelineElement,
): string { ): string {
return this.getTopicCountTooltip(topic, `im Jahr ${item.year}`); return this.getTopicCountTooltip(topic, this.languageService.translate('researchTimeline.inYear', { year: item.year }));
} }
getPhaseTopicCountTooltip( getPhaseTopicCountTooltip(
@@ -574,31 +593,30 @@ export class ResearchTimelineComponent implements OnChanges, AfterViewChecked {
} }
private getPublicationTooltip(count: number, period: string): string { private getPublicationTooltip(count: number, period: string): string {
const publicationLabel = return this.languageService.translate(
count === 1 ? 'Publikation wurde' : 'Publikationen wurden'; count === 1 ? 'researchTimeline.publicationTooltipOne' : 'researchTimeline.publicationTooltipMany',
{ count, period },
return `Insgesamt ${count} ${publicationLabel} ${period} veröffentlicht.`; );
} }
private getTopicCountTooltip( private getTopicCountTooltip(
topic: TopicTimelineTopic, topic: TopicTimelineTopic,
period: string, period: string,
): string { ): string {
const publicationLabel = return this.languageService.translate(
topic.count === 1 ? 'Publikation' : 'Publikationen'; topic.count === 1 ? 'researchTimeline.topicTooltipOne' : 'researchTimeline.topicTooltipMany',
const verb = topic.count === 1 ? 'hat' : 'haben'; { count: topic.count, period, topic: topic.name },
);
return `${topic.count} ${publicationLabel} ${period} ${verb} das Topic ${topic.name}.`;
} }
private getPhasePublicationTooltipPeriod( private getPhasePublicationTooltipPeriod(
phase: ResearchTimelinePhase, phase: ResearchTimelinePhase,
): string { ): string {
if (phase.startYear === phase.endYear) { if (phase.startYear === phase.endYear) {
return `im Jahr ${phase.startYear}`; return this.languageService.translate('researchTimeline.inYear', { year: phase.startYear });
} }
return `im Zeitraum ${this.getPhaseYearLabel(phase)}`; return this.languageService.translate('researchTimeline.inPeriod', { period: this.getPhaseYearLabel(phase) });
} }
private get earlierYearsColumnCount(): number { private get earlierYearsColumnCount(): number {
return this.showEarlierYearsControl ? 1 : 0; return this.showEarlierYearsControl ? 1 : 0;
@@ -695,7 +713,7 @@ export class ResearchTimelineComponent implements OnChanges, AfterViewChecked {
this.pushWorkingPhase(phases, currentPhase); this.pushWorkingPhase(phases, currentPhase);
currentPhase = this.createWorkingPhase( currentPhase = this.createWorkingPhase(
item, item,
this.getMainTopicItem(item) ?? { name: 'Keine Topics', count: 0 }, this.getMainTopicItem(item) ?? { name: this.languageService.translate('researchTimeline.noTopicsShort'), count: 0 },
); );
continue; continue;
} }
@@ -21,7 +21,7 @@
(loadEarlierYears)="onTimelineLoadEarlierYears()"> (loadEarlierYears)="onTimelineLoadEarlierYears()">
<div timeline-wordcloud-content class="word-cloud-view"> <div timeline-wordcloud-content class="word-cloud-view">
@if (loadingWordCloud) { @if (loadingWordCloud) {
<div class="word-cloud-state">Forschungsthemen werden geladen ...</div> <div class="word-cloud-state">{{ 'personOverview.topicsLoading' | translate }}</div>
} @else if (wordCloudWords.length) { } @else if (wordCloudWords.length) {
<div class="word-cloud-chart"> <div class="word-cloud-chart">
@for (word of wordCloudWords; track word.name) { @for (word of wordCloudWords; track word.name) {
@@ -41,7 +41,7 @@
} }
</div> </div>
} @else if (wordCloudEmpty) { } @else if (wordCloudEmpty) {
<p class="word-cloud-empty">Keine Forschungsthemen gefunden.</p> <p class="word-cloud-empty">{{ 'personOverview.noTopics' | translate }}</p>
} }
</div> </div>
</app-research-timeline> </app-research-timeline>
@@ -17,6 +17,7 @@ import {
import { TopicLegendTopic } from '../../resolvers/utils/topic-legend'; import { TopicLegendTopic } from '../../resolvers/utils/topic-legend';
import { topicHierarchyColor } from '../../resolvers/utils/topic-colors'; import { topicHierarchyColor } from '../../resolvers/utils/topic-colors';
import { buildTopicHierarchyTooltip } from '../../resolvers/utils/topic-tooltip'; import { buildTopicHierarchyTooltip } from '../../resolvers/utils/topic-tooltip';
import { TranslatePipe } from '../../shared/i18n/translate.pipe';
export interface WordCloudWord { export interface WordCloudWord {
name: string; name: string;
@@ -33,7 +34,7 @@ export interface WordCloudWord {
@Component({ @Component({
selector: 'app-person-overview', selector: 'app-person-overview',
standalone: true, standalone: true,
imports: [CommonModule, ResearchTimelineComponent, MatTooltipModule], imports: [CommonModule, ResearchTimelineComponent, MatTooltipModule, TranslatePipe],
templateUrl: './person-overview.component.html', templateUrl: './person-overview.component.html',
styleUrl: './person-overview.component.scss', styleUrl: './person-overview.component.scss',
}) })
@@ -1,11 +1,11 @@
@if (loading) { @if (loading) {
<app-loading <app-loading
text="Patentdaten werden geladen..." [text]="'personPatents.loading' | translate"
icon="workspace_premium" icon="workspace_premium"
[size]="150" [size]="150"
[diameter]="150" /> [diameter]="150" />
} @else if (error) { } @else if (error) {
<p class="message">Fehler beim Laden der Patente.</p> <p class="message">{{ 'personPatents.loadError' | translate }}</p>
} @else if (patents.length === 0) { } @else if (patents.length === 0) {
<p class="message">{{ getEmptyMessage() }}</p> <p class="message">{{ getEmptyMessage() }}</p>
} @else { } @else {
@@ -20,8 +20,8 @@
<mat-select <mat-select
[value]="activeFilter" [value]="activeFilter"
(selectionChange)="setFilter($event.value)"> (selectionChange)="setFilter($event.value)">
<mat-select-trigger>Filter nach Quelle</mat-select-trigger> <mat-select-trigger>{{ 'personPatents.filterSource' | translate }}</mat-select-trigger>
<mat-option value="all">Alle</mat-option> <mat-option value="all">{{ 'common.all' | translate }}</mat-option>
<mat-option value="EPO">EPO</mat-option> <mat-option value="EPO">EPO</mat-option>
<mat-option value="USPTO">USPTO</mat-option> <mat-option value="USPTO">USPTO</mat-option>
</mat-select> </mat-select>
@@ -33,9 +33,9 @@
<mat-select <mat-select
[value]="sortMode" [value]="sortMode"
(selectionChange)="setSortMode($event.value)"> (selectionChange)="setSortMode($event.value)">
<mat-select-trigger>Sortieren nach</mat-select-trigger> <mat-select-trigger>{{ 'personPatents.sortBy' | translate }}</mat-select-trigger>
<mat-option value="date">Datum</mat-option> <mat-option value="date">{{ 'publicationDetail.date' | translate }}</mat-option>
<mat-option value="title">Titel</mat-option> <mat-option value="title">{{ 'publications.columnTitle' | translate }}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
</div> </div>
@@ -43,11 +43,11 @@
<table> <table>
<thead> <thead>
<tr> <tr>
<th>Patent</th> <th>{{ 'personPatents.patent' | translate }}</th>
<th>Quelle</th> <th>{{ 'patents.source' | translate }}</th>
<th>Jahr</th> <th>{{ 'publications.year' | translate }}</th>
<th>Erfinder</th> <th>{{ 'patents.inventors' | translate }}</th>
<th>Anmelder</th> <th>{{ 'patents.assignees' | translate }}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@@ -94,7 +94,7 @@
<h3>{{ selectedPatent.title ?? selectedPatent.patent_id }}</h3> <h3>{{ selectedPatent.title ?? selectedPatent.patent_id }}</h3>
<div class="detail-stats"> <div class="detail-stats">
<div class="stat"> <div class="stat">
<span class="stat-label">Quelle</span> <span class="stat-label">{{ 'patents.source' | translate }}</span>
<span class="stat-value"> <span class="stat-value">
<span <span
class="source-badge source-badge--{{ class="source-badge source-badge--{{
@@ -105,18 +105,18 @@
</span> </span>
</div> </div>
<div class="stat"> <div class="stat">
<span class="stat-label">Patent-Nr.</span> <span class="stat-label">{{ 'patents.number' | translate }}</span>
<span class="stat-value">{{ selectedPatent.patent_id }}</span> <span class="stat-value">{{ selectedPatent.patent_id }}</span>
</div> </div>
<div class="stat"> <div class="stat">
<span class="stat-label">Datum</span> <span class="stat-label">{{ 'publicationDetail.date' | translate }}</span>
<span class="stat-value">{{ <span class="stat-value">{{
formatDate(selectedPatent.publication_date) formatDate(selectedPatent.publication_date)
}}</span> }}</span>
</div> </div>
@if (getPublicationStageLabel(selectedPatent); as stageLabel) { @if (getPublicationStageLabel(selectedPatent); as stageLabel) {
<div class="stat"> <div class="stat">
<span class="stat-label">Publikationsstufe</span> <span class="stat-label">{{ 'patents.publicationStage' | translate }}</span>
<span class="stat-value">{{ stageLabel }}</span> <span class="stat-value">{{ stageLabel }}</span>
</div> </div>
} }
@@ -134,22 +134,22 @@
class="patent-detail-action" class="patent-detail-action"
(click)="openDetail()"> (click)="openDetail()">
<span class="patent-detail-action__label" <span class="patent-detail-action__label"
>Patentdetails anzeigen</span >{{ 'personPatents.showDetails' | translate }}</span
> >
<mat-icon aria-hidden="true">chevron_right</mat-icon> <mat-icon aria-hidden="true">chevron_right</mat-icon>
</button> </button>
<p class="patent-detail-hint"> <p class="patent-detail-hint">
Abstract, Erfinder, Anmelder und IPC/CPC-Klassifikation {{ 'personPatents.detailHint' | translate }}
</p> </p>
</div> </div>
} @else { } @else {
<div class="patent-detail overview"> <div class="patent-detail overview">
<p class="overview-title">Patentübersicht</p> <p class="overview-title">{{ 'personPatents.overview' | translate }}</p>
<p class="overview-subtitle">Patente mit passendem Erfindername.</p> <p class="overview-subtitle">{{ 'personPatents.overviewSubtitle' | translate }}</p>
<div class="overview-stats"> <div class="overview-stats">
<div class="overview-stat overview-stat--total"> <div class="overview-stat overview-stat--total">
<span class="overview-value">{{ patents.length }}</span> <span class="overview-value">{{ patents.length }}</span>
<span class="overview-label">Patente</span> <span class="overview-label">{{ 'patents.title' | translate }}</span>
</div> </div>
<div class="overview-stat overview-stat--epo"> <div class="overview-stat overview-stat--epo">
<span class="overview-value">{{ getEpoCount() }}</span> <span class="overview-value">{{ getEpoCount() }}</span>
@@ -161,7 +161,7 @@
</div> </div>
</div> </div>
<p class="overview-hint"> <p class="overview-hint">
Wähle links ein Patent aus, um Details zu sehen. {{ 'personPatents.selectHint' | translate }}
</p> </p>
</div> </div>
} }
@@ -15,6 +15,8 @@ import {
import { LoadingComponent } from '../../shared/ui/loading/loading.component'; import { LoadingComponent } from '../../shared/ui/loading/loading.component';
import { PageEvent } from '@angular/material/paginator'; import { PageEvent } from '@angular/material/paginator';
import { QueryParamPaginatorComponent } from '../../shared/ui/query-param-paginator/query-param-paginator.component'; import { QueryParamPaginatorComponent } from '../../shared/ui/query-param-paginator/query-param-paginator.component';
import { TranslatePipe } from '../../shared/i18n/translate.pipe';
import { LanguageService } from '../../shared/i18n/language.service';
type SortMode = 'date' | 'title'; type SortMode = 'date' | 'title';
type SourceFilter = 'all' | 'EPO' | 'USPTO'; type SourceFilter = 'all' | 'EPO' | 'USPTO';
@@ -28,6 +30,7 @@ type SourceFilter = 'all' | 'EPO' | 'USPTO';
MatSelectModule, MatSelectModule,
MatIconModule, MatIconModule,
QueryParamPaginatorComponent, QueryParamPaginatorComponent,
TranslatePipe,
], ],
templateUrl: './person-patents.component.html', templateUrl: './person-patents.component.html',
styleUrl: './person-patents.component.scss', styleUrl: './person-patents.component.scss',
@@ -36,6 +39,7 @@ export class PersonPatentsComponent {
private route = inject(ActivatedRoute); private route = inject(ActivatedRoute);
private router = inject(Router); private router = inject(Router);
private destroyRef = inject(DestroyRef); private destroyRef = inject(DestroyRef);
private languageService = inject(LanguageService);
patents: PatentEntry[] = []; patents: PatentEntry[] = [];
filteredPatents: PatentEntry[] = []; filteredPatents: PatentEntry[] = [];
@@ -146,7 +150,7 @@ export class PersonPatentsComponent {
a.publication_date ?? '', a.publication_date ?? '',
); );
} }
return (a.title ?? '').localeCompare(b.title ?? '', 'de', { return (a.title ?? '').localeCompare(b.title ?? '', this.languageService.language(), {
sensitivity: 'base', sensitivity: 'base',
}); });
}); });
@@ -198,7 +202,7 @@ export class PersonPatentsComponent {
} }
formatDate(date: string | null | undefined): string { formatDate(date: string | null | undefined): string {
return formatPatentDate(date); return formatPatentDate(date, this.languageService.language() === 'de' ? 'de-DE' : 'en-US');
} }
getEpoCount(): number { getEpoCount(): number {
@@ -234,6 +238,6 @@ export class PersonPatentsComponent {
} }
getEmptyMessage(): string { getEmptyMessage(): string {
return 'Keine Patente gefunden.'; return this.languageService.translate('personPatents.empty');
} }
} }
@@ -8,7 +8,7 @@
routerLinkActive routerLinkActive
#rla="routerLinkActive" #rla="routerLinkActive"
[active]="rla.isActive"> [active]="rla.isActive">
{{ route.label }} {{ route.labelKey | translate }}
</a> </a>
} }
</nav> </nav>
@@ -3,6 +3,8 @@ import { RouterLink, RouterLinkActive, RouterOutlet } from '@angular/router';
import { MatCardModule } from '@angular/material/card'; import { MatCardModule } from '@angular/material/card';
import { MatTabsModule } from '@angular/material/tabs'; import { MatTabsModule } from '@angular/material/tabs';
import { TranslatePipe } from '../../shared/i18n/translate.pipe';
import { TranslationKey } from '../../shared/i18n/translations';
@Component({ @Component({
selector: 'app-person-projects', selector: 'app-person-projects',
@@ -13,6 +15,7 @@ import { MatTabsModule } from '@angular/material/tabs';
RouterOutlet, RouterOutlet,
RouterLink, RouterLink,
RouterLinkActive, RouterLinkActive,
TranslatePipe,
], ],
templateUrl: './person-projects.component.html', templateUrl: './person-projects.component.html',
styleUrl: './person-projects.component.scss', styleUrl: './person-projects.component.scss',
@@ -21,11 +24,11 @@ export class PersonProjectsComponent {
readonly childRoutes = [ readonly childRoutes = [
{ {
path: 'dfg', path: 'dfg',
label: 'DFG-Projekte', labelKey: 'personProjects.dfg' as TranslationKey,
}, },
{ {
path: 'eu', path: 'eu',
label: 'EU-Projekte', labelKey: 'personProjects.eu' as TranslationKey,
}, },
]; ];
} }
@@ -2,7 +2,7 @@
<mat-accordion multi> <mat-accordion multi>
<mat-expansion-panel class="mat-elevation-z1"> <mat-expansion-panel class="mat-elevation-z1">
<mat-expansion-panel-header> <mat-expansion-panel-header>
<mat-panel-title>Forschungszwecke</mat-panel-title> <mat-panel-title>{{ 'publications.researchPurposes' | translate }}</mat-panel-title>
</mat-expansion-panel-header> </mat-expansion-panel-header>
<app-primary-category-year-aggregation-chart <app-primary-category-year-aggregation-chart
[page]="primaryCategoryYearAggregationPage()" /> [page]="primaryCategoryYearAggregationPage()" />
@@ -10,10 +10,10 @@
<mat-expansion-panel class="mat-elevation-z1" [expanded]="true"> <mat-expansion-panel class="mat-elevation-z1" [expanded]="true">
<mat-expansion-panel-header> <mat-expansion-panel-header>
<mat-panel-title>Publikationsliste</mat-panel-title> <mat-panel-title>{{ 'publications.list' | translate }}</mat-panel-title>
<mat-panel-description <mat-panel-description
>{{ total() >= 10000 ? 'mehr als' : '' }} >{{ total() >= 10000 ? ('publications.moreThan' | translate) : '' }}
{{ total() }} Publikationen</mat-panel-description {{ total() }} {{ 'publications.publications' | translate }}</mat-panel-description
> >
</mat-expansion-panel-header> </mat-expansion-panel-header>
<ng-container *ngTemplateOutlet="filterTableAndPaginator" /> <ng-container *ngTemplateOutlet="filterTableAndPaginator" />
@@ -13,6 +13,7 @@ import { PublicationFilterComponent } from '../../shared/ui/publication-filters/
import { PrimaryCategoryYearAggregationChartComponent } from '../../shared/ui/primary-category-year-aggregation-chart/primary-category-year-aggregation-chart.component'; import { PrimaryCategoryYearAggregationChartComponent } from '../../shared/ui/primary-category-year-aggregation-chart/primary-category-year-aggregation-chart.component';
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { ActivatedRoute } from '@angular/router'; import { ActivatedRoute } from '@angular/router';
import { TranslatePipe } from '../../shared/i18n/translate.pipe';
@Component({ @Component({
selector: 'app-person-publications', selector: 'app-person-publications',
@@ -23,6 +24,7 @@ import { ActivatedRoute } from '@angular/router';
QueryParamPaginatorComponent, QueryParamPaginatorComponent,
PrimaryCategoryYearAggregationChartComponent, PrimaryCategoryYearAggregationChartComponent,
CommonModule, CommonModule,
TranslatePipe,
], ],
templateUrl: './person-publications.component.html', templateUrl: './person-publications.component.html',
styleUrl: './person-publications.component.scss', styleUrl: './person-publications.component.scss',
@@ -12,13 +12,13 @@
[class.bookmarked]="bookmarkService.isBookmarked(person()?.id)" [class.bookmarked]="bookmarkService.isBookmarked(person()?.id)"
[attr.aria-label]=" [attr.aria-label]="
bookmarkService.isBookmarked(person()?.id) bookmarkService.isBookmarked(person()?.id)
? 'Bookmark entfernen' ? ('bookmarks.removeTooltip' | translate)
: 'Person bookmarken' : ('bookmarks.saveTooltip' | translate)
" "
[matTooltip]=" [matTooltip]="
bookmarkService.isBookmarked(person()?.id) bookmarkService.isBookmarked(person()?.id)
? 'Bookmark entfernen' ? ('bookmarks.removeTooltip' | translate)
: 'Person bookmarken' : ('bookmarks.saveTooltip' | translate)
" "
(click)="toggleBookmark()"> (click)="toggleBookmark()">
<mat-icon>{{ <mat-icon>{{
@@ -23,6 +23,7 @@ import { PersonBioResolved } from '../../resolvers/person-bio.resolver';
import { PersonDataResolved } from '../../resolvers/person.resolver'; import { PersonDataResolved } from '../../resolvers/person.resolver';
import { BookmarkService } from '../../shared/services/bookmark.service'; import { BookmarkService } from '../../shared/services/bookmark.service';
import { collaborationGraphQueryParamKeys } from '../../resolvers/collaboration-graph.resolver'; import { collaborationGraphQueryParamKeys } from '../../resolvers/collaboration-graph.resolver';
import { TranslatePipe } from '../../shared/i18n/translate.pipe';
type PersonLink = { type PersonLink = {
label: string; label: string;
@@ -43,6 +44,7 @@ type PersonLink = {
RouterOutlet, RouterOutlet,
RouterModule, RouterModule,
LoadingComponent, LoadingComponent,
TranslatePipe,
], ],
templateUrl: './person.component.html', templateUrl: './person.component.html',
styleUrl: './person.component.scss', styleUrl: './person.component.scss',
@@ -3,7 +3,10 @@
@if (showHeader) { @if (showHeader) {
<div class="section-header"> <div class="section-header">
<mat-icon>business</mat-icon> <mat-icon>business</mat-icon>
<h2>{{ headerTitle }} ({{ getOrgsCount() }})</h2> <h2>
{{ headerTitle || ('organizations.title' | translate) }}
({{ getOrgsCount() }})
</h2>
</div> </div>
} }
@@ -14,7 +17,11 @@
class="org-name-cell" class="org-name-cell"
(click)="searchForInstitutionName(org.name || org.shortName || '')"> (click)="searchForInstitutionName(org.name || org.shortName || '')">
<span class="org-name-text"> <span class="org-name-text">
{{ org.name || org.shortName || 'Unbekannte Organisation' }} {{
org.name ||
org.shortName ||
('organizations.unknown' | translate)
}}
</span> </span>
</div> </div>
</ng-template> </ng-template>
@@ -19,6 +19,8 @@ import {
DataTableComponent, DataTableComponent,
GenericColumn, GenericColumn,
} from '../../../../shared/ui/data-table/data-table.component'; } from '../../../../shared/ui/data-table/data-table.component';
import { LanguageService } from '../../../../shared/i18n/language.service';
import { TranslatePipe } from '../../../../shared/i18n/translate.pipe';
@Component({ @Component({
selector: 'app-organizations-table', selector: 'app-organizations-table',
@@ -29,17 +31,19 @@ import {
CurrencyPipe, CurrencyPipe,
DataTableComponent, DataTableComponent,
MatPaginatorModule, MatPaginatorModule,
TranslatePipe,
], ],
templateUrl: './organizations-table.component.html', templateUrl: './organizations-table.component.html',
styleUrl: './organizations-table.component.scss', styleUrl: './organizations-table.component.scss',
}) })
export class OrganizationsTableComponent { export class OrganizationsTableComponent {
private readonly router = inject(Router); private readonly router = inject(Router);
private readonly languageService = inject(LanguageService);
public paginationService = inject(PaginationService); public paginationService = inject(PaginationService);
@Input() orgs: HEUOrganization[] = []; @Input() orgs: HEUOrganization[] = [];
@Input() showHeader: boolean = true; @Input() showHeader: boolean = true;
@Input() headerTitle: string = 'Organisationen'; @Input() headerTitle?: string;
pageIndex = signal(0); pageIndex = signal(0);
pageSize = signal(10); pageSize = signal(10);
@@ -63,35 +67,35 @@ export class OrganizationsTableComponent {
columns = computed<GenericColumn<HEUOrganization>[]>(() => [ columns = computed<GenericColumn<HEUOrganization>[]>(() => [
{ {
id: 'name', id: 'name',
header: 'Name', header: this.languageService.translate('organizations.name'),
type: 'accessor', type: 'accessor',
accessorKey: 'name', accessorKey: 'name',
cellTemplate: this.nameTemplate(), cellTemplate: this.nameTemplate(),
}, },
{ {
id: 'role', id: 'role',
header: 'Rolle', header: this.languageService.translate('organizations.role'),
type: 'accessor', type: 'accessor',
accessorKey: 'role', accessorKey: 'role',
cellTemplate: this.roleTemplate(), cellTemplate: this.roleTemplate(),
}, },
{ {
id: 'city', id: 'city',
header: 'Stadt', header: this.languageService.translate('organizations.city'),
type: 'accessor', type: 'accessor',
accessorKey: 'city', accessorKey: 'city',
cellTemplate: this.cityTemplate(), cellTemplate: this.cityTemplate(),
}, },
{ {
id: 'ecContribution', id: 'ecContribution',
header: 'EU-Beitrag', header: this.languageService.translate('organizations.euContribution'),
type: 'accessor', type: 'accessor',
accessorKey: 'ecContribution', accessorKey: 'ecContribution',
cellTemplate: this.ecContributionTemplate(), cellTemplate: this.ecContributionTemplate(),
}, },
{ {
id: 'activityType', id: 'activityType',
header: 'Aktivitätstyp', header: this.languageService.translate('organizations.activityType'),
type: 'accessor', type: 'accessor',
accessorKey: 'activityType', accessorKey: 'activityType',
cellTemplate: this.activityTypeTemplate(), cellTemplate: this.activityTypeTemplate(),
@@ -105,7 +109,7 @@ export class OrganizationsTableComponent {
}, },
{ {
id: 'organizationURL', id: 'organizationURL',
header: 'URL', header: this.languageService.translate('organizations.url'),
type: 'accessor', type: 'accessor',
accessorKey: 'organizationURL', accessorKey: 'organizationURL',
cellTemplate: this.organizationUrlTemplate(), cellTemplate: this.organizationUrlTemplate(),
@@ -5,20 +5,20 @@
(click)="navigateBack()" (click)="navigateBack()"
[attr.aria-label]="returnAriaLabel"> [attr.aria-label]="returnAriaLabel">
<mat-icon>arrow_back</mat-icon> <mat-icon>arrow_back</mat-icon>
{{ returnLabel }} {{ displayReturnLabel }}
</button> </button>
@if (loading) { @if (loading) {
<div class="state"> <div class="state">
<mat-spinner diameter="42"></mat-spinner> <mat-spinner diameter="42"></mat-spinner>
<p>Publikation wird geladen...</p> <p>{{ 'publicationDetail.loading' | translate }}</p>
</div> </div>
} @else if (notFound || !publication) { } @else if (notFound || !publication) {
<div class="state error-state"> <div class="state error-state">
<mat-icon>search_off</mat-icon> <mat-icon>search_off</mat-icon>
<h2>Publikation nicht gefunden</h2> <h2>{{ 'publicationDetail.notFound' | translate }}</h2>
<p>Die Publikation konnte nicht geladen werden.</p> <p>{{ 'publicationDetail.loadError' | translate }}</p>
<a mat-stroked-button routerLink="/persons"> Zur Personensuche </a> <a mat-stroked-button routerLink="/persons">{{ 'publicationDetail.peopleSearch' | translate }}</a>
</div> </div>
} @else { } @else {
<header class="hero"> <header class="hero">
@@ -41,7 +41,7 @@
} }
</div> </div>
<h1> <h1>
{{ publication.title || publication.display_name || 'Ohne Titel' }} {{ publication.title || publication.display_name || ('publicationDetail.untitled' | translate) }}
</h1> </h1>
<p class="author-line"> <p class="author-line">
@for ( @for (
@@ -52,13 +52,13 @@
<span>{{ <span>{{
authorship.author?.display_name || authorship.author?.display_name ||
authorship.raw_author_name || authorship.raw_author_name ||
'Unbekannt' ('common.unknown' | translate)
}}</span> }}</span>
@if (!last) { @if (!last) {
<span>, </span> <span>, </span>
} }
} @empty { } @empty {
Autorinnen und Autoren nicht angegeben {{ 'publicationDetail.authorsNotProvided' | translate }}
} }
</p> </p>
<div class="hero-actions"> <div class="hero-actions">
@@ -81,24 +81,24 @@
</div> </div>
</div> </div>
<div class="metrics" aria-label="Publikationskennzahlen"> <div class="metrics" [attr.aria-label]="'publicationDetail.metrics' | translate">
<div> <div>
<mat-icon>format_quote</mat-icon> <mat-icon>format_quote</mat-icon>
<strong>{{ publication.cited_by_count ?? 0 | number }}</strong> <strong>{{ publication.cited_by_count ?? 0 | number }}</strong>
<span>Zitationen</span> <span>{{ 'publicationDetail.citations' | translate }}</span>
</div> </div>
<div> <div>
<mat-icon>menu_book</mat-icon> <mat-icon>menu_book</mat-icon>
<strong>{{ <strong>{{
publication.referenced_works_count ?? 0 | number publication.referenced_works_count ?? 0 | number
}}</strong> }}</strong>
<span>Referenzen</span> <span>{{ 'publicationDetail.references' | translate }}</span>
</div> </div>
<div [class.positive]="publication.open_access?.is_oa"> <div [class.positive]="publication.open_access?.is_oa">
<mat-icon>{{ <mat-icon>{{
publication.open_access?.is_oa ? 'lock_open' : 'lock' publication.open_access?.is_oa ? 'lock_open' : 'lock'
}}</mat-icon> }}</mat-icon>
<strong>{{ publication.open_access?.is_oa ? 'Ja' : 'Nein' }}</strong> <strong>{{ (publication.open_access?.is_oa ? 'common.yes' : 'common.no') | translate }}</strong>
<span>Open Access</span> <span>Open Access</span>
</div> </div>
</div> </div>
@@ -107,7 +107,7 @@
@if (publication.is_retracted) { @if (publication.is_retracted) {
<div class="warning"> <div class="warning">
<mat-icon>warning</mat-icon> <mat-icon>warning</mat-icon>
Diese Publikation wurde zurückgezogen. {{ 'publicationDetail.retracted' | translate }}
</div> </div>
} }
@@ -130,10 +130,10 @@
(click)="authorsExpanded = !authorsExpanded" (click)="authorsExpanded = !authorsExpanded"
[attr.aria-expanded]="authorsExpanded"> [attr.aria-expanded]="authorsExpanded">
<mat-icon>group</mat-icon> <mat-icon>group</mat-icon>
<span class="accordion-title">Autorinnen und Autoren</span> <span class="accordion-title">{{ 'publicationDetail.authors' | translate }}</span>
<mat-icon <mat-icon
class="info-icon" class="info-icon"
matTooltip="Autorinnen und Autoren dieser Publikation. Klicke auf eine Person, um zu ihrem Profil zu gelangen." [matTooltip]="'publicationDetail.authorsHelp' | translate"
matTooltipPosition="above" matTooltipPosition="above"
(click)="$event.stopPropagation()" (click)="$event.stopPropagation()"
>info_outline</mat-icon >info_outline</mat-icon
@@ -173,24 +173,24 @@
{{ {{
authorship.author?.display_name || authorship.author?.display_name ||
authorship.raw_author_name || authorship.raw_author_name ||
'Unbekannt' ('common.unknown' | translate)
}} }}
</a> </a>
} @else { } @else {
<strong>{{ <strong>{{
authorship.raw_author_name || 'Unbekannt' authorship.raw_author_name || ('common.unknown' | translate)
}}</strong> }}</strong>
} }
<p> <p>
{{ authorship.author_position || 'Mitautor/in' }} {{ authorship.author_position || ('publicationDetail.coauthor' | translate) }}
@if (authorship.is_corresponding) { @if (authorship.is_corresponding) {
· Korrespondenz · {{ 'publicationDetail.corresponding' | translate }}
} }
</p> </p>
</div> </div>
</article> </article>
} @empty { } @empty {
<p class="empty">Keine Angaben vorhanden.</p> <p class="empty">{{ 'common.noInformation' | translate }}</p>
} }
</div> </div>
@if (authorsPageCount() > 1) { @if (authorsPageCount() > 1) {
@@ -198,6 +198,7 @@
<button <button
type="button" type="button"
class="page-btn" class="page-btn"
[attr.aria-label]="'paginator.previous' | translate"
[disabled]="authorsPage === 0" [disabled]="authorsPage === 0"
(click)="authorsPage = authorsPage - 1"> (click)="authorsPage = authorsPage - 1">
<mat-icon>chevron_left</mat-icon> <mat-icon>chevron_left</mat-icon>
@@ -208,6 +209,7 @@
<button <button
type="button" type="button"
class="page-btn" class="page-btn"
[attr.aria-label]="'paginator.next' | translate"
[disabled]="authorsPage === authorsPageCount() - 1" [disabled]="authorsPage === authorsPageCount() - 1"
(click)="authorsPage = authorsPage + 1"> (click)="authorsPage = authorsPage + 1">
<mat-icon>chevron_right</mat-icon> <mat-icon>chevron_right</mat-icon>
@@ -224,7 +226,7 @@
<section class="card"> <section class="card">
<div class="section-title"> <div class="section-title">
<mat-icon>label</mat-icon> <mat-icon>label</mat-icon>
<h2>Themen</h2> <h2>{{ 'publications.columnTopics' | translate }}</h2>
</div> </div>
<div class="tags"> <div class="tags">
@for (topic of publication.topics; track topic.id) { @for (topic of publication.topics; track topic.id) {
@@ -246,7 +248,7 @@
<section class="card"> <section class="card">
<div class="section-title"> <div class="section-title">
<mat-icon>interests</mat-icon> <mat-icon>interests</mat-icon>
<h2>Keywords</h2> <h2>{{ 'publicationDetail.keywords' | translate }}</h2>
</div> </div>
<div class="tags"> <div class="tags">
@for (keyword of publication.keywords; track keyword.id) { @for (keyword of publication.keywords; track keyword.id) {
@@ -264,10 +266,10 @@
(click)="sourcesExpanded = !sourcesExpanded" (click)="sourcesExpanded = !sourcesExpanded"
[attr.aria-expanded]="sourcesExpanded"> [attr.aria-expanded]="sourcesExpanded">
<mat-icon>library_books</mat-icon> <mat-icon>library_books</mat-icon>
<span class="accordion-title">Quellen und Versionen</span> <span class="accordion-title">{{ 'publicationDetail.sourcesVersions' | translate }}</span>
<mat-icon <mat-icon
class="info-icon" class="info-icon"
matTooltip="Quellen und Versionen, unter denen die Publikation verfügbar ist. Klicke auf das Symbol, um die Quelle zu öffnen." [matTooltip]="'publicationDetail.sourcesHelp' | translate"
matTooltipPosition="above" matTooltipPosition="above"
(click)="$event.stopPropagation()" (click)="$event.stopPropagation()"
>info_outline</mat-icon >info_outline</mat-icon
@@ -287,13 +289,13 @@
<article> <article>
<div> <div>
<strong>{{ <strong>{{
location.source?.display_name || 'Externe Quelle' location.source?.display_name || ('publicationDetail.externalSource' | translate)
}}</strong> }}</strong>
<p> <p>
{{ {{
location.version || location.version ||
location.source?.type || location.source?.type ||
'Veröffentlichte Version' ('publicationDetail.publishedVersion' | translate)
}} }}
@if (location.license) { @if (location.license) {
· {{ location.license }} · {{ location.license }}
@@ -312,7 +314,7 @@
[href]="sourceUrl" [href]="sourceUrl"
target="_blank" target="_blank"
rel="noopener" rel="noopener"
aria-label="Quelle öffnen"> [attr.aria-label]="'publicationDetail.openSource' | translate">
<mat-icon>open_in_new</mat-icon> <mat-icon>open_in_new</mat-icon>
</a> </a>
} }
@@ -330,21 +332,21 @@
<section class="card facts-card"> <section class="card facts-card">
<div class="section-title"> <div class="section-title">
<mat-icon>info</mat-icon> <mat-icon>info</mat-icon>
<h2>Publikationsdaten</h2> <h2>{{ 'publicationDetail.data' | translate }}</h2>
</div> </div>
<dl> <dl>
<div> <div>
<dt>Datum</dt> <dt>{{ 'publicationDetail.date' | translate }}</dt>
<dd> <dd>
{{ (publication.publication_date | date: 'dd.MM.yyyy') || '-' }} {{ (publication.publication_date | date: 'dd.MM.yyyy') || '-' }}
</dd> </dd>
</div> </div>
<div> <div>
<dt>Typ</dt> <dt>{{ 'publications.type' | translate }}</dt>
<dd>{{ publication.type | workType }}</dd> <dd>{{ publication.type | workType }}</dd>
</div> </div>
<div> <div>
<dt>Sprache</dt> <dt>{{ 'publications.language' | translate }}</dt>
<dd>{{ publication.language | languageCode }}</dd> <dd>{{ publication.language | languageCode }}</dd>
</div> </div>
<div> <div>
@@ -352,19 +354,19 @@
<dd>{{ openAccessLabel() }}</dd> <dd>{{ openAccessLabel() }}</dd>
</div> </div>
<div> <div>
<dt>Volume</dt> <dt>{{ 'publicationDetail.volume' | translate }}</dt>
<dd>{{ publication.biblio?.volume || '-' }}</dd> <dd>{{ publication.biblio?.volume || '-' }}</dd>
</div> </div>
<div> <div>
<dt>Ausgabe</dt> <dt>{{ 'publicationDetail.issue' | translate }}</dt>
<dd>{{ publication.biblio?.issue || '-' }}</dd> <dd>{{ publication.biblio?.issue || '-' }}</dd>
</div> </div>
<div> <div>
<dt>Seiten</dt> <dt>{{ 'publicationDetail.pages' | translate }}</dt>
<dd>{{ pages() || '-' }}</dd> <dd>{{ pages() || '-' }}</dd>
</div> </div>
<div> <div>
<dt>Indexiert in</dt> <dt>{{ 'publicationDetail.indexedIn' | translate }}</dt>
<dd>{{ publication.indexed_in?.join(', ') || '-' }}</dd> <dd>{{ publication.indexed_in?.join(', ') || '-' }}</dd>
</div> </div>
</dl> </dl>
@@ -378,10 +380,10 @@
(click)="institutionsExpanded = !institutionsExpanded" (click)="institutionsExpanded = !institutionsExpanded"
[attr.aria-expanded]="institutionsExpanded"> [attr.aria-expanded]="institutionsExpanded">
<mat-icon>account_balance</mat-icon> <mat-icon>account_balance</mat-icon>
<span class="accordion-title">Institutionen</span> <span class="accordion-title">{{ 'publications.columnInstitutions' | translate }}</span>
<mat-icon <mat-icon
class="info-icon" class="info-icon"
matTooltip="Institutionen, denen die Autorinnen und Autoren angehören. Klicke auf eine Institution, um zu ihrer Seite zu gelangen." [matTooltip]="'publicationDetail.institutionsHelp' | translate"
matTooltipPosition="above" matTooltipPosition="above"
(click)="$event.stopPropagation()" (click)="$event.stopPropagation()"
>info_outline</mat-icon >info_outline</mat-icon
@@ -431,6 +433,7 @@
<button <button
type="button" type="button"
class="page-btn" class="page-btn"
[attr.aria-label]="'paginator.previous' | translate"
[disabled]="institutionsPage === 0" [disabled]="institutionsPage === 0"
(click)="institutionsPage = institutionsPage - 1"> (click)="institutionsPage = institutionsPage - 1">
<mat-icon>chevron_left</mat-icon> <mat-icon>chevron_left</mat-icon>
@@ -442,6 +445,7 @@
<button <button
type="button" type="button"
class="page-btn" class="page-btn"
[attr.aria-label]="'paginator.next' | translate"
[disabled]=" [disabled]="
institutionsPage === institutionsPageCount() - 1 institutionsPage === institutionsPageCount() - 1
" "
@@ -463,10 +467,10 @@
(click)="fundingExpanded = !fundingExpanded" (click)="fundingExpanded = !fundingExpanded"
[attr.aria-expanded]="fundingExpanded"> [attr.aria-expanded]="fundingExpanded">
<mat-icon>paid</mat-icon> <mat-icon>paid</mat-icon>
<span class="accordion-title">Förderungen</span> <span class="accordion-title">{{ 'publicationDetail.funding' | translate }}</span>
<mat-icon <mat-icon
class="info-icon" class="info-icon"
matTooltip="Förderorganisationen und Förderungen, die zu dieser Publikation beigetragen haben." [matTooltip]="'publicationDetail.fundingHelp' | translate"
matTooltipPosition="above" matTooltipPosition="above"
(click)="$event.stopPropagation()" (click)="$event.stopPropagation()"
>info_outline</mat-icon >info_outline</mat-icon
@@ -482,7 +486,7 @@
@for (funder of publication.funders ?? []; track funder.id) { @for (funder of publication.funders ?? []; track funder.id) {
<div> <div>
<strong>{{ funder.display_name }}</strong <strong>{{ funder.display_name }}</strong
><span>Förderorganisation</span> ><span>{{ 'publicationDetail.funder' | translate }}</span>
</div> </div>
} }
@for (award of publication.awards ?? []; track award.id) { @for (award of publication.awards ?? []; track award.id) {
@@ -491,7 +495,7 @@
award.display_name || award.funder_award_id award.display_name || award.funder_award_id
}}</strong }}</strong
><span>{{ ><span>{{
award.funder_display_name || 'Förderung' award.funder_display_name || ('publicationDetail.fundingOne' | translate)
}}</span> }}</span>
</div> </div>
} }
@@ -509,10 +513,10 @@
(click)="linksExpanded = !linksExpanded" (click)="linksExpanded = !linksExpanded"
[attr.aria-expanded]="linksExpanded"> [attr.aria-expanded]="linksExpanded">
<mat-icon>link</mat-icon> <mat-icon>link</mat-icon>
<span class="accordion-title">Externe Links</span> <span class="accordion-title">{{ 'publicationDetail.externalLinks' | translate }}</span>
<mat-icon <mat-icon
class="info-icon" class="info-icon"
matTooltip="Externe Links zur Publikation, z. B. DOI oder Open-Access-Version. Klicke auf einen Link, um ihn in einem neuen Tab zu öffnen." [matTooltip]="'publicationDetail.externalLinksHelp' | translate"
matTooltipPosition="above" matTooltipPosition="above"
(click)="$event.stopPropagation()" (click)="$event.stopPropagation()"
>info_outline</mat-icon >info_outline</mat-icon
@@ -22,6 +22,8 @@ import { WorkTypePipe } from '../../shared/pipes/work-type.pipe';
import { LanguageCodePipe } from '../../shared/pipes/language-code.pipe'; import { LanguageCodePipe } from '../../shared/pipes/language-code.pipe';
import { WorkPrimaryCategoryPipe } from '../../shared/pipes/work-primary-category.pipe'; import { WorkPrimaryCategoryPipe } from '../../shared/pipes/work-primary-category.pipe';
import { ResearchProfileComponent } from './research-profile/research-profile.component'; import { ResearchProfileComponent } from './research-profile/research-profile.component';
import { TranslatePipe } from '../../shared/i18n/translate.pipe';
import { LanguageService } from '../../shared/i18n/language.service';
interface DetailLink { interface DetailLink {
label: string; label: string;
@@ -50,6 +52,7 @@ interface InstitutionDetail {
LanguageCodePipe, LanguageCodePipe,
WorkPrimaryCategoryPipe, WorkPrimaryCategoryPipe,
ResearchProfileComponent, ResearchProfileComponent,
TranslatePipe,
], ],
templateUrl: './publication-detail.component.html', templateUrl: './publication-detail.component.html',
styleUrl: './publication-detail.component.scss', styleUrl: './publication-detail.component.scss',
@@ -61,6 +64,7 @@ export class PublicationDetailComponent implements OnInit {
private readonly location = inject(Location); private readonly location = inject(Location);
private readonly router = inject(Router); private readonly router = inject(Router);
private readonly worksService = inject(WorksService); private readonly worksService = inject(WorksService);
private readonly languageService = inject(LanguageService);
workClassification = input.required<WorkClassification | null>(); workClassification = input.required<WorkClassification | null>();
@@ -81,8 +85,15 @@ export class PublicationDetailComponent implements OnInit {
readonly institutionsPageSize = 5; readonly institutionsPageSize = 5;
returnUrl: string | null = null; returnUrl: string | null = null;
returnLabel = 'Alle Publikationen'; returnLabel: string | null = null;
returnAriaLabel = 'Zurück zu den Publikationen';
get displayReturnLabel(): string {
return this.returnLabel ?? this.languageService.translate('publicationDetail.allPublications');
}
get returnAriaLabel(): string {
return this.languageService.translate('publicationDetail.backTo', { target: this.displayReturnLabel });
}
ngOnInit(): void { ngOnInit(): void {
this.loading = true; this.loading = true;
@@ -93,8 +104,7 @@ export class PublicationDetailComponent implements OnInit {
} | null; } | null;
if (navigationState?.returnUrl) { if (navigationState?.returnUrl) {
this.returnUrl = navigationState.returnUrl; this.returnUrl = navigationState.returnUrl;
this.returnLabel = navigationState.returnLabel ?? 'Zurück'; this.returnLabel = navigationState.returnLabel ?? this.languageService.translate('common.back');
this.returnAriaLabel = `Zurück zu ${this.returnLabel}`;
} }
this.route.data.pipe(takeUntilDestroyed(this.destroyRef)).subscribe({ this.route.data.pipe(takeUntilDestroyed(this.destroyRef)).subscribe({
@@ -252,7 +262,7 @@ export class PublicationDetailComponent implements OnInit {
? `Open Access (${this.publication.open_access.oa_status})` ? `Open Access (${this.publication.open_access.oa_status})`
: 'Open Access'; : 'Open Access';
} }
return 'Kein Open Access'; return this.languageService.translate('publicationDetail.noOpenAccess');
} }
private doiUrl(doi: string | null | undefined): string | null { private doiUrl(doi: string | null | undefined): string | null {
@@ -3,9 +3,9 @@
<mat-card-header class="profile-header"> <mat-card-header class="profile-header">
<mat-icon class="profile-icon">science</mat-icon> <mat-icon class="profile-icon">science</mat-icon>
<div class="profile-heading"> <div class="profile-heading">
<mat-card-title>Forschungsprofil</mat-card-title> <mat-card-title>{{ 'researchProfile.title' | translate }}</mat-card-title>
<mat-card-subtitle> <mat-card-subtitle>
Einordnung der Forschungsorientierung dieser Publikation {{ 'researchProfile.subtitle' | translate }}
</mat-card-subtitle> </mat-card-subtitle>
</div> </div>
</mat-card-header> </mat-card-header>
@@ -14,7 +14,7 @@
<div class="visualizations"> <div class="visualizations">
<section aria-labelledby="pasteur-title"> <section aria-labelledby="pasteur-title">
<h3 id="pasteur-title" class="visualization-title"> <h3 id="pasteur-title" class="visualization-title">
Pasteur-Quadrant {{ 'researchProfile.quadrant' | translate }}
</h3> </h3>
<div class="quadrant-chart-frame"> <div class="quadrant-chart-frame">
<div <div
@@ -29,7 +29,7 @@
<section aria-labelledby="score-title" class="score-section"> <section aria-labelledby="score-title" class="score-section">
<h3 id="score-title" class="visualization-title"> <h3 id="score-title" class="visualization-title">
Orientierungsscore {{ 'researchProfile.score' | translate }}
</h3> </h3>
<div class="score-content"> <div class="score-content">
<app-orientation-gauge <app-orientation-gauge
@@ -50,7 +50,7 @@
profile.insufficient_context profile.insufficient_context
) { ) {
<mat-divider class="notices-divider"></mat-divider> <mat-divider class="notices-divider"></mat-divider>
<div class="notices" aria-label="Hinweise zur Klassifikation"> <div class="notices" [attr.aria-label]="'researchProfile.notices' | translate">
@if ( @if (
profile.confidence === 'medium' || profile.confidence === 'low' profile.confidence === 'medium' || profile.confidence === 'low'
) { ) {
@@ -66,7 +66,7 @@
[matTooltip]="confidenceTooltip(profile.confidence)" [matTooltip]="confidenceTooltip(profile.confidence)"
matTooltipPosition="above" matTooltipPosition="above"
(click)="$event.stopPropagation()" (click)="$event.stopPropagation()"
aria-label="Erläuterung zur Konfidenz"> [attr.aria-label]="'researchProfile.confidenceExplanation' | translate">
info_outline info_outline
</mat-icon> </mat-icon>
</mat-card> </mat-card>
@@ -74,13 +74,13 @@
@if (profile.insufficient_context) { @if (profile.insufficient_context) {
<mat-card appearance="outlined" class="warning-note"> <mat-card appearance="outlined" class="warning-note">
<span>Begrenzte Informationsgrundlage</span> <span>{{ 'researchProfile.limitedInformation' | translate }}</span>
<mat-icon <mat-icon
class="info-icon" class="info-icon"
matTooltip="Für diese Einordnung standen nicht genügend inhaltliche Angaben zur Verfügung." [matTooltip]="'researchProfile.limitedInformationHelp' | translate"
matTooltipPosition="above" matTooltipPosition="above"
(click)="$event.stopPropagation()" (click)="$event.stopPropagation()"
aria-label="Erläuterung zur Informationsgrundlage"> [attr.aria-label]="'researchProfile.informationExplanation' | translate">
info_outline info_outline
</mat-icon> </mat-icon>
</mat-card> </mat-card>
@@ -21,6 +21,9 @@ import { WorkPrimaryCategoryPipe } from '../../../shared/pipes/work-primary-cate
import { ChartThemeService } from '../../../shared/services/chart-theme.service'; import { ChartThemeService } from '../../../shared/services/chart-theme.service';
import { OrientationGaugeComponent } from '../../../shared/ui/orientation-gauge/orientation-gauge.component'; import { OrientationGaugeComponent } from '../../../shared/ui/orientation-gauge/orientation-gauge.component';
import { TopicChipComponent } from '../../../shared/ui/topic-chip/topic-chip.component'; import { TopicChipComponent } from '../../../shared/ui/topic-chip/topic-chip.component';
import { TranslatePipe } from '../../../shared/i18n/translate.pipe';
import { LanguageService } from '../../../shared/i18n/language.service';
import { TranslationKey } from '../../../shared/i18n/translations';
type PasteurQuadrant = type PasteurQuadrant =
| 'pure_basic' | 'pure_basic'
@@ -32,7 +35,7 @@ interface QuadrantDefinition {
key: PasteurQuadrant; key: PasteurQuadrant;
coordinate: [string, string]; coordinate: [string, string];
title: string; title: string;
description: string; descriptionKey: TranslationKey;
color?: 'blue' | 'purple' | 'green'; color?: 'blue' | 'purple' | 'green';
} }
@@ -41,27 +44,27 @@ const QUADRANTS: readonly QuadrantDefinition[] = [
key: 'pure_basic', key: 'pure_basic',
coordinate: ['Niedrig', 'Hoch'], coordinate: ['Niedrig', 'Hoch'],
title: 'Bohr', title: 'Bohr',
description: 'Reine\nGrundlagenforschung', descriptionKey: 'researchProfile.pureBasic',
color: 'blue', color: 'blue',
}, },
{ {
key: 'use_inspired_basic', key: 'use_inspired_basic',
coordinate: ['Hoch', 'Hoch'], coordinate: ['Hoch', 'Hoch'],
title: 'Pasteur', title: 'Pasteur',
description: 'Vom Nutzen inspirierte\nGrundlagenforschung', descriptionKey: 'researchProfile.useInspiredBasic',
color: 'purple', color: 'purple',
}, },
{ {
key: 'not_applicable', key: 'not_applicable',
coordinate: ['Niedrig', 'Niedrig'], coordinate: ['Niedrig', 'Niedrig'],
title: 'Weder noch', title: '',
description: 'Keine eindeutige\nForschungsorientierung', descriptionKey: 'researchProfile.neither',
}, },
{ {
key: 'pure_applied', key: 'pure_applied',
coordinate: ['Hoch', 'Niedrig'], coordinate: ['Hoch', 'Niedrig'],
title: 'Edison', title: 'Edison',
description: 'Angewandte Forschung\nund Entwicklung', descriptionKey: 'researchProfile.applied',
color: 'green', color: 'green',
}, },
]; ];
@@ -78,6 +81,7 @@ const QUADRANTS: readonly QuadrantDefinition[] = [
OrientationGaugeComponent, OrientationGaugeComponent,
TopicChipComponent, TopicChipComponent,
WorkPrimaryCategoryPipe, WorkPrimaryCategoryPipe,
TranslatePipe,
], ],
templateUrl: './research-profile.component.html', templateUrl: './research-profile.component.html',
styleUrl: './research-profile.component.scss', styleUrl: './research-profile.component.scss',
@@ -85,6 +89,7 @@ const QUADRANTS: readonly QuadrantDefinition[] = [
export class ResearchProfileComponent { export class ResearchProfileComponent {
private readonly destroyRef = inject(DestroyRef); private readonly destroyRef = inject(DestroyRef);
private readonly chartTheme = inject(ChartThemeService); private readonly chartTheme = inject(ChartThemeService);
private readonly languageService = inject(LanguageService);
private readonly quadrantChartSize = signal({ width: 640, height: 320 }); private readonly quadrantChartSize = signal({ width: 640, height: 320 });
private quadrantResizeObserver?: ResizeObserver; private quadrantResizeObserver?: ResizeObserver;
@@ -120,13 +125,15 @@ export class ResearchProfileComponent {
}); });
confidenceLabel(confidence: string | null | undefined): string { confidenceLabel(confidence: string | null | undefined): string {
return confidence === 'low' ? 'Geringe Konfidenz' : 'Mittlere Konfidenz'; return this.languageService.translate(
confidence === 'low' ? 'researchProfile.lowConfidence' : 'researchProfile.mediumConfidence',
);
} }
confidenceTooltip(confidence: string | null | undefined): string { confidenceTooltip(confidence: string | null | undefined): string {
return confidence === 'low' return this.languageService.translate(
? 'Das Klassifikationsergebnis wurde mit geringer Konfidenz bestimmt.' confidence === 'low' ? 'researchProfile.lowConfidenceHelp' : 'researchProfile.mediumConfidenceHelp',
: 'Das Klassifikationsergebnis wurde mit mittlerer Konfidenz bestimmt.'; );
} }
onQuadrantChartInit(chart: EChartsType): void { onQuadrantChartInit(chart: EChartsType): void {
@@ -276,7 +283,7 @@ export class ResearchProfileComponent {
x: axisLeft + (horizontalTipX - axisLeft) / 2, x: axisLeft + (horizontalTipX - axisLeft) / 2,
y: chartHeight - 17, y: chartHeight - 17,
style: { style: {
text: 'Anwendungsorientierung', text: this.languageService.translate('researchProfile.applicationOrientation'),
fill: textColor, fill: textColor,
fontSize: 12, fontSize: 12,
fontWeight: 600, fontWeight: 600,
@@ -290,7 +297,7 @@ export class ResearchProfileComponent {
top: 'middle', top: 'middle',
rotation: Math.PI / 2, rotation: Math.PI / 2,
style: { style: {
text: 'Erkenntnisorientierung', text: this.languageService.translate('researchProfile.knowledgeOrientation'),
fill: textColor, fill: textColor,
fontSize: 12, fontSize: 12,
fontWeight: 600, fontWeight: 600,
@@ -325,9 +332,9 @@ export class ResearchProfileComponent {
lineHeight: 16, lineHeight: 16,
fontWeight: 400, fontWeight: 400,
formatter: [ formatter: [
`{title|${quadrant.title}}`, `{title|${quadrant.title || this.languageService.translate('researchProfile.neitherTitle')}}`,
`{description|${quadrant.description}}`, `{description|${this.languageService.translate(quadrant.descriptionKey)}}`,
...(active ? ['{active|✓ Diese Publikation}'] : []), ...(active ? [`{active|✓ ${this.languageService.translate('researchProfile.thisPublication')}}`] : []),
].join('\n'), ].join('\n'),
rich: { rich: {
title: { title: {
@@ -1,9 +1,9 @@
<section class="login-page"> <section class="login-page">
<div class="login-panel"> <div class="login-panel">
<div class="brand-block"> <div class="brand-block">
<span class="eyebrow">SmartGuide Account Portal</span> <span class="eyebrow">{{ 'login.portal' | translate }}</span>
<h1>Passwort zurücksetzen</h1> <h1>{{ 'resetPassword.title' | translate }}</h1>
<p>Gib ein neues Passwort für Dein Konto ein.</p> <p>{{ 'resetPassword.description' | translate }}</p>
</div> </div>
@if (passwordChanged()) { @if (passwordChanged()) {
@@ -11,10 +11,9 @@
<div class="code-intro"> <div class="code-intro">
<mat-icon>check_circle</mat-icon> <mat-icon>check_circle</mat-icon>
<div> <div>
<strong>Passwort geändert</strong> <strong>{{ 'resetPassword.changed' | translate }}</strong>
<span> <span>
Dein Passwort wurde erfolgreich geändert. Bitte melde Dich mit dem {{ 'resetPassword.changedMessage' | translate }}
neuen Passwort an.
</span> </span>
</div> </div>
</div> </div>
@@ -25,7 +24,7 @@
class="submit-button" class="submit-button"
type="button" type="button"
routerLink="/login"> routerLink="/login">
Zurück zum Login {{ 'forgotPassword.backLogin' | translate }}
</button> </button>
</div> </div>
} @else if (!hasToken()) { } @else if (!hasToken()) {
@@ -33,20 +32,18 @@
<div class="code-intro"> <div class="code-intro">
<mat-icon>error_outline</mat-icon> <mat-icon>error_outline</mat-icon>
<div> <div>
<strong>Ungültiger Link</strong> <strong>{{ 'resetPassword.invalidLink' | translate }}</strong>
<span> <span>
Der Link zum Zurücksetzen des Passworts ist ungültig oder {{ 'resetPassword.invalidLinkMessage' | translate }}
unvollständig.
</span> </span>
</div> </div>
</div> </div>
<
<div class="form-actions"> <div class="form-actions">
<a class="auth-link" routerLink="/login">Zurück zum Login</a> <a class="auth-link" routerLink="/login">{{ 'forgotPassword.backLogin' | translate }}</a>
<a class="auth-link" routerLink="/forgot-password" <a class="auth-link" routerLink="/forgot-password"
>Neuen Link anfordern</a >{{ 'resetPassword.requestNewLink' | translate }}</a
> >
</div> </div>
</div> </div>
@@ -55,25 +52,24 @@
<div class="code-intro"> <div class="code-intro">
<mat-icon>error_outline</mat-icon> <mat-icon>error_outline</mat-icon>
<div> <div>
<strong>Link nicht mehr gültig</strong> <strong>{{ 'resetPassword.linkExpired' | translate }}</strong>
<span> <span>
Der Link zum Zurücksetzen des Passworts ist abgelaufen oder wurde {{ 'resetPassword.expiredMessage' | translate }}
bereits verwendet.
</span> </span>
</div> </div>
</div> </div>
<div class="form-actions"> <div class="form-actions">
<a class="auth-link" routerLink="/forgot-password" <a class="auth-link" routerLink="/forgot-password"
>Neuen Link anfordern</a >{{ 'resetPassword.requestNewLink' | translate }}</a
> >
<a class="auth-link" routerLink="/login">Zurück zum Login</a> <a class="auth-link" routerLink="/login">{{ 'forgotPassword.backLogin' | translate }}</a>
</div> </div>
</div> </div>
} @else { } @else {
<form class="login-form" [formGroup]="form" (ngSubmit)="resetPassword()"> <form class="login-form" [formGroup]="form" (ngSubmit)="resetPassword()">
<mat-form-field class="field" appearance="outline"> <mat-form-field class="field" appearance="outline">
<mat-label>Neues Passwort</mat-label> <mat-label>{{ 'resetPassword.newPassword' | translate }}</mat-label>
<input <input
matInput matInput
[type]="showPasswords() ? 'text' : 'password'" [type]="showPasswords() ? 'text' : 'password'"
@@ -85,7 +81,7 @@
matSuffix matSuffix
type="button" type="button"
[attr.aria-label]=" [attr.aria-label]="
showPasswords() ? 'Passwort verbergen' : 'Passwort anzeigen' (showPasswords() ? 'login.hidePassword' : 'login.showPassword') | translate
" "
(click)="showPasswords.set(!showPasswords())"> (click)="showPasswords.set(!showPasswords())">
<mat-icon> <mat-icon>
@@ -94,16 +90,16 @@
</button> </button>
@if (form.controls.newPassword.hasError('required')) { @if (form.controls.newPassword.hasError('required')) {
<mat-error>Neues Passwort ist erforderlich.</mat-error> <mat-error>{{ 'resetPassword.newPasswordRequired' | translate }}</mat-error>
} @else if (form.controls.newPassword.hasError('minlength')) { } @else if (form.controls.newPassword.hasError('minlength')) {
<mat-error>Passwort muss mindestens 8 Zeichen haben.</mat-error> <mat-error>{{ 'login.passwordLength' | translate }}</mat-error>
} @else if (form.controls.newPassword.hasError('maxlength')) { } @else if (form.controls.newPassword.hasError('maxlength')) {
<mat-error>Passwort darf maximal 64 Zeichen haben.</mat-error> <mat-error>{{ 'resetPassword.passwordMax' | translate }}</mat-error>
} }
</mat-form-field> </mat-form-field>
<mat-form-field class="field" appearance="outline"> <mat-form-field class="field" appearance="outline">
<mat-label>Neues Passwort wiederholen</mat-label> <mat-label>{{ 'resetPassword.repeatPassword' | translate }}</mat-label>
<input <input
matInput matInput
[type]="showPasswords() ? 'text' : 'password'" [type]="showPasswords() ? 'text' : 'password'"
@@ -115,7 +111,7 @@
matSuffix matSuffix
type="button" type="button"
[attr.aria-label]=" [attr.aria-label]="
showPasswords() ? 'Passwort verbergen' : 'Passwort anzeigen' (showPasswords() ? 'login.hidePassword' : 'login.showPassword') | translate
" "
(click)="showPasswords.set(!showPasswords())"> (click)="showPasswords.set(!showPasswords())">
<mat-icon> <mat-icon>
@@ -124,11 +120,11 @@
</button> </button>
@if (form.controls.confirmPassword.hasError('required')) { @if (form.controls.confirmPassword.hasError('required')) {
<mat-error>Bitte wiederhole das neue Passwort.</mat-error> <mat-error>{{ 'resetPassword.repeatRequired' | translate }}</mat-error>
} @else if ( } @else if (
form.controls.confirmPassword.hasError('passwordsMismatch') form.controls.confirmPassword.hasError('passwordsMismatch')
) { ) {
<mat-error>Die Passwörter stimmen nicht überein.</mat-error> <mat-error>{{ 'resetPassword.mismatch' | translate }}</mat-error>
} }
</mat-form-field> </mat-form-field>
@@ -136,7 +132,7 @@
<div class="code-intro"> <div class="code-intro">
<mat-icon>error_outline</mat-icon> <mat-icon>error_outline</mat-icon>
<div> <div>
<strong>Fehler</strong> <strong>{{ 'errorPage.error' | translate }}</strong>
<span>{{ errorMessage() }}</span> <span>{{ errorMessage() }}</span>
</div> </div>
</div> </div>
@@ -149,14 +145,14 @@
type="submit" type="submit"
[disabled]="form.invalid || isSubmitting()"> [disabled]="form.invalid || isSubmitting()">
@if (isSubmitting()) { @if (isSubmitting()) {
Passwort wird geändert... {{ 'resetPassword.changing' | translate }}
} @else { } @else {
Passwort ändern {{ 'resetPassword.change' | translate }}
} }
</button> </button>
<div class="form-actions form-actions-single"> <div class="form-actions form-actions-single">
<a class="auth-link" routerLink="/login">Zurück zum Login</a> <a class="auth-link" routerLink="/login">{{ 'forgotPassword.backLogin' | translate }}</a>
</div> </div>
</form> </form>
} }
@@ -19,6 +19,8 @@ import { MatInputModule } from '@angular/material/input';
import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar'; import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar';
import { CredentialService } from '../../shared/services/credential.service'; import { CredentialService } from '../../shared/services/credential.service';
import { TranslatePipe } from '../../shared/i18n/translate.pipe';
import { LanguageService } from '../../shared/i18n/language.service';
@Component({ @Component({
selector: 'app-reset-password', selector: 'app-reset-password',
@@ -31,6 +33,7 @@ import { CredentialService } from '../../shared/services/credential.service';
MatButtonModule, MatButtonModule,
MatIconModule, MatIconModule,
MatSnackBarModule, MatSnackBarModule,
TranslatePipe,
], ],
templateUrl: './reset-password.component.html', templateUrl: './reset-password.component.html',
styleUrl: '../app-login/app-login.component.scss', styleUrl: '../app-login/app-login.component.scss',
@@ -39,6 +42,7 @@ export class ResetPasswordComponent {
private readonly destroyRef = inject(DestroyRef); private readonly destroyRef = inject(DestroyRef);
private readonly snackBar = inject(MatSnackBar); private readonly snackBar = inject(MatSnackBar);
private readonly resetToken = signal<string | undefined>(undefined); private readonly resetToken = signal<string | undefined>(undefined);
private readonly languageService = inject(LanguageService);
readonly isSubmitting = signal(false); readonly isSubmitting = signal(false);
readonly passwordChanged = signal(false); readonly passwordChanged = signal(false);
@@ -81,7 +85,7 @@ export class ResetPasswordComponent {
if (!this.hasToken()) { if (!this.hasToken()) {
this.linkInvalid.set(true); this.linkInvalid.set(true);
this.errorMessage.set( this.errorMessage.set(
'Der Link zum Zurücksetzen des Passworts ist ungültig oder unvollständig.', this.languageService.translate('resetPassword.invalidLinkMessage'),
); );
return; return;
} }
@@ -125,7 +129,7 @@ export class ResetPasswordComponent {
) { ) {
this.linkInvalid.set(true); this.linkInvalid.set(true);
this.snackBar.open( this.snackBar.open(
'Der Link zum Zurücksetzen des Passworts ist abgelaufen oder wurde bereits verwendet.', this.languageService.translate('resetPassword.expiredMessage'),
'OK', 'OK',
{ duration: 7000 }, { duration: 7000 },
); );
@@ -133,7 +137,7 @@ export class ResetPasswordComponent {
} }
this.errorMessage.set( this.errorMessage.set(
'Das Passwort konnte nicht geändert werden. Bitte versuche es später erneut.', this.languageService.translate('resetPassword.changeError'),
); );
this.form.enable(); this.form.enable();
}, },
@@ -1,15 +1,27 @@
import { Injectable } from '@angular/core'; import { effect, inject, Injectable } from '@angular/core';
import { MatPaginatorIntl } from '@angular/material/paginator'; import { MatPaginatorIntl } from '@angular/material/paginator';
import { LanguageService } from '../../shared/i18n/language.service';
@Injectable() @Injectable()
export class PaginatorIntl extends MatPaginatorIntl { export class PaginatorIntl extends MatPaginatorIntl {
override itemsPerPageLabel = 'Einträge pro Seite'; private readonly languageService = inject(LanguageService);
override nextPageLabel = 'Nächste Seite';
override previousPageLabel = 'Vorherige Seite'; constructor() {
super();
effect(() => {
this.languageService.language();
this.itemsPerPageLabel =
this.languageService.translate('paginator.itemsPerPage');
this.nextPageLabel = this.languageService.translate('paginator.next');
this.previousPageLabel =
this.languageService.translate('paginator.previous');
this.changes.next();
});
}
override getRangeLabel = (page: number, pageSize: number, length: number) => { override getRangeLabel = (page: number, pageSize: number, length: number) => {
if (length === 0 || pageSize === 0) { if (length === 0 || pageSize === 0) {
return '0 von ' + length; return `0 ${this.languageService.translate('paginator.of')} ${length}`;
} }
length = Math.max(length, 0); length = Math.max(length, 0);
const startIndex = page * pageSize; const startIndex = page * pageSize;
@@ -17,6 +29,6 @@ export class PaginatorIntl extends MatPaginatorIntl {
startIndex < length startIndex < length
? Math.min(startIndex + pageSize, length) ? Math.min(startIndex + pageSize, length)
: startIndex + pageSize; : startIndex + pageSize;
return startIndex + 1 + ' - ' + endIndex + ' von ' + length; return `${startIndex + 1} - ${endIndex} ${this.languageService.translate('paginator.of')} ${length}`;
}; };
} }
@@ -0,0 +1,181 @@
import { DOCUMENT } from '@angular/common';
import { effect, inject, Injectable, signal } from '@angular/core';
import {
SUPPORTED_LANGUAGES,
SupportedLanguage,
TRANSLATIONS,
TranslationKey,
} from './translations';
import { UI_TEXT_TRANSLATIONS } from './ui-text-translations';
import { PAGE_TEXT_TRANSLATIONS } from './page-text-translations';
@Injectable({ providedIn: 'root' })
export class LanguageService {
private readonly document = inject(DOCUMENT);
private readonly storageKey = 'smartguide.language';
readonly language = signal<SupportedLanguage>(this.readInitialLanguage());
private readonly originalText = new WeakMap<Text, string>();
private readonly originalAttributes = new WeakMap<Element, Map<string, string>>();
private observer?: MutationObserver;
private applyingTranslations = false;
constructor() {
effect(() => {
const language = this.language();
localStorage.setItem(this.storageKey, language);
this.document.documentElement.lang = language;
queueMicrotask(() => this.localizeDocument(language));
});
queueMicrotask(() => this.observeDocument());
}
setLanguage(language: SupportedLanguage): void {
this.language.set(language);
}
translate(
key: TranslationKey,
parameters?: Readonly<Record<string, string | number>>,
): string {
let value: string = TRANSLATIONS[this.language()][key] ?? key;
for (const [name, replacement] of Object.entries(parameters ?? {})) {
value = value.replaceAll(`{{${name}}}`, String(replacement));
}
return value;
}
private readInitialLanguage(): SupportedLanguage {
const storedLanguage = localStorage.getItem(this.storageKey);
if (
SUPPORTED_LANGUAGES.includes(storedLanguage as SupportedLanguage)
) {
return storedLanguage as SupportedLanguage;
}
return navigator.language.toLowerCase().startsWith('de') ? 'de' : 'en';
}
private observeDocument(): void {
if (!this.document.body || this.observer) return;
this.observer = new MutationObserver((mutations) => {
if (this.applyingTranslations) return;
for (const mutation of mutations) {
if (mutation.type === 'characterData') {
this.localizeTextNode(mutation.target as Text, this.language());
continue;
}
for (const node of Array.from(mutation.addedNodes)) {
this.localizeNode(node, this.language());
}
}
});
this.observer.observe(this.document.body, {
childList: true,
characterData: true,
subtree: true,
});
this.localizeDocument(this.language());
}
private localizeDocument(language: SupportedLanguage): void {
if (!this.document.body) return;
this.localizeNode(this.document.body, language);
}
private localizeNode(node: Node, language: SupportedLanguage): void {
this.applyingTranslations = true;
try {
if (node.nodeType === Node.TEXT_NODE) {
this.localizeTextNode(node as Text, language);
return;
}
if (!(node instanceof Element)) return;
this.localizeElementAttributes(node, language);
const walker = this.document.createTreeWalker(
node,
NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_TEXT,
);
let currentNode: Node | null;
while ((currentNode = walker.nextNode())) {
if (currentNode.nodeType === Node.TEXT_NODE) {
this.localizeTextNode(currentNode as Text, language);
} else {
this.localizeElementAttributes(currentNode as Element, language);
}
}
} finally {
this.applyingTranslations = false;
}
}
private localizeTextNode(node: Text, language: SupportedLanguage): void {
const current = node.data;
const trimmed = current.trim();
if (!trimmed) return;
let original = this.originalText.get(node);
if (!original || (current !== original && current !== this.translateUiValue(original))) {
original = current;
this.originalText.set(node, original);
}
const localized =
language === 'en' ? this.translateUiValue(original) : original;
if (node.data !== localized) node.data = localized;
}
private localizeElementAttributes(
element: Element,
language: SupportedLanguage,
): void {
for (const attributeName of ['aria-label', 'placeholder', 'title']) {
const current = element.getAttribute(attributeName);
if (!current) continue;
let originals = this.originalAttributes.get(element);
if (!originals) {
originals = new Map<string, string>();
this.originalAttributes.set(element, originals);
}
let original = originals.get(attributeName);
if (!original || (current !== original && current !== this.translateUiValue(original))) {
original = current;
originals.set(attributeName, original);
}
const localized =
language === 'en' ? this.translateUiValue(original) : original;
if (current !== localized) {
element.setAttribute(attributeName, localized);
}
}
}
private translateUiValue(value: string): string {
const leadingWhitespace = value.match(/^\s*/)?.[0] ?? '';
const trailingWhitespace = value.match(/\s*$/)?.[0] ?? '';
const content = value.trim();
let translated =
UI_TEXT_TRANSLATIONS[content] ??
PAGE_TEXT_TRANSLATIONS[content] ??
content;
if (translated === content) {
translated = content
.replace(/^(\d+)\s*\/\s*(\d+) ausgewählt$/, '$1 / $2 selected')
.replace(/^Seite (\d+) von (\d+)$/, 'Page $1 of $2')
.replace(/^(\d+) Keywords$/, '$1 keywords')
.replace(/^Quellentext:\s*/, 'Source text: ')
.replace(/^Fehler beim Hinzufügen von (.+)\.$/, 'Failed to add $1.')
.replace(/^(.+) ist bereits vorhanden\.$/, '$1 already exists.')
.replace(
/^Es können maximal (\d+) Autoren verglichen werden\.$/,
'A maximum of $1 authors can be compared.',
);
}
return `${leadingWhitespace}${translated}${trailingWhitespace}`;
}
}
@@ -0,0 +1,192 @@
/** Additional page titles, controls, table labels and empty states. */
export const PAGE_TEXT_TRANSLATIONS: Readonly<Record<string, string>> = {
Abschlussbericht: 'Final report',
Absteigend: 'Descending',
Abteilung: 'Department',
Adresse: 'Address',
Alle: 'All',
'Alle abwählen': 'Deselect all',
'Alle löschen': 'Delete all',
Anwendungsorientiert: 'Application-oriented',
Aufsteigend: 'Ascending',
'Autor vergleichen': 'Compare author',
'Autoren vergleichen': 'Compare authors',
'Autoren-Vergleich': 'Author comparison',
'Autorinnen und Autoren': 'Authors',
'Beste Treffer (Relevanz)': 'Best matches (relevance)',
'Bookmarks werden geladen …': 'Loading bookmarks …',
BUND: 'Federal',
'Bund Projekt': 'Federal project',
'Bund Projekte': 'Federal projects',
'Bund-Projekte': 'Federal projects',
Bundesland: 'Federal state',
Datum: 'Date',
'Daten werden geladen...': 'Loading data...',
Datensatzdatum: 'Record date',
'DFG Projekt': 'DFG project',
'DFG Projekte': 'DFG projects',
'DFG-Projekte': 'DFG projects',
'DFG Verfahren': 'DFG procedure',
'DFG-Verfahren': 'DFG procedures',
'Einrichtung vergleichen': 'Compare institution',
'Einrichtungen vergleichen': 'Compare institutions',
'Einzigartige Publikationen': 'Unique publications',
'Keine Ergebnisse': 'No results',
'EU Projekt': 'EU project',
'EU Projekte': 'EU projects',
'EU-Projekte': 'EU projects',
'EU-Beitrag': 'EU contribution',
Fachsystematik: 'Subject classification',
'Filter & Suche': 'Filters & search',
'Filter nach Position': 'Filter by position',
'Filter nach Quelle': 'Filter by source',
'Filter nach Quelle:': 'Filter by source:',
Förderart: 'Funding type',
Förderempfänger: 'Funding recipient',
Förderer: 'Funders',
Förderorganisation: 'Funding organization',
Förderprofil: 'Funding profile',
Förderprogramm: 'Funding program',
Förderreferenz: 'Funding reference',
Fördersumme: 'Funding amount',
Förderungen: 'Funding',
'Füge ein Keyword hinzu': 'Add a keyword',
'Institutionen:': 'Institutions:',
'Keine Angaben vorhanden.': 'No information available.',
'Keine Daten gefunden.': 'No data found.',
'Keine Forschungsthemen gefunden.': 'No research topics found.',
'Keine Förderungen gefunden.': 'No funding found.',
'Keine Institution gefunden': 'No institution found',
'Keine Institutionen gefunden.': 'No institutions found.',
'Keine Keywords gefunden': 'No keywords found',
'Keine Nachrichten gefunden.': 'No news found.',
'Keine Patente gefunden.': 'No patents found.',
'Keine Personen gefunden': 'No people found',
'Keine Personen gefunden.': 'No people found.',
'Keine Themen gefunden': 'No topics found',
'Keine Timeline-Daten vorhanden.': 'No timeline data available.',
Kennzahl: 'Metric',
'Kennzahlen zu den Keywords': 'Keyword metrics',
'Kennzahlen zur Person': 'Person metrics',
'Keyword-Auswahl': 'Keyword selection',
Klassifikationen: 'Classifications',
'Lade Daten...': 'Loading data...',
'Lade Themen...': 'Loading topics...',
'Laden…': 'Loading…',
'Land oder Kontinent suchen': 'Search country or continent',
'Meine Sammlung': 'My collection',
'Nachricht nicht gefunden': 'News item not found',
'Nachricht wird geladen...': 'Loading news item...',
Netzwerk: 'Network',
'Noch nicht ausgeführt': 'Not run yet',
'Noch nichts ausgewählt': 'Nothing selected yet',
'Passwort vergessen': 'Forgot password',
'Passwort vergessen?': 'Forgot password?',
'Passwörter anzeigen': 'Show passwords',
Patent: 'Patent',
'Patent wird geladen...': 'Loading patent...',
'Patent-Nr.': 'Patent no.',
'Patentdetails anzeigen': 'Show patent details',
Patentübersicht: 'Patent overview',
Person: 'Person',
Projektkennung: 'Project identifier',
Projektagentur: 'Project agency',
Publikationsstufe: 'Publication stage',
'Publikationen:': 'Publications:',
Referenzen: 'References',
Quelle: 'Source',
'Quellen und Versionen': 'Sources and versions',
'Schlüsselwörter:': 'Keywords:',
Suche: 'Search',
'Suche nach Titel oder Patent-Nr.': 'Search by title or patent number',
'Teilprojekt von': 'Subproject of',
'Themen & Schlüsselwörter': 'Topics & keywords',
'Themen-Fokus': 'Topic focus',
Themenbreite: 'Topic breadth',
Themenprofil: 'Topic profile',
'Themenverteilung nach Subfield': 'Topic distribution by subfield',
'Top Förderer': 'Top funders',
'Top-Autoren einer Einrichtung hinzufügen': 'Add top authors from an institution',
Unternehmensstatus: 'Company status',
Veröffentlichungsdatum: 'Publication date',
'Verknüpfte Personen': 'Linked people',
Webseite: 'Website',
'Weitere Informationen': 'More information',
'Passende Institutionen finden': 'Find matching institutions',
'Passende Personen finden': 'Find matching people',
'Alle extrahierten Keywords abwählen': 'Deselect all extracted keywords',
'Alle extrahierten Keywords auswählen': 'Select all extracted keywords',
'Alle extrahierten Keywords löschen': 'Delete all extracted keywords',
'Breite Keywords': 'Broad keywords',
'Coarse Keywords': 'Coarse keywords',
'Eigene Keywords': 'Custom keywords',
'Extrahierte Keywords': 'Extracted keywords',
'Füge eine URL ein, um Keywords zu extrahieren': 'Enter a URL to extract keywords',
'Schreibe einen Text, um Keywords zu extrahieren': 'Enter text to extract keywords',
'Keywords extrahieren': 'Extract keywords',
'Ähnliche Themen': 'Similar topics',
'Die Abbildung der extrahierten Keywords auf die bekannten Themenbereiche': 'Map the extracted keywords to known topics',
'Thema suchen oder eintippen...': 'Search for or enter a topic...',
'Manuelles Keyword entfernen': 'Remove custom keyword',
'Nichts hinzugefügt': 'Nothing added',
'Neues Keyword wird hinzugefügt...': 'Adding new keyword...',
'Nichts extrahiert': 'Nothing extracted',
Breit: 'Broad',
Eigene: 'Custom',
'Keywords anpassen': 'Adjust keywords',
'Keine Suchdaten': 'No search data',
'Starte eine neue Suche, um Ergebnisse zu sehen.': 'Start a new search to see results.',
'Zur Suche': 'Back to search',
Visualisierung: 'Visualization',
Nachrichten: 'News',
'Keine Autoren gefunden': 'No authors found',
'Passe die Keywords oder die Gewichtung an.': 'Adjust the keywords or weighting.',
ausgewählt: 'selected',
Vergleichen: 'Compare',
'Personen-Gewichtung': 'People weighting',
'Bestimme die Relevanz der einzelnen Faktoren.': 'Set the relevance of the individual factors.',
Ausgewogen: 'Balanced',
'Neu gewichten': 'Reweight',
Normalisiert: 'Normalized',
'Alle Unternehmen': 'All companies',
'Nur aktive Unternehmen': 'Active companies only',
'Nur gelöschte Unternehmen': 'Deleted companies only',
UND: 'AND',
ODER: 'OR',
Zitationen: 'Citations',
Unternehmensgründungen: 'Company formations',
'Medien-Sichtbarkeit': 'Media visibility',
'Gewichtet die Anzahl und Relevanz wissenschaftlicher Arbeiten.': 'Weights the number and relevance of scholarly works.',
'Gewichtet wissenschaftlichen Einfluss über Zitationen.': 'Weights scholarly impact based on citations.',
'Gewichtet die Anzahl der Unternehmensgründungen (Handelsregister-Verbindungen).': 'Weights the number of company formations (commercial-register links).',
'Gewichtet die öffentliche Sichtbarkeit über Nennungen in Nachrichtenartikeln.': 'Weights public visibility based on mentions in news articles.',
'Gewichtet Innovations- und Transferleistung über Patente.': 'Weights innovation and transfer performance based on patents.',
'Patenten-Gewichtung': 'Patent weighting',
'Steuert die Gewichtung von IPC/CPC-Match, OpenAlex-Topic und Text-Match für den Gesamt-Score.': 'Controls how IPC/CPC, OpenAlex topic, and text matches contribute to the overall score.',
'Gewichtet die Übereinstimmung der Patent-Klassifikation (IPC/CPC) mit den Keywords.': 'Weights how closely the patent classification (IPC/CPC) matches the keywords.',
'Gewichtet die thematische Übereinstimmung über OpenAlex-Topics und Fachgebiete.': 'Weights topic similarity based on OpenAlex topics and fields.',
'Gewichtet Treffer der Keywords im Patenttitel und in der Zusammenfassung.': 'Weights keyword matches in the patent title and abstract.',
'Passende Patente': 'Matching patents',
'Fehler beim Laden der Patente.': 'Failed to load patents.',
'Gematchte Keywords': 'Matched keywords',
'Gematchte IPC/CPC': 'Matched IPC/CPC',
'Match-Score': 'Match score',
'Keine passenden Patente gefunden': 'No matching patents found',
'Die Patentrecherche ist technisch fehlgeschlagen. Bitte später erneut versuchen.': 'The patent search failed due to a technical error. Please try again later.',
Newsliste: 'News list',
'News-Gewichtung': 'News weighting',
'Werte zwischen 0 und 1. Summe wird normalisiert zu 1.': 'Values between 0 and 1. The sum is normalized to 1.',
'Übersicht der durchgeführten Projekte.': 'Overview of completed projects.',
'Wenn aktiviert, werden die extrahierten Keywords auf bekannte Themenbereiche abgebildet, man kann dann nach Themen filtern. Wenn deaktiviert, werden die Keywords direkt für die Suche verwendet.': 'When enabled, extracted keywords are mapped to known topics so you can filter by topic. When disabled, keywords are used directly for the search.',
'Keine Keywords extrahiert': 'No keywords extracted',
'Unbekannter Fehler': 'Unknown error',
'Bitte Datei hochladen.': 'Please upload a file.',
'Dateien werden verarbeitet...': 'Processing files...',
'Dateien hochgeladen. Keywords werden extrahiert...': 'Files uploaded. Extracting keywords...',
'Keywords werden extrahiert...': 'Extracting keywords...',
'Inhalt konnte nicht gesendet werden': 'Failed to send content',
'Starte Extraktion...': 'Starting extraction...',
'Fehler beim Senden der Anfrage': 'Failed to send request',
'Extraktion abgebrochen': 'Extraction canceled',
'Fertig!': 'Done!',
};
@@ -0,0 +1,12 @@
import { Pipe, PipeTransform, inject } from '@angular/core';
import { LanguageService } from './language.service';
import { TranslationKey } from './translations';
@Pipe({ name: 'translate', standalone: true, pure: false })
export class TranslatePipe implements PipeTransform {
private readonly languageService = inject(LanguageService);
transform(key: TranslationKey): string {
return this.languageService.translate(key);
}
}
File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More