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
farajollahi a25d70466f Merge pull request 'dfg-topics-treemap' (#259) from dfg-topics-treemap into dev
LocationBasedServices/smartguide/pipeline/head Build queued...
Reviewed-on: #259
2026-08-03 14:09:35 +02:00
142 changed files with 4410 additions and 1430 deletions
@@ -16,15 +16,15 @@
<mat-divider />
<mat-tab-group>
<mat-tab label="Einstellungen">
<mat-tab [label]="'account.settings' | translate">
<div class="settings-tab">
<h5>Passwort ändern</h5>
<h5>{{ 'account.changePassword' | translate }}</h5>
<form class="change-password-form" [formRoot]="changePasswordForm">
<mat-form-field subscriptSizing="dynamic">
<mat-label>Altes Passwort</mat-label>
<mat-label>{{ 'account.currentPassword' | translate }}</mat-label>
<input
matInput
aria-label="Altes Passwort"
[attr.aria-label]="'account.currentPassword' | translate"
[type]="inputFieldType()"
[formField]="changePasswordForm.oldPassword" />
@if (oldPasswordErrorMessage()) {
@@ -34,10 +34,10 @@
<div class="new-password-fields">
<mat-form-field subscriptSizing="dynamic">
<mat-label>Neues Passwort</mat-label>
<mat-label>{{ 'accounts.newPassword' | translate }}</mat-label>
<input
matInput
aria-label="Neues Passwort"
[attr.aria-label]="'accounts.newPassword' | translate"
[type]="inputFieldType()"
[formField]="changePasswordForm.newPassword" />
@if (newPasswordErrorMessage()) {
@@ -46,10 +46,10 @@
</mat-form-field>
<mat-form-field subscriptSizing="dynamic">
<mat-label>Neues Passwort wiederholen</mat-label>
<mat-label>{{ 'account.repeatNewPassword' | translate }}</mat-label>
<input
matInput
aria-label="Neues Passwort wiederholen"
[attr.aria-label]="'account.repeatNewPassword' | translate"
[type]="inputFieldType()"
[formField]="changePasswordForm.newPasswordRepeat" />
@if (newPasswordRepeatErrorMessage()) {
@@ -61,7 +61,7 @@
<mat-slide-toggle
labelPosition="before"
[formField]="changePasswordForm.showPasswords"
>Passwörter anzeigen</mat-slide-toggle
>{{ 'account.showPasswords' | translate }}</mat-slide-toggle
>
<button
mat-raised-button
@@ -70,7 +70,7 @@
[disabled]="
changePasswordForm().invalid() || changePasswordForm().submitting()
">
Passwort ändern
{{ 'account.changePassword' | translate }}
</button>
</form>
<mat-divider />
@@ -29,6 +29,9 @@ import { MatSlideToggleModule } from '@angular/material/slide-toggle';
import { CredentialService } from '../../shared/services/credential.service';
import { MatSnackBar } from '@angular/material/snack-bar';
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 {
oldPassword: string;
@@ -54,6 +57,7 @@ interface ChangePasswordForm {
MatSlideToggleModule,
FormField,
FormRoot,
TranslatePipe,
],
templateUrl: './account.component.html',
styleUrl: './account.component.scss',
@@ -64,6 +68,7 @@ export class AccountComponent {
private readonly _credentialService = inject(CredentialService);
private readonly _snackBar = inject(MatSnackBar);
private readonly _router = inject(Router);
private readonly languageService = inject(LanguageService);
roles: UserRole[] = [];
@@ -76,37 +81,37 @@ export class AccountComponent {
oldPasswordErrorMessage = computed<string | null>(() => {
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>(() => {
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>(() => {
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(
this.changePasswordModel,
(schemaPath) => {
required(schemaPath.oldPassword, {
message: 'Altes Passwort ist erforderlich.',
message: 'account.currentPasswordRequired',
});
required(schemaPath.newPassword, {
message: 'Neues Passwort ist erforderlich.',
message: 'account.newPasswordRequired',
});
required(schemaPath.newPasswordRepeat, {
message: 'Neues Passwort wiederholen ist erforderlich.',
message: 'account.repeatPasswordRequired',
});
minLength(schemaPath.newPassword, 8, {
message: 'Neues Passwort muss mindestens 8 Zeichen lang sein.',
message: 'account.passwordMinLength',
});
maxLength(schemaPath.newPassword, 64, {
message: 'Neues Passwort darf maximal 64 Zeichen lang sein.',
message: 'account.passwordMaxLength',
});
validate(schemaPath.newPasswordRepeat, ({ value, valueOf }) => {
@@ -116,7 +121,7 @@ export class AccountComponent {
if (newPassword !== newPasswordRepeat) {
return {
kind: 'passwordMismatch',
message: 'Passwörter stimmen nicht überein.',
message: 'account.passwordMismatch',
};
}
@@ -130,8 +135,7 @@ export class AccountComponent {
if (oldPassword && newPassword && oldPassword === newPassword) {
return {
kind: 'passwordSameAsOld',
message:
'Neues Passwort darf nicht dasselbe wie das alte Passwort sein.',
message: 'account.passwordSameAsOld',
};
}
@@ -157,8 +161,10 @@ export class AccountComponent {
},
error: (error) => {
this._snackBar.open(
'Fehler beim Aktualisieren des Zugriffstokens. Bitte melden Sie sich erneut an.',
'OK',
this.languageService.translate(
'account.tokenRefreshError',
),
this.languageService.translate('common.ok'),
{ duration: 7000 },
);
},
@@ -167,8 +173,10 @@ export class AccountComponent {
error: (error) => {
console.error('Error changing password:', error);
this._snackBar.open(
'Fehler beim Ändern des Passworts. Bitte versuchen Sie es erneut.',
'OK',
this.languageService.translate(
'account.changePasswordError',
),
this.languageService.translate('common.ok'),
{ duration: 7000 },
);
},
@@ -184,6 +192,11 @@ export class AccountComponent {
this.changePasswordModel().showPasswords ? 'text' : 'password',
);
private translateValidationError(message?: string): string | null {
if (!message) return null;
return this.languageService.translate(message as TranslationKey);
}
constructor() {
effect(() => {
this.roles = this.accountProfile().roles;
@@ -1,29 +1,33 @@
<h2 mat-dialog-title>
{{ data.mode === 'create' ? 'Account erstellen' : 'Account bearbeiten' }}
{{
data.mode === 'create'
? ('accounts.create' | translate)
: ('accounts.edit' | translate)
}}
</h2>
<mat-dialog-content>
<form class="account-form" [formGroup]="form" (ngSubmit)="submit()">
<mat-form-field appearance="outline">
<mat-label>E-Mail</mat-label>
<mat-label>{{ 'accounts.email' | translate }}</mat-label>
<input matInput type="email" formControlName="email" />
@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')) {
<mat-error>Bitte gültige E-Mail eingeben.</mat-error>
<mat-error>{{ 'accounts.emailInvalid' | translate }}</mat-error>
}
</mat-form-field>
<mat-form-field appearance="outline">
<mat-label>Name</mat-label>
<mat-label>{{ 'organizations.name' | translate }}</mat-label>
<input matInput formControlName="name" />
@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 appearance="outline">
<mat-label>Rolle</mat-label>
<mat-label>{{ 'accounts.role' | translate }}</mat-label>
<mat-select formControlName="roles" multiple>
@for (role of data.roles; track role) {
<mat-option [value]="role">{{ role }}</mat-option>
@@ -33,7 +37,7 @@
@if (data.canSelectOrganization) {
<mat-form-field appearance="outline">
<mat-label>Organisation</mat-label>
<mat-label>{{ 'accounts.organization' | translate }}</mat-label>
<mat-select formControlName="organizationId">
@for (organization of data.organizations; track organization.id) {
<mat-option [value]="organization.id">
@@ -46,22 +50,28 @@
<mat-form-field appearance="outline">
<mat-label>
{{ data.mode === 'create' ? 'Initiales Passwort' : 'Neues Passwort' }}
{{
data.mode === 'create'
? ('accounts.initialPassword' | translate)
: ('accounts.newPassword' | translate)
}}
</mat-label>
<input matInput type="password" formControlName="password" />
@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')) {
<mat-error>Mindestens 8 Zeichen.</mat-error>
<mat-error>{{ 'accounts.passwordMinLength' | translate }}</mat-error>
}
</mat-form-field>
</form>
</mat-dialog-content>
<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()">
<mat-icon>save</mat-icon>
Speichern
{{ 'common.save' | translate }}
</button>
</mat-dialog-actions>
@@ -21,6 +21,7 @@ import {
InseAccountManagementModelOrganizationProfile,
UserRole,
} from '../../api';
import { TranslatePipe } from '../../shared/i18n/translate.pipe';
export type AccountDialogMode = 'create' | 'edit';
@@ -65,6 +66,7 @@ export type AccountDialogResult =
MatIconModule,
MatInputModule,
MatSelectModule,
TranslatePipe,
],
templateUrl: './account-dialog.component.html',
styleUrl: './account-dialog.component.scss',
@@ -1,12 +1,12 @@
<section class="accounts-page">
<header class="page-header">
<div>
<h1>Accounts</h1>
<h1>{{ 'accounts.title' | translate }}</h1>
<p>
{{
isReadOnly
? 'Personen der eigenen Organisation ansehen.'
: 'Account-Zugänge verwalten, Rollen setzen und Impersonation starten.'
? ('accounts.readOnlyDescription' | translate)
: ('accounts.description' | translate)
}}
</p>
</div>
@@ -15,10 +15,10 @@
mat-flat-button
color="primary"
type="button"
matTooltip="Neuen Account anlegen"
[matTooltip]="'accounts.newTooltip' | translate"
(click)="startCreate()">
<mat-icon>person_add</mat-icon>
Neuer Account
{{ 'accounts.new' | translate }}
</button>
}
</header>
@@ -26,12 +26,12 @@
<section style="display: flex; gap: 1rem; align-items: center">
<app-query-param-input
queryParamKey="search"
label="Nach Name oder E-Mail suchen"
[label]="'accounts.search' | translate"
style="width: 35%" />
<app-query-param-selector
queryParamKey="organization_id"
[options]="selectorOptions()"
label="Organisation"
[label]="'accounts.organization' | translate"
[allowEmptyValue]="true"
style="width: 25%" />
</section>
@@ -65,14 +65,14 @@
<button
mat-icon-button
type="button"
aria-label="Bearbeiten"
[attr.aria-label]="'common.edit' | translate"
(click)="startEdit(row)">
<mat-icon>edit</mat-icon>
</button>
<button
mat-icon-button
type="button"
aria-label="Impersonate"
[attr.aria-label]="'accounts.impersonate' | translate"
[disabled]="!canImpersonate(row)"
(click)="impersonate(row)">
<mat-icon>switch_account</mat-icon>
@@ -80,7 +80,11 @@
<button
mat-icon-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"
(click)="toggleAccountActivation(row)">
<mat-icon>{{ row.activated ? 'person_off' : 'person_check' }}</mat-icon>
@@ -88,7 +92,7 @@
<button
mat-icon-button
type="button"
aria-label="Deaktivieren"
[attr.aria-label]="'common.deactivate' | translate"
[disabled]="row.is_current || row.deleted"
(click)="deleteAccount(row)">
<mat-icon>delete</mat-icon>
@@ -4,7 +4,9 @@ import {
OnInit,
TemplateRef,
computed,
effect,
inject,
Injector,
input,
viewChild,
} from '@angular/core';
@@ -44,6 +46,8 @@ import {
UserRole,
} from '../../api';
import { StatusPipe } from '../../shared/pipes/status.pipe';
import { LanguageService } from '../../shared/i18n/language.service';
import { TranslatePipe } from '../../shared/i18n/translate.pipe';
@Component({
selector: 'app-accounts',
@@ -65,6 +69,7 @@ import { StatusPipe } from '../../shared/pipes/status.pipe';
QueryParamSelectorComponent,
MatCardModule,
StatusPipe,
TranslatePipe,
],
templateUrl: './accounts.component.html',
styleUrl: './accounts.component.scss',
@@ -76,6 +81,8 @@ export class AccountsComponent implements OnInit {
private readonly router = inject(Router);
private readonly dialog = inject(MatDialog);
private readonly authService = inject(AuthService);
private readonly languageService = inject(LanguageService);
private readonly injector = inject(Injector);
protected get isReadOnly(): boolean {
return this.credentialService.isEffectiveManager();
@@ -106,41 +113,51 @@ export class AccountsComponent implements OnInit {
input.required<InseAccountManagementModelOrganizationProfile[]>();
ngOnInit(): void {
effect(
() => {
this.languageService.language();
this.setAccountColumns();
},
{ injector: this.injector },
);
}
private setAccountColumns(): void {
this.accountColumns = [
{
id: 'name',
header: 'Name',
header: this.languageService.translate('organizations.name'),
type: 'accessor',
accessorKey: 'name',
},
{
id: 'email',
header: 'E-Mail',
header: this.languageService.translate('accounts.email'),
type: 'accessor',
accessorKey: 'email',
},
{
id: 'organization_name',
header: 'Organisation',
header: this.languageService.translate('accounts.organization'),
type: 'accessor',
accessorKey: 'organization_name',
},
{
id: 'roles',
header: 'Rolle',
header: this.languageService.translate('accounts.role'),
type: 'accessor',
accessorKey: 'roles',
cellTemplate: this.accountRoleTmp(),
},
{
id: 'status',
header: 'Status',
header: this.languageService.translate('common.status'),
type: 'display',
cellTemplate: this.accountStatusTmp(),
},
{
id: 'actions',
header: 'Aktionen',
header: this.languageService.translate('common.actions'),
type: 'display',
cellTemplate: this.accountActionsTmp(),
},
@@ -163,9 +180,13 @@ export class AccountsComponent implements OnInit {
request.subscribe({
next: () => {
this.snackBar.open('Account wurde gespeichert.', 'OK', {
this.snackBar.open(
this.languageService.translate('accounts.saved'),
this.languageService.translate('common.ok'),
{
duration: 3000,
});
},
);
this.router.navigate([], {
queryParams: { page: 0 },
queryParamsHandling: 'merge',
@@ -174,9 +195,13 @@ export class AccountsComponent implements OnInit {
error: (error) => {
const message =
error.status === 409
? 'Diese E-Mail-Adresse wird bereits verwendet.'
: 'Account konnte nicht gespeichert werden.';
this.snackBar.open(message, 'OK', { duration: 5000 });
? this.languageService.translate('accounts.emailConflict')
: this.languageService.translate('accounts.saveError');
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({
next: () => {
this.snackBar.open('Account wurde deaktiviert.', 'OK', {
this.snackBar.open(
this.languageService.translate('accounts.deactivated'),
this.languageService.translate('common.ok'),
{
duration: 3000,
});
},
);
this.router.navigate([], {
queryParams: { page: 0 },
queryParamsHandling: 'merge',
});
},
error: () => {
this.snackBar.open('Account konnte nicht deaktiviert werden.', 'OK', {
duration: 5000,
});
this.snackBar.open(
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 action = activated ? 'aktivieren' : 'deaktivieren';
import('../../shared/ui/confirmation-dialog/confirmation-dialog.component').then(
({ ConfirmationDialogComponent }) => {
const dialogRef = this.dialog.open(ConfirmationDialogComponent, {
data: {
title: activated ? 'Account aktivieren' : 'Account deaktivieren',
message: `Möchtest Du den Account „${account.name}“ wirklich ${action}?`,
confirmText: activated ? 'Aktivieren' : 'Deaktivieren',
cancelText: 'Abbrechen',
title: this.languageService.translate(
activated
? 'accounts.activateTitle'
: '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({
next: () => {
this.snackBar.open(
activated ? 'Account wurde aktiviert.' : 'Account wurde deaktiviert.',
'OK',
this.languageService.translate(
activated ? 'accounts.activated' : 'accounts.deactivated',
),
this.languageService.translate('common.ok'),
{ duration: 3000 },
);
this.router.navigate([], {
@@ -286,8 +328,8 @@ export class AccountsComponent implements OnInit {
},
error: () => {
this.snackBar.open(
'Account-Status konnte nicht geändert werden.',
'OK',
this.languageService.translate('accounts.statusError'),
this.languageService.translate('common.ok'),
{ duration: 5000 },
);
},
@@ -301,15 +343,21 @@ export class AccountsComponent implements OnInit {
try {
await this.credentialService.impersonateAccount(account.id);
this.snackBar.open(`Impersonation aktiv: ${account.name}`, 'OK', {
duration: 4000,
});
this.snackBar.open(
this.languageService.translate('accounts.impersonationActive', {
name: account.name,
}),
this.languageService.translate('common.ok'),
{ duration: 4000 },
);
this.router.navigate(['/dashboard']);
} catch (error) {
console.error('Impersonation failed:', error);
this.snackBar.open('Impersonation konnte nicht gestartet werden.', 'OK', {
duration: 5000,
});
this.snackBar.open(
this.languageService.translate('accounts.impersonationError'),
this.languageService.translate('common.ok'),
{ duration: 5000 },
);
return;
}
}
@@ -1,23 +1,22 @@
<section class="login-page">
<div class="login-panel">
<div class="brand-block">
<span class="eyebrow">SmartGuide Account Portal</span>
<h1>Login</h1>
<span class="eyebrow">{{ 'login.portal' | translate }}</span>
<h1>{{ 'login.title' | translate }}</h1>
<p>
Melde Dich mit Deiner Organisation an. Nach den Zugangsdaten erhältst Du
einen einmaligen Code per E-Mail.
{{ 'login.description' | translate }}
</p>
</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'">
<span>1</span>
<strong>Zugangsdaten</strong>
<strong>{{ 'login.credentials' | translate }}</strong>
</div>
<div class="step-line"></div>
<div class="step" [class.step--active]="currentStep === 'otk'">
<span>2</span>
<strong>OTK-Code</strong>
<strong>{{ 'login.otkCode' | translate }}</strong>
</div>
</div>
@@ -27,7 +26,7 @@
[formGroup]="credentialsForm"
(ngSubmit)="requestOtk()">
<mat-form-field class="field" appearance="outline">
<mat-label>E-Mail-Adresse</mat-label>
<mat-label>{{ 'login.email' | translate }}</mat-label>
<input
id="login-email"
matInput
@@ -35,14 +34,14 @@
autocomplete="email"
formControlName="email" />
@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')) {
<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 class="field" appearance="outline">
<mat-label>Passwort</mat-label>
<mat-label>{{ 'login.password' | translate }}</mat-label>
<input
id="login-password"
matInput
@@ -54,7 +53,7 @@
matSuffix
type="button"
[attr.aria-label]="
showPassword ? 'Passwort verbergen' : 'Passwort anzeigen'
(showPassword ? 'login.hidePassword' : 'login.showPassword') | translate
"
(click)="showPassword = !showPassword">
<mat-icon>{{
@@ -62,9 +61,9 @@
}}</mat-icon>
</button>
@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')) {
<mat-error>Passwort muss mindestens 8 Zeichen haben.</mat-error>
<mat-error>{{ 'login.passwordLength' | translate }}</mat-error>
}
</mat-form-field>
@@ -75,16 +74,16 @@
type="submit"
[disabled]="credentialsForm.invalid || isSubmitting">
@if (isSubmitting) {
Code wird gesendet...
{{ 'login.sendingCode' | translate }}
} @else {
Code per E-Mail senden
{{ 'login.sendCode' | translate }}
}
</button>
<div class="form-actions">
<span></span>
<a class="auth-link" routerLink="/forgot-password"
>Passwort vergessen?</a
>{{ 'login.forgotPassword' | translate }}</a
>
</div>
</form>
@@ -93,19 +92,19 @@
<div class="code-intro">
<mat-icon>mark_email_unread</mat-icon>
<div>
<strong>Code eingeben</strong>
<strong>{{ 'login.enterCode' | translate }}</strong>
<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>
</div>
</div>
<mat-form-field class="field" appearance="outline">
<mat-label>OTK-Code</mat-label>
<mat-label>{{ 'login.otkCode' | translate }}</mat-label>
<input
id="login-otk"
matInput
@@ -113,9 +112,9 @@
autocomplete="one-time-code"
formControlName="code" />
@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')) {
<mat-error>Bitte gib den Code aus der E-Mail ein.</mat-error>
<mat-error>{{ 'login.codeInvalid' | translate }}</mat-error>
}
</mat-form-field>
@@ -125,9 +124,9 @@
aria-live="polite">
<mat-icon>timer</mat-icon>
@if (codeExpiresIn > 0) {
<span>Code läuft in {{ formatCountdown() }} ab.</span>
<span>{{ 'login.codeExpiresIn' | translate }} {{ formatCountdown() }}.</span>
} @else {
<span>Code ist abgelaufen. Bitte neuen Code anfordern.</span>
<span>{{ 'login.codeExpired' | translate }}</span>
}
</div>
@@ -138,9 +137,9 @@
type="submit"
[disabled]="otkForm.invalid || isSubmitting || codeExpiresIn === 0">
@if (isSubmitting) {
Anmeldung wird geprüft...
{{ 'login.checking' | translate }}
} @else {
Anmelden
{{ 'login.signIn' | translate }}
}
</button>
@@ -150,10 +149,10 @@
type="button"
(click)="resendCode()"
[disabled]="isSubmitting">
Code erneut senden
{{ 'login.resend' | translate }}
</button>
<button mat-button type="button" (click)="editCredentials()">
E-Mail ändern
{{ 'login.changeEmail' | translate }}
</button>
</div>
</form>
@@ -15,6 +15,8 @@ import { finalize, Subscription } from 'rxjs';
import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar';
import { Router, RouterLink } from '@angular/router';
import { HttpErrorResponse } from '@angular/common/http';
import { LanguageService } from '../../shared/i18n/language.service';
import { TranslatePipe } from '../../shared/i18n/translate.pipe';
type LoginStep = 'credentials' | 'otk';
@@ -29,6 +31,7 @@ type LoginStep = 'credentials' | 'otk';
MatIconModule,
MatSnackBarModule,
RouterLink,
TranslatePipe,
],
templateUrl: './app-login.component.html',
styleUrl: './app-login.component.scss',
@@ -64,6 +67,7 @@ export class AppLoginComponent implements OnDestroy {
protected credentialService: CredentialService,
protected router: Router,
protected snackBar: MatSnackBar,
private readonly languageService: LanguageService,
) {
effect(() => {
if (this.credentialService.isValidating()) {
@@ -119,7 +123,7 @@ export class AppLoginComponent implements OnDestroy {
this.otkForm.reset();
this.startCountdown();
this.snackBar.open(
'OTK-Code wurde an die E-Mail-Adresse gesendet.',
this.languageService.translate('login.codeSent'),
'OK',
{
duration: 4000,
@@ -154,7 +158,7 @@ export class AppLoginComponent implements OnDestroy {
if (this.codeExpiresIn <= 0) {
this.snackBar.open(
'Der Code ist abgelaufen. Bitte fordere einen neuen Code an.',
this.languageService.translate('login.codeExpiredRequest'),
'OK',
{ duration: 5000 },
);
@@ -162,7 +166,7 @@ export class AppLoginComponent implements OnDestroy {
}
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,
});
return;
@@ -242,13 +246,13 @@ export class AppLoginComponent implements OnDestroy {
private getLoginErrorMessage(error: HttpErrorResponse): string {
console.error('Login error:', error);
if (error.status === 401) {
return 'E-Mail, Passwort oder OTK-Code ist ungültig.';
return this.languageService.translate('login.invalidCredentials');
}
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">
<header class="page-header">
<div>
<p class="eyebrow">Meine Sammlung</p>
<h1>Bookmarks</h1>
<p>Gespeicherte Personen für den schnellen Zugriff.</p>
<p class="eyebrow">{{ 'bookmarks.eyebrow' | translate }}</p>
<h1>{{ 'bookmarks.title' | translate }}</h1>
<p>{{ 'bookmarks.description' | translate }}</p>
</div>
<div class="bookmark-count">
<mat-icon>bookmarks</mat-icon>
<strong>{{ persons().length }}</strong>
<span>Personen</span>
<span>{{ 'bookmarks.people' | translate }}</span>
</div>
</header>
@if (loading()) {
<div class="loading-state">
<mat-spinner diameter="42"></mat-spinner>
<p>Bookmarks werden geladen …</p>
<p>{{ 'bookmarks.loading' | translate }}</p>
</div>
} @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) {
<app-person-card
[person]="person"
@@ -30,10 +32,8 @@
} @else {
<section class="empty-state">
<mat-icon>bookmark_border</mat-icon>
<h2>Noch keine Bookmarks</h2>
<p>
Speichere Personen über das Bookmark-Symbol auf einer Personenkarte.
</p>
<h2>{{ 'bookmarks.emptyTitle' | translate }}</h2>
<p>{{ 'bookmarks.emptyDescription' | translate }}</p>
</section>
}
</main>
@@ -8,6 +8,7 @@ import { catchError, forkJoin, map, of, switchMap } from 'rxjs';
import { CustomAuthor, PersonsService } from '../../api';
import { BookmarkService } from '../../shared/services/bookmark.service';
import { PersonCardComponent } from '../person-card/person-card.component';
import { TranslatePipe } from '../../shared/i18n/translate.pipe';
const PERSON_INCLUDE_TAGS =
'display_name,works_count,cited_by_count,summary_stats,ids,' +
@@ -22,6 +23,7 @@ const PERSON_INCLUDE_TAGS =
MatIconModule,
MatProgressSpinnerModule,
PersonCardComponent,
TranslatePipe,
],
templateUrl: './bookmarks.component.html',
styleUrl: './bookmarks.component.scss',
@@ -4,6 +4,7 @@ import { EChartsCoreOption } from 'echarts';
import { MatIconModule } from '@angular/material/icon';
import { NgxEchartsDirective } from 'ngx-echarts';
import { ChartThemeService } from '../../shared/services/chart-theme.service';
import { LanguageService } from '../../shared/i18n/language.service';
import * as echarts from 'echarts/core';
import {
@@ -49,13 +50,14 @@ export class CollaborationGraphComponent {
handleNodeClick = output<NodeClickEvent>();
private readonly chartTheme = inject(ChartThemeService);
private readonly languageService = inject(LanguageService);
categoryLabels: Record<string, string> = {
author: 'Autor',
collaborator: 'Kollaborierender',
institution: 'Institution',
work: 'Publikation',
};
categoryLabels = computed<Record<string, string>>(() => ({
author: this.languageService.translate('publications.author'),
collaborator: this.languageService.translate('personNetwork.collaborator'),
institution: this.languageService.translate('publications.institution'),
work: this.languageService.translate('researchTimeline.publication'),
}));
private readonly graphNodes = computed<GraphNode[]>(() => {
const graph = this.collaborationGraph();
@@ -151,7 +153,7 @@ export class CollaborationGraphComponent {
data: categories.map((category) => category.name),
bottom: 0,
orient: 'horizontal',
formatter: (name: string) => this.categoryLabels[name] || name,
formatter: (name: string) => this.categoryLabels()[name] || name,
itemGap: 20,
textStyle: { color: textColor },
inactiveColor: colors.mutedTextColor,
@@ -1,23 +1,25 @@
<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">
<button
type="button"
[class.active]="dashboardPeriodMode === 'all_time'"
(click)="setDashboardPeriodMode('all_time')">
Alle Zeiten
{{ 'dashboard.allTime' | translate }}
</button>
<button
type="button"
[class.active]="dashboardPeriodMode === 'last_10_years'"
(click)="setDashboardPeriodMode('last_10_years')">
Letzte 10 Jahre
{{ 'dashboard.last10Years' | translate }}
</button>
<button
type="button"
[class.active]="dashboardPeriodMode === 'last_5_years'"
(click)="setDashboardPeriodMode('last_5_years')">
Letzte 5 Jahre
{{ 'dashboard.last5Years' | translate }}
</button>
</div>
<div class="dashboard-period-slider">
@@ -32,20 +34,24 @@
</div>
</section>
<section class="statistics-grid" aria-label="Kennzahlen">
<section
class="statistics-grid"
[attr.aria-label]="'dashboard.metrics' | translate">
<a
class="statistics-card"
[routerLink]="['/institution', institutionRouteId(), 'publications']"
[class.disabled]="!institutionRouteId()"
[attr.aria-disabled]="!institutionRouteId()"
[attr.aria-label]="
'Publikationen von ' + organizationName() + ' anzeigen'
languageService.translate('dashboard.showPublications', {
name: organizationName(),
})
">
<div class="statistics-icon statistics-icon--publications">
<mat-icon>menu_book</mat-icon>
</div>
<div>
<span>Publikationen</span>
<span>{{ 'dashboard.publications' | translate }}</span>
<strong>
{{
isStatisticLoading('publications')
@@ -60,12 +66,16 @@
class="statistics-card"
routerLink="/persons"
[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">
<mat-icon>groups</mat-icon>
</div>
<div>
<span>Personen</span>
<span>{{ 'dashboard.people' | translate }}</span>
<strong>
{{
isStatisticLoading('persons')
@@ -81,12 +91,16 @@
[routerLink]="['/institution', institutionRouteId(), 'patents']"
[class.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">
<mat-icon>description</mat-icon>
</div>
<div>
<span>Patente</span>
<span>{{ 'dashboard.patents' | translate }}</span>
<strong>
{{
isStatisticLoading('patents')
@@ -101,12 +115,12 @@
class="statistics-card"
routerLink="/projects"
[queryParams]="{ selected_project_types: 'eu' }"
aria-label="EU-Projekte anzeigen">
[attr.aria-label]="'dashboard.showEuProjects' | translate">
<div class="statistics-icon statistics-icon--eu-projects">
<mat-icon>public</mat-icon>
</div>
<div>
<span>EU-Projekte</span>
<span>{{ 'dashboard.euProjects' | translate }}</span>
<strong>
{{
isStatisticLoading('eu_projects')
@@ -121,12 +135,12 @@
class="statistics-card"
routerLink="/projects"
[queryParams]="{ selected_project_types: 'bund' }"
aria-label="Bund-Projekte anzeigen">
[attr.aria-label]="'dashboard.showFederalProjects' | translate">
<div class="statistics-icon statistics-icon--bund-projects">
<mat-icon>account_balance</mat-icon>
</div>
<div>
<span>Bund-Projekte</span>
<span>{{ 'dashboard.federalProjects' | translate }}</span>
<strong>
{{
isStatisticLoading('bmbf_projects')
@@ -141,12 +155,12 @@
class="statistics-card"
routerLink="/projects"
[queryParams]="{ selected_project_types: 'dfg' }"
aria-label="DFG-Projekte anzeigen">
[attr.aria-label]="'dashboard.showDfgProjects' | translate">
<div class="statistics-icon statistics-icon--dfg-projects">
<mat-icon>science</mat-icon>
</div>
<div>
<span>DFG-Projekte</span>
<span>{{ 'dashboard.dfgProjects' | translate }}</span>
<strong>
{{
isStatisticLoading('dfg_projects')
@@ -159,7 +173,7 @@
</section>
@if (statisticsError) {
<p class="statistics-error">Die Kennzahlen konnten nicht geladen werden.</p>
<p class="statistics-error">{{ 'dashboard.metricsError' | translate }}</p>
}
@if (
@@ -174,11 +188,8 @@
<section class="topic-heatmap-section">
<header class="topic-heatmap-header">
<div>
<h2>Projektstatus nach Fördergeber</h2>
<p>
Laufende, kommende und abgeschlossene EU-, Bund- und DFG-Projekte
Ihrer Organisation.
</p>
<h2>{{ 'dashboard.projectStatusTitle' | translate }}</h2>
<p>{{ 'dashboard.projectStatusDescription' | translate }}</p>
</div>
@if (euProjectStatuses && bmbfProjectStatuses && dfgProjectStatuses) {
<div class="project-status-summary">
@@ -217,7 +228,7 @@
) {
<div class="project-status-loading" role="status" aria-live="polite">
<app-loading
text="Projektstatus wird geladen …"
[text]="'dashboard.projectStatusLoading' | translate"
icon="stacked_bar_chart"
size="64"
diameter="64"></app-loading>
@@ -228,8 +239,7 @@
dfgProjectStatusesError
) {
<p class="statistics-error">
Der Status der EU-, Bund- und DFG-Projekte konnte nicht geladen
werden.
{{ 'dashboard.projectStatusError' | translate }}
</p>
} @else if (
euProjectStatuses && bmbfProjectStatuses && dfgProjectStatuses
@@ -246,22 +256,22 @@
<section class="topic-heatmap-section">
<header class="topic-heatmap-header">
<div>
<h2>Field Treemap</h2>
<p>Publikationen Ihrer Organisation nach Field.</p>
<h2>{{ 'dashboard.treemapTitle' | translate }}</h2>
<p>{{ 'dashboard.treemapDescription' | translate }}</p>
</div>
</header>
@if (topicTreemapLoading) {
<div class="topic-heatmap-loading" role="status" aria-live="polite">
<app-loading
text="Treemap-Daten für den gewählten Zeitraum werden geladen …"
[text]="'dashboard.treemapLoading' | translate"
icon="account_tree"
size="72"
diameter="72"></app-loading>
</div>
} @else if (topicTreemapError) {
<p class="statistics-error">
Die Field-Treemap konnte nicht geladen werden.
{{ 'dashboard.treemapError' | translate }}
</p>
} @else {
<app-topic-treemap
@@ -278,16 +288,17 @@
<section class="topic-heatmap-section">
<header class="topic-heatmap-header">
<div>
<h2>DFG-Projekt-Topics</h2>
<p>
Gematchte DFG-Projekte nach Field, Subfield und Topic. Ein Klick
auf ein Topic zeigt die zugehörigen Keywords.
</p>
<h2>{{ 'dashboard.dfgTopicsTitle' | translate }}</h2>
<p>{{ 'dashboard.dfgTopicsDescription' | translate }}</p>
</div>
@if (dfgProjectTopics) {
<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>
}
</header>
@@ -295,20 +306,20 @@
@if (dfgTopicsLoading) {
<div class="topic-heatmap-loading" role="status" aria-live="polite">
<app-loading
text="DFG-Topics werden geladen …"
[text]="'dashboard.dfgTopicsLoading' | translate"
icon="account_tree"
size="72"
diameter="72"></app-loading>
</div>
} @else if (dfgTopicsError) {
<p class="statistics-error">
Die DFG-Topic-Treemap konnte nicht geladen werden.
{{ 'dashboard.dfgTopicsError' | translate }}
</p>
} @else {
<app-topic-treemap
[data]="dfgTopicTreemap"
[selectedNodeId]="selectedDfgTopicTreemapNode"
countLabel="DFG-Projekte"
[countLabel]="'dashboard.dfgProjects' | translate"
[showCountInTooltip]="false"
(selectedNodeIdChange)="onDfgTopicTreemapNodeChange($event)"
(topicSelect)="onDfgTopicTreemapTopicSelect($event)">
@@ -321,17 +332,14 @@
<section class="top-authors-section">
<header class="top-authors-header">
<div>
<h2>Top 10 Personen</h2>
<p>
Nach Anzahl der Works, DFG-Projekte, Patente und News Ihrer
Organisation.
</p>
<h2>{{ 'dashboard.topPeopleTitle' | translate }}</h2>
<p>{{ 'dashboard.topPeopleDescription' | translate }}</p>
</div>
</header>
@if (topAuthorsError) {
<p class="statistics-error">
Die Autorenstatistiken konnten nicht geladen werden.
{{ 'dashboard.topPeopleError' | translate }}
</p>
} @else {
<div class="top-authors-grid" [class.loading]="topAuthorsLoading">
@@ -380,8 +388,8 @@
<p class="empty-chart">
{{
topAuthorsLoading
? 'Wird geladen …'
: 'Keine Daten vorhanden.'
? ('dashboard.loading' | translate)
: ('dashboard.noData' | translate)
}}
</p>
}
@@ -1,4 +1,4 @@
import { Component, OnInit } from '@angular/core';
import { Component, inject, OnInit } from '@angular/core';
import { DecimalPipe } from '@angular/common';
import { MatIconModule } from '@angular/material/icon';
import { Observable, finalize } from 'rxjs';
@@ -33,6 +33,8 @@ import {
institutionPersonListQueryParamsForPeriod,
PersonListQueryParams,
} from '../../shared/person-list-query-params';
import { LanguageService } from '../../shared/i18n/language.service';
import { TranslatePipe } from '../../shared/i18n/translate.pipe';
type DashboardStatisticKey =
| 'publications'
| 'persons'
@@ -61,11 +63,13 @@ type DashboardPeriodMode =
EuProjectStatusChartComponent,
TopicTreemapComponent,
YearRangeSliderComponent,
TranslatePipe,
],
templateUrl: './dashboard.component.html',
styleUrl: './dashboard.component.scss',
})
export class DashboardComponent implements OnInit {
protected readonly languageService = inject(LanguageService);
statistics?: Partial<DashboardStatistics>;
statisticsLoading = false;
statisticsError = false;
@@ -169,22 +173,22 @@ export class DashboardComponent implements OnInit {
topAuthorDatasets(): TopAuthorDataset[] {
return [
{
title: 'Publikationen',
title: this.languageService.translate('dashboard.publications'),
icon: 'menu_book',
entries: this.topAuthors?.works ?? [],
},
{
title: 'EU-Projekte',
title: this.languageService.translate('dashboard.euProjects'),
icon: 'public',
entries: this.topAuthors?.eu_projects ?? [],
},
{
title: 'Patente',
title: this.languageService.translate('dashboard.patents'),
icon: 'description',
entries: this.topAuthors?.patents ?? [],
},
{
title: 'DFG Projekte',
title: this.languageService.translate('dashboard.dfgProjects'),
icon: 'account_tree',
entries: this.topAuthors?.projects ?? [],
stripAuthorTitle: true,
@@ -225,8 +229,12 @@ export class DashboardComponent implements OnInit {
Map<string, { topics: DfgProjectTopic[] }>
>();
for (const topic of projectTopics.topics) {
const fieldName = topic.field?.trim() || 'Ohne Field';
const subfieldName = topic.subfield?.trim() || 'Ohne Subfield';
const fieldName =
topic.field?.trim() ||
this.languageService.translate('dashboard.withoutField');
const subfieldName =
topic.subfield?.trim() ||
this.languageService.translate('dashboard.withoutSubfield');
const subfields =
fields.get(fieldName) ??
new Map<string, { topics: DfgProjectTopic[] }>();
@@ -310,7 +318,10 @@ export class DashboardComponent implements OnInit {
}
organizationName(): string {
return this.statistics?.organization_name ?? 'Ihre Organisation';
return (
this.statistics?.organization_name ??
this.languageService.translate('dashboard.yourOrganization')
);
}
institutionRouteId(): string {
@@ -1,5 +1,7 @@
@if (topics.length) {
<div echarts [options]="options" class="dfg-topic-donut-chart"></div>
} @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 { NgxEchartsDirective } from 'ngx-echarts';
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';
@Component({
selector: 'app-dfg-topic-donut',
imports: [NgxEchartsDirective],
imports: [NgxEchartsDirective, TranslatePipe],
templateUrl: './dfg-topic-donut.component.html',
styleUrl: './dfg-topic-donut.component.scss',
})
@@ -15,6 +17,7 @@ export class DfgTopicDonutComponent implements OnChanges {
@Input() topics: DfgProjectTopic[] = [];
private chartTheme = inject(ChartThemeService);
private languageService = inject(LanguageService);
options: EChartsOption = {};
constructor() {
@@ -51,7 +54,9 @@ export class DfgTopicDonutComponent implements OnChanges {
borderColor: theme.tooltipBorder,
textStyle: { color: theme.tooltipTextColor },
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: {
type: 'scroll',
@@ -68,7 +73,7 @@ export class DfgTopicDonutComponent implements OnChanges {
left: '30%',
top: '46%',
style: {
text: `${this.topics.length}\nTopics`,
text: `${this.topics.length}\n${this.languageService.translate('nav.topics')}`,
align: 'center',
fill: theme.textColor,
fontSize: 18,
@@ -79,7 +84,7 @@ export class DfgTopicDonutComponent implements OnChanges {
],
series: [
{
name: 'DFG-Topics',
name: this.languageService.translate('dashboard.dfgTopicsTitle'),
type: 'pie',
radius: ['42%', '72%'],
center: ['32%', '50%'],
@@ -95,7 +100,7 @@ export class DfgTopicDonutComponent implements OnChanges {
scaleSize: 8,
label: {
show: true,
formatter: '{b}\n{c} Projekte',
formatter: `{b}\n{c} ${this.languageService.translate('dashboard.projects')}`,
fontWeight: 700,
},
},
@@ -3,4 +3,4 @@
[options]="options"
class="eu-project-status-chart"
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 { NgxEchartsDirective } from 'ngx-echarts';
import { ChartThemeService } from '../../../shared/services/chart-theme.service';
import { LanguageService } from '../../../shared/i18n/language.service';
import { TranslatePipe } from '../../../shared/i18n/translate.pipe';
import {
BmbfProjectStatusStatistics,
@@ -11,7 +13,7 @@ import {
@Component({
selector: 'app-eu-project-status-chart',
imports: [NgxEchartsDirective],
imports: [NgxEchartsDirective, TranslatePipe],
templateUrl: './eu-project-status-chart.component.html',
styleUrl: './eu-project-status-chart.component.scss',
})
@@ -21,6 +23,7 @@ export class EuProjectStatusChartComponent implements OnChanges {
@Input({ required: true }) dfgStatuses!: DfgProjectStatusStatistics;
private chartTheme = inject(ChartThemeService);
private languageService = inject(LanguageService);
options: EChartsOption = {};
constructor() {
@@ -39,7 +42,7 @@ export class EuProjectStatusChartComponent implements OnChanges {
const values = [
{
name: 'Laufend',
name: this.languageService.translate('dashboard.ongoing'),
data: [
this.statuses?.ongoing ?? 0,
this.bmbfStatuses?.ongoing ?? 0,
@@ -48,7 +51,7 @@ export class EuProjectStatusChartComponent implements OnChanges {
color: '#2563eb',
},
{
name: 'Kommend',
name: this.languageService.translate('dashboard.upcoming'),
data: [
this.statuses?.upcoming ?? 0,
this.bmbfStatuses?.upcoming ?? 0,
@@ -57,7 +60,7 @@ export class EuProjectStatusChartComponent implements OnChanges {
color: '#f59e0b',
},
{
name: 'Abgeschlossen',
name: this.languageService.translate('dashboard.completed'),
data: [
this.statuses?.completed ?? 0,
this.bmbfStatuses?.completed ?? 0,
@@ -79,7 +82,9 @@ export class EuProjectStatusChartComponent implements OnChanges {
borderColor: theme.tooltipBorder,
textStyle: { color: theme.tooltipTextColor },
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: {
top: 0,
@@ -91,7 +96,7 @@ export class EuProjectStatusChartComponent implements OnChanges {
xAxis: {
type: 'value',
minInterval: 1,
name: 'Anzahl Projekte',
name: this.languageService.translate('dashboard.projectCount'),
nameLocation: 'middle',
nameGap: 28,
axisLabel: { color: theme.mutedTextColor },
@@ -100,7 +105,11 @@ export class EuProjectStatusChartComponent implements OnChanges {
},
yAxis: {
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 },
axisLine: { show: false },
axisLabel: { color: theme.textColor, fontWeight: 600 },
@@ -1,17 +1,19 @@
<div class="dialog-title" mat-dialog-title>
<div class="dialog-heading">
<div>
<span class="dialog-eyebrow">Topic Insights</span>
<span class="dialog-eyebrow">{{ 'wordcloud.insights' | translate }}</span>
<h2>
{{
data.source === 'dfg' ? 'DFG-Keyword Wordcloud' : 'Keyword Wordcloud'
data.source === 'dfg'
? ('wordcloud.dfgTitle' | translate)
: ('wordcloud.title' | translate)
}}
</h2>
<p>
{{
data.source === 'dfg'
? 'Keywords der DFG-Projekte zum ausgewählten Topic'
: 'Die wichtigsten Begriffe zum ausgewählten Forschungsthema'
? ('wordcloud.dfgDescription' | translate)
: ('wordcloud.description' | translate)
}}
</p>
</div>
@@ -20,14 +22,16 @@
class="dialog-close"
mat-icon-button
type="button"
aria-label="Dialog schließen"
[attr.aria-label]="'wordcloud.close' | translate"
mat-dialog-close>
<mat-icon>close</mat-icon>
</button>
</div>
<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">
<span
class="topic-context-icon topic-context-icon--field"
@@ -76,14 +80,20 @@
<section class="word-cloud-panel" aria-labelledby="word-cloud-heading">
<div class="word-cloud-panel-header">
<div>
<h3 id="word-cloud-heading">Top Keywords</h3>
<h3 id="word-cloud-heading">
{{ 'wordcloud.topKeywords' | translate }}
</h3>
<p>
Die Schriftgröße entspricht der Anzahl der
{{ data.source === 'dfg' ? 'DFG-Projekte' : 'Publikationen' }}.
{{
(data.source === 'dfg'
? 'wordcloud.sizeDescriptionDfg'
: 'wordcloud.sizeDescriptionPublications'
) | translate
}}
</p>
</div>
@if (!loading && !loadFailed && words.length) {
<span class="word-count">{{ words.length }} Begriffe</span>
<span class="word-count">{{ termCountLabel() }}</span>
}
</div>
@@ -92,27 +102,26 @@
<span class="state-icon state-icon--loading" aria-hidden="true">
<mat-icon>hourglass_top</mat-icon>
</span>
<strong>Wordcloud wird erstellt</strong>
<span>Die wichtigsten Keywords werden geladen …</span>
<strong>{{ 'wordcloud.creating' | translate }}</strong>
<span>{{ 'wordcloud.loading' | translate }}</span>
</div>
} @else if (loadFailed) {
<div class="word-cloud-state word-cloud-state--error">
<span class="state-icon" aria-hidden="true"
><mat-icon>cloud_off</mat-icon></span
>
<strong>Wordcloud nicht verfügbar</strong>
<span>Die Keywords konnten nicht geladen werden.</span>
<strong>{{ 'wordcloud.unavailable' | translate }}</strong>
<span>{{ 'wordcloud.loadError' | translate }}</span>
</div>
} @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">
<mat-icon aria-hidden="true">tune</mat-icon>
<span>
<strong>Keyword-Auswahl</strong>
<small
>Klicken Sie auf Begriffe in der Wordcloud, um sie
auszuwählen.</small
>
<strong>{{ 'wordcloud.selection' | translate }}</strong>
<small>{{ 'wordcloud.selectionHelp' | translate }}</small>
</span>
</div>
@@ -121,13 +130,15 @@
<button
type="button"
class="keyword-chip"
[attr.aria-label]="word.name + ' aus Auswahl entfernen'"
[attr.aria-label]="removeWordLabel(word.name)"
(click)="toggleWord(word)">
{{ word.name }}
<mat-icon aria-hidden="true">close</mat-icon>
</button>
} @empty {
<span class="keyword-selection-empty">Noch nichts ausgewählt</span>
<span class="keyword-selection-empty">
{{ 'wordcloud.nothingSelected' | translate }}
</span>
}
</div>
@@ -138,7 +149,7 @@
type="button"
class="keyword-clear"
(click)="clearSelection()">
Auswahl löschen
{{ 'wordcloud.clearSelection' | translate }}
</button>
}
<a
@@ -158,7 +169,7 @@
: closeForSearchNavigation()
">
<mat-icon aria-hidden="true">manage_search</mat-icon>
Suche in Keywords
{{ 'wordcloud.searchKeywords' | translate }}
</a>
<a
mat-flat-button
@@ -179,12 +190,14 @@
: closeForSearchNavigation()
">
<mat-icon aria-hidden="true">search</mat-icon>
Suche in Themen
{{ 'wordcloud.searchTopics' | translate }}
</a>
</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) {
<button
type="button"
@@ -198,7 +211,9 @@
word.name +
': ' +
word.count +
(data.source === 'dfg' ? ' DFG-Projekte' : ' Publikationen')
(data.source === 'dfg'
? ' ' + languageService.translate('dashboard.dfgProjects')
: ' ' + languageService.translate('dashboard.publications'))
"
(click)="toggleWord(word)">
{{ word.name }}
@@ -210,11 +225,8 @@
<span class="state-icon" aria-hidden="true"
><mat-icon>search_off</mat-icon></span
>
<strong>Keine Keywords gefunden</strong>
<span
>Für dieses Topic sind im gewählten Zeitraum keine Daten
vorhanden.</span
>
<strong>{{ 'wordcloud.noKeywords' | translate }}</strong>
<span>{{ 'wordcloud.noData' | translate }}</span>
</div>
}
</section>
@@ -14,6 +14,8 @@ import {
DashboardStatisticsService,
TopicWordCloudWord,
} from '../dashboard-statistics.service';
import { LanguageService } from '../../../shared/i18n/language.service';
import { TranslatePipe } from '../../../shared/i18n/translate.pipe';
export interface TopicWordCloudDialogData {
topicId: string;
@@ -41,6 +43,7 @@ interface DisplayWord extends TopicWordCloudWord {
MatDialogModule,
MatIconModule,
RouterLink,
TranslatePipe,
],
templateUrl: './topic-wordcloud-dialog.component.html',
styleUrl: './topic-wordcloud-dialog.component.scss',
@@ -52,6 +55,7 @@ export class TopicWordCloudDialogComponent {
);
private readonly statisticsService = inject(DashboardStatisticsService);
private readonly destroyRef = inject(DestroyRef);
protected readonly languageService = inject(LanguageService);
words: DisplayWord[] = [];
selectedWordIds = new Set<string>();
@@ -122,6 +126,18 @@ export class TopicWordCloudDialogComponent {
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 {
this.selectedWordIds = new Set<string>();
}
@@ -5,9 +5,9 @@
<mat-icon class="error-icon">warning</mat-icon>
</div>
<span class="status-code">Fehler {{ statusCode() }}</span>
<h1 class="error-title">{{ title() }}</h1>
<p class="error-message">{{ message() }}</p>
<span class="status-code">{{ 'errorPage.error' | translate }} {{ statusCode() }}</span>
<h1 class="error-title">{{ localizedTitle() }}</h1>
<p class="error-message">{{ localizedMessage() }}</p>
<button
class="back-button"
@@ -15,7 +15,7 @@
color="primary"
(click)="goBack()">
<mat-icon>arrow_back</mat-icon>
Zurück
{{ 'common.back' | translate }}
</button>
@if (errorDetails()) {
@@ -25,7 +25,7 @@
appearance="outlined">
<mat-expansion-panel-header>
<mat-panel-title class="diagnostics-title">
ERWEITERTE DIAGNOSE
{{ 'errorPage.diagnostics' | translate }}
</mat-panel-title>
</mat-expansion-panel-header>
@@ -4,20 +4,20 @@ import { MatCardModule } from '@angular/material/card';
import { MatExpansionModule } from '@angular/material/expansion';
import { MatIconModule } from '@angular/material/icon';
import { ErrorService } from '../../shared/services/error.service';
import { TranslatePipe } from '../../shared/i18n/translate.pipe';
import { LanguageService } from '../../shared/i18n/language.service';
@Component({
selector: 'app-error-page',
standalone: true,
imports: [MatButtonModule, MatCardModule, MatIconModule, MatExpansionModule],
imports: [MatButtonModule, MatCardModule, MatIconModule, MatExpansionModule, TranslatePipe],
templateUrl: './error-page.component.html',
styleUrl: './error-page.component.scss',
})
export class ErrorPageComponent implements OnInit {
routeStatusCode = input<number>(500);
routeTitle = input<string>('Da ist was schiefgelaufen');
routeMessage = input<string>(
'Ein unerwarteter Fehler ist aufgetreten. Bitte versuchen Sie es später erneut.',
);
routeTitle = input<string | undefined>(undefined);
routeMessage = input<string | undefined>(undefined);
routeErrorDetails = input<string | undefined>(undefined);
statusCode = signal<number>(500);
@@ -28,6 +28,27 @@ export class ErrorPageComponent implements OnInit {
isDetailsOpen = signal<boolean>(false);
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() {
const savedError = this.errorService.getError();
@@ -37,11 +58,11 @@ export class ErrorPageComponent implements OnInit {
this.title.set(savedError.title);
this.message.set(savedError.message);
this.errorDetails.set(savedError.errorDetails);
this.errorService.clearError(); // Speicher aufräumen
this.errorService.clearError();
} else {
this.statusCode.set(this.routeStatusCode());
this.title.set(this.routeTitle());
this.message.set(this.routeMessage());
this.title.set(this.routeTitle() ?? '');
this.message.set(this.routeMessage() ?? '');
this.errorDetails.set(this.routeErrorDetails());
}
}
@@ -1,11 +1,10 @@
<section class="login-page">
<div class="login-panel">
<div class="brand-block">
<span class="eyebrow">SmartGuide Account Portal</span>
<h1>Passwort vergessen</h1>
<span class="eyebrow">{{ 'login.portal' | translate }}</span>
<h1>{{ 'forgotPassword.title' | translate }}</h1>
<p>
Gib Deine E-Mail-Adresse ein. Wenn ein Konto existiert, senden wir Dir
einen Link zum Zurücksetzen des Passworts.
{{ 'forgotPassword.description' | translate }}
</p>
</div>
@@ -17,17 +16,14 @@
</mat-icon>
<div>
@if (rateLimited()) {
<strong>Zu viele Anfragen</strong>
<strong>{{ 'forgotPassword.tooMany' | translate }}</strong>
<span>
Es wurden bereits mehrere Links angefordert. Bitte prüfe Dein
Postfach oder versuche es in {{ retryAfterText() }} erneut.
{{ 'forgotPassword.rateLimitPrefix' | translate }} {{ retryAfterText() }} {{ 'forgotPassword.retrySuffix' | translate }}
</span>
} @else {
<strong>E-Mail wurde versendet</strong>
<strong>{{ 'forgotPassword.emailSent' | translate }}</strong>
<span>
Falls ein Konto mit dieser E-Mail-Adresse existiert, wurde ein
Link zum Zurücksetzen des Passworts versendet. Bitte prüfe Dein
Postfach.
{{ 'forgotPassword.emailSentMessage' | translate }}
</span>
}
</div>
@@ -37,20 +33,20 @@
<div class="code-intro">
<mat-icon>error_outline</mat-icon>
<div>
<strong>Fehler</strong>
<strong>{{ 'errorPage.error' | translate }}</strong>
<span>{{ errorMessage() }}</span>
</div>
</div>
}
<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"
href="#"
(click)="$event.preventDefault(); requestPasswordResetAgain()">
E-Mail nicht bekommen?
{{ 'forgotPassword.notReceived' | translate }}
</a>
</div>
</div>
@@ -60,16 +56,16 @@
[formGroup]="form"
(ngSubmit)="requestPasswordReset()">
<mat-form-field class="field" appearance="outline">
<mat-label>E-Mail-Adresse</mat-label>
<mat-label>{{ 'login.email' | translate }}</mat-label>
<input
matInput
type="email"
autocomplete="email"
formControlName="email" />
@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')) {
<mat-error>Bitte gib eine gültige E-Mail-Adresse ein.</mat-error>
<mat-error>{{ 'login.emailInvalid' | translate }}</mat-error>
}
</mat-form-field>
@@ -77,7 +73,7 @@
<div class="code-intro">
<mat-icon>error_outline</mat-icon>
<div>
<strong>Fehler</strong>
<strong>{{ 'errorPage.error' | translate }}</strong>
<span>{{ errorMessage() }}</span>
</div>
</div>
@@ -90,14 +86,14 @@
type="submit"
[disabled]="form.invalid || isSubmitting()">
@if (isSubmitting()) {
Link wird gesendet...
{{ 'forgotPassword.sending' | translate }}
} @else {
Link zum Zurücksetzen senden
{{ 'forgotPassword.send' | translate }}
}
</button>
<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>
</form>
}
@@ -13,6 +13,8 @@ import { MatInputModule } from '@angular/material/input';
import { MatIconModule } from '@angular/material/icon';
import { CredentialService } from '../../shared/services/credential.service';
import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar';
import { TranslatePipe } from '../../shared/i18n/translate.pipe';
import { LanguageService } from '../../shared/i18n/language.service';
@Component({
selector: 'app-forgot-password',
@@ -24,6 +26,7 @@ import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar';
MatButtonModule,
MatIconModule,
MatSnackBarModule,
TranslatePipe,
],
templateUrl: './forgot-password.component.html',
styleUrl: '../app-login/app-login.component.scss',
@@ -32,6 +35,7 @@ import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar';
export class ForgotPasswordComponent {
private readonly credentialService = inject(CredentialService);
private readonly snackBar = inject(MatSnackBar);
private readonly languageService = inject(LanguageService);
form = new FormGroup({
email: new FormControl<string>('', [Validators.required, Validators.email]),
@@ -68,11 +72,14 @@ export class ForgotPasswordComponent {
const seconds = this.retryAfterSeconds();
if (!seconds) {
return 'einigen Minuten';
return this.languageService.translate('forgotPassword.someMinutes');
}
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 {
@@ -102,7 +109,7 @@ export class ForgotPasswordComponent {
if (response.rate_limited) {
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',
{ duration: 7000 },
);
@@ -111,7 +118,7 @@ export class ForgotPasswordComponent {
if (wasAlreadySent) {
this.snackBar.open(
'Wir haben Dir einen neuen Link zum Zurücksetzen des Passworts gesendet.',
this.languageService.translate('forgotPassword.newLinkSent'),
'OK',
{ duration: 5000 },
);
@@ -119,7 +126,7 @@ export class ForgotPasswordComponent {
},
error: () => {
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) {
@@ -127,7 +134,7 @@ export class ForgotPasswordComponent {
}
this.snackBar.open(
'Die Anfrage konnte nicht gesendet werden. Bitte versuche es später erneut.',
this.languageService.translate('forgotPassword.sendError'),
'OK',
{ duration: 7000 },
);
@@ -1 +1 @@
<p>institution-overview works!</p>
<p>{{ 'institutionOverview.placeholder' | translate }}</p>
@@ -1,8 +1,9 @@
import { Component } from '@angular/core';
import { TranslatePipe } from '../../shared/i18n/translate.pipe';
@Component({
selector: 'app-institution-overview',
imports: [],
imports: [TranslatePipe],
templateUrl: './institution-overview.component.html',
styleUrl: './institution-overview.component.scss',
})
@@ -1,17 +1,17 @@
@if (loading) {
<app-loading
text="Patentdaten werden geladen..."
[text]="'personPatents.loading' | translate"
icon="workspace_premium"
[size]="150"
[diameter]="150" />
} @else if (error) {
<p class="message">Fehler beim Laden der Patente.</p>
<p class="message">{{ 'personPatents.loadError' | translate }}</p>
} @else if (patents.length === 0) {
<p class="message">
Keine Patente in org_patents für diese Institution gefunden.
{{ 'institutionPatents.empty' | translate }}
</p>
<p class="message message-hint">
Der Index muss zuerst befüllt werden:
{{ 'institutionPatents.indexHint' | translate }}
<code
>python service/scripts/index_org_patents.py --institution-id
{{ institutionId }}</code
@@ -30,10 +30,10 @@
[value]="activeMatchType"
(selectionChange)="setMatchType($event.value)">
<mat-select-trigger>Matching</mat-select-trigger>
<mat-option value="all">Alle</mat-option>
<mat-option value="institution">Institution</mat-option>
<mat-option value="name">Name</mat-option>
<mat-option value="both">Beides</mat-option>
<mat-option value="all">{{ 'common.all' | translate }}</mat-option>
<mat-option value="institution">{{ 'publications.institution' | translate }}</mat-option>
<mat-option value="name">{{ 'jobs.name' | translate }}</mat-option>
<mat-option value="both">{{ 'institutionPatents.both' | translate }}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field
@@ -43,8 +43,8 @@
<mat-select
[value]="activeFilter"
(selectionChange)="setFilter($event.value)">
<mat-select-trigger>Filter nach Quelle</mat-select-trigger>
<mat-option value="all">Alle</mat-option>
<mat-select-trigger>{{ 'personPatents.filterSource' | translate }}</mat-select-trigger>
<mat-option value="all">{{ 'common.all' | translate }}</mat-option>
<mat-option value="EPO">EPO</mat-option>
<mat-option value="USPTO">USPTO</mat-option>
</mat-select>
@@ -56,9 +56,9 @@
<mat-select
[value]="sortMode"
(selectionChange)="setSortMode($event.value)">
<mat-select-trigger>Sortieren nach</mat-select-trigger>
<mat-option value="date">Datum</mat-option>
<mat-option value="title">Titel</mat-option>
<mat-select-trigger>{{ 'personPatents.sortBy' | translate }}</mat-select-trigger>
<mat-option value="date">{{ 'publicationDetail.date' | translate }}</mat-option>
<mat-option value="title">{{ 'projects.columnTitle' | translate }}</mat-option>
</mat-select>
</mat-form-field>
</div>
@@ -66,13 +66,13 @@
<table>
<thead>
<tr>
<th>Patent</th>
<th>Quelle</th>
<th>Jahr</th>
<th>Erfinder</th>
<th>Applicant/Assignee</th>
<th>Match-Typ</th>
<th>Personen</th>
<th>{{ 'personPatents.patent' | translate }}</th>
<th>{{ 'patents.source' | translate }}</th>
<th>{{ 'publications.year' | translate }}</th>
<th>{{ 'patents.inventors' | translate }}</th>
<th>{{ 'institutionPatents.applicantAssignee' | translate }}</th>
<th>{{ 'institutionPatents.matchType' | translate }}</th>
<th>{{ 'nav.people' | translate }}</th>
</tr>
</thead>
<tbody>
@@ -140,7 +140,7 @@
<h3>{{ selectedPatent.title ?? selectedPatent.patent_id }}</h3>
<div class="detail-stats">
<div class="stat">
<span class="stat-label">Quelle</span>
<span class="stat-label">{{ 'patents.source' | translate }}</span>
<span class="stat-value">
<span
class="source-badge source-badge--{{
@@ -151,11 +151,11 @@
</span>
</div>
<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>
</div>
<div class="stat">
<span class="stat-label">Datum</span>
<span class="stat-label">{{ 'publicationDetail.date' | translate }}</span>
@if (selectedPatent.publication_date) {
<span class="stat-value">{{
formatDate(selectedPatent.publication_date)
@@ -163,7 +163,7 @@
}
</div>
<div class="stat">
<span class="stat-label">Match-Typ</span>
<span class="stat-label">{{ 'institutionPatents.matchType' | translate }}</span>
<span class="stat-value">
<span
class="match-badge match-badge--{{
@@ -175,7 +175,7 @@
</div>
@if (getPublicationStageLabel(selectedPatent); as stageLabel) {
<div class="stat">
<span class="stat-label">Publikationsstufe</span>
<span class="stat-label">{{ 'patents.publicationStage' | translate }}</span>
<span class="stat-value">{{ stageLabel }}</span>
</div>
}
@@ -183,7 +183,7 @@
@if (selectedPatent.matched_authors?.length) {
<div class="detail-section">
<h4>Verknüpfte Personen</h4>
<h4>{{ 'institutionPatents.linkedPeople' | translate }}</h4>
<ul class="tag-list tag-list--compact">
@for (
author of selectedPatent.matched_authors;
@@ -213,46 +213,46 @@
class="patent-detail-action"
(click)="openDetail()">
<span class="patent-detail-action__label"
>Patentdetails anzeigen</span
>{{ 'personPatents.showDetails' | translate }}</span
>
<mat-icon aria-hidden="true">chevron_right</mat-icon>
</button>
<p class="patent-detail-hint">
Abstract, Erfinder, Anmelder und IPC/CPC-Klassifikation
{{ 'personPatents.detailHint' | translate }}
</p>
</div>
} @else {
<div class="patent-detail overview">
<p class="overview-title">Patentübersicht</p>
<p class="overview-title">{{ 'personPatents.overview' | translate }}</p>
<p class="overview-subtitle">
@if (institutionName) {
Alle Patente von {{ institutionName }} im Überblick.
{{ 'institutionPatents.allBy' | translate }} {{ institutionName }}.
} @else {
Alle Patente dieser Institution im Überblick.
{{ 'institutionPatents.allInstitution' | translate }}
}
</p>
<div class="overview-stats">
<div class="overview-stat overview-stat--total">
<span class="overview-value">{{ totalPatents }}</span>
<span class="overview-label">Patente</span>
<span class="overview-label">{{ 'patents.title' | translate }}</span>
</div>
<div class="overview-stat overview-stat--institution">
<span class="overview-value">{{
getInstitutionMatchCount()
}}</span>
<span class="overview-label">Institution</span>
<span class="overview-label">{{ 'publications.institution' | translate }}</span>
</div>
<div class="overview-stat overview-stat--name">
<span class="overview-value">{{ getNameMatchCount() }}</span>
<span class="overview-label">Name</span>
<span class="overview-label">{{ 'jobs.name' | translate }}</span>
</div>
<div class="overview-stat overview-stat--both">
<span class="overview-value">{{ getBothMatchCount() }}</span>
<span class="overview-label">Beides</span>
<span class="overview-label">{{ 'institutionPatents.both' | translate }}</span>
</div>
</div>
<p class="overview-hint">
Wähle links ein Patent aus, um Kurzinfos und Details zu sehen.
{{ 'institutionPatents.selectHint' | translate }}
</p>
</div>
}
@@ -13,6 +13,8 @@ import {
import { LoadingComponent } from '../../shared/ui/loading/loading.component';
import { PageEvent } from '@angular/material/paginator';
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 SourceFilter = 'all' | 'EPO' | 'USPTO';
@@ -28,6 +30,7 @@ type OrgPatentMatchTypeFilter = 'all' | 'institution' | 'name' | 'both';
MatSelectModule,
MatIconModule,
QueryParamPaginatorComponent,
TranslatePipe,
],
templateUrl: './institution-patents.component.html',
styleUrl: './institution-patents.component.scss',
@@ -36,6 +39,7 @@ export class InstitutionPatentsComponent implements OnInit {
private route = inject(ActivatedRoute);
private router = inject(Router);
private patentsApi = inject(PatentsService);
private languageService = inject(LanguageService);
patents: OrgPatentEntry[] = [];
filteredPatents: OrgPatentEntry[] = [];
@@ -170,7 +174,7 @@ export class InstitutionPatentsComponent implements OnInit {
private sortPatents(patents: OrgPatentEntry[]): OrgPatentEntry[] {
if (this.sortMode === 'title') {
return [...patents].sort((a, b) =>
(a.title ?? '').localeCompare(b.title ?? '', 'de', {
(a.title ?? '').localeCompare(b.title ?? '', this.languageService.language(), {
sensitivity: 'base',
}),
);
@@ -223,7 +227,7 @@ export class InstitutionPatentsComponent implements OnInit {
}
formatDate(date: string | null | undefined): string {
return formatPatentDate(date);
return formatPatentDate(date, this.languageService.language() === 'de' ? 'de-DE' : 'en-US');
}
getEpoCount(): number {
@@ -277,11 +281,11 @@ export class InstitutionPatentsComponent implements OnInit {
getMatchTypeLabel(patent: OrgPatentEntry): string {
switch (patent.match_type) {
case 'institution':
return 'Institution';
return this.languageService.translate('publications.institution');
case 'name':
return 'Name';
return this.languageService.translate('jobs.name');
case 'both':
return 'Beides';
return this.languageService.translate('institutionPatents.both');
default:
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 { EChartsOption } from 'echarts';
@@ -7,6 +7,7 @@ import { GridComponent, LegendComponent } from 'echarts/components';
import { CanvasRenderer } from 'echarts/renderers';
import { NgxEchartsDirective } from 'ngx-echarts';
import { InstitutionFunderSummary } from '../../api';
import { LanguageService } from '../../shared/i18n/language.service';
echarts.use([GridComponent, CanvasRenderer, LegendComponent]);
@@ -22,6 +23,7 @@ type FunderData = {
styleUrl: './institution-projects-funding-graph.component.scss',
})
export class InstitutionProjectsFundingGraphComponent {
private readonly languageService = inject(LanguageService);
options!: EChartsOption;
fundings = input.required<InstitutionFunderSummary[]>();
@@ -36,7 +38,7 @@ export class InstitutionProjectsFundingGraphComponent {
generateChartOptions(fundings: InstitutionFunderSummary[]): void {
const floorToTwoDecimals = (value: number): string => {
const floored = Math.floor(value * 100) / 100;
return floored.toLocaleString(undefined, {
return floored.toLocaleString(this.languageService.language() === 'de' ? 'de-DE' : 'en-US', {
style: 'currency',
currency: 'EUR',
minimumFractionDigits: 2,
@@ -83,7 +85,7 @@ export class InstitutionProjectsFundingGraphComponent {
label: {
show: true,
position: 'end',
formatter: 'Aktuelles Jahr',
formatter: this.languageService.translate('institutionProjects.currentYear'),
backgroundColor: '#333',
color: '#fff',
padding: [4, 6],
@@ -139,7 +141,7 @@ export class InstitutionProjectsFundingGraphComponent {
type: 'value',
axisLabel: {
formatter: (value: number) =>
value.toLocaleString(undefined, {
value.toLocaleString(this.languageService.language() === 'de' ? 'de-DE' : 'en-US', {
style: 'currency',
currency: 'EUR',
maximumFractionDigits: 0,
@@ -1,5 +1,5 @@
<div class="content">
<h3>Projekte</h3>
<h3>{{ 'nav.projects' | translate }}</h3>
<div class="funding-area">
<div class="person-projects">
@@ -12,7 +12,7 @@
routerLinkActive
#rla="routerLinkActive"
[active]="rla.isActive">
{{ route.label }}
{{ route.labelKey | translate }}
</a>
}
</nav>
@@ -23,7 +23,7 @@
<div class="funding-info-section">
<mat-card appearance="outlined">
<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-content>
<app-institution-projects-funding-graph
@@ -33,28 +33,28 @@
<div class="funding-info-cards">
<app-info-card
[description]="'Gesamte Förderung durch Bund'"
[description]="'institutionProjects.totalFederal' | translate"
[value]="
(bundTotalFunding()
| currency: 'EUR' : 'symbol' : '1.0-0' : 'de') ?? undefined
| currency: 'EUR' : 'symbol' : '1.0-0' : locale()) ?? undefined
" />
<app-info-card
[description]="'Durchschnittliche jährliche Förderung durch Bund'"
[description]="'institutionProjects.averageFederal' | translate"
[value]="
(bundAverageAnnualFunding()
| currency: 'EUR' : 'symbol' : '1.0-0' : 'de') ?? undefined
| currency: 'EUR' : 'symbol' : '1.0-0' : locale()) ?? undefined
" />
<app-info-card
[description]="'Gesamte Förderung durch die Europäische Union'"
[description]="'institutionProjects.totalEu' | translate"
[value]="
(euTotalFunding()
| currency: 'EUR' : 'symbol' : '1.0-0' : 'de') ?? undefined
| currency: 'EUR' : 'symbol' : '1.0-0' : locale()) ?? undefined
" />
<app-info-card
[description]="'Durchschnittliche jährliche Förderung durch die Europäische Union'"
[description]="'institutionProjects.averageEu' | translate"
[value]="
(euAverageAnnualFunding()
| currency: 'EUR' : 'symbol' : '1.0-0' : 'de') ?? undefined
| currency: 'EUR' : 'symbol' : '1.0-0' : locale()) ?? undefined
" />
</div>
</div>
@@ -68,7 +68,7 @@
{{ row.funding_end | date: 'dd.MM.yyyy' }}
</ng-template>
<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 #euProjectActionsTmp let-row>
@@ -6,6 +6,7 @@ import {
OnInit,
TemplateRef,
viewChild,
inject,
} from '@angular/core';
import { ActivatedRoute, Router, RouterModule } from '@angular/router';
import {
@@ -27,6 +28,9 @@ import { MatIconModule } from '@angular/material/icon';
import { MatButtonModule } from '@angular/material/button';
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 { TranslatePipe } from '../../shared/i18n/translate.pipe';
import { LanguageService } from '../../shared/i18n/language.service';
import { TranslationKey } from '../../shared/i18n/translations';
type BundProjectRow = {
id: string;
@@ -60,11 +64,14 @@ type EuProjectRow = {
InstitutionProjectsFundingGraphComponent,
AppInfoCardComponent,
RouterModule,
TranslatePipe,
],
templateUrl: './institution-projects.component.html',
styleUrl: './institution-projects.component.scss',
})
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');
fundingEndTmp = viewChild.required<TemplateRef<any>>('fundingEndTmp');
fundingAmountTmp = viewChild.required<TemplateRef<any>>('fundingAmountTmp');
@@ -111,15 +118,15 @@ export class InstitutionProjectsComponent implements OnInit {
readonly childRoutes = [
{
path: 'dfg',
label: 'DFG-Projekte',
labelKey: 'personProjects.dfg' as TranslationKey,
},
{
path: 'eu',
label: 'EU-Projekte',
labelKey: 'personProjects.eu' as TranslationKey,
},
{
path: 'bund',
label: 'BUND-Projekte',
labelKey: 'institutionProjects.federalProjects' as TranslationKey,
},
];
constructor(
@@ -168,28 +175,28 @@ export class InstitutionProjectsComponent implements OnInit {
this.euProjectColumns = [
{
id: 'title',
header: 'Titel',
header: this.languageService.translate('projects.columnTitle'),
type: 'accessor',
accessorKey: 'topic',
},
{
id: 'funding_start',
header: 'Förderbeginn',
header: this.languageService.translate('projects.fundingStart'),
type: 'accessor',
accessorKey: 'funding_start',
cellTemplate: this.fundingStartTmp(),
},
{
id: 'funding_end',
header: 'Förderende',
header: this.languageService.translate('projects.fundingEnd'),
type: 'accessor',
accessorKey: 'funding_end',
cellTemplate: this.fundingEndTmp(),
},
{
id: 'funding_amount',
header: 'Fördersumme (EC)',
header: this.languageService.translate('institutionProjects.fundingAmountEc'),
type: 'accessor',
accessorKey: 'funding_amount',
cellTemplate: this.fundingAmountTmp(),
@@ -204,27 +211,27 @@ export class InstitutionProjectsComponent implements OnInit {
this.bundProjectColumns = [
{
id: 'title',
header: 'Titel',
header: this.languageService.translate('projects.columnTitle'),
type: 'accessor',
accessorKey: 'topic',
},
{
id: 'funding_start',
header: 'Förderbeginn',
header: this.languageService.translate('projects.fundingStart'),
type: 'accessor',
accessorKey: 'funding_start',
cellTemplate: this.fundingStartTmp(),
},
{
id: 'funding_end',
header: 'Fördersende',
header: this.languageService.translate('projects.fundingEnd'),
type: 'accessor',
accessorKey: 'funding_end',
cellTemplate: this.fundingEndTmp(),
},
{
id: 'funding_amount',
header: 'Fördersumme',
header: this.languageService.translate('institutionProjects.fundingAmount'),
type: 'accessor',
accessorKey: 'funding_amount',
cellTemplate: this.fundingAmountTmp(),
@@ -1,13 +1,13 @@
<div class="content">
<div>
<h6>Publikationen</h6>
<p>Übersicht der wissenschaftlichen Veröffentlichungen.</p>
<h6>{{ 'publications.publications' | translate }}</h6>
<p>{{ 'institutionPublications.description' | translate }}</p>
</div>
@if (canViewClassificationChart()) {
<mat-accordion multi>
<mat-expansion-panel class="mat-elevation-z1">
<mat-expansion-panel-header>
<mat-panel-title>Forschungszwecke</mat-panel-title>
<mat-panel-title>{{ 'publications.researchPurposes' | translate }}</mat-panel-title>
</mat-expansion-panel-header>
<app-primary-category-year-aggregation-chart
[page]="primaryCategoryYearAggregationPage()" />
@@ -15,10 +15,10 @@
<mat-expansion-panel class="mat-elevation-z1" [expanded]="true">
<mat-expansion-panel-header>
<mat-panel-title>Publikationsliste</mat-panel-title>
<mat-panel-title>{{ 'publications.list' | translate }}</mat-panel-title>
<mat-panel-description
>{{ total() >= 10000 ? 'mehr als' : '' }}
{{ total() }} Publikationen</mat-panel-description
>{{ total() >= 10000 ? ('publications.moreThan' | translate) : '' }}
{{ total() }} {{ 'publications.publications' | translate }}</mat-panel-description
>
</mat-expansion-panel-header>
<ng-container *ngTemplateOutlet="filterTableAndPaginator" />
@@ -12,6 +12,7 @@ import { PrimaryCategoryYearAggregationChartComponent } from '../../shared/ui/pr
import { MatExpansionModule } from '@angular/material/expansion';
import { CommonModule } from '@angular/common';
import { ActivatedRoute } from '@angular/router';
import { TranslatePipe } from '../../shared/i18n/translate.pipe';
@Component({
selector: 'app-institution-publications',
@@ -22,6 +23,7 @@ import { ActivatedRoute } from '@angular/router';
PrimaryCategoryYearAggregationChartComponent,
MatExpansionModule,
CommonModule,
TranslatePipe,
],
templateUrl: './institution-publications.component.html',
styleUrl: './institution-publications.component.scss',
@@ -4,7 +4,7 @@
<mat-card-content>
<p>{{ institution.homepage_url }}</p>
<p>{{ institution.display_name_alternatives }}</p>
<p>And many more useful details...</p>
<p>{{ 'institution.moreDetails' | translate }}</p>
</mat-card-content>
</mat-card>
@@ -18,7 +18,7 @@
#rla="routerLinkActive"
[active]="rla.isActive"
[disabled]="link.disabled">
{{ link.label }}
{{ link.labelKey | translate }}
</a>
}
</nav>
@@ -9,8 +9,10 @@ import { Institution } from '../../api';
import { PatentsService } from '../../api/api/patents.service';
import { MatCardModule } from '@angular/material/card';
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({
selector: 'app-institution',
@@ -20,6 +22,7 @@ const PATENTS_LINK = { label: 'Patente', path: 'patents', disabled: false };
RouterLink,
RouterOutlet,
RouterLinkActive,
TranslatePipe,
],
templateUrl: './institution.component.html',
styleUrl: './institution.component.scss',
@@ -30,10 +33,10 @@ export class InstitutionComponent implements OnInit {
institution!: Institution;
links = [
{ label: 'Übersicht', path: 'overview', disabled: false },
{ label: 'Publikationen', path: 'publications', disabled: false },
{ labelKey: 'personCard.overview' as TranslationKey, path: 'overview', disabled: false },
{ labelKey: 'publications.publications' as TranslationKey, path: 'publications', disabled: false },
{
label: 'Projekte',
labelKey: 'nav.projects' as TranslationKey,
path: 'projects',
disabled: false,
queryParams: {
@@ -1,5 +1,5 @@
<div class="content">
<h1>Passende Institutionen finden</h1>
<h1>{{ 'institutions.title' | translate }}</h1>
<mat-divider />
@@ -9,9 +9,11 @@
[cardTmp]="cardTmp"
[observers]="observers"
[cardMinWidth]="550"
searchLabel="Suche nach Namen"
[sortingOptions]="sortingOptions"
[sortingDirectionOptions]="sortingDirectionOptions" />
[searchLabel]="'institutions.searchName' | translate"
[sortingOptions]="sortingOptions()"
[sortByLabel]="'personPatents.sortBy' | translate"
[sortingDirectionOptions]="sortingDirectionOptions()"
[sortingDirectionLabel]="'persons.sortOrder' | translate" />
</div>
<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 { MatButtonModule } from '@angular/material/button';
import { MatCardModule } from '@angular/material/card';
@@ -13,6 +13,8 @@ import {
} from '../../shared/ui/card-search/card-search.component';
import { FilterObserver } from '../../shared/ui/selected-filters/selected-filters.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({
selector: 'app-institutions',
@@ -24,11 +26,13 @@ import { AppInstitutionCardComponent } from '../../shared/ui/app-institution-car
RouterModule,
CardSearchComponent,
AppInstitutionCardComponent,
TranslatePipe,
],
templateUrl: './institutions.component.html',
styleUrl: './institutions.component.scss',
})
export class InstitutionsComponent {
private readonly languageService = inject(LanguageService);
institutionPage = input.required<InstitutionPage>();
observers: FilterObserver[] = [
@@ -46,14 +50,14 @@ export class InstitutionsComponent {
elements: this.institutionPage().elements || [],
}));
sortingOptions: SelectorOption[] = [
{ value: 'relevance', display_name: 'Relevanz' },
{ value: 'name', display_name: 'Name' },
{ value: 'works_count', display_name: 'Anzahl Publikationen' },
{ value: 'citations_count', display_name: 'Anzahl Zitationen' },
];
sortingDirectionOptions: SelectorOption[] = [
{ value: 'asc', display_name: 'Aufsteigend' },
{ value: 'desc', display_name: 'Absteigend' },
];
sortingOptions = computed<SelectorOption[]>(() => [
{ value: 'relevance', display_name: this.languageService.translate('institutions.relevance') },
{ value: 'name', display_name: this.languageService.translate('jobs.name') },
{ value: 'works_count', display_name: this.languageService.translate('institutions.publicationCount') },
{ value: 'citations_count', display_name: this.languageService.translate('institutions.citationCount') },
]);
sortingDirectionOptions = computed<SelectorOption[]>(() => [
{ value: 'asc', display_name: this.languageService.translate('persons.ascending') },
{ value: 'desc', display_name: this.languageService.translate('persons.descending') },
]);
}
@@ -6,15 +6,15 @@
<mat-progress-spinner
diameter="24"
mode="indeterminate"></mat-progress-spinner>
<span>Läufe werden geladen …</span>
<span>{{ 'jobs.runsLoading' | translate }}</span>
</div>
} @else if (runsError()) {
<p class="logs-error">{{ runsError() }}</p>
} @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 {
<mat-form-field appearance="outline" class="run-select">
<mat-label>Lauf auswählen</mat-label>
<mat-label>{{ 'jobs.selectRun' | translate }}</mat-label>
<mat-select
[value]="selectedRunId()"
(selectionChange)="onRunSelected($event.value)">
@@ -35,7 +35,7 @@
<div class="logs-header">
<div class="run-meta">
<span>Lauf #{{ selectedRunId() }}</span>
<span>{{ 'jobs.run' | translate }} #{{ selectedRunId() }}</span>
@if (runStatus()) {
<span
class="task-status"
@@ -47,13 +47,13 @@
@if (selectedRun(); as run) {
@if (runStatus() === 'running' || runStatus() === 'stopping') {
@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) {
<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 class="logs-actions">
<button
@@ -62,13 +62,13 @@
[disabled]="selectedRunId() == null"
(click)="downloadLogs()">
<mat-icon>download</mat-icon>
Herunterladen
{{ 'jobs.download' | translate }}
</button>
<button
mat-icon-button
type="button"
aria-label="Logs aktualisieren"
matTooltip="Logs aktualisieren"
[attr.aria-label]="'jobs.refreshLogs' | translate"
[matTooltip]="'jobs.refreshLogs' | translate"
matTooltipPosition="above"
[disabled]="loading() || runsLoading()"
(click)="loadRuns()">
@@ -83,7 +83,7 @@
<mat-progress-spinner
diameter="20"
mode="indeterminate"></mat-progress-spinner>
<span>Logs werden geladen …</span>
<span>{{ 'jobs.logsLoading' | translate }}</span>
</div>
} @else {
<pre>{{ logs() }}</pre>
@@ -93,5 +93,5 @@
</mat-dialog-content>
<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>
@@ -29,6 +29,8 @@ import {
formatUtcDateAsLocal,
statusMeta,
} from '../jobs.utils';
import { LanguageService } from '../../../shared/i18n/language.service';
import { TranslatePipe } from '../../../shared/i18n/translate.pipe';
export interface JobLogsDialogData {
task: BackgroundJobTask;
@@ -45,6 +47,7 @@ export interface JobLogsDialogData {
MatProgressSpinnerModule,
MatSelectModule,
MatTooltipModule,
TranslatePipe,
],
templateUrl: './job-logs-dialog.component.html',
styleUrl: './job-logs-dialog.component.scss',
@@ -54,10 +57,9 @@ export class JobLogsDialogComponent implements OnInit {
private readonly dialogRef = inject(MatDialogRef<JobLogsDialogComponent>);
private readonly backgroundJobsService = inject(BackgroundJobsService);
private readonly destroyRef = inject(DestroyRef);
private readonly languageService = inject(LanguageService);
protected readonly data = inject<JobLogsDialogData>(MAT_DIALOG_DATA);
protected readonly statusMeta = statusMeta;
protected readonly formatUtcDateAsLocal = formatUtcDateAsLocal;
protected readonly formatRunDuration = formatRunDuration;
protected readonly formatRunElapsed = formatRunElapsed;
@@ -114,7 +116,7 @@ export class JobLogsDialogComponent implements OnInit {
}
},
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({
next: (result) => {
if (!result) {
this.logs.set('Die Log-Anfrage hat keine Daten zurückgegeben.');
this.logs.set(this.languageService.translate('jobs.emptyLogResponse'));
return;
}
this.logs.set(result.logs || 'Keine Logs vorhanden.');
this.logs.set(result.logs || this.languageService.translate('jobs.noLogs'));
this.runStatus.set(result.status);
if (this.followTail) this.scrollToBottom();
},
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 {
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">
<header class="page-header">
<div>
<h1>Jobs</h1>
<p>
Background-Jobs zur Aufbereitung und Indizierung der Daten manuell
ausführen oder per Cron-Zeitplan automatisieren.
</p>
<h1>{{ 'jobs.title' | translate }}</h1>
<p>{{ 'jobs.description' | translate }}</p>
</div>
<button
mat-flat-button
@@ -14,7 +11,7 @@
class="new-job-button"
(click)="openCreateDialog()">
<mat-icon>add</mat-icon>
Neuer Job
{{ 'jobs.new' | translate }}
</button>
</header>
@@ -33,7 +30,9 @@
<strong>Docker-Daemon</strong>
<div class="health-detail">
{{
dockerHealth()?.reachable ? 'Erreichbar' : 'Nicht erreichbar'
dockerHealth()?.reachable
? ('jobs.reachable' | translate)
: ('jobs.unreachable' | translate)
}}
@if (dockerHealth()?.detail) {
<span> · {{ dockerHealth()?.detail }}</span>
@@ -44,8 +43,8 @@
<button
mat-icon-button
type="button"
aria-label="Docker-Status aktualisieren"
matTooltip="Docker-Status aktualisieren"
[attr.aria-label]="'jobs.refreshDocker' | translate"
[matTooltip]="'jobs.refreshDocker' | translate"
[disabled]="dockerHealthLoading()"
(click)="refreshDockerHealth()">
<mat-icon>refresh</mat-icon>
@@ -72,12 +71,12 @@
</div>
<div class="health-detail">
@if (registryHealthLoading() && !registryHealth()) {
<span>Wird geprüft …</span>
<span>{{ 'jobs.checking' | translate }}</span>
} @else {
{{
registryHealth()?.reachable
? 'Erreichbar'
: 'Nicht erreichbar'
? ('jobs.reachable' | translate)
: ('jobs.unreachable' | translate)
}}
@if (registryHealth()?.detail) {
<span> · {{ registryHealth()?.detail }}</span>
@@ -89,8 +88,8 @@
<button
mat-icon-button
type="button"
aria-label="Nexus-Status aktualisieren"
matTooltip="Nexus-Status aktualisieren"
[attr.aria-label]="'jobs.refreshNexus' | translate"
[matTooltip]="'jobs.refreshNexus' | translate"
[disabled]="registryHealthLoading()"
(click)="refreshRegistryHealth()">
<mat-icon>refresh</mat-icon>
@@ -111,8 +110,8 @@
<button
type="button"
class="edit-name-action"
aria-label="Job bearbeiten"
matTooltip="Job bearbeiten"
[attr.aria-label]="'jobs.edit' | translate"
[matTooltip]="'jobs.edit' | translate"
matTooltipPosition="above"
[disabled]="row.status === 'running' || row.status === 'stopping'"
(click)="openEditDialog(row)">
@@ -131,16 +130,20 @@
@if (row.schedule) {
<span class="schedule-cron">{{ row.schedule }}</span>
} @else {
<span>Nur manuell</span>
<span>{{ 'jobs.manualOnly' | translate }}</span>
}
@if (row.next_run_at) {
<span class="next-run">
Nächster Lauf: {{ formatUtcDateAsLocal(row.next_run_at) }}
{{ nextRunLabel(row.next_run_at) }}
</span>
}
@if (row.schedule) {
<span class="enabled-badge" [class.enabled-badge--on]="row.enabled">
{{ row.enabled ? 'Aktiv' : 'Inaktiv' }}
{{
row.enabled
? ('status.active' | translate)
: ('status.inactive' | translate)
}}
</span>
}
</div>
@@ -165,10 +168,10 @@
<span>{{ formatUtcDateAsLocal(row.last_run.started_at) }}</span>
@if (row.status === 'running' || row.status === 'stopping') {
@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) {
<span class="last-run-message">Dauer: {{ duration }}</span>
<span class="last-run-message">{{ durationLabel(duration) }}</span>
}
@if (row.last_run.exit_code != null) {
<span class="last-run-message"
@@ -177,18 +180,18 @@
}
</div>
} @else {
<span class="last-run-empty">Noch nicht ausgeführt</span>
<span class="last-run-empty">{{ 'jobs.neverRun' | translate }}</span>
}
</ng-template>
<ng-template #taskActionsHeaderTmp>
<div class="actions-header">
<span>Aktionen</span>
<span>{{ 'common.actions' | translate }}</span>
<button
mat-icon-button
type="button"
aria-label="Jobs aktualisieren"
matTooltip="Jobs aktualisieren"
[attr.aria-label]="'jobs.refresh' | translate"
[matTooltip]="'jobs.refresh' | translate"
matTooltipPosition="above"
(click)="refreshTasks()">
<mat-icon>refresh</mat-icon>
@@ -201,8 +204,8 @@
<button
mat-icon-button
type="button"
aria-label="Jetzt ausführen"
matTooltip="Jetzt ausführen"
[attr.aria-label]="'jobs.runNow' | translate"
[matTooltip]="'jobs.runNow' | translate"
matTooltipPosition="above"
[disabled]="row.status === 'running' || row.status === 'stopping'"
(click)="runNow(row)">
@@ -211,8 +214,8 @@
<button
mat-icon-button
type="button"
aria-label="Stoppen"
matTooltip="Stoppen"
[attr.aria-label]="'jobs.stop' | translate"
[matTooltip]="'jobs.stop' | translate"
matTooltipPosition="above"
[disabled]="row.status !== 'running'"
(click)="stopNow(row)">
@@ -221,8 +224,8 @@
<button
mat-icon-button
type="button"
aria-label="Logs anzeigen"
matTooltip="Logs anzeigen"
[attr.aria-label]="'jobs.showLogs' | translate"
[matTooltip]="'jobs.showLogs' | translate"
matTooltipPosition="above"
[disabled]="!row.last_run"
(click)="openLogsDialog(row)">
@@ -231,8 +234,8 @@
<button
mat-icon-button
type="button"
aria-label="Zeitplan bearbeiten"
matTooltip="Zeitplan bearbeiten"
[attr.aria-label]="'jobs.editSchedule' | translate"
[matTooltip]="'jobs.editSchedule' | translate"
matTooltipPosition="above"
(click)="openScheduleDialog(row)">
<mat-icon>edit_calendar</mat-icon>
@@ -241,8 +244,8 @@
mat-icon-button
type="button"
class="delete-action"
aria-label="Job löschen"
matTooltip="Job löschen"
[attr.aria-label]="'jobs.delete' | translate"
[matTooltip]="'jobs.delete' | translate"
matTooltipPosition="above"
[disabled]="
row.status === 'running' ||
+77 -32
View File
@@ -2,6 +2,8 @@ import { CommonModule } from '@angular/common';
import {
Component,
DestroyRef,
effect,
Injector,
OnInit,
TemplateRef,
inject,
@@ -58,6 +60,8 @@ import {
TaskEditDialogComponent,
TaskEditDialogData,
} 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;
@@ -73,6 +77,7 @@ const MAX_IDLE_POLL_WAIT_MS = 60000;
MatSnackBarModule,
MatTooltipModule,
DataTableComponent,
TranslatePipe,
],
templateUrl: './jobs.component.html',
styleUrl: './jobs.component.scss',
@@ -83,6 +88,8 @@ export class JobsComponent implements OnInit {
private readonly snackBar = inject(MatSnackBar);
private readonly backgroundJobsService = inject(BackgroundJobsService);
private readonly destroyRef = inject(DestroyRef);
private readonly languageService = inject(LanguageService);
private readonly injector = inject(Injector);
tasksInput = input.required<BackgroundJobTask[]>({ alias: 'tasks' });
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 nowMs = signal(Date.now());
protected readonly statusMeta = statusMeta;
protected readonly formatScheduleCron = formatScheduleCron;
protected readonly formatUtcDateAsLocal = formatUtcDateAsLocal;
protected readonly formatRunDuration = formatRunDuration;
protected readonly formatRunElapsed = formatRunElapsed;
@@ -137,7 +142,9 @@ export class JobsComponent implements OnInit {
})
.pipe(
catchError(() => {
this.showError('Jobs konnten nicht aktualisiert werden.');
this.showError(
this.languageService.translate('jobs.refreshError'),
);
return EMPTY;
}),
),
@@ -151,34 +158,44 @@ export class JobsComponent implements OnInit {
this.syncBackgroundWork();
effect(
() => {
this.languageService.language();
this.setTaskColumns();
},
{ injector: this.injector },
);
}
private setTaskColumns(): void {
this.taskColumns = [
{
id: 'name',
header: 'Job',
header: this.languageService.translate('jobs.columnJob'),
type: 'display',
cellTemplate: this.taskNameTmp(),
},
{
id: 'schedule',
header: 'Zeitplan',
header: this.languageService.translate('jobs.columnSchedule'),
type: 'display',
cellTemplate: this.taskScheduleTmp(),
},
{
id: 'status',
header: 'Status',
header: this.languageService.translate('common.status'),
type: 'display',
cellTemplate: this.taskStatusTmp(),
},
{
id: 'lastRun',
header: 'Letzter Lauf',
header: this.languageService.translate('jobs.columnLastRun'),
type: 'display',
cellTemplate: this.taskLastRunTmp(),
},
{
id: 'actions',
header: 'Aktionen',
header: this.languageService.translate('common.actions'),
type: 'display',
headerTemplate: this.taskActionsHeaderTmp(),
cellTemplate: this.taskActionsTmp(),
@@ -248,7 +265,7 @@ export class JobsComponent implements OnInit {
},
error: () => {
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: () => {
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);
if (!health.reachable) {
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') {
this.showError(
`„${task.name}“ ist fehlgeschlagen — Details in den Logs.`,
this.languageService.translate('jobs.runFailed', { name: task.name }),
);
this.refreshRegistryHealth();
} 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,
horizontalPosition: 'center',
verticalPosition: 'bottom',
@@ -314,8 +333,8 @@ export class JobsComponent implements OnInit {
error: (error) =>
this.showError(
error.status === 409
? `„${task.name}“ läuft bereits.`
: `„${task.name}“ konnte nicht gestartet werden.`,
? this.languageService.translate('jobs.alreadyRunning', { name: task.name })
: this.languageService.translate('jobs.startError', { name: task.name }),
),
});
}
@@ -340,9 +359,9 @@ export class JobsComponent implements OnInit {
}));
const message =
run.status === 'stopped'
? `„${task.name}“ wurde gestoppt.`
: `„${task.name}“ war bereits beendet.`;
this.snackBar.open(message, 'OK', {
? this.languageService.translate('jobs.stopped', { name: task.name })
: this.languageService.translate('jobs.alreadyFinished', { name: task.name });
this.snackBar.open(message, this.languageService.translate('common.ok'), {
duration: 3000,
horizontalPosition: 'center',
verticalPosition: 'bottom',
@@ -357,8 +376,8 @@ export class JobsComponent implements OnInit {
}));
this.showError(
error.status === 409
? `„${task.name}“ läuft nicht.`
: `„${task.name}“ konnte nicht gestoppt werden.`,
? this.languageService.translate('jobs.notRunning', { name: task.name })
: this.languageService.translate('jobs.stopError', { name: task.name }),
);
this.refreshTasks();
},
@@ -394,7 +413,7 @@ export class JobsComponent implements OnInit {
if (!task) return;
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,
horizontalPosition: 'center',
verticalPosition: 'bottom',
@@ -422,7 +441,7 @@ export class JobsComponent implements OnInit {
if (!updatedTask) return;
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,
horizontalPosition: 'center',
verticalPosition: 'bottom',
@@ -452,7 +471,7 @@ export class JobsComponent implements OnInit {
.subscribe({
next: (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,
horizontalPosition: 'center',
verticalPosition: 'bottom',
@@ -461,7 +480,7 @@ export class JobsComponent implements OnInit {
error: (error) =>
this.showError(
error?.error?.detail ??
'Zeitplan konnte nicht gespeichert werden.',
this.languageService.translate('jobs.scheduleSaveError'),
),
});
});
@@ -481,10 +500,10 @@ export class JobsComponent implements OnInit {
width: '520px',
maxWidth: 'calc(100vw - 32px)',
data: {
title: 'Job löschen',
message: `Möchtest Du „${task.name}“ wirklich löschen? Alle Laufdaten und gespeicherten Logs werden dauerhaft gelöscht.`,
confirmText: 'Löschen',
cancelText: 'Abbrechen',
title: this.languageService.translate('jobs.delete'),
message: this.languageService.translate('jobs.deleteQuestion', { name: task.name }),
confirmText: this.languageService.translate('common.remove'),
cancelText: this.languageService.translate('common.cancel'),
},
});
@@ -514,7 +533,7 @@ export class JobsComponent implements OnInit {
this.tasks.update((tasks) =>
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,
horizontalPosition: 'center',
verticalPosition: 'bottom',
@@ -525,8 +544,8 @@ export class JobsComponent implements OnInit {
this.finishDeletingTask(task.id);
this.showError(
error.status === 409
? `„${task.name}“ läuft noch und kann nicht gelöscht werden.`
: `„${task.name}“ konnte nicht gelöscht werden.`,
? this.languageService.translate('jobs.deleteRunningError', { name: task.name })
: this.languageService.translate('jobs.deleteError', { name: task.name }),
);
this.refreshTasks();
},
@@ -552,10 +571,36 @@ export class JobsComponent implements OnInit {
}
private showError(message: string): void {
this.snackBar.open(message, 'OK', {
this.snackBar.open(message, this.languageService.translate('common.ok'), {
duration: 5000,
horizontalPosition: 'center',
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();
}
export function formatUtcDateAsLocal(value: string | null | undefined): string {
export function formatUtcDateAsLocal(
value: string | null | undefined,
locale = 'de-DE',
): string {
if (!value) return '';
return new Intl.DateTimeFormat('de-DE', {
return new Intl.DateTimeFormat(locale, {
day: '2-digit',
month: '2-digit',
year: 'numeric',
@@ -1,23 +1,23 @@
<h2 mat-dialog-title>Neuer Job</h2>
<h2 mat-dialog-title>{{ 'jobs.new' | translate }}</h2>
<mat-dialog-content>
<form class="create-form" [formGroup]="form">
<mat-form-field appearance="outline">
<mat-label>Name</mat-label>
<mat-label>{{ 'jobs.name' | translate }}</mat-label>
<input matInput formControlName="name" />
<mat-icon
matSuffix
class="field-info"
matTooltip="Eindeutiger Anzeigename des Jobs, z.B. „News-Themen-Mapping (Testlauf)“."
[matTooltip]="'jobs.nameHelp' | translate"
>info_outline</mat-icon
>
@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 appearance="outline">
<mat-label>Befehl</mat-label>
<mat-label>{{ 'jobs.command' | translate }}</mat-label>
<textarea
matInput
class="command-input"
@@ -27,13 +27,13 @@
<mat-icon
matSuffix
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
>
</mat-form-field>
<mat-form-field appearance="outline">
<mat-label>Image</mat-label>
<mat-label>{{ 'jobs.image' | translate }}</mat-label>
<input
matInput
class="image-input"
@@ -47,39 +47,39 @@
<mat-icon
matSuffix
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
>
@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 appearance="outline">
<mat-label>Beschreibung (optional)</mat-label>
<mat-label>{{ 'jobs.descriptionOptional' | translate }}</mat-label>
<textarea matInput rows="2" formControlName="description"></textarea>
<mat-icon
matSuffix
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
>
</mat-form-field>
<mat-form-field appearance="outline">
<mat-label>Ziel-Index (optional)</mat-label>
<mat-label>{{ 'jobs.targetIndexOptional' | translate }}</mat-label>
<input matInput formControlName="targetIndex" />
<mat-icon
matSuffix
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
>
</mat-form-field>
<mat-form-field appearance="outline">
<mat-label>Umgebungsvariablen (optional)</mat-label>
<mat-label>{{ 'jobs.environmentOptional' | translate }}</mat-label>
<textarea
matInput
rows="3"
@@ -88,12 +88,12 @@
<mat-icon
matSuffix
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
>
<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')) {
<mat-error>Ungültige Zeile — Format: KEY=value.</mat-error>
<mat-error>{{ 'jobs.envInvalid' | translate }}</mat-error>
}
</mat-form-field>
</form>
@@ -104,7 +104,7 @@
</mat-dialog-content>
<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"
@@ -112,6 +112,6 @@
[disabled]="creating()"
(click)="submit()">
<mat-icon>add</mat-icon>
Anlegen
{{ 'jobs.create' | translate }}
</button>
</mat-dialog-actions>
@@ -15,6 +15,8 @@ import { MatIconModule } from '@angular/material/icon';
import { MatInputModule } from '@angular/material/input';
import { MatTooltipModule } from '@angular/material/tooltip';
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_]*=.*$/;
@@ -30,6 +32,7 @@ const ENV_LINE_PATTERN = /^[A-Za-z_][A-Za-z0-9_]*=.*$/;
MatIconModule,
MatInputModule,
MatTooltipModule,
TranslatePipe,
],
templateUrl: './task-create-dialog.component.html',
styleUrl: './task-create-dialog.component.scss',
@@ -41,6 +44,7 @@ export class TaskCreateDialogComponent implements OnInit {
MatDialogRef<TaskCreateDialogComponent, BackgroundJobTask | undefined>
>(MatDialogRef);
private readonly backgroundJobsService = inject(BackgroundJobsService);
private readonly languageService = inject(LanguageService);
protected readonly creating = signal(false);
protected readonly serverError = signal('');
@@ -119,7 +123,7 @@ export class TaskCreateDialogComponent implements OnInit {
this.serverError.set(
typeof detail === 'string'
? 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>
<form class="edit-form" [formGroup]="form">
<mat-form-field appearance="outline">
<mat-label>Name</mat-label>
<mat-label>{{ 'jobs.name' | translate }}</mat-label>
<input matInput formControlName="name" />
<mat-icon
matSuffix
class="field-info"
matTooltip="Eindeutiger Anzeigename des Jobs, z.B. „News-Themen-Mapping (Testlauf)“."
[matTooltip]="'jobs.nameHelp' | translate"
>info_outline</mat-icon
>
@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 appearance="outline">
<mat-label>Befehl</mat-label>
<mat-label>{{ 'jobs.command' | translate }}</mat-label>
<textarea
matInput
class="command-input"
@@ -27,13 +27,13 @@
<mat-icon
matSuffix
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
>
</mat-form-field>
<mat-form-field appearance="outline">
<mat-label>Image</mat-label>
<mat-label>{{ 'jobs.image' | translate }}</mat-label>
<input
matInput
class="image-input"
@@ -47,39 +47,39 @@
<mat-icon
matSuffix
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
>
@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 appearance="outline">
<mat-label>Beschreibung (optional)</mat-label>
<mat-label>{{ 'jobs.descriptionOptional' | translate }}</mat-label>
<textarea matInput rows="2" formControlName="description"></textarea>
<mat-icon
matSuffix
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
>
</mat-form-field>
<mat-form-field appearance="outline">
<mat-label>Ziel-Index (optional)</mat-label>
<mat-label>{{ 'jobs.targetIndexOptional' | translate }}</mat-label>
<input matInput formControlName="targetIndex" />
<mat-icon
matSuffix
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
>
</mat-form-field>
<mat-form-field appearance="outline">
<mat-label>Umgebungsvariablen (optional)</mat-label>
<mat-label>{{ 'jobs.environmentOptional' | translate }}</mat-label>
<textarea
matInput
rows="3"
@@ -88,12 +88,12 @@
<mat-icon
matSuffix
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
>
<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')) {
<mat-error>Ungültige Zeile — Format: KEY=value.</mat-error>
<mat-error>{{ 'jobs.envInvalid' | translate }}</mat-error>
}
</mat-form-field>
</form>
@@ -104,7 +104,7 @@
</mat-dialog-content>
<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"
@@ -112,6 +112,6 @@
[disabled]="saving()"
(click)="submit()">
<mat-icon>save</mat-icon>
Speichern
{{ 'common.save' | translate }}
</button>
</mat-dialog-actions>
@@ -19,6 +19,8 @@ import { MatIconModule } from '@angular/material/icon';
import { MatInputModule } from '@angular/material/input';
import { MatTooltipModule } from '@angular/material/tooltip';
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_]*=.*$/;
@@ -38,6 +40,7 @@ export interface TaskEditDialogData {
MatIconModule,
MatInputModule,
MatTooltipModule,
TranslatePipe,
],
templateUrl: './task-edit-dialog.component.html',
styleUrl: './task-edit-dialog.component.scss',
@@ -49,6 +52,7 @@ export class TaskEditDialogComponent implements OnInit {
MatDialogRef<TaskEditDialogComponent, BackgroundJobTask | undefined>
>(MatDialogRef);
private readonly backgroundJobsService = inject(BackgroundJobsService);
private readonly languageService = inject(LanguageService);
protected readonly data = inject<TaskEditDialogData>(MAT_DIALOG_DATA);
protected readonly saving = signal(false);
@@ -135,7 +139,7 @@ export class TaskEditDialogComponent implements OnInit {
this.serverError.set(
typeof detail === 'string'
? detail
: 'Der Job konnte nicht gespeichert werden.',
: this.languageService.translate('jobs.saveError'),
);
},
});
@@ -5,30 +5,30 @@
<form class="schedule-form" [formGroup]="form">
<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-option value="manual">Nur manuell</mat-option>
<mat-option value="hourly">Stündlich</mat-option>
<mat-option value="daily">Täglich</mat-option>
<mat-option value="weekly">Wöchentlich</mat-option>
<mat-option value="monthly">Monatlich</mat-option>
<mat-option value="advanced">Erweiterter Cron-Ausdruck</mat-option>
<mat-option value="manual">{{ 'jobs.manualOnly' | translate }}</mat-option>
<mat-option value="hourly">{{ 'jobs.hourly' | translate }}</mat-option>
<mat-option value="daily">{{ 'jobs.daily' | translate }}</mat-option>
<mat-option value="weekly">{{ 'jobs.weekly' | translate }}</mat-option>
<mat-option value="monthly">{{ 'jobs.monthly' | translate }}</mat-option>
<mat-option value="advanced">{{ 'jobs.advancedCron' | translate }}</mat-option>
</mat-select>
</mat-form-field>
@switch (form.controls.mode.value) {
@case ('hourly') {
<mat-form-field appearance="outline">
<mat-label>Minute der Stunde</mat-label>
<mat-label>{{ 'jobs.minute' | translate }}</mat-label>
<input
matInput
type="number"
min="0"
max="59"
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) {
<mat-error>Bitte eine Minute zwischen 0 und 59 eingeben.</mat-error>
<mat-error>{{ 'jobs.minuteError' | translate }}</mat-error>
}
</mat-form-field>
}
@@ -38,9 +38,9 @@
@case ('weekly') {
<div class="schedule-fields">
<mat-form-field appearance="outline">
<mat-label>Wochentag</mat-label>
<mat-label>{{ 'jobs.weekday' | translate }}</mat-label>
<mat-select formControlName="weekday">
@for (weekday of weekdays; track weekday.value) {
@for (weekday of weekdays(); track weekday.value) {
<mat-option [value]="weekday.value">
{{ weekday.label }}
</mat-option>
@@ -53,7 +53,7 @@
@case ('monthly') {
<div class="schedule-fields">
<mat-form-field appearance="outline">
<mat-label>Tag des Monats</mat-label>
<mat-label>{{ 'jobs.monthDay' | translate }}</mat-label>
<input
matInput
type="number"
@@ -61,7 +61,7 @@
max="31"
formControlName="monthDay" />
@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>
<ng-container *ngTemplateOutlet="timeField"></ng-container>
@@ -72,14 +72,14 @@
}
@case ('advanced') {
<mat-form-field appearance="outline">
<mat-label>Cron-Ausdruck (UTC)</mat-label>
<mat-label>{{ 'jobs.cron' | translate }}</mat-label>
<input
matInput
formControlName="cronExpression"
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')) {
<mat-error>Ungültiger Cron-Ausdruck, z. B. „0 3 * * *“.</mat-error>
<mat-error>{{ 'jobs.cronError' | translate }}</mat-error>
}
</mat-form-field>
}
@@ -92,12 +92,12 @@
class="enabled-toggle"
[class.enabled-toggle--on]="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)">
<span class="enabled-toggle__track">
<span class="enabled-toggle__thumb"></span>
</span>
<span class="enabled-toggle__label">Automatische Ausführung aktiv</span>
<span class="enabled-toggle__label">{{ 'jobs.autoExecutionActive' | translate }}</span>
</button>
}
@@ -110,10 +110,10 @@
<ng-template #timeField>
<mat-form-field appearance="outline">
<mat-label>Uhrzeit (UTC)</mat-label>
<mat-label>{{ 'jobs.timeUtc' | translate }}</mat-label>
<input matInput type="time" formControlName="time" />
@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>
</ng-template>
@@ -121,9 +121,9 @@
</mat-dialog-content>
<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()">
<mat-icon>save</mat-icon>
Speichern
{{ 'common.save' | translate }}
</button>
</mat-dialog-actions>
@@ -1,5 +1,5 @@
import { CommonModule } from '@angular/common';
import { Component, inject } from '@angular/core';
import { Component, computed, inject } from '@angular/core';
import {
FormControl,
FormGroup,
@@ -18,6 +18,8 @@ import { MatInputModule } from '@angular/material/input';
import { MatSelectModule } from '@angular/material/select';
import { BackgroundJobTask } from '../../../api';
import { formatUtcDateAsLocal } from '../jobs.utils';
import { LanguageService } from '../../../shared/i18n/language.service';
import { TranslatePipe } from '../../../shared/i18n/translate.pipe';
export interface TaskScheduleDialogData {
task: BackgroundJobTask;
@@ -121,12 +123,14 @@ function toTime(hour: string, minute: string): string {
MatIconModule,
MatInputModule,
MatSelectModule,
TranslatePipe,
],
templateUrl: './task-schedule-dialog.component.html',
styleUrl: './task-schedule-dialog.component.scss',
standalone: true,
})
export class TaskScheduleDialogComponent {
private readonly languageService = inject(LanguageService);
private readonly dialogRef =
inject<
MatDialogRef<
@@ -135,7 +139,19 @@ export class TaskScheduleDialogComponent {
>
>(MatDialogRef);
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;
private readonly initialSchedule = parseSchedule(this.data.task.schedule);
@@ -423,16 +423,16 @@ export class KeywordsSearchComponent {
limit: undefined,
};
this.statusMessage.set('Files uploaded. Extracting keywords...');
this.statusMessage.set('Dateien hochgeladen. Keywords werden extrahiert...');
this.websocketService
.sendRequest(keywordsRequest)
.then(() => {
this.statusMessage.set('Extracting keywords...');
this.statusMessage.set('Keywords werden extrahiert...');
})
.catch((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);
});
}
@@ -3,22 +3,24 @@
type="button"
class="back-link"
(click)="navigateBack()"
aria-label="Zurück zu den Nachrichten">
[attr.aria-label]="'news.back' | translate">
<mat-icon>arrow_back</mat-icon>
Alle Nachrichten
{{ 'news.all' | translate }}
</button>
@if (loading) {
<div class="state">
<mat-spinner diameter="42"></mat-spinner>
<p>Nachricht wird geladen...</p>
<p>{{ 'news.loading' | translate }}</p>
</div>
} @else if (notFound || !article) {
<div class="state error-state">
<mat-icon>search_off</mat-icon>
<h2>Nachricht nicht gefunden</h2>
<p>Der Artikel konnte nicht geladen werden.</p>
<a mat-stroked-button routerLink="/persons">Zur Personensuche</a>
<h2>{{ 'news.notFound' | translate }}</h2>
<p>{{ 'news.articleLoadError' | translate }}</p>
<a mat-stroked-button routerLink="/persons">
{{ 'news.peopleSearch' | translate }}
</a>
</div>
} @else {
<div class="detail-layout">
@@ -32,22 +34,24 @@
<span>{{ formatDate(article.date) }}</span>
}
</div>
<p class="article-heading">{{ article.maintitle || 'Kein Titel' }}</p>
<p class="article-heading">
{{ article.maintitle || ('news.noTitle' | translate) }}
</p>
@if (article.relevant === true) {
<span class="relevance-badge is-relevant">
<mat-icon>check_circle</mat-icon>
Relevant
{{ 'news.relevant' | translate }}
</span>
} @else if (article.relevant === false) {
<span class="relevance-badge not-relevant">
<mat-icon>cancel</mat-icon>
Nicht relevant
{{ 'news.notRelevant' | translate }}
</span>
} @else {
<span class="relevance-badge undetermined">
<mat-icon>help</mat-icon>
Relevanz nicht bestimmt
{{ 'news.relevanceUndetermined' | translate }}
</span>
}
</header>
@@ -59,7 +63,7 @@
class="content"
[innerHTML]="highlightedContent"></p>
} @else {
<p class="placeholder">Kein Inhalt verfügbar.</p>
<p class="placeholder">{{ 'news.noContent' | translate }}</p>
}
</div>
@@ -71,7 +75,7 @@
target="_blank"
rel="noopener">
<mat-icon>open_in_new</mat-icon>
Originalartikel öffnen
{{ 'news.openOriginal' | translate }}
</a>
</div>
}
@@ -86,10 +90,12 @@
(click)="openPanel = openPanel === 'persons' ? null : 'persons'"
[attr.aria-expanded]="openPanel === 'persons'">
<mat-icon>group</mat-icon>
<span class="accordion-title">Erwähnte Personen</span>
<span class="accordion-title">
{{ 'news.mentionedPeople' | translate }}
</span>
<mat-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"
(click)="$event.stopPropagation()"
>info_outline</mat-icon
@@ -154,7 +160,9 @@
</div>
}
} @else {
<p class="placeholder">Keine erwähnten Personen gefunden.</p>
<p class="placeholder">
{{ 'news.noMentionedPeople' | translate }}
</p>
}
</div>
}
@@ -169,10 +177,12 @@
(click)="openPanel = openPanel === 'topics' ? null : 'topics'"
[attr.aria-expanded]="openPanel === 'topics'">
<mat-icon>label</mat-icon>
<span class="accordion-title">Themen & Schlüsselwörter</span>
<span class="accordion-title">
{{ 'news.topicsAndKeywords' | translate }}
</span>
<mat-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"
(click)="$event.stopPropagation()"
>info_outline</mat-icon
@@ -213,12 +223,12 @@
<div class="topic-item-body">
@if (topic.source_keyword) {
<p class="kw-suggestion-label">
Vorgeschlagen durch das Schlüsselwort im Text:
{{ 'news.suggestedByKeyword' | translate }}
</p>
<button
mat-icon-button
class="analyse-btn"
matTooltip="Suche nach dem Schlüsselwort"
[matTooltip]="'news.searchKeyword' | translate"
(click)="analyseKeyword(topic.source_keyword)">
<mat-icon>search</mat-icon>
</button>
@@ -229,12 +239,11 @@
»{{ topic.source_keyword }}«
</button>
<p class="kw-hint">
Im Artikel hervorgehoben · klicken zum Suche zu
öffnen
{{ 'news.keywordHint' | translate }}
</p>
} @else {
<p class="placeholder">
Kein Schlüsselwort verknüpft.
{{ 'news.noLinkedKeyword' | translate }}
</p>
}
</div>
@@ -244,7 +253,7 @@
</div>
} @else {
<p class="placeholder">
Keine Themen oder Schlüsselwörter gefunden.
{{ 'news.noTopicsOrKeywords' | translate }}
</p>
}
</div>
@@ -18,6 +18,8 @@ import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
import { WorksService } from '../../api';
import { topicHierarchyColor } from '../../resolvers/utils/topic-colors';
import { LanguageService } from '../../shared/i18n/language.service';
import { TranslatePipe } from '../../shared/i18n/translate.pipe';
interface MentionedPerson {
name: string;
@@ -55,6 +57,7 @@ interface NewsArticleDetail {
MatProgressSpinnerModule,
MatTooltipModule,
RouterLink,
TranslatePipe,
],
templateUrl: './news-detail.component.html',
styleUrl: './news-detail.component.scss',
@@ -68,6 +71,7 @@ export class NewsDetailComponent implements OnInit {
private readonly worksService = inject(WorksService);
private readonly location = inject(Location);
private readonly sanitizer = inject(DomSanitizer);
private readonly languageService = inject(LanguageService);
article: NewsArticleDetail | null = null;
highlightedContent: SafeHtml = this.sanitizer.bypassSecurityTrustHtml('');
@@ -157,11 +161,14 @@ export class NewsDetailComponent implements OnInit {
if (!dateStr) return '-';
const date = new Date(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',
month: 'long',
year: 'numeric',
}).format(date);
},
).format(date);
}
private fetchArticle(id: string): void {
+14 -12
View File
@@ -1,7 +1,7 @@
<div class="page">
<div class="page-header">
<h1>Nachrichten</h1>
<p>Aktuelle Nachrichten aus Campus-Aktuell.</p>
<h1>{{ 'news.title' | translate }}</h1>
<p>{{ 'news.description' | translate }}</p>
</div>
<ng-template #snippetTpl let-article>
@@ -21,16 +21,18 @@
<mat-form-field appearance="outline" class="relevance-field">
<mat-select
[formControl]="relevanceFilter"
placeholder="Relevanz"
[placeholder]="'news.relevance' | translate"
multiple>
<mat-option value="relevant">Relevant</mat-option>
<mat-option value="not_relevant">Nicht relevant</mat-option>
<mat-option value="relevant">{{ 'news.relevant' | translate }}</mat-option>
<mat-option value="not_relevant">
{{ 'news.notRelevant' | translate }}
</mat-option>
</mat-select>
</mat-form-field>
<div class="year-field">
<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">
{{ yearFrom.value }} – {{ yearTo.value }}
</span>
@@ -46,9 +48,9 @@
mat-stroked-button
type="button"
(click)="resetFilters()"
aria-label="Filter zurücksetzen">
[attr.aria-label]="'news.resetFilters' | translate">
<mat-icon>filter_alt_off</mat-icon>
<span>Zurücksetzen</span>
<span>{{ 'news.reset' | translate }}</span>
</button>
</div>
</ng-template>
@@ -56,9 +58,9 @@
<ng-template #noResultsTmp>
<div class="no-results">
@if (isSearching()) {
<span>Keine Ergebnisse für „{{ searchQuery().trim() }}" gefunden.</span>
<span>{{ noSearchResultsLabel() }}</span>
} @else {
<span>Keine Nachrichten gefunden.</span>
<span>{{ 'news.noResults' | translate }}</span>
}
</div>
</ng-template>
@@ -71,6 +73,6 @@
[noResultsTmp]="noResultsTmp"
[cardMinWidth]="380"
[sortingDirectionOptions]="sortingDirectionOptions()"
sortingDirectionLabel="Sortierung"
searchLabel="Nachrichten durchsuchen" />
[sortingDirectionLabel]="'news.sorting' | translate"
[searchLabel]="'news.search' | translate" />
</div>
+23 -5
View File
@@ -28,6 +28,8 @@ import {
NEWS_MIN_YEAR,
} from '../../shared/ui/news-card/news-card.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 {
author?: string | null;
@@ -54,6 +56,7 @@ type SortOrder = 'desc' | 'asc';
MatIconModule,
CardSearchComponent,
NewsCardComponent,
TranslatePipe,
],
templateUrl: './news.component.html',
styleUrl: './news.component.scss',
@@ -64,14 +67,23 @@ export class NewsComponent implements OnInit {
private readonly router = inject(Router);
private readonly httpClient = inject(HttpClient);
private readonly worksService = inject(WorksService);
private readonly languageService = inject(LanguageService);
readonly minYear = NEWS_MIN_YEAR;
readonly maxYear = new Date().getFullYear();
private readonly sortingDirectionOptionsAll: SelectorOption[] = [
{ value: 'desc', display_name: 'Neueste zuerst' },
{ value: 'asc', display_name: 'Älteste zuerst' },
];
private readonly sortingDirectionOptionsAll = computed<SelectorOption[]>(
() => [
{
value: 'desc',
display_name: this.languageService.translate('news.newestFirst'),
},
{
value: 'asc',
display_name: this.languageService.translate('news.oldestFirst'),
},
],
);
readonly relevanceFilter = new FormControl<string[]>([], {
nonNullable: true,
@@ -90,7 +102,13 @@ export class NewsComponent implements OnInit {
readonly isSearching = computed(() => this.searchQuery().trim().length > 0);
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>(() => ({
@@ -1,38 +1,42 @@
<h2 mat-dialog-title>
{{
data.mode === 'create'
? 'Organisation erstellen'
: 'Organisation bearbeiten'
? ('organizations.create' | translate)
: ('organizations.edit' | translate)
}}
</h2>
<mat-dialog-content>
<form class="organization-form" [formGroup]="form" (ngSubmit)="submit()">
<mat-form-field appearance="outline">
<mat-label>Name</mat-label>
<mat-label>{{ 'organizations.name' | translate }}</mat-label>
<input matInput formControlName="name" />
@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 appearance="outline">
<mat-label>Externe Institutions-ID</mat-label>
<mat-label>
{{ 'organizations.externalInstitutionId' | translate }}
</mat-label>
<input matInput formControlName="otherInstId" />
</mat-form-field>
@if (data.mode === 'edit') {
<mat-checkbox formControlName="deleted">
Organisation als gelöscht markieren
{{ 'organizations.markDeleted' | translate }}
</mat-checkbox>
}
</form>
</mat-dialog-content>
<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()">
<mat-icon>save</mat-icon>
Speichern
{{ 'common.save' | translate }}
</button>
</mat-dialog-actions>
@@ -17,6 +17,7 @@ import { MatFormFieldModule } from '@angular/material/form-field';
import { MatIconModule } from '@angular/material/icon';
import { MatInputModule } from '@angular/material/input';
import { InseOrganizationManagementModelOrganizationProfile } from '../../../api';
import { TranslatePipe } from '../../../shared/i18n/translate.pipe';
export interface CreateOrganizationPayload {
name: string;
@@ -53,6 +54,7 @@ export type OrganizationDialogResult =
MatFormFieldModule,
MatIconModule,
MatInputModule,
TranslatePipe,
],
templateUrl: './organization-dialog.component.html',
styleUrl: './organization-dialog.component.scss',
@@ -1,8 +1,8 @@
<section class="organizations-page">
<header class="page-header">
<div>
<h1>Organisationen</h1>
<p>Mandanten, externe Institutions-IDs und Status verwalten.</p>
<h1>{{ 'organizations.title' | translate }}</h1>
<p>{{ 'organizations.description' | translate }}</p>
<!-- Was meinte die KI mit Mandanten? -->
</div>
<button
@@ -11,7 +11,7 @@
type="button"
(click)="startCreate()">
<mat-icon>add_business</mat-icon>
Neue Organisation
{{ 'organizations.new' | translate }}
</button>
</header>
@@ -36,14 +36,14 @@
<button
mat-icon-button
type="button"
aria-label="Bearbeiten"
[attr.aria-label]="'common.edit' | translate"
(click)="startEdit(row)">
<mat-icon>edit</mat-icon>
</button>
<button
mat-icon-button
type="button"
aria-label="Deaktivieren"
[attr.aria-label]="'common.deactivate' | translate"
[disabled]="row.deleted"
(click)="deleteOrganization(row)">
<mat-icon>delete</mat-icon>
@@ -1,7 +1,9 @@
import { CommonModule } from '@angular/common';
import {
Component,
effect,
inject,
Injector,
input,
OnInit,
TemplateRef,
@@ -29,6 +31,8 @@ import { MatCardModule } from '@angular/material/card';
import { StatusPipe } from '../../shared/pipes/status.pipe';
import { QueryParamPaginatorComponent } from '../../shared/ui/query-param-paginator/query-param-paginator.component';
import { Router } from '@angular/router';
import { LanguageService } from '../../shared/i18n/language.service';
import { TranslatePipe } from '../../shared/i18n/translate.pipe';
@Component({
selector: 'app-organizations',
@@ -42,6 +46,7 @@ import { Router } from '@angular/router';
MatCardModule,
StatusPipe,
QueryParamPaginatorComponent,
TranslatePipe,
],
templateUrl: './organizations.component.html',
styleUrl: './organizations.component.scss',
@@ -52,6 +57,8 @@ export class OrganizationsComponent implements OnInit {
private readonly dialog = inject(MatDialog);
private readonly snackBar = inject(MatSnackBar);
private readonly organizationService = inject(OrganizationService);
private readonly languageService = inject(LanguageService);
private readonly injector = inject(Injector);
organizationPage = input.required<OrganizationPage>();
organizationColumns: GenericColumn<InseOrganizationManagementModelOrganizationProfile>[] =
@@ -65,35 +72,45 @@ export class OrganizationsComponent implements OnInit {
);
ngOnInit(): void {
effect(
() => {
this.languageService.language();
this.setOrganizationColumns();
},
{ injector: this.injector },
);
}
private setOrganizationColumns(): void {
this.organizationColumns = [
{
id: 'name',
header: 'Name',
header: this.languageService.translate('organizations.name'),
type: 'accessor',
accessorKey: 'name',
},
{
id: 'other_inst_id',
header: 'Externe ID',
header: this.languageService.translate('organizations.externalId'),
type: 'accessor',
accessorKey: 'other_inst_id',
},
{
id: 'member_count',
header: 'Mitglieder',
header: this.languageService.translate('organizations.members'),
type: 'accessor',
accessorKey: 'member_count',
},
{
id: 'deleted',
header: 'Status',
header: this.languageService.translate('common.status'),
type: 'accessor',
accessorKey: 'deleted',
cellTemplate: this.organizationStatusTmp(),
},
{
id: 'actions',
header: 'Aktionen',
header: this.languageService.translate('common.actions'),
type: 'display',
cellTemplate: this.organizationActionsTmp(),
},
@@ -119,10 +136,15 @@ export class OrganizationsComponent implements OnInit {
({ ConfirmationDialogComponent }) => {
const dialogRef = this.dialog.open(ConfirmationDialogComponent, {
data: {
title: 'Organisation deaktivieren',
message: `Möchtest Du die Organisation „${organization.name}“ wirklich deaktivieren?`,
confirmText: 'Deaktivieren',
cancelText: 'Abbrechen',
title: this.languageService.translate(
'organizations.deactivateTitle',
),
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 {
this.organizationService.deleteOrganisation(organization.id).subscribe({
next: () => {
this.snackBar.open('Organisation wurde deaktiviert.', 'OK', {
this.snackBar.open(
this.languageService.translate('organizations.deactivated'),
this.languageService.translate('common.ok'),
{
duration: 3000,
});
},
);
this.router.navigate([], {
queryParams: { page: 0 },
queryParamsHandling: 'merge',
});
},
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({
next: () => {
this.snackBar.open('Organisation wurde gespeichert.', 'OK', {
this.snackBar.open(
this.languageService.translate('organizations.saved'),
this.languageService.translate('common.ok'),
{
duration: 3000,
});
},
);
this.router.navigate([], {
queryParams: { page: 0 },
queryParamsHandling: 'merge',
@@ -193,13 +225,17 @@ export class OrganizationsComponent implements OnInit {
error: (error) =>
this.showError(
error.status === 409
? 'Eine Organisation mit diesem Namen existiert bereits.'
: 'Organisation konnte nicht gespeichert werden.',
? this.languageService.translate('organizations.nameConflict')
: this.languageService.translate('organizations.saveError'),
),
});
}
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"
class="back-link"
(click)="navigateBack()"
aria-label="Zurück zu den Patenten">
[attr.aria-label]="'patents.back' | translate">
<mat-icon>arrow_back</mat-icon>
Alle Patente
{{ 'patents.all' | translate }}
</button>
@if (loading) {
<div class="state">
<mat-spinner diameter="42"></mat-spinner>
<p>Patent wird geladen...</p>
<p>{{ 'patents.loadingOne' | translate }}</p>
</div>
} @else if (notFound || !patent) {
<div class="state error-state">
<mat-icon>search_off</mat-icon>
<h2>Patent nicht gefunden</h2>
<p>Das Patent konnte nicht geladen werden.</p>
<a mat-stroked-button routerLink="/patents"> Zur Patentübersicht </a>
<h2>{{ 'patents.notFound' | translate }}</h2>
<p>{{ 'patents.notFoundDescription' | translate }}</p>
<a mat-stroked-button routerLink="/patents">
{{ 'patents.overviewLink' | translate }}
</a>
</div>
} @else {
<header class="hero">
@@ -37,7 +39,9 @@
<span>{{ stage }}</span>
}
</div>
<h1>{{ patent.title || patent.patent_id || 'Ohne Titel' }}</h1>
<h1>
{{ patent.title || patent.patent_id || ('patents.noTitle' | translate) }}
</h1>
<p class="meta-line">
<span>{{ patent.patent_id }}</span>
@if (patent.publication_date) {
@@ -60,23 +64,23 @@
</div>
</div>
<div class="metrics" aria-label="Patentkennzahlen">
<div class="metrics" [attr.aria-label]="'patents.metrics' | translate">
<div>
<mat-icon>groups</mat-icon>
<strong>{{ patent.inventors?.length ?? 0 }}</strong>
<span>Erfinder</span>
<span>{{ 'patents.inventors' | translate }}</span>
</div>
<div>
<mat-icon>business</mat-icon>
<strong>{{ patent.assignees?.length ?? 0 }}</strong>
<span>Anmelder</span>
<span>{{ 'patents.assignees' | translate }}</span>
</div>
<div>
<mat-icon>category</mat-icon>
<strong>{{
(patent.ipc?.length ?? 0) + (patent.cpc?.length ?? 0)
}}</strong>
<span>Klassifikationen</span>
<span>{{ 'patents.classifications' | translate }}</span>
</div>
</div>
</header>
@@ -87,7 +91,7 @@
<section class="card abstract-card">
<div class="section-title">
<mat-icon>subject</mat-icon>
<h2>Abstract</h2>
<h2>{{ 'patents.abstract' | translate }}</h2>
</div>
<p>{{ patent.abstract }}</p>
</section>
@@ -96,14 +100,14 @@
<section class="card">
<div class="section-title">
<mat-icon>engineering</mat-icon>
<h2>Erfinder</h2>
<h2>{{ 'patents.inventors' | translate }}</h2>
<span>{{ patent.inventors?.length ?? 0 }}</span>
</div>
<div class="tags">
@for (inventor of patent.inventors; track inventor) {
<span>{{ inventor }}</span>
} @empty {
<p class="empty">Keine Angaben vorhanden.</p>
<p class="empty">{{ 'patents.noInformation' | translate }}</p>
}
</div>
</section>
@@ -112,7 +116,7 @@
<section class="card">
<div class="section-title">
<mat-icon>account_balance</mat-icon>
<h2>Anmelder</h2>
<h2>{{ 'patents.assignees' | translate }}</h2>
<span>{{ patent.assignees?.length ?? 0 }}</span>
</div>
<div class="compact-list">
@@ -129,7 +133,7 @@
<section class="card">
<div class="section-title">
<mat-icon>topic</mat-icon>
<h2>OpenAlex Themen</h2>
<h2>{{ 'patents.openAlexTopics' | translate }}</h2>
</div>
<div class="tags">
@for (
@@ -153,7 +157,7 @@
class="card classification-card-section classification-card-section--ipc">
<div class="section-title">
<mat-icon>label</mat-icon>
<h2>Klassifikation (IPC)</h2>
<h2>{{ 'patents.ipcClassification' | translate }}</h2>
</div>
<div class="classification-cards">
@for (
@@ -203,8 +207,8 @@
(click)="toggleClassificationExpanded(card.key)">
{{
isClassificationExpanded(card.key)
? 'Weniger anzeigen'
: 'Mehr anzeigen'
? ('patents.showLess' | translate)
: ('patents.showMore' | translate)
}}
</button>
}
@@ -227,7 +231,7 @@
<section class="card">
<div class="section-title">
<mat-icon>label</mat-icon>
<h2>Klassifikation (IPC)</h2>
<h2>{{ 'patents.ipcClassification' | translate }}</h2>
</div>
<div class="tags">
@for (ipc of patent.ipc; track ipc) {
@@ -242,7 +246,7 @@
class="card classification-card-section classification-card-section--cpc">
<div class="section-title">
<mat-icon>label</mat-icon>
<h2>Klassifikation (CPC)</h2>
<h2>{{ 'patents.cpcClassification' | translate }}</h2>
</div>
<div class="classification-cards">
@for (
@@ -292,8 +296,8 @@
(click)="toggleClassificationExpanded(card.key)">
{{
isClassificationExpanded(card.key)
? 'Weniger anzeigen'
: 'Mehr anzeigen'
? ('patents.showLess' | translate)
: ('patents.showMore' | translate)
}}
</button>
}
@@ -316,7 +320,7 @@
<section class="card">
<div class="section-title">
<mat-icon>label</mat-icon>
<h2>Klassifikation (CPC)</h2>
<h2>{{ 'patents.cpcClassification' | translate }}</h2>
</div>
<div class="tags">
@for (cpc of patent.cpc; track cpc) {
@@ -331,7 +335,7 @@
<section class="card facts-card">
<div class="section-title">
<mat-icon>info</mat-icon>
<h2>Patentdaten</h2>
<h2>{{ 'patents.data' | translate }}</h2>
</div>
<dl>
@for (row of metadataRows(); track row.label) {
@@ -358,7 +362,7 @@
<section class="card">
<div class="section-title">
<mat-icon>link</mat-icon>
<h2>Externe Links</h2>
<h2>{{ 'patents.externalLinks' | translate }}</h2>
</div>
<div class="link-list">
@for (link of externalLinks(); track link.url) {
@@ -26,6 +26,8 @@ import {
isLongDescription,
patentExternalLinks,
} from './patent-detail.utils';
import { LanguageService } from '../../shared/i18n/language.service';
import { TranslatePipe } from '../../shared/i18n/translate.pipe';
@Component({
selector: 'app-patent-detail',
@@ -35,6 +37,7 @@ import {
MatProgressSpinnerModule,
RouterLink,
TopicChipComponent,
TranslatePipe,
],
templateUrl: './patent-detail.component.html',
styleUrl: './patent-detail.component.scss',
@@ -44,6 +47,7 @@ export class PatentDetailComponent implements OnInit {
private readonly route = inject(ActivatedRoute);
private readonly patentsService = inject(PatentsService);
private readonly location = inject(Location);
private readonly languageService = inject(LanguageService);
patent: PatentEntry | null = null;
loading = true;
@@ -76,11 +80,20 @@ export class PatentDetailComponent implements OnInit {
}
formatDate(date: string | null | undefined): string {
return formatPatentDate(date);
return formatPatentDate(
date,
this.languageService.language() === 'de' ? 'de-DE' : 'en-US',
);
}
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 {
@@ -95,7 +108,9 @@ export class PatentDetailComponent implements OnInit {
entries: PatentEntry['ipc_descriptions'],
system: ClassificationSystem,
): ClassificationCard[] {
return getClassificationCards(entries, system);
return getClassificationCards(entries, system, (key) =>
this.languageService.translate(key),
);
}
topicColor(topic: OpenAlexTopicTag): string {
@@ -1,5 +1,8 @@
import { PatentEntry } from '../../api/model/patentEntry';
import { IpcClassification } from '../../api/model/ipcClassification';
import { TranslationKey } from '../../shared/i18n/translations';
type PatentTranslator = (key: TranslationKey) => string;
export type ClassificationSystem = 'IPC' | 'CPC';
@@ -21,12 +24,15 @@ export interface PatentMetadataRow {
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 '-';
const normalized = date.replace(/(\d{4})(\d{2})(\d{2})/, '$1-$2-$3');
const parsed = new Date(normalized);
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 {
@@ -42,40 +48,59 @@ export function getPublicationStageLabel(patent: PatentEntry): string | null {
export function getPatentMetadataRows(
patent: PatentEntry,
translate?: PatentTranslator,
locale = 'de-DE',
): PatentMetadataRow[] {
const label = (key: TranslationKey, fallback: string) =>
translate?.(key) ?? fallback;
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) {
rows.push({
label: 'Veröffentlichungsdatum',
value: formatPatentDate(patent.publication_date),
label: label('patents.publicationDate', 'Veröffentlichungsdatum'),
value: formatPatentDate(patent.publication_date, locale),
});
}
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) {
rows.push({
label: 'Anmeldedatum',
value: formatPatentDate(patent.application_date),
label: label('patents.applicationDate', 'Anmeldedatum'),
value: formatPatentDate(patent.application_date, locale),
});
}
const stageLabel = getPublicationStageLabel(patent);
if (stageLabel) {
rows.push({
label: patent.kind ? 'Publikationsstufe' : 'Anmeldungstyp',
label: patent.kind
? label('patents.publicationStage', 'Publikationsstufe')
: label('patents.applicationType', 'Anmeldungstyp'),
value: patent.kind ? stageLabel : formatMetadataLabel(stageLabel),
});
}
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) {
rows.push({ label: 'Status', value: formatMetadataLabel(patent.status) });
rows.push({
label: label('patents.status', 'Status'),
value: formatMetadataLabel(patent.status),
});
}
return rows;
@@ -84,13 +109,14 @@ export function getPatentMetadataRows(
export function getClassificationCards(
entries: IpcClassification[] | undefined,
system: ClassificationSystem,
translate?: PatentTranslator,
): ClassificationCard[] {
if (!entries?.length) return [];
const merged = new Map<string, ClassificationCard>();
for (const entry of entries) {
const card = buildClassificationCard(entry, system);
const card = buildClassificationCard(entry, system, translate);
const mergeKey =
card.primaryDescription?.toLocaleLowerCase('en') ??
card.symbols[0] ??
@@ -147,8 +173,9 @@ export function patentExternalLinks(
function buildClassificationCard(
entry: IpcClassification,
system: ClassificationSystem,
translate?: PatentTranslator,
): ClassificationCard {
const level = getClassificationLevel(entry);
const level = getClassificationLevel(entry, translate);
const primaryDescription = extractDescriptionText(entry[level.field]);
return {
@@ -157,25 +184,33 @@ function buildClassificationCard(
system,
levelLabel: level.label,
primaryDescription,
hierarchy: buildHierarchyRows(entry, primaryDescription),
hierarchy: buildHierarchyRows(entry, primaryDescription, translate),
sectionName: entry.section ?? null,
};
}
function getClassificationLevel(entry: IpcClassification): {
function getClassificationLevel(
entry: IpcClassification,
translate?: PatentTranslator,
): {
label: string;
field: keyof IpcClassification;
} {
if (entry.subgroup) return { label: 'Untergruppe', field: 'subgroup' };
if (entry.main_group) return { label: 'Hauptgruppe', field: 'main_group' };
if (entry.subclass) return { label: 'Unterklasse', field: 'subclass' };
if (entry.section) return { label: 'Sektion', field: 'section' };
return { label: 'Code', field: 'symbol' };
if (entry.subgroup)
return { label: translate?.('patents.subgroup') ?? 'Untergruppe', field: 'subgroup' };
if (entry.main_group)
return { label: translate?.('patents.mainGroup') ?? 'Hauptgruppe', field: 'main_group' };
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(
entry: IpcClassification,
primaryDescription: string | null,
translate?: PatentTranslator,
): { label: string; value: string }[] {
const rows: { label: string; value: string }[] = [];
const seen = new Set<string>();
@@ -194,9 +229,12 @@ function buildHierarchyRows(
rows.push({ label, value });
};
addRow('Sektion', entry.section ?? null);
addRow('Klasse', entry.class ?? null);
addRow('Unterklasse', entry.subclass ?? null);
addRow(translate?.('patents.section') ?? 'Sektion', entry.section ?? null);
addRow(translate?.('patents.class') ?? 'Klasse', entry.class ?? null);
addRow(
translate?.('patents.subclass') ?? 'Unterklasse',
entry.subclass ?? null,
);
return rows;
}
@@ -1,11 +1,11 @@
<div class="content">
<h1>Patente</h1>
<h1>{{ 'patents.title' | translate }}</h1>
<mat-divider />
<div class="search-and-filter">
<mat-form-field style="width: 100%">
<mat-label>Suche nach Titel oder Patent-Nr.</mat-label>
<mat-label>{{ 'patents.search' | translate }}</mat-label>
<input
matInput
type="search"
@@ -28,10 +28,11 @@
<div class="year-filter">
<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">
{{ selectedStartYear }} bis {{ selectedEndYear }}
{{ selectedStartYear }} {{ 'range.to' | translate }}
{{ selectedEndYear }}
</span>
<button
@@ -39,7 +40,7 @@
class="reset-range-button"
[disabled]="!canResetYearRange"
(click)="resetYearRange()">
Zurücksetzen
{{ 'range.reset' | translate }}
</button>
</div>
@@ -57,7 +58,7 @@
[style.z-index]="selectedStartYear >= selectedEndYear - 5 ? 4 : 2"
(input)="onStartYearDrag($event)"
(change)="onStartYearInput($event)"
aria-label="Startjahr" />
[attr.aria-label]="'range.startYear' | translate" />
<input
class="range-input range-input-end"
type="range"
@@ -66,7 +67,7 @@
[value]="selectedEndYear"
(input)="onEndYearDrag($event)"
(change)="onEndYearInput($event)"
aria-label="Endjahr" />
[attr.aria-label]="'range.endYear' | translate" />
</div>
<div class="year-filter-bounds">
@@ -81,16 +82,16 @@
@if (loading) {
<app-loading
text="Patentdaten werden geladen..."
[text]="'patents.loading' | translate"
icon="workspace_premium"
[size]="150"
[diameter]="150" />
} @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) {
<div class="detail-view">
<button type="button" class="back-btn" (click)="closeDetail()">
← Zurück zu den Patenten
← {{ 'patents.back' | translate }}
</button>
<h2>{{ selectedPatent.title ?? selectedPatent.patent_id }}</h2>
@@ -117,13 +118,13 @@
@if (selectedPatent.abstract) {
<div class="detail-section">
<h4>Abstract</h4>
<h4>{{ 'patents.abstract' | translate }}</h4>
<p>{{ selectedPatent.abstract }}</p>
</div>
}
<div class="detail-section">
<h4>Erfinder</h4>
<h4>{{ 'patents.inventors' | translate }}</h4>
<ul class="tag-list">
@for (inv of selectedPatent.inventors; track inv) {
<li class="tag">{{ inv }}</li>
@@ -133,7 +134,7 @@
@if ((selectedPatent.assignees?.length ?? 0) > 0) {
<div class="detail-section">
<h4>Anmelder</h4>
<h4>{{ 'patents.assignees' | translate }}</h4>
<ul class="tag-list">
@for (a of selectedPatent.assignees; track a) {
<li class="tag">{{ a }}</li>
@@ -144,7 +145,7 @@
@if ((selectedPatent.openalex_topics?.length ?? 0) > 0) {
<div class="detail-section">
<h4>OpenAlex Themen</h4>
<h4>{{ 'patents.openAlexTopics' | translate }}</h4>
<div class="tag-list">
@for (
topic of selectedPatent.openalex_topics;
@@ -165,7 +166,7 @@
@if ((selectedPatent.ipc_descriptions?.length ?? 0) > 0) {
<div
class="detail-section classification-section classification-section--ipc">
<h4>Klassifikation (IPC)</h4>
<h4>{{ 'patents.ipcClassification' | translate }}</h4>
<div class="classification-cards">
@for (
card of getClassificationCards(
@@ -217,8 +218,8 @@
(click)="toggleClassificationExpanded(card.key)">
{{
isClassificationExpanded(card.key)
? 'Weniger anzeigen'
: 'Mehr anzeigen'
? ('patents.showLess' | translate)
: ('patents.showMore' | translate)
}}
</button>
}
@@ -239,7 +240,7 @@
</div>
} @else if ((selectedPatent.ipc?.length ?? 0) > 0) {
<div class="detail-section">
<h4>Klassifikation (IPC)</h4>
<h4>{{ 'patents.ipcClassification' | translate }}</h4>
<ul class="tag-list tag-list--compact">
@for (ipc of selectedPatent.ipc; track ipc) {
<li class="tag">{{ ipc }}</li>
@@ -251,7 +252,7 @@
@if ((selectedPatent.cpc_descriptions?.length ?? 0) > 0) {
<div
class="detail-section classification-section classification-section--cpc">
<h4>Klassifikation (CPC)</h4>
<h4>{{ 'patents.cpcClassification' | translate }}</h4>
<div class="classification-cards">
@for (
card of getClassificationCards(
@@ -303,8 +304,8 @@
(click)="toggleClassificationExpanded(card.key)">
{{
isClassificationExpanded(card.key)
? 'Weniger anzeigen'
: 'Mehr anzeigen'
? ('patents.showLess' | translate)
: ('patents.showMore' | translate)
}}
</button>
}
@@ -325,7 +326,7 @@
</div>
} @else if ((selectedPatent.cpc?.length ?? 0) > 0) {
<div class="detail-section">
<h4>Klassifikation (CPC)</h4>
<h4>{{ 'patents.cpcClassification' | translate }}</h4>
<ul class="tag-list tag-list--compact">
@for (cpc of selectedPatent.cpc; track cpc) {
<li class="tag">{{ cpc }}</li>
@@ -336,7 +337,7 @@
</div>
} @else if (patents.length === 0) {
<div class="no-results">
<p>Keine Patente gefunden.</p>
<p>{{ 'patents.noResults' | translate }}</p>
</div>
} @else {
<div class="cards">
@@ -375,7 +376,7 @@
mat-button
(click)="selectPatent(patent); $event.stopPropagation()">
<mat-icon>info</mat-icon>
Übersicht
{{ 'patents.overview' | translate }}
</button>
</mat-card-actions>
</mat-card-footer>
@@ -21,6 +21,8 @@ import {
classificationSectionColor,
topicHierarchyColor,
} from '../../resolvers/utils/topic-colors';
import { LanguageService } from '../../shared/i18n/language.service';
import { TranslatePipe } from '../../shared/i18n/translate.pipe';
type PatentSource = 'EPO' | 'USPTO';
@@ -54,6 +56,7 @@ const MIN_YEAR = 1978;
MatDividerModule,
TopicChipComponent,
LoadingComponent,
TranslatePipe,
],
templateUrl: './patents.component.html',
styleUrl: './patents.component.scss',
@@ -62,6 +65,7 @@ export class PatentsComponent implements OnInit {
private router = inject(Router);
private route = inject(ActivatedRoute);
private patentsApi = inject(PatentsService);
private languageService = inject(LanguageService);
patents: PatentEntry[] = [];
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 parsed = new Date(d);
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 {
@@ -310,34 +316,48 @@ export class PatentsComponent implements OnInit {
getPatentMetadataRows(patent: PatentEntry) {
const rows: { label: string; value: string; variant?: 'source' }[] = [];
rows.push({ label: 'Quelle', value: patent.source, variant: 'source' });
rows.push({ label: 'Patent-Nr.', value: patent.patent_id });
rows.push({
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)
rows.push({
label: 'Veröffentlichungsdatum',
label: this.languageService.translate('patents.publicationDate'),
value: this.formatDate(patent.publication_date),
});
if (patent.application_number)
rows.push({
label: 'Anmeldungsnummer',
label: this.languageService.translate('patents.applicationNumber'),
value: patent.application_number,
});
if (patent.application_date)
rows.push({
label: 'Anmeldedatum',
label: this.languageService.translate('patents.applicationDate'),
value: this.formatDate(patent.application_date),
});
const stage = this.getPublicationStageLabel(patent);
if (stage)
rows.push({
label: patent.kind ? 'Publikationsstufe' : 'Anmeldungstyp',
label: this.languageService.translate(
patent.kind
? 'patents.publicationStage'
: 'patents.applicationType',
),
value: this.formatMetadataLabel(stage),
});
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)
rows.push({
label: 'Status',
label: this.languageService.translate('patents.status'),
value: this.formatMetadataLabel(patent.status),
});
return rows;
@@ -429,11 +449,30 @@ export class PatentsComponent implements OnInit {
label: string;
field: keyof IpcClassification;
} {
if (entry.subgroup) return { label: 'Untergruppe', field: 'subgroup' };
if (entry.main_group) return { label: 'Hauptgruppe', field: 'main_group' };
if (entry.subclass) return { label: 'Unterklasse', field: 'subclass' };
if (entry.section) return { label: 'Sektion', field: 'section' };
return { label: 'Code', field: 'symbol' };
if (entry.subgroup)
return {
label: this.languageService.translate('patents.subgroup'),
field: 'subgroup',
};
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(
@@ -454,9 +493,18 @@ export class PatentsComponent implements OnInit {
seen.add(norm);
rows.push({ label, value });
};
addRow('Sektion', entry.section ?? null);
addRow('Klasse', entry.class ?? null);
addRow('Unterklasse', entry.subclass ?? null);
addRow(
this.languageService.translate('patents.section'),
entry.section ?? null,
);
addRow(
this.languageService.translate('patents.class'),
entry.class ?? null,
);
addRow(
this.languageService.translate('patents.subclass'),
entry.subclass ?? null,
);
return rows;
}
@@ -20,10 +20,14 @@
"
[class.bookmarked]="isBookmarked()"
[attr.aria-label]="
isBookmarked() ? 'Bookmark entfernen' : 'Person speichern'
isBookmarked()
? ('bookmarks.removeTooltip' | translate)
: ('bookmarks.saveTooltip' | translate)
"
[matTooltip]="
isBookmarked() ? 'Bookmark entfernen' : 'Person speichern'
isBookmarked()
? ('bookmarks.removeTooltip' | translate)
: ('bookmarks.saveTooltip' | translate)
">
<mat-icon>{{
isBookmarked() ? 'bookmark' : 'bookmark_border'
@@ -42,7 +46,7 @@
@if (!loading()) {
@if (careerStage(); as careerStage) {
<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
class="career-stage-chip"
[matTooltip]="getCareerStageTooltip(careerStage)"
@@ -102,7 +106,7 @@
<mat-icon
class="institution-open-icon"
(click)="openInstitutionPage($event)"
aria-label="Institutionsseite öffnen"
[attr.aria-label]="'persons.openInstitution' | translate"
>open_in_new</mat-icon
>
}
@@ -133,17 +137,17 @@
<div class="action-buttons">
<a [routerLink]="['/person', person().id, 'overview']" class="action-btn">
<mat-icon>visibility</mat-icon>
<span>Übersicht</span>
<span>{{ 'personCard.overview' | translate }}</span>
</a>
<a
[routerLink]="['/person', person().id, 'publications']"
class="action-btn">
<mat-icon>menu_book</mat-icon>
<span>Publikationen</span>
<span>{{ 'publications.publications' | translate }}</span>
</a>
<a [routerLink]="['/person', person().id, 'network']" class="action-btn">
<mat-icon>share</mat-icon>
<span>Netzwerk</span>
<span>{{ 'personCard.network' | translate }}</span>
</a>
</div>
</div>
@@ -7,6 +7,8 @@ import { CustomAuthor, DehydratedInstitution, WorkTopic } from '../../api';
import { SkTextDirective } from '../../custom-directives/sk-text.directive';
import { TopicChipComponent } from '../../shared/ui/topic-chip/topic-chip.component';
import { topicHierarchyColor } from '../../resolvers/utils/topic-colors';
import { TranslatePipe } from '../../shared/i18n/translate.pipe';
import { LanguageService } from '../../shared/i18n/language.service';
@Component({
selector: 'app-person-card',
@@ -18,12 +20,14 @@ import { topicHierarchyColor } from '../../resolvers/utils/topic-colors';
SkTextDirective,
MatTooltipModule,
TopicChipComponent,
TranslatePipe,
],
templateUrl: './person-card.component.html',
styleUrl: './person-card.component.scss',
})
export class PersonCardComponent {
private readonly router = inject(Router);
private readonly languageService = inject(LanguageService);
person = input.required<CustomAuthor>();
isBookmarked = input<boolean>(false);
@@ -109,11 +113,11 @@ export class PersonCardComponent {
const hasCitations = citations !== undefined && citations !== null;
if (hasWorks && hasCitations) {
return `Publikationen: ${works} · Zitationen: ${citations}`;
return this.languageService.translate('personCard.stats', { works, citations });
} else if (hasWorks) {
return `Publikationen: ${works}`;
return this.languageService.translate('personCard.works', { works });
} else if (hasCitations) {
return `Zitationen: ${citations}`;
return this.languageService.translate('personCard.citations', { citations });
}
return '';
});
@@ -175,18 +179,10 @@ export class PersonCardComponent {
getCareerStageTooltip(careerStage: string): string {
const activeYears = this.person().career_metrics?.active_years ?? '-';
return [
`Aktuell: ${careerStage.replace(' Researcher', '')}`,
`Aktive Publikationsjahre: ${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');
return this.languageService.translate('personCard.careerTooltip', {
stage: careerStage.replace(' Researcher', ''),
years: activeYears,
});
}
toggleBookmark(): void {
@@ -1,13 +1,13 @@
@if (loading) {
<app-loading
text="Förderdaten werden geladen..."
[text]="'personFunding.loading' | translate"
icon="volunteer_activism"
[size]="150"
[diameter]="150" />
} @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) {
<p class="message">Keine Förderungen gefunden.</p>
<p class="message">{{ 'personFunding.empty' | translate }}</p>
} @else {
<div class="funding-container">
<div class="funding-content">
@@ -21,11 +21,11 @@
<mat-select
[value]="activeFilter"
(selectionChange)="setFilter($event.value)">
<mat-select-trigger>Filter nach Position</mat-select-trigger>
<mat-option value="all">Alle</mat-option>
<mat-option value="first">Erstautor</mat-option>
<mat-option value="middle">Mitautor</mat-option>
<mat-option value="last">Letztautor</mat-option>
<mat-select-trigger>{{ 'personFunding.filterPosition' | translate }}</mat-select-trigger>
<mat-option value="all">{{ 'common.all' | translate }}</mat-option>
<mat-option value="first">{{ 'personFunding.firstAuthor' | translate }}</mat-option>
<mat-option value="middle">{{ 'personFunding.coauthor' | translate }}</mat-option>
<mat-option value="last">{{ 'personFunding.lastAuthor' | translate }}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field
@@ -35,20 +35,20 @@
<mat-select
[value]="sortMode"
(selectionChange)="setSortMode($event.value)">
<mat-select-trigger>Sortieren nach</mat-select-trigger>
<mat-option value="name">Name</mat-option>
<mat-option value="top">Top Förderer</mat-option>
<mat-select-trigger>{{ 'personPatents.sortBy' | translate }}</mat-select-trigger>
<mat-option value="name">{{ 'jobs.name' | translate }}</mat-option>
<mat-option value="top">{{ 'personFunding.topFunders' | translate }}</mat-option>
</mat-select>
</mat-form-field>
</div>
<table>
<thead>
<tr>
<th>Förderer</th>
<th class="text-center">Publikationen</th>
<th class="text-center">Erstautor</th>
<th class="text-center">Mitautor</th>
<th class="text-center">Letztautor</th>
<th>{{ 'personFunding.funder' | translate }}</th>
<th class="text-center">{{ 'publications.publications' | translate }}</th>
<th class="text-center">{{ 'personFunding.firstAuthor' | translate }}</th>
<th class="text-center">{{ 'personFunding.coauthor' | translate }}</th>
<th class="text-center">{{ 'personFunding.lastAuthor' | translate }}</th>
</tr>
</thead>
<tbody>
@@ -96,7 +96,7 @@
<div class="position-stats">
@if (shouldShowPosition('first')) {
<div class="stat stat-first">
<span class="stat-label">Erstautor</span>
<span class="stat-label">{{ 'personFunding.firstAuthor' | translate }}</span>
<span class="stat-value">{{
selectedFunder.author_position_count.first
}}</span>
@@ -104,7 +104,7 @@
}
@if (shouldShowPosition('middle')) {
<div class="stat stat-middle">
<span class="stat-label">Mitautor</span>
<span class="stat-label">{{ 'personFunding.coauthor' | translate }}</span>
<span class="stat-value">{{
selectedFunder.author_position_count.middle
}}</span>
@@ -112,7 +112,7 @@
}
@if (shouldShowPosition('last')) {
<div class="stat stat-last">
<span class="stat-label">Letztautor</span>
<span class="stat-label">{{ 'personFunding.lastAuthor' | translate }}</span>
<span class="stat-value">{{
selectedFunder.author_position_count.last
}}</span>
@@ -120,7 +120,7 @@
}
</div>
<h4>Publikationen</h4>
<h4>{{ 'publications.publications' | translate }}</h4>
<ul class="publication-list">
@for (id of getSelectedPublicationIdsPage(); track id) {
<li class="publication-item" (click)="togglePublication(id)">
@@ -129,11 +129,11 @@
@if (expandedPublicationId === id) {
<a
class="publication-more-info"
title="Publikationsdetails öffnen"
[title]="'personFunding.openPublication' | translate"
[routerLink]="['/publication', getShortPublicationId(id)]"
[state]="{
returnUrl: getCurrentUrl(),
returnLabel: 'Förderungen',
returnLabel: fundingReturnLabel,
}"
(click)="$event.stopPropagation()">
<span class="material-icons">open_in_new</span>
@@ -157,15 +157,15 @@
<span
class="empty-overview__filter"
[ngClass]="getPositionBadgeClass(activeFilter)">
Filter: {{ getPositionLabel(activeFilter) }}
{{ 'personFunding.filter' | translate }}: {{ getPositionLabel(activeFilter) }}
</span>
}
<h3 class="empty-overview__title">Förderübersicht</h3>
<h3 class="empty-overview__title">{{ 'personFunding.overview' | translate }}</h3>
<p class="empty-overview__subtitle">
@if (activeFilter === 'all') {
Alle geförderten Publikationen dieser Person im Überblick.
{{ 'personFunding.allOverview' | translate }}
} @else {
Nur Publikationen mit der gewählten Autorenposition.
{{ 'personFunding.filteredOverview' | translate }}
}
</p>
<div class="empty-overview__stats">
@@ -175,20 +175,19 @@
getUniquePublicationCount()
}}</span>
<span class="empty-overview__stat-label"
>Einzigartige Publikationen</span
>{{ 'personFunding.uniquePublications' | translate }}</span
>
</div>
<div class="empty-overview__stat empty-overview__stat--funders">
<span class="empty-overview__stat-value">{{
filteredFunders.length
}}</span>
<span class="empty-overview__stat-label">Förderer</span>
<span class="empty-overview__stat-label">{{ 'personFunding.funder' | translate }}</span>
</div>
</div>
<div class="empty-overview__hint">
<p>
Wähle links einen Förderer aus, um die zugehörigen Publikationen
anzuzeigen.
{{ 'personFunding.selectHint' | translate }}
</p>
</div>
</div>
@@ -9,6 +9,8 @@ import { PageEvent } from '@angular/material/paginator';
import { FundingService } from '../../api';
import { LoadingComponent } from '../../shared/ui/loading/loading.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 AuthorPosition = 'first' | 'middle' | 'last' | 'unknown';
@@ -31,6 +33,7 @@ type FundingPublicationDetail = {
MatIconModule,
LoadingComponent,
QueryParamPaginatorComponent,
TranslatePipe,
],
templateUrl: './person-funding.component.html',
styleUrl: './person-funding.component.scss',
@@ -39,6 +42,7 @@ export class PersonFundingComponent implements OnInit {
private route = inject(ActivatedRoute);
private router = inject(Router);
private fundingApi = inject(FundingService);
private languageService = inject(LanguageService);
private initialSelectedFunderKey: string | null = null;
private initialFunderPageIndex = 0;
private initialFunderPageSize = 10;
@@ -265,13 +269,13 @@ export class PersonFundingComponent implements OnInit {
}
getPositionLabel(position: string): string {
const labels: Record<string, string> = {
first: 'Erstautor',
middle: 'Mitautor',
last: 'Letztautor',
unknown: 'Unbekannt',
const labels: Record<string, Parameters<LanguageService['translate']>[0]> = {
first: 'personFunding.firstAuthor',
middle: 'personFunding.coauthor',
last: 'personFunding.lastAuthor',
unknown: 'common.unknown',
};
return labels[position] ?? position;
return labels[position] ? this.languageService.translate(labels[position]) : position;
}
shouldShowPosition(position: 'first' | 'middle' | 'last'): boolean {
@@ -307,7 +311,7 @@ export class PersonFundingComponent implements OnInit {
return this.getSortableFunderName(first).localeCompare(
this.getSortableFunderName(second),
'de',
this.languageService.language(),
{ sensitivity: 'base' },
);
});
@@ -353,6 +357,10 @@ export class PersonFundingComponent implements OnInit {
return this.router.url;
}
get fundingReturnLabel(): string {
return this.languageService.translate('personFunding.funding');
}
getPublicationDetail(publicationId: string): FundingPublicationDetail | null {
const detail = this.selectedFunder?.publication_details?.[publicationId];
if (detail) {
@@ -1,10 +1,10 @@
<aside class="interest-card" [class.interest-card-loading]="loading()">
<div class="interest-header">
<h3>Interessant für</h3>
<h3>{{ 'personInteresting.title' | translate }}</h3>
@if (tags().length > 0) {
<span class="interest-footnote">
<mat-icon class="footnote-icon">article</mat-icon>
Anzahl Publikationen zum Thema
{{ 'personInteresting.publicationCount' | translate }}
</span>
}
</div>
@@ -26,7 +26,7 @@
@if (loading()) {
<div class="interest-state interest-state-loading" aria-live="polite">
<mat-spinner diameter="36"></mat-spinner>
<span>Themen werden geladen ...</span>
<span>{{ 'personInteresting.loading' | translate }}</span>
</div>
} @else if (tags().length > 0) {
@for (tag of tags(); track tag.label) {
@@ -46,7 +46,7 @@
</app-topic-chip>
}
} @else {
<span class="interest-empty">Keine Themen gefunden</span>
<span class="interest-empty">{{ 'personInteresting.empty' | translate }}</span>
}
</div>
</aside>
@@ -27,6 +27,7 @@ import {
toggleTopicLegendFieldSelection,
toggleTopicLegendSubfieldSelection,
} from '../../resolvers/utils/topic-legend';
import { TranslatePipe } from '../../shared/i18n/translate.pipe';
interface InterestTag {
id: string;
@@ -55,6 +56,7 @@ const MAX_TAGS = 5;
MatProgressSpinnerModule,
TopicChipComponent,
TopicLegendComponent,
TranslatePipe,
],
templateUrl: './person-interesting.component.html',
styleUrl: './person-interesting.component.scss',
@@ -4,23 +4,22 @@
<main class="results-column">
<header class="page-header">
<div>
<h1>Passende Personen finden</h1>
<h1>{{ 'persons.title' | translate }}</h1>
<p>
Durchsuchen Sie OpenAlex-Autorinnen und -Autoren nach Namen, Themen
oder Kennungen.
{{ 'persons.description' | translate }}
</p>
</div>
@if (searchValue()) {
<div class="selection-summary">
<div>
<strong>Aktive Suche</strong>
<strong>{{ 'persons.activeSearch' | translate }}</strong>
<span [skText]="loading">„{{ searchValue() }}“</span>
</div>
<button
mat-icon-button
(click)="clearSearch()"
matTooltip="Suche zurücksetzen"
aria-label="Suche zurücksetzen">
[matTooltip]="'persons.resetSearch' | translate"
[attr.aria-label]="'persons.resetSearch' | translate">
<mat-icon>close</mat-icon>
</button>
</div>
@@ -30,7 +29,7 @@
<!-- Active Filter Chips Row -->
@if (activeFilters.length) {
<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">
@for (
filter of activeFilters;
@@ -54,7 +53,7 @@
class="remove-chip-btn"
(click)="removeFilter(filter)"
[attr.aria-label]="
'Themenfilter ' + filter.value + ' entfernen'
('persons.removeTopicFilter' | translate) + ': ' + filter.value
">
<mat-icon>close</mat-icon>
</button>
@@ -86,7 +85,7 @@
<mat-icon
class="institution-open-icon"
(click)="openInstitutionPage(filter.value, $event)"
aria-label="Institutionsseite öffnen"
[attr.aria-label]="'persons.openInstitution' | translate"
>open_in_new</mat-icon
>
}
@@ -95,7 +94,7 @@
type="button"
class="remove-chip-btn"
(click)="removeFilter(filter)"
aria-label="Institutionsfilter entfernen">
[attr.aria-label]="'persons.removeInstitutionFilter' | translate">
<mat-icon>close</mat-icon>
</button>
</span>
@@ -106,7 +105,7 @@
type="button"
class="remove-chip-btn"
(click)="removeFilter(filter)"
aria-label="Filter entfernen">
[attr.aria-label]="'common.removeFilter' | translate">
<mat-icon>close</mat-icon>
</button>
</span>
@@ -115,8 +114,8 @@
<button
class="clear-all-btn"
(click)="clearAllFilters()"
aria-label="Alle Filter zurücksetzen">
Filter zurücksetzen
[attr.aria-label]="'common.resetAllFilters' | translate">
{{ 'common.resetFilters' | translate }}
</button>
</div>
</div>
@@ -127,22 +126,22 @@
<div class="toolbar-actions">
<div class="sort-selector">
<span class="sort-label">Sortierung:</span>
<span class="sort-label">{{ 'persons.sort' | translate }}</span>
<div class="select-wrapper">
<select
[formControl]="sortValueControl"
aria-label="Sortierkriterium">
<option [ngValue]="null">Beste Treffer (Relevanz)</option>
<option value="works_count">Publikationen</option>
<option value="cited_by_count">Zitierungen</option>
[attr.aria-label]="'persons.sortCriterion' | translate">
<option [ngValue]="null">{{ 'persons.relevance' | translate }}</option>
<option value="works_count">{{ 'publications.publications' | translate }}</option>
<option value="cited_by_count">{{ 'persons.citations' | translate }}</option>
<option value="summary_stats.h_index">h_index</option>
</select>
<select
[formControl]="sortOrderControl"
aria-label="Sortierreihenfolge">
<option value="desc">Absteigend</option>
<option value="asc">Aufsteigend</option>
[attr.aria-label]="'persons.sortOrder' | translate">
<option value="desc">{{ 'persons.descending' | translate }}</option>
<option value="asc">{{ 'persons.ascending' | translate }}</option>
</select>
</div>
</div>
@@ -152,7 +151,7 @@
<section class="results-panel">
<div class="results-head">
<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>-->
</div>
@@ -175,10 +174,9 @@
} @else {
<div class="empty-state">
<mat-icon>person_search</mat-icon>
<h2>Keine Personen gefunden</h2>
<h2>{{ 'persons.noneFound' | translate }}</h2>
<p>
Versuchen Sie einen anderen Suchbegriff oder passen Sie die Filter
an.
{{ 'persons.noneHint' | translate }}
</p>
</div>
}
@@ -190,7 +188,7 @@
[pageSizeOptions]="paginationService.options"
[pageIndex]="currentPage - 1"
(page)="onPageChange($event)"
aria-label="Ausgewählte Seite">
[attr.aria-label]="'persons.selectedPage' | translate">
</mat-paginator>
</section>
</main>
@@ -199,25 +197,25 @@
<aside class="filters-sidebar">
<div class="sidebar-header">
<mat-icon>filter_alt</mat-icon>
<h2>Filter &amp; Suche</h2>
<h2>{{ 'persons.filterSearch' | translate }}</h2>
</div>
<!-- Section 1: Topics Search and Selection -->
<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">
<mat-icon>search</mat-icon>
<input
type="text"
[formControl]="topicSearchControl"
aria-label="Thema suchen"
placeholder="Thema suchen..." />
[attr.aria-label]="'persons.searchTopic' | translate"
[placeholder]="'persons.searchTopicPlaceholder' | translate" />
@if (topicSearchControl.value) {
<button
class="clear-topic-search"
(click)="topicSearchControl.setValue('')"
aria-label="Themensuche zurücksetzen">
[attr.aria-label]="'persons.resetTopicSearch' | translate">
<mat-icon>close</mat-icon>
</button>
}
@@ -234,15 +232,15 @@
<!-- Section 2: Institution Filter -->
<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">
<mat-icon>apartment</mat-icon>
<input
type="text"
[formControl]="institutionControl"
[matAutocomplete]="auto"
aria-label="Institution suchen"
placeholder="Institution suchen..."
[attr.aria-label]="'persons.searchInstitution' | translate"
[placeholder]="'persons.searchInstitutionPlaceholder' | translate"
(keyup.enter)="applySidebarFilters()" />
<mat-autocomplete
#auto="matAutocomplete"
@@ -262,14 +260,14 @@
institutionControl.value &&
displayInstitution(institutionControl.value).trim().length >= 2
) {
<mat-option disabled>Keine Institution gefunden</mat-option>
<mat-option disabled>{{ 'persons.noInstitution' | translate }}</mat-option>
}
</mat-autocomplete>
@if (institutionControl.value) {
<button
class="clear-topic-search"
(click)="clearInstitutionFilter()"
aria-label="Institution zurücksetzen">
[attr.aria-label]="'persons.resetInstitution' | translate">
<mat-icon>close</mat-icon>
</button>
}
@@ -285,10 +283,10 @@
<mat-checkbox
[formControl]="yearFilterEnabledControl"
(change)="applySidebarFilters()"
aria-label="Institutionszugehörigkeit nach Jahr filtern">
[attr.aria-label]="'persons.filterMembershipYear' | translate">
<span
style="font-size: 12px; font-weight: 500; color: var(--sg-text)">
Institutionszugehörigkeit nach Jahr filtern
{{ 'persons.filterMembershipYear' | translate }}
</span>
</mat-checkbox>
@@ -305,20 +303,20 @@
[formControl]="filterModeControl"
(change)="applySidebarFilters()"
style="display: flex; gap: 16px"
aria-label="Modus für Jahresfilter">
[attr.aria-label]="'persons.yearFilterMode' | translate">
<mat-radio-button value="in">
<span style="font-size: 12px; color: var(--sg-text)">
Genau im Jahr
{{ 'persons.exactYear' | translate }}
</span>
</mat-radio-button>
<mat-radio-button value="from">
<span style="font-size: 12px; color: var(--sg-text)">
Seit
{{ 'persons.since' | translate }}
</span>
</mat-radio-button>
<mat-radio-button value="between">
<span style="font-size: 12px; color: var(--sg-text)">
Zeitraum
{{ 'persons.period' | translate }}
</span>
</mat-radio-button>
</mat-radio-group>
@@ -333,7 +331,7 @@
margin-top: 4px;
">
<mat-label>
{{ filterModeControl.value === 'between' ? 'Von' : 'Jahr' }}
{{ (filterModeControl.value === 'between' ? 'persons.from' : 'publications.year') | translate }}
</mat-label>
<input
matInput
@@ -342,14 +340,14 @@
(change)="applySidebarFilters()"
(keyup.enter)="applySidebarFilters()"
[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')) {
<mat-error>Jahr muss ≥ 1900 sein</mat-error>
<mat-error>{{ 'persons.yearMin' | translate }}</mat-error>
}
@if (filterYearControl.hasError('max')) {
<mat-error>Zukünftige Jahre sind nicht erlaubt</mat-error>
<mat-error>{{ 'persons.yearFuture' | translate }}</mat-error>
}
</mat-form-field>
@@ -362,26 +360,26 @@
font-size: 13px;
margin-top: 4px;
">
<mat-label>Bis</mat-label>
<mat-label>{{ 'persons.to' | translate }}</mat-label>
<input
matInput
type="number"
[formControl]="filterYearToControl"
(change)="applySidebarFilters()"
(keyup.enter)="applySidebarFilters()"
aria-label="Bis"
placeholder="Z. B. 2026" />
[attr.aria-label]="'persons.to' | translate"
[placeholder]="'persons.yearExampleTo' | translate" />
@if (filterYearToControl.hasError('min')) {
<mat-error>Jahr muss ≥ 1900 sein</mat-error>
<mat-error>{{ 'persons.yearMin' | translate }}</mat-error>
}
@if (filterYearToControl.hasError('max')) {
<mat-error>Zukünftige Jahre sind nicht erlaubt</mat-error>
<mat-error>{{ 'persons.yearFuture' | translate }}</mat-error>
}
@if (
!filterYearToControl.invalid &&
filterYearControl.value > filterYearToControl.value
) {
<mat-error>„Bis“ muss ≥ „Von“ sein</mat-error>
<mat-error>{{ 'persons.toAfterFrom' | translate }}</mat-error>
}
</mat-form-field>
}
@@ -396,9 +394,9 @@
<button
class="submit-btn"
(click)="applySidebarFilters()"
aria-label="Gefundene Personen anzeigen">
[attr.aria-label]="'persons.showFound' | translate">
<span [skText]="loading"
>{{ total | number: '1.0-0' }} Personen anzeigen</span
>{{ total | number: '1.0-0' }} {{ 'persons.showPeople' | translate }}</span
>
</button>
</div>
@@ -43,6 +43,8 @@ import {
} from '@angular/material/autocomplete';
import { SkTextDirective } from '../../custom-directives/sk-text.directive';
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';
@@ -64,6 +66,7 @@ type InstitutionYearFilterMode = 'in' | 'from' | 'between';
PersonCardComponent,
SkTextDirective,
MatAutocompleteModule,
TranslatePipe,
],
templateUrl: './person-list.component.html',
styleUrl: './person-list.component.scss',
@@ -77,6 +80,7 @@ export class PersonListComponent {
private readonly institutionsService = inject(InstitutionsService);
private readonly destroyRef = inject(DestroyRef);
private readonly bookmarkService = inject(BookmarkService);
private readonly languageService = inject(LanguageService);
public readonly state = inject(SharedStateService);
public readonly paginationService = inject(PaginationService);
public readonly resolverStateService = inject(ResolverStateService);
@@ -350,7 +354,7 @@ export class PersonListComponent {
countryCode?: string | null;
}> = [];
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) {
let label = `Institution: ${this.appliedInstitutionName}`;
@@ -546,10 +550,20 @@ export class PersonListComponent {
}
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 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
@@ -1,10 +1,10 @@
<h2 mat-dialog-title>Netzwerkfilter</h2>
<h2 mat-dialog-title>{{ 'personNetwork.dialogTitle' | translate }}</h2>
<mat-dialog-content>
<form>
<div class="pair-field">
<mat-form-field [subscriptSizing]="'dynamic'">
<mat-label>Startjahr (inklusive)</mat-label>
<mat-label>{{ 'personNetwork.startYearInclusive' | translate }}</mat-label>
<input
matInput
type="number"
@@ -12,7 +12,7 @@
[formField]="filterForm.startYear" />
</mat-form-field>
<mat-form-field [subscriptSizing]="'dynamic'">
<mat-label>Endjahr (inklusive)</mat-label>
<mat-label>{{ 'personNetwork.endYearInclusive' | translate }}</mat-label>
<input
matInput
type="number"
@@ -21,7 +21,7 @@
</mat-form-field>
</div>
<mat-form-field [subscriptSizing]="'dynamic'">
<mat-label>Minimale Anzahl von Kollaborierenden (inklusiv)</mat-label>
<mat-label>{{ 'personNetwork.minCollaboratorsInclusive' | translate }}</mat-label>
<input
matInput
type="number"
@@ -29,7 +29,7 @@
[formField]="filterForm.minContributors" />
</mat-form-field>
<mat-form-field [subscriptSizing]="'dynamic'">
<mat-label>Maximale Anzahl von Kollaborierenden (exklusiv)</mat-label>
<mat-label>{{ 'personNetwork.maxCollaboratorsExclusive' | translate }}</mat-label>
<input
matInput
type="number"
@@ -47,8 +47,8 @@
</form>
</mat-dialog-content>
<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>
Anwenden
{{ 'personNetwork.apply' | translate }}
</button>
</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 { SearchableInstitutionSelectComponent } from '../../shared/ui/searchable-institution-select/searchable-institution-select.component';
import { form, FormField } from '@angular/forms/signals';
import { TranslatePipe } from '../../shared/i18n/translate.pipe';
export interface PersonNetworkFilterDialogData {
selectedInstitutions: Institution[];
@@ -47,6 +48,7 @@ interface FilterData {
SearchableTopicSelectComponent,
SearchableInstitutionSelectComponent,
FormField,
TranslatePipe,
],
templateUrl: './person-network-filter-dialog.component.html',
styleUrl: './person-network-filter-dialog.component.scss',
@@ -1,6 +1,6 @@
@if (this.isPending()) {
<app-loading
text="Das Netzwerk wird gebaut, kleinen Moment..."
[text]="'personNetwork.building' | translate"
icon="graph_3"
[size]="150"
[diameter]="150" />
@@ -10,13 +10,13 @@
<span class="error-message">{{
this.collaborationGraphError()
? this.collaborationGraphError()
: 'Fehler beim Laden des Netzwerks. Bitte versuchen Sie es später erneut.'
: ('personNetwork.loadError' | translate)
}}</span>
<app-selected-filters [observers]="observers" />
<button matButton="outlined" type="button" (click)="openFilterDialog()">
<mat-icon>filter_alt</mat-icon>
Filter
{{ 'personNetwork.filter' | translate }}
</button>
</div>
} @else {
@@ -34,18 +34,18 @@
<div class="toggle-group">
<mat-button-toggle-group
class="mat-button-toggle-group"
aria-label="Select view"
[attr.aria-label]="'personNetwork.selectView' | translate"
(change)="onToggleChange($event)"
[value]="displayedTable()"
style="width: 100%">
<mat-button-toggle value="collaborator">
Kollaborierende
{{ 'personNetwork.collaborators' | translate }}
</mat-button-toggle>
<mat-button-toggle value="publication"
>Publikationen</mat-button-toggle
>{{ 'publications.publications' | translate }}</mat-button-toggle
>
<mat-button-toggle value="institution">
Institutionen
{{ 'publications.columnInstitutions' | translate }}
</mat-button-toggle>
</mat-button-toggle-group>
<button
@@ -54,7 +54,7 @@
type="button"
(click)="openFilterDialog()">
<mat-icon>filter_alt</mat-icon>
Filter
{{ 'personNetwork.filter' | translate }}
</button>
</div>
@@ -69,21 +69,21 @@
<mat-card-content class="scroll-viewport-container">
@if (this.displayedTable() === 'collaborator') {
<app-data-table
[columns]="collaboratorsColumns"
[columns]="collaboratorsColumns()"
[data]="collaboratorsData()"
[filterTerm]="searchTerm()"
[detailTemplate]="collaboratorsDetailRow"
[maxHeight]="'100%'" />
} @else if (this.displayedTable() === 'publication') {
<app-data-table
[columns]="publicationsColumns"
[columns]="publicationsColumns()"
[data]="publicationsData()"
[filterTerm]="searchTerm()"
[detailTemplate]="publicationsDetailRow"
[maxHeight]="'100%'" />
} @else if (this.displayedTable() === 'institution') {
<app-data-table
[columns]="institutionsColumns"
[columns]="institutionsColumns()"
[data]="institutionsData()"
[filterTerm]="searchTerm()"
[detailTemplate]="institutionsDetailRow"
@@ -122,7 +122,7 @@
<ng-template #collaboratorsDetailRow let-element>
<div class="detail-row">
@if (element.works.length > 0) {
<span style="font-weight: bold">Publikationen:</span>
<span style="font-weight: bold">{{ 'publications.publications' | translate }}:</span>
<ul>
@for (work of element.works; track $index) {
<a
@@ -138,7 +138,7 @@
</ul>
}
@if (element.institutions.length > 0) {
<span style="font-weight: bold">Institutionen:</span>
<span style="font-weight: bold">{{ 'publications.columnInstitutions' | translate }}:</span>
<ul>
@for (institution of element.institutions; track $index) {
<a
@@ -175,7 +175,7 @@
<ng-template #publicationsDetailRow let-element>
<div class="detail-row">
@if (element.authors.length > 0) {
<span style="font-weight: bold">Mitwirkende:</span>
<span style="font-weight: bold">{{ 'personNetwork.contributors' | translate }}:</span>
<ul>
@for (collaborator of element.authors; track $index) {
<li>
@@ -214,7 +214,7 @@
<ng-template #institutionsDetailRow let-element>
<div class="detail-row">
@if (element.authors.length > 0) {
<span style="font-weight: bold">Mitwirkende:</span>
<span style="font-weight: bold">{{ 'personNetwork.contributors' | translate }}:</span>
<ul>
@for (collaborator of element.authors; track $index) {
<li>
@@ -11,6 +11,7 @@ import {
DestroyRef,
effect,
input,
inject,
OnInit,
signal,
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 { AppInstitutionTooltipComponent } from '../../shared/ui/app-institution-tooltip/app-institution-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 & {
authors: AuthorNode[];
@@ -116,12 +119,14 @@ interface FilterData {
LoadingComponent,
MatGridListModule,
ComponentTooltipDirective,
TranslatePipe,
],
templateUrl: './person-network.component.html',
styleUrl: './person-network.component.scss',
providers: [],
})
export class PersonNetworkComponent implements OnInit {
private readonly languageService = inject(LanguageService);
readonly AppAuthorTooltipComponent = AppAuthorTooltipComponent;
readonly AppInstitutionTooltipComponent = AppInstitutionTooltipComponent;
readonly AppPublicationTooltipComponent = AppPublicationTooltipComponent;
@@ -175,7 +180,7 @@ export class PersonNetworkComponent implements OnInit {
queryParamKey: collaborationGraphQueryParamKeys.yearFrom,
icon: 'calendar_today',
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,
icon: 'calendar_today',
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,
icon: 'person',
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,
icon: 'group',
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[]>(
() =>
this.collaborationGraph()?.authors?.map((author) => ({
@@ -257,7 +261,6 @@ export class PersonNetworkComponent implements OnInit {
'collaboratorsDetailRow',
);
publicationsColumns: GenericColumn<DetailedWorkNode>[] = [];
publicationsData = computed(
() =>
this.collaborationGraph()?.works?.map((work) => ({
@@ -279,7 +282,6 @@ export class PersonNetworkComponent implements OnInit {
'publicationsDetailRow',
);
institutionsColumns: GenericColumn<DetailedInstitutionNode>[] = [];
institutionsData = computed(
() =>
this.collaborationGraph()?.institutions?.map((institution) => ({
@@ -313,13 +315,13 @@ export class PersonNetworkComponent implements OnInit {
const displayedTable = this.displayedTable();
switch (displayedTable) {
case 'collaborator':
return 'Suche Kollaborierende nach Name';
return this.languageService.translate('personNetwork.searchCollaborators');
case 'publication':
return 'Suche Publikationen nach Titel';
return this.languageService.translate('personNetwork.searchPublications');
case 'institution':
return 'Suche Institutionen nach Name';
return this.languageService.translate('personNetwork.searchInstitutions');
default:
return 'Suchbegriff';
return this.languageService.translate('personNetwork.searchTerm');
}
});
@@ -422,22 +424,22 @@ export class PersonNetworkComponent implements OnInit {
{
icon: 'person',
value: this.persons(),
description: 'Personen',
description: this.languageService.translate('nav.people'),
},
{
icon: 'apartment',
value: this.institutions(),
description: 'Institutionen',
description: this.languageService.translate('publications.columnInstitutions'),
},
{
icon: 'menu_book',
value: this.publications(),
description: 'Gemeinsame Publikationen',
description: this.languageService.translate('personNetwork.sharedPublications'),
},
{
icon: 'share',
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') || '');
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;
constructor(
@@ -566,66 +584,6 @@ export class PersonNetworkComponent implements OnInit {
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) {
@@ -4,9 +4,9 @@
[loading]="loading"
[cardTmp]="cardTmp"
[cardMinWidth]="380"
[sortingDirectionOptions]="sortingDirectionOptions"
sortingDirectionLabel="Sortierung"
searchLabel="Nachrichten durchsuchen" />
[sortingDirectionOptions]="sortingDirectionOptions()"
[sortingDirectionLabel]="'personNews.sorting' | translate"
[searchLabel]="'personNews.search' | translate" />
</div>
<ng-template #cardTmp let-article>
@@ -17,10 +17,12 @@ import {
} from '../../shared/ui/card-search/card-search.component';
import { NewsCardComponent } from '../../shared/ui/news-card/news-card.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({
selector: 'app-person-news',
imports: [CardSearchComponent, NewsCardComponent],
imports: [CardSearchComponent, NewsCardComponent, TranslatePipe],
templateUrl: './person-news.component.html',
styleUrl: './person-news.component.scss',
})
@@ -28,11 +30,12 @@ export class PersonNewsComponent implements OnInit {
private readonly destroyRef = inject(DestroyRef);
private readonly route = inject(ActivatedRoute);
private readonly resolverStateService = inject(ResolverStateService);
private readonly languageService = inject(LanguageService);
readonly sortingDirectionOptions: SelectorOption[] = [
{ value: 'desc', display_name: 'Neueste zuerst' },
{ value: 'asc', display_name: 'Älteste zuerst' },
];
readonly sortingDirectionOptions = computed<SelectorOption[]>(() => [
{ value: 'desc', display_name: this.languageService.translate('personNews.newestFirst') },
{ value: 'asc', display_name: this.languageService.translate('personNews.oldestFirst') },
]);
private readonly articles = signal<NewsArticle[]>([]);
private readonly total = signal(0);
@@ -1,10 +1,10 @@
<section class="research-timeline-card">
<div class="timeline-header">
<div class="timeline-title">
<h2>Forschungstimeline</h2>
<h2>{{ 'researchTimeline.title' | translate }}</h2>
<p>
Entwicklung der Forschungsthemen im Zeitverlauf
<span>(basierend auf Publikationen)</span>
{{ 'researchTimeline.subtitle' | translate }}
<span>{{ 'researchTimeline.basedOn' | translate }}</span>
</p>
<span
@@ -14,7 +14,7 @@
!loadingEarlierYears
"
class="no-topics">
Frühere Jahre konnten nicht geladen werden.
{{ 'researchTimeline.earlierFailed' | translate }}
</span>
</div>
@@ -33,38 +33,38 @@
(expandedChange)="onSubfieldLegendExpandedChange($event)">
</app-topic-legend>
<div class="view-toggle" aria-label="Ansicht wechseln">
<div class="view-toggle" [attr.aria-label]="'researchTimeline.changeView' | translate">
<button
type="button"
[class.active]="timelineViewMode === 'years'"
(click)="setTimelineViewMode('years')">
Jahre
{{ 'researchTimeline.years' | translate }}
</button>
<button
type="button"
[class.active]="timelineViewMode === 'compact'"
(click)="setTimelineViewMode('compact')">
Kompakt
{{ 'researchTimeline.compact' | translate }}
</button>
<button
type="button"
[class.active]="timelineViewMode === 'wordcloud'"
(click)="setTimelineViewMode('wordcloud')">
Wordcloud
{{ 'researchTimeline.wordCloud' | translate }}
</button>
</div>
<div
*ngIf="hasYearRange"
class="year-filter"
aria-label="Zeitraum eingrenzen">
[attr.aria-label]="'researchTimeline.limitPeriod' | translate">
<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">
{{ selectedStartYear }} bis {{ selectedEndYear }}
{{ selectedStartYear }} {{ 'researchTimeline.to' | translate }} {{ selectedEndYear }}
</span>
<button
@@ -72,7 +72,7 @@
class="reset-range-button"
[disabled]="!canResetYearRange"
(click)="resetYearRange()">
Zurücksetzen
{{ 'researchTimeline.reset' | translate }}
</button>
</div>
@@ -89,7 +89,7 @@
[max]="maxYear"
[value]="selectedStartYear"
(input)="onStartYearInput($event)"
aria-label="Startjahr" />
[attr.aria-label]="'researchTimeline.startYear' | translate" />
<input
class="range-input range-input-end"
@@ -98,7 +98,7 @@
[max]="maxYear"
[value]="selectedEndYear"
(input)="onEndYearInput($event)"
aria-label="Endjahr" />
[attr.aria-label]="'researchTimeline.endYear' | translate" />
</div>
<div class="year-filter-bounds">
@@ -118,13 +118,13 @@
class="timeline-state timeline-state-loading"
aria-live="polite">
<mat-spinner diameter="36"></mat-spinner>
<span>Forschungstimeline wird geladen ...</span>
<span>{{ 'researchTimeline.loading' | translate }}</span>
</div>
<div
*ngIf="!loading && loadFailed"
class="timeline-state timeline-state-error">
Forschungstimeline konnte nicht geladen werden.
{{ 'researchTimeline.loadFailed' | translate }}
</div>
<ng-container *ngIf="!loading && !loadFailed">
@@ -146,7 +146,7 @@
class="year-button"
[disabled]="loadingEarlierYears"
(click)="requestEarlierYears()"
aria-label="Frühere Jahre der Forschungstimeline laden">
[attr.aria-label]="'researchTimeline.loadEarlierAria' | translate">
‹
</button>
<span class="dot"></span>
@@ -163,7 +163,7 @@
class="year-button"
(click)="selectYears([item.year])"
[attr.aria-label]="
'Publikationen aus dem Jahr ' + item.year + ' anzeigen'
yearPublicationsAria(item.year)
">
{{ item.year }}
</button>
@@ -195,7 +195,7 @@
<span
*ngIf="earlierYearsLoadFailed && !loadingEarlierYears"
class="no-topics">
Laden fehlgeschlagen.
{{ 'researchTimeline.loadingFailed' | translate }}
</span>
</article>
@@ -229,12 +229,7 @@
class="publication-count publication-count-button"
[matTooltip]="getYearPublicationTooltip(item)"
(click)="selectYears([item.year])">
{{ item.publication_count }}
{{
item.publication_count === 1
? 'Publikation'
: 'Publikationen'
}}
{{ item.publication_count }} {{ publicationLabel(item.publication_count) }}
</button>
<div class="topic-list">
@@ -264,7 +259,7 @@
</ng-container>
<ng-template #noTopicsForYear>
<span class="no-topics"> Keine weiteren Topics </span>
<span class="no-topics">{{ 'researchTimeline.noMoreTopics' | translate }}</span>
</ng-template>
</div>
</article>
@@ -304,9 +299,7 @@
class="phase-years phase-years-button"
(click)="selectYears(getPhaseYears(phase))"
[attr.aria-label]="
'Publikationen im Zeitraum ' +
getPhaseYearLabel(phase) +
' anzeigen'
periodPublicationsAria(getPhaseYearLabel(phase))
">
{{ getPhaseYearLabel(phase) }}
</button>
@@ -316,12 +309,7 @@
class="phase-publications phase-publications-button"
[matTooltip]="getPhasePublicationTooltip(phase)"
(click)="selectYears(getPhaseYears(phase))">
{{ phase.publication_count }}
{{
phase.publication_count === 1
? 'Publikation'
: 'Publikationen'
}}
{{ phase.publication_count }} {{ publicationLabel(phase.publication_count) }}
</button>
</div>
@@ -365,7 +353,7 @@
</ng-container>
<ng-template #noPhaseTopics>
<span class="no-topics"> Keine weiteren Topics </span>
<span class="no-topics">{{ 'researchTimeline.noMoreTopics' | translate }}</span>
</ng-template>
</div>
@@ -376,8 +364,8 @@
(click)="togglePhase(phase)">
{{
isPhaseExpanded(phase)
? 'Details ausblenden'
: 'Details anzeigen'
? ('researchTimeline.hideDetails' | translate)
: ('researchTimeline.showDetails' | translate)
}}
</button>
@@ -391,7 +379,7 @@
class="phase-year-button"
(click)="selectYears([year.year])"
[attr.aria-label]="
'Publikationen aus dem Jahr ' + year.year + ' anzeigen'
yearPublicationsAria(year.year)
">
{{ year.year }}
</button>
@@ -401,12 +389,7 @@
class="phase-year-publication-button"
[matTooltip]="getYearPublicationTooltip(year)"
(click)="selectYears([year.year])">
{{ year.publication_count }}
{{
year.publication_count === 1
? 'Publikation'
: 'Publikationen'
}}
{{ year.publication_count }} {{ publicationLabel(year.publication_count) }}
</button>
</div>
@@ -443,7 +426,7 @@
</ng-container>
<ng-template #noPhaseYearTopics>
<span class="no-topics"> Keine weiteren Topics </span>
<span class="no-topics">{{ 'researchTimeline.noMoreTopics' | translate }}</span>
</ng-template>
</div>
</div>
@@ -454,13 +437,13 @@
<div class="timeline-note">
<span class="note-dot"></span>
<span> Hauptforschungsschwerpunkte im jeweiligen Zeitraum </span>
<span>{{ 'researchTimeline.note' | translate }}</span>
</div>
</ng-container>
</ng-container>
</ng-template>
<ng-template #emptyTimeline>
<div class="timeline-state">Keine Timeline-Daten vorhanden.</div>
<div class="timeline-state">{{ 'researchTimeline.empty' | translate }}</div>
</ng-template>
</section>
@@ -11,6 +11,7 @@ import {
Output,
SimpleChanges,
ViewChild,
inject,
} from '@angular/core';
import { TopicChipComponent } from '../../../../shared/ui/topic-chip/topic-chip.component';
import { TopicLegendComponent } from '../../../../shared/ui/topic-legend/topic-legend.component';
@@ -26,6 +27,8 @@ import {
toggleTopicLegendSubfieldSelection,
} from '../../../../resolvers/utils/topic-legend';
import { buildTopicHierarchyTooltip } from '../../../../resolvers/utils/topic-tooltip';
import { TranslatePipe } from '../../../../shared/i18n/translate.pipe';
import { LanguageService } from '../../../../shared/i18n/language.service';
export interface TopicTimelineTopic {
id?: string;
@@ -97,11 +100,13 @@ interface TimelineScrollAnchor {
MatTooltipModule,
TopicChipComponent,
TopicLegendComponent,
TranslatePipe,
],
templateUrl: './research-timeline.component.html',
styleUrl: './research-timeline.component.scss',
})
export class ResearchTimelineComponent implements OnChanges, AfterViewChecked {
private readonly languageService = inject(LanguageService);
@ViewChild('timelineWrapper')
private readonly timelineWrapper?: ElementRef<HTMLDivElement>;
@Input() elements: TopicTimelineElement[] = [];
@@ -213,14 +218,14 @@ export class ResearchTimelineComponent implements OnChanges, AfterViewChecked {
get earlierYearsLabel(): string {
if (this.loadingEarlierYears) {
return 'Frühere Jahre werden geladen ...';
return this.languageService.translate('researchTimeline.earlierLoading');
}
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 {
@@ -322,7 +327,7 @@ export class ResearchTimelineComponent implements OnChanges, AfterViewChecked {
}
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 {
@@ -356,10 +361,24 @@ export class ResearchTimelineComponent implements OnChanges, AfterViewChecked {
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 {
return this.getPublicationTooltip(
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,
item: TopicTimelineElement,
): string {
return this.getTopicCountTooltip(topic, `im Jahr ${item.year}`);
return this.getTopicCountTooltip(topic, this.languageService.translate('researchTimeline.inYear', { year: item.year }));
}
getPhaseTopicCountTooltip(
@@ -574,31 +593,30 @@ export class ResearchTimelineComponent implements OnChanges, AfterViewChecked {
}
private getPublicationTooltip(count: number, period: string): string {
const publicationLabel =
count === 1 ? 'Publikation wurde' : 'Publikationen wurden';
return `Insgesamt ${count} ${publicationLabel} ${period} veröffentlicht.`;
return this.languageService.translate(
count === 1 ? 'researchTimeline.publicationTooltipOne' : 'researchTimeline.publicationTooltipMany',
{ count, period },
);
}
private getTopicCountTooltip(
topic: TopicTimelineTopic,
period: string,
): string {
const publicationLabel =
topic.count === 1 ? 'Publikation' : 'Publikationen';
const verb = topic.count === 1 ? 'hat' : 'haben';
return `${topic.count} ${publicationLabel} ${period} ${verb} das Topic ${topic.name}.`;
return this.languageService.translate(
topic.count === 1 ? 'researchTimeline.topicTooltipOne' : 'researchTimeline.topicTooltipMany',
{ count: topic.count, period, topic: topic.name },
);
}
private getPhasePublicationTooltipPeriod(
phase: ResearchTimelinePhase,
): string {
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 {
return this.showEarlierYearsControl ? 1 : 0;
@@ -695,7 +713,7 @@ export class ResearchTimelineComponent implements OnChanges, AfterViewChecked {
this.pushWorkingPhase(phases, currentPhase);
currentPhase = this.createWorkingPhase(
item,
this.getMainTopicItem(item) ?? { name: 'Keine Topics', count: 0 },
this.getMainTopicItem(item) ?? { name: this.languageService.translate('researchTimeline.noTopicsShort'), count: 0 },
);
continue;
}
@@ -21,7 +21,7 @@
(loadEarlierYears)="onTimelineLoadEarlierYears()">
<div timeline-wordcloud-content class="word-cloud-view">
@if (loadingWordCloud) {
<div class="word-cloud-state">Forschungsthemen werden geladen ...</div>
<div class="word-cloud-state">{{ 'personOverview.topicsLoading' | translate }}</div>
} @else if (wordCloudWords.length) {
<div class="word-cloud-chart">
@for (word of wordCloudWords; track word.name) {
@@ -41,7 +41,7 @@
}
</div>
} @else if (wordCloudEmpty) {
<p class="word-cloud-empty">Keine Forschungsthemen gefunden.</p>
<p class="word-cloud-empty">{{ 'personOverview.noTopics' | translate }}</p>
}
</div>
</app-research-timeline>
@@ -17,6 +17,7 @@ import {
import { TopicLegendTopic } from '../../resolvers/utils/topic-legend';
import { topicHierarchyColor } from '../../resolvers/utils/topic-colors';
import { buildTopicHierarchyTooltip } from '../../resolvers/utils/topic-tooltip';
import { TranslatePipe } from '../../shared/i18n/translate.pipe';
export interface WordCloudWord {
name: string;
@@ -33,7 +34,7 @@ export interface WordCloudWord {
@Component({
selector: 'app-person-overview',
standalone: true,
imports: [CommonModule, ResearchTimelineComponent, MatTooltipModule],
imports: [CommonModule, ResearchTimelineComponent, MatTooltipModule, TranslatePipe],
templateUrl: './person-overview.component.html',
styleUrl: './person-overview.component.scss',
})
@@ -1,11 +1,11 @@
@if (loading) {
<app-loading
text="Patentdaten werden geladen..."
[text]="'personPatents.loading' | translate"
icon="workspace_premium"
[size]="150"
[diameter]="150" />
} @else if (error) {
<p class="message">Fehler beim Laden der Patente.</p>
<p class="message">{{ 'personPatents.loadError' | translate }}</p>
} @else if (patents.length === 0) {
<p class="message">{{ getEmptyMessage() }}</p>
} @else {
@@ -20,8 +20,8 @@
<mat-select
[value]="activeFilter"
(selectionChange)="setFilter($event.value)">
<mat-select-trigger>Filter nach Quelle</mat-select-trigger>
<mat-option value="all">Alle</mat-option>
<mat-select-trigger>{{ 'personPatents.filterSource' | translate }}</mat-select-trigger>
<mat-option value="all">{{ 'common.all' | translate }}</mat-option>
<mat-option value="EPO">EPO</mat-option>
<mat-option value="USPTO">USPTO</mat-option>
</mat-select>
@@ -33,9 +33,9 @@
<mat-select
[value]="sortMode"
(selectionChange)="setSortMode($event.value)">
<mat-select-trigger>Sortieren nach</mat-select-trigger>
<mat-option value="date">Datum</mat-option>
<mat-option value="title">Titel</mat-option>
<mat-select-trigger>{{ 'personPatents.sortBy' | translate }}</mat-select-trigger>
<mat-option value="date">{{ 'publicationDetail.date' | translate }}</mat-option>
<mat-option value="title">{{ 'publications.columnTitle' | translate }}</mat-option>
</mat-select>
</mat-form-field>
</div>
@@ -43,11 +43,11 @@
<table>
<thead>
<tr>
<th>Patent</th>
<th>Quelle</th>
<th>Jahr</th>
<th>Erfinder</th>
<th>Anmelder</th>
<th>{{ 'personPatents.patent' | translate }}</th>
<th>{{ 'patents.source' | translate }}</th>
<th>{{ 'publications.year' | translate }}</th>
<th>{{ 'patents.inventors' | translate }}</th>
<th>{{ 'patents.assignees' | translate }}</th>
</tr>
</thead>
<tbody>
@@ -94,7 +94,7 @@
<h3>{{ selectedPatent.title ?? selectedPatent.patent_id }}</h3>
<div class="detail-stats">
<div class="stat">
<span class="stat-label">Quelle</span>
<span class="stat-label">{{ 'patents.source' | translate }}</span>
<span class="stat-value">
<span
class="source-badge source-badge--{{
@@ -105,18 +105,18 @@
</span>
</div>
<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>
</div>
<div class="stat">
<span class="stat-label">Datum</span>
<span class="stat-label">{{ 'publicationDetail.date' | translate }}</span>
<span class="stat-value">{{
formatDate(selectedPatent.publication_date)
}}</span>
</div>
@if (getPublicationStageLabel(selectedPatent); as stageLabel) {
<div class="stat">
<span class="stat-label">Publikationsstufe</span>
<span class="stat-label">{{ 'patents.publicationStage' | translate }}</span>
<span class="stat-value">{{ stageLabel }}</span>
</div>
}
@@ -134,22 +134,22 @@
class="patent-detail-action"
(click)="openDetail()">
<span class="patent-detail-action__label"
>Patentdetails anzeigen</span
>{{ 'personPatents.showDetails' | translate }}</span
>
<mat-icon aria-hidden="true">chevron_right</mat-icon>
</button>
<p class="patent-detail-hint">
Abstract, Erfinder, Anmelder und IPC/CPC-Klassifikation
{{ 'personPatents.detailHint' | translate }}
</p>
</div>
} @else {
<div class="patent-detail overview">
<p class="overview-title">Patentübersicht</p>
<p class="overview-subtitle">Patente mit passendem Erfindername.</p>
<p class="overview-title">{{ 'personPatents.overview' | translate }}</p>
<p class="overview-subtitle">{{ 'personPatents.overviewSubtitle' | translate }}</p>
<div class="overview-stats">
<div class="overview-stat overview-stat--total">
<span class="overview-value">{{ patents.length }}</span>
<span class="overview-label">Patente</span>
<span class="overview-label">{{ 'patents.title' | translate }}</span>
</div>
<div class="overview-stat overview-stat--epo">
<span class="overview-value">{{ getEpoCount() }}</span>
@@ -161,7 +161,7 @@
</div>
</div>
<p class="overview-hint">
Wähle links ein Patent aus, um Details zu sehen.
{{ 'personPatents.selectHint' | translate }}
</p>
</div>
}
@@ -15,6 +15,8 @@ import {
import { LoadingComponent } from '../../shared/ui/loading/loading.component';
import { PageEvent } from '@angular/material/paginator';
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 SourceFilter = 'all' | 'EPO' | 'USPTO';
@@ -28,6 +30,7 @@ type SourceFilter = 'all' | 'EPO' | 'USPTO';
MatSelectModule,
MatIconModule,
QueryParamPaginatorComponent,
TranslatePipe,
],
templateUrl: './person-patents.component.html',
styleUrl: './person-patents.component.scss',
@@ -36,6 +39,7 @@ export class PersonPatentsComponent {
private route = inject(ActivatedRoute);
private router = inject(Router);
private destroyRef = inject(DestroyRef);
private languageService = inject(LanguageService);
patents: PatentEntry[] = [];
filteredPatents: PatentEntry[] = [];
@@ -146,7 +150,7 @@ export class PersonPatentsComponent {
a.publication_date ?? '',
);
}
return (a.title ?? '').localeCompare(b.title ?? '', 'de', {
return (a.title ?? '').localeCompare(b.title ?? '', this.languageService.language(), {
sensitivity: 'base',
});
});
@@ -198,7 +202,7 @@ export class PersonPatentsComponent {
}
formatDate(date: string | null | undefined): string {
return formatPatentDate(date);
return formatPatentDate(date, this.languageService.language() === 'de' ? 'de-DE' : 'en-US');
}
getEpoCount(): number {
@@ -234,6 +238,6 @@ export class PersonPatentsComponent {
}
getEmptyMessage(): string {
return 'Keine Patente gefunden.';
return this.languageService.translate('personPatents.empty');
}
}
@@ -8,7 +8,7 @@
routerLinkActive
#rla="routerLinkActive"
[active]="rla.isActive">
{{ route.label }}
{{ route.labelKey | translate }}
</a>
}
</nav>
@@ -3,6 +3,8 @@ import { RouterLink, RouterLinkActive, RouterOutlet } from '@angular/router';
import { MatCardModule } from '@angular/material/card';
import { MatTabsModule } from '@angular/material/tabs';
import { TranslatePipe } from '../../shared/i18n/translate.pipe';
import { TranslationKey } from '../../shared/i18n/translations';
@Component({
selector: 'app-person-projects',
@@ -13,6 +15,7 @@ import { MatTabsModule } from '@angular/material/tabs';
RouterOutlet,
RouterLink,
RouterLinkActive,
TranslatePipe,
],
templateUrl: './person-projects.component.html',
styleUrl: './person-projects.component.scss',
@@ -21,11 +24,11 @@ export class PersonProjectsComponent {
readonly childRoutes = [
{
path: 'dfg',
label: 'DFG-Projekte',
labelKey: 'personProjects.dfg' as TranslationKey,
},
{
path: 'eu',
label: 'EU-Projekte',
labelKey: 'personProjects.eu' as TranslationKey,
},
];
}
@@ -2,7 +2,7 @@
<mat-accordion multi>
<mat-expansion-panel class="mat-elevation-z1">
<mat-expansion-panel-header>
<mat-panel-title>Forschungszwecke</mat-panel-title>
<mat-panel-title>{{ 'publications.researchPurposes' | translate }}</mat-panel-title>
</mat-expansion-panel-header>
<app-primary-category-year-aggregation-chart
[page]="primaryCategoryYearAggregationPage()" />
@@ -10,10 +10,10 @@
<mat-expansion-panel class="mat-elevation-z1" [expanded]="true">
<mat-expansion-panel-header>
<mat-panel-title>Publikationsliste</mat-panel-title>
<mat-panel-title>{{ 'publications.list' | translate }}</mat-panel-title>
<mat-panel-description
>{{ total() >= 10000 ? 'mehr als' : '' }}
{{ total() }} Publikationen</mat-panel-description
>{{ total() >= 10000 ? ('publications.moreThan' | translate) : '' }}
{{ total() }} {{ 'publications.publications' | translate }}</mat-panel-description
>
</mat-expansion-panel-header>
<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 { CommonModule } from '@angular/common';
import { ActivatedRoute } from '@angular/router';
import { TranslatePipe } from '../../shared/i18n/translate.pipe';
@Component({
selector: 'app-person-publications',
@@ -23,6 +24,7 @@ import { ActivatedRoute } from '@angular/router';
QueryParamPaginatorComponent,
PrimaryCategoryYearAggregationChartComponent,
CommonModule,
TranslatePipe,
],
templateUrl: './person-publications.component.html',
styleUrl: './person-publications.component.scss',
@@ -12,13 +12,13 @@
[class.bookmarked]="bookmarkService.isBookmarked(person()?.id)"
[attr.aria-label]="
bookmarkService.isBookmarked(person()?.id)
? 'Bookmark entfernen'
: 'Person bookmarken'
? ('bookmarks.removeTooltip' | translate)
: ('bookmarks.saveTooltip' | translate)
"
[matTooltip]="
bookmarkService.isBookmarked(person()?.id)
? 'Bookmark entfernen'
: 'Person bookmarken'
? ('bookmarks.removeTooltip' | translate)
: ('bookmarks.saveTooltip' | translate)
"
(click)="toggleBookmark()">
<mat-icon>{{
@@ -23,6 +23,7 @@ import { PersonBioResolved } from '../../resolvers/person-bio.resolver';
import { PersonDataResolved } from '../../resolvers/person.resolver';
import { BookmarkService } from '../../shared/services/bookmark.service';
import { collaborationGraphQueryParamKeys } from '../../resolvers/collaboration-graph.resolver';
import { TranslatePipe } from '../../shared/i18n/translate.pipe';
type PersonLink = {
label: string;
@@ -43,6 +44,7 @@ type PersonLink = {
RouterOutlet,
RouterModule,
LoadingComponent,
TranslatePipe,
],
templateUrl: './person.component.html',
styleUrl: './person.component.scss',
@@ -3,7 +3,10 @@
@if (showHeader) {
<div class="section-header">
<mat-icon>business</mat-icon>
<h2>{{ headerTitle }} ({{ getOrgsCount() }})</h2>
<h2>
{{ headerTitle || ('organizations.title' | translate) }}
({{ getOrgsCount() }})
</h2>
</div>
}
@@ -14,7 +17,11 @@
class="org-name-cell"
(click)="searchForInstitutionName(org.name || org.shortName || '')">
<span class="org-name-text">
{{ org.name || org.shortName || 'Unbekannte Organisation' }}
{{
org.name ||
org.shortName ||
('organizations.unknown' | translate)
}}
</span>
</div>
</ng-template>
@@ -19,6 +19,8 @@ import {
DataTableComponent,
GenericColumn,
} from '../../../../shared/ui/data-table/data-table.component';
import { LanguageService } from '../../../../shared/i18n/language.service';
import { TranslatePipe } from '../../../../shared/i18n/translate.pipe';
@Component({
selector: 'app-organizations-table',
@@ -29,17 +31,19 @@ import {
CurrencyPipe,
DataTableComponent,
MatPaginatorModule,
TranslatePipe,
],
templateUrl: './organizations-table.component.html',
styleUrl: './organizations-table.component.scss',
})
export class OrganizationsTableComponent {
private readonly router = inject(Router);
private readonly languageService = inject(LanguageService);
public paginationService = inject(PaginationService);
@Input() orgs: HEUOrganization[] = [];
@Input() showHeader: boolean = true;
@Input() headerTitle: string = 'Organisationen';
@Input() headerTitle?: string;
pageIndex = signal(0);
pageSize = signal(10);
@@ -63,35 +67,35 @@ export class OrganizationsTableComponent {
columns = computed<GenericColumn<HEUOrganization>[]>(() => [
{
id: 'name',
header: 'Name',
header: this.languageService.translate('organizations.name'),
type: 'accessor',
accessorKey: 'name',
cellTemplate: this.nameTemplate(),
},
{
id: 'role',
header: 'Rolle',
header: this.languageService.translate('organizations.role'),
type: 'accessor',
accessorKey: 'role',
cellTemplate: this.roleTemplate(),
},
{
id: 'city',
header: 'Stadt',
header: this.languageService.translate('organizations.city'),
type: 'accessor',
accessorKey: 'city',
cellTemplate: this.cityTemplate(),
},
{
id: 'ecContribution',
header: 'EU-Beitrag',
header: this.languageService.translate('organizations.euContribution'),
type: 'accessor',
accessorKey: 'ecContribution',
cellTemplate: this.ecContributionTemplate(),
},
{
id: 'activityType',
header: 'Aktivitätstyp',
header: this.languageService.translate('organizations.activityType'),
type: 'accessor',
accessorKey: 'activityType',
cellTemplate: this.activityTypeTemplate(),
@@ -105,7 +109,7 @@ export class OrganizationsTableComponent {
},
{
id: 'organizationURL',
header: 'URL',
header: this.languageService.translate('organizations.url'),
type: 'accessor',
accessorKey: 'organizationURL',
cellTemplate: this.organizationUrlTemplate(),
@@ -5,20 +5,20 @@
(click)="navigateBack()"
[attr.aria-label]="returnAriaLabel">
<mat-icon>arrow_back</mat-icon>
{{ returnLabel }}
{{ displayReturnLabel }}
</button>
@if (loading) {
<div class="state">
<mat-spinner diameter="42"></mat-spinner>
<p>Publikation wird geladen...</p>
<p>{{ 'publicationDetail.loading' | translate }}</p>
</div>
} @else if (notFound || !publication) {
<div class="state error-state">
<mat-icon>search_off</mat-icon>
<h2>Publikation nicht gefunden</h2>
<p>Die Publikation konnte nicht geladen werden.</p>
<a mat-stroked-button routerLink="/persons"> Zur Personensuche </a>
<h2>{{ 'publicationDetail.notFound' | translate }}</h2>
<p>{{ 'publicationDetail.loadError' | translate }}</p>
<a mat-stroked-button routerLink="/persons">{{ 'publicationDetail.peopleSearch' | translate }}</a>
</div>
} @else {
<header class="hero">
@@ -41,7 +41,7 @@
}
</div>
<h1>
{{ publication.title || publication.display_name || 'Ohne Titel' }}
{{ publication.title || publication.display_name || ('publicationDetail.untitled' | translate) }}
</h1>
<p class="author-line">
@for (
@@ -52,13 +52,13 @@
<span>{{
authorship.author?.display_name ||
authorship.raw_author_name ||
'Unbekannt'
('common.unknown' | translate)
}}</span>
@if (!last) {
<span>, </span>
}
} @empty {
Autorinnen und Autoren nicht angegeben
{{ 'publicationDetail.authorsNotProvided' | translate }}
}
</p>
<div class="hero-actions">
@@ -81,24 +81,24 @@
</div>
</div>
<div class="metrics" aria-label="Publikationskennzahlen">
<div class="metrics" [attr.aria-label]="'publicationDetail.metrics' | translate">
<div>
<mat-icon>format_quote</mat-icon>
<strong>{{ publication.cited_by_count ?? 0 | number }}</strong>
<span>Zitationen</span>
<span>{{ 'publicationDetail.citations' | translate }}</span>
</div>
<div>
<mat-icon>menu_book</mat-icon>
<strong>{{
publication.referenced_works_count ?? 0 | number
}}</strong>
<span>Referenzen</span>
<span>{{ 'publicationDetail.references' | translate }}</span>
</div>
<div [class.positive]="publication.open_access?.is_oa">
<mat-icon>{{
publication.open_access?.is_oa ? 'lock_open' : 'lock'
}}</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>
</div>
</div>
@@ -107,7 +107,7 @@
@if (publication.is_retracted) {
<div class="warning">
<mat-icon>warning</mat-icon>
Diese Publikation wurde zurückgezogen.
{{ 'publicationDetail.retracted' | translate }}
</div>
}
@@ -130,10 +130,10 @@
(click)="authorsExpanded = !authorsExpanded"
[attr.aria-expanded]="authorsExpanded">
<mat-icon>group</mat-icon>
<span class="accordion-title">Autorinnen und Autoren</span>
<span class="accordion-title">{{ 'publicationDetail.authors' | translate }}</span>
<mat-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"
(click)="$event.stopPropagation()"
>info_outline</mat-icon
@@ -173,24 +173,24 @@
{{
authorship.author?.display_name ||
authorship.raw_author_name ||
'Unbekannt'
('common.unknown' | translate)
}}
</a>
} @else {
<strong>{{
authorship.raw_author_name || 'Unbekannt'
authorship.raw_author_name || ('common.unknown' | translate)
}}</strong>
}
<p>
{{ authorship.author_position || 'Mitautor/in' }}
{{ authorship.author_position || ('publicationDetail.coauthor' | translate) }}
@if (authorship.is_corresponding) {
· Korrespondenz
· {{ 'publicationDetail.corresponding' | translate }}
}
</p>
</div>
</article>
} @empty {
<p class="empty">Keine Angaben vorhanden.</p>
<p class="empty">{{ 'common.noInformation' | translate }}</p>
}
</div>
@if (authorsPageCount() > 1) {
@@ -198,6 +198,7 @@
<button
type="button"
class="page-btn"
[attr.aria-label]="'paginator.previous' | translate"
[disabled]="authorsPage === 0"
(click)="authorsPage = authorsPage - 1">
<mat-icon>chevron_left</mat-icon>
@@ -208,6 +209,7 @@
<button
type="button"
class="page-btn"
[attr.aria-label]="'paginator.next' | translate"
[disabled]="authorsPage === authorsPageCount() - 1"
(click)="authorsPage = authorsPage + 1">
<mat-icon>chevron_right</mat-icon>
@@ -224,7 +226,7 @@
<section class="card">
<div class="section-title">
<mat-icon>label</mat-icon>
<h2>Themen</h2>
<h2>{{ 'publications.columnTopics' | translate }}</h2>
</div>
<div class="tags">
@for (topic of publication.topics; track topic.id) {
@@ -246,7 +248,7 @@
<section class="card">
<div class="section-title">
<mat-icon>interests</mat-icon>
<h2>Keywords</h2>
<h2>{{ 'publicationDetail.keywords' | translate }}</h2>
</div>
<div class="tags">
@for (keyword of publication.keywords; track keyword.id) {
@@ -264,10 +266,10 @@
(click)="sourcesExpanded = !sourcesExpanded"
[attr.aria-expanded]="sourcesExpanded">
<mat-icon>library_books</mat-icon>
<span class="accordion-title">Quellen und Versionen</span>
<span class="accordion-title">{{ 'publicationDetail.sourcesVersions' | translate }}</span>
<mat-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"
(click)="$event.stopPropagation()"
>info_outline</mat-icon
@@ -287,13 +289,13 @@
<article>
<div>
<strong>{{
location.source?.display_name || 'Externe Quelle'
location.source?.display_name || ('publicationDetail.externalSource' | translate)
}}</strong>
<p>
{{
location.version ||
location.source?.type ||
'Veröffentlichte Version'
('publicationDetail.publishedVersion' | translate)
}}
@if (location.license) {
· {{ location.license }}
@@ -312,7 +314,7 @@
[href]="sourceUrl"
target="_blank"
rel="noopener"
aria-label="Quelle öffnen">
[attr.aria-label]="'publicationDetail.openSource' | translate">
<mat-icon>open_in_new</mat-icon>
</a>
}
@@ -330,21 +332,21 @@
<section class="card facts-card">
<div class="section-title">
<mat-icon>info</mat-icon>
<h2>Publikationsdaten</h2>
<h2>{{ 'publicationDetail.data' | translate }}</h2>
</div>
<dl>
<div>
<dt>Datum</dt>
<dt>{{ 'publicationDetail.date' | translate }}</dt>
<dd>
{{ (publication.publication_date | date: 'dd.MM.yyyy') || '-' }}
</dd>
</div>
<div>
<dt>Typ</dt>
<dt>{{ 'publications.type' | translate }}</dt>
<dd>{{ publication.type | workType }}</dd>
</div>
<div>
<dt>Sprache</dt>
<dt>{{ 'publications.language' | translate }}</dt>
<dd>{{ publication.language | languageCode }}</dd>
</div>
<div>
@@ -352,19 +354,19 @@
<dd>{{ openAccessLabel() }}</dd>
</div>
<div>
<dt>Volume</dt>
<dt>{{ 'publicationDetail.volume' | translate }}</dt>
<dd>{{ publication.biblio?.volume || '-' }}</dd>
</div>
<div>
<dt>Ausgabe</dt>
<dt>{{ 'publicationDetail.issue' | translate }}</dt>
<dd>{{ publication.biblio?.issue || '-' }}</dd>
</div>
<div>
<dt>Seiten</dt>
<dt>{{ 'publicationDetail.pages' | translate }}</dt>
<dd>{{ pages() || '-' }}</dd>
</div>
<div>
<dt>Indexiert in</dt>
<dt>{{ 'publicationDetail.indexedIn' | translate }}</dt>
<dd>{{ publication.indexed_in?.join(', ') || '-' }}</dd>
</div>
</dl>
@@ -378,10 +380,10 @@
(click)="institutionsExpanded = !institutionsExpanded"
[attr.aria-expanded]="institutionsExpanded">
<mat-icon>account_balance</mat-icon>
<span class="accordion-title">Institutionen</span>
<span class="accordion-title">{{ 'publications.columnInstitutions' | translate }}</span>
<mat-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"
(click)="$event.stopPropagation()"
>info_outline</mat-icon
@@ -431,6 +433,7 @@
<button
type="button"
class="page-btn"
[attr.aria-label]="'paginator.previous' | translate"
[disabled]="institutionsPage === 0"
(click)="institutionsPage = institutionsPage - 1">
<mat-icon>chevron_left</mat-icon>
@@ -442,6 +445,7 @@
<button
type="button"
class="page-btn"
[attr.aria-label]="'paginator.next' | translate"
[disabled]="
institutionsPage === institutionsPageCount() - 1
"
@@ -463,10 +467,10 @@
(click)="fundingExpanded = !fundingExpanded"
[attr.aria-expanded]="fundingExpanded">
<mat-icon>paid</mat-icon>
<span class="accordion-title">Förderungen</span>
<span class="accordion-title">{{ 'publicationDetail.funding' | translate }}</span>
<mat-icon
class="info-icon"
matTooltip="Förderorganisationen und Förderungen, die zu dieser Publikation beigetragen haben."
[matTooltip]="'publicationDetail.fundingHelp' | translate"
matTooltipPosition="above"
(click)="$event.stopPropagation()"
>info_outline</mat-icon
@@ -482,7 +486,7 @@
@for (funder of publication.funders ?? []; track funder.id) {
<div>
<strong>{{ funder.display_name }}</strong
><span>Förderorganisation</span>
><span>{{ 'publicationDetail.funder' | translate }}</span>
</div>
}
@for (award of publication.awards ?? []; track award.id) {
@@ -491,7 +495,7 @@
award.display_name || award.funder_award_id
}}</strong
><span>{{
award.funder_display_name || 'Förderung'
award.funder_display_name || ('publicationDetail.fundingOne' | translate)
}}</span>
</div>
}
@@ -509,10 +513,10 @@
(click)="linksExpanded = !linksExpanded"
[attr.aria-expanded]="linksExpanded">
<mat-icon>link</mat-icon>
<span class="accordion-title">Externe Links</span>
<span class="accordion-title">{{ 'publicationDetail.externalLinks' | translate }}</span>
<mat-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"
(click)="$event.stopPropagation()"
>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 { WorkPrimaryCategoryPipe } from '../../shared/pipes/work-primary-category.pipe';
import { ResearchProfileComponent } from './research-profile/research-profile.component';
import { TranslatePipe } from '../../shared/i18n/translate.pipe';
import { LanguageService } from '../../shared/i18n/language.service';
interface DetailLink {
label: string;
@@ -50,6 +52,7 @@ interface InstitutionDetail {
LanguageCodePipe,
WorkPrimaryCategoryPipe,
ResearchProfileComponent,
TranslatePipe,
],
templateUrl: './publication-detail.component.html',
styleUrl: './publication-detail.component.scss',
@@ -61,6 +64,7 @@ export class PublicationDetailComponent implements OnInit {
private readonly location = inject(Location);
private readonly router = inject(Router);
private readonly worksService = inject(WorksService);
private readonly languageService = inject(LanguageService);
workClassification = input.required<WorkClassification | null>();
@@ -81,8 +85,15 @@ export class PublicationDetailComponent implements OnInit {
readonly institutionsPageSize = 5;
returnUrl: string | null = null;
returnLabel = 'Alle Publikationen';
returnAriaLabel = 'Zurück zu den Publikationen';
returnLabel: string | null = null;
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 {
this.loading = true;
@@ -93,8 +104,7 @@ export class PublicationDetailComponent implements OnInit {
} | null;
if (navigationState?.returnUrl) {
this.returnUrl = navigationState.returnUrl;
this.returnLabel = navigationState.returnLabel ?? 'Zurück';
this.returnAriaLabel = `Zurück zu ${this.returnLabel}`;
this.returnLabel = navigationState.returnLabel ?? this.languageService.translate('common.back');
}
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';
}
return 'Kein Open Access';
return this.languageService.translate('publicationDetail.noOpenAccess');
}
private doiUrl(doi: string | null | undefined): string | null {
@@ -3,9 +3,9 @@
<mat-card-header class="profile-header">
<mat-icon class="profile-icon">science</mat-icon>
<div class="profile-heading">
<mat-card-title>Forschungsprofil</mat-card-title>
<mat-card-title>{{ 'researchProfile.title' | translate }}</mat-card-title>
<mat-card-subtitle>
Einordnung der Forschungsorientierung dieser Publikation
{{ 'researchProfile.subtitle' | translate }}
</mat-card-subtitle>
</div>
</mat-card-header>
@@ -14,7 +14,7 @@
<div class="visualizations">
<section aria-labelledby="pasteur-title">
<h3 id="pasteur-title" class="visualization-title">
Pasteur-Quadrant
{{ 'researchProfile.quadrant' | translate }}
</h3>
<div class="quadrant-chart-frame">
<div
@@ -29,7 +29,7 @@
<section aria-labelledby="score-title" class="score-section">
<h3 id="score-title" class="visualization-title">
Orientierungsscore
{{ 'researchProfile.score' | translate }}
</h3>
<div class="score-content">
<app-orientation-gauge
@@ -50,7 +50,7 @@
profile.insufficient_context
) {
<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 (
profile.confidence === 'medium' || profile.confidence === 'low'
) {
@@ -66,7 +66,7 @@
[matTooltip]="confidenceTooltip(profile.confidence)"
matTooltipPosition="above"
(click)="$event.stopPropagation()"
aria-label="Erläuterung zur Konfidenz">
[attr.aria-label]="'researchProfile.confidenceExplanation' | translate">
info_outline
</mat-icon>
</mat-card>
@@ -74,13 +74,13 @@
@if (profile.insufficient_context) {
<mat-card appearance="outlined" class="warning-note">
<span>Begrenzte Informationsgrundlage</span>
<span>{{ 'researchProfile.limitedInformation' | translate }}</span>
<mat-icon
class="info-icon"
matTooltip="Für diese Einordnung standen nicht genügend inhaltliche Angaben zur Verfügung."
[matTooltip]="'researchProfile.limitedInformationHelp' | translate"
matTooltipPosition="above"
(click)="$event.stopPropagation()"
aria-label="Erläuterung zur Informationsgrundlage">
[attr.aria-label]="'researchProfile.informationExplanation' | translate">
info_outline
</mat-icon>
</mat-card>
@@ -21,6 +21,9 @@ import { WorkPrimaryCategoryPipe } from '../../../shared/pipes/work-primary-cate
import { ChartThemeService } from '../../../shared/services/chart-theme.service';
import { OrientationGaugeComponent } from '../../../shared/ui/orientation-gauge/orientation-gauge.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 =
| 'pure_basic'
@@ -32,7 +35,7 @@ interface QuadrantDefinition {
key: PasteurQuadrant;
coordinate: [string, string];
title: string;
description: string;
descriptionKey: TranslationKey;
color?: 'blue' | 'purple' | 'green';
}
@@ -41,27 +44,27 @@ const QUADRANTS: readonly QuadrantDefinition[] = [
key: 'pure_basic',
coordinate: ['Niedrig', 'Hoch'],
title: 'Bohr',
description: 'Reine\nGrundlagenforschung',
descriptionKey: 'researchProfile.pureBasic',
color: 'blue',
},
{
key: 'use_inspired_basic',
coordinate: ['Hoch', 'Hoch'],
title: 'Pasteur',
description: 'Vom Nutzen inspirierte\nGrundlagenforschung',
descriptionKey: 'researchProfile.useInspiredBasic',
color: 'purple',
},
{
key: 'not_applicable',
coordinate: ['Niedrig', 'Niedrig'],
title: 'Weder noch',
description: 'Keine eindeutige\nForschungsorientierung',
title: '',
descriptionKey: 'researchProfile.neither',
},
{
key: 'pure_applied',
coordinate: ['Hoch', 'Niedrig'],
title: 'Edison',
description: 'Angewandte Forschung\nund Entwicklung',
descriptionKey: 'researchProfile.applied',
color: 'green',
},
];
@@ -78,6 +81,7 @@ const QUADRANTS: readonly QuadrantDefinition[] = [
OrientationGaugeComponent,
TopicChipComponent,
WorkPrimaryCategoryPipe,
TranslatePipe,
],
templateUrl: './research-profile.component.html',
styleUrl: './research-profile.component.scss',
@@ -85,6 +89,7 @@ const QUADRANTS: readonly QuadrantDefinition[] = [
export class ResearchProfileComponent {
private readonly destroyRef = inject(DestroyRef);
private readonly chartTheme = inject(ChartThemeService);
private readonly languageService = inject(LanguageService);
private readonly quadrantChartSize = signal({ width: 640, height: 320 });
private quadrantResizeObserver?: ResizeObserver;
@@ -120,13 +125,15 @@ export class ResearchProfileComponent {
});
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 {
return confidence === 'low'
? 'Das Klassifikationsergebnis wurde mit geringer Konfidenz bestimmt.'
: 'Das Klassifikationsergebnis wurde mit mittlerer Konfidenz bestimmt.';
return this.languageService.translate(
confidence === 'low' ? 'researchProfile.lowConfidenceHelp' : 'researchProfile.mediumConfidenceHelp',
);
}
onQuadrantChartInit(chart: EChartsType): void {
@@ -276,7 +283,7 @@ export class ResearchProfileComponent {
x: axisLeft + (horizontalTipX - axisLeft) / 2,
y: chartHeight - 17,
style: {
text: 'Anwendungsorientierung',
text: this.languageService.translate('researchProfile.applicationOrientation'),
fill: textColor,
fontSize: 12,
fontWeight: 600,
@@ -290,7 +297,7 @@ export class ResearchProfileComponent {
top: 'middle',
rotation: Math.PI / 2,
style: {
text: 'Erkenntnisorientierung',
text: this.languageService.translate('researchProfile.knowledgeOrientation'),
fill: textColor,
fontSize: 12,
fontWeight: 600,
@@ -325,9 +332,9 @@ export class ResearchProfileComponent {
lineHeight: 16,
fontWeight: 400,
formatter: [
`{title|${quadrant.title}}`,
`{description|${quadrant.description}}`,
...(active ? ['{active|✓ Diese Publikation}'] : []),
`{title|${quadrant.title || this.languageService.translate('researchProfile.neitherTitle')}}`,
`{description|${this.languageService.translate(quadrant.descriptionKey)}}`,
...(active ? [`{active|✓ ${this.languageService.translate('researchProfile.thisPublication')}}`] : []),
].join('\n'),
rich: {
title: {
@@ -1,9 +1,9 @@
<section class="login-page">
<div class="login-panel">
<div class="brand-block">
<span class="eyebrow">SmartGuide Account Portal</span>
<h1>Passwort zurücksetzen</h1>
<p>Gib ein neues Passwort für Dein Konto ein.</p>
<span class="eyebrow">{{ 'login.portal' | translate }}</span>
<h1>{{ 'resetPassword.title' | translate }}</h1>
<p>{{ 'resetPassword.description' | translate }}</p>
</div>
@if (passwordChanged()) {
@@ -11,10 +11,9 @@
<div class="code-intro">
<mat-icon>check_circle</mat-icon>
<div>
<strong>Passwort geändert</strong>
<strong>{{ 'resetPassword.changed' | translate }}</strong>
<span>
Dein Passwort wurde erfolgreich geändert. Bitte melde Dich mit dem
neuen Passwort an.
{{ 'resetPassword.changedMessage' | translate }}
</span>
</div>
</div>
@@ -25,7 +24,7 @@
class="submit-button"
type="button"
routerLink="/login">
Zurück zum Login
{{ 'forgotPassword.backLogin' | translate }}
</button>
</div>
} @else if (!hasToken()) {
@@ -33,20 +32,18 @@
<div class="code-intro">
<mat-icon>error_outline</mat-icon>
<div>
<strong>Ungültiger Link</strong>
<strong>{{ 'resetPassword.invalidLink' | translate }}</strong>
<span>
Der Link zum Zurücksetzen des Passworts ist ungültig oder
unvollständig.
{{ 'resetPassword.invalidLinkMessage' | translate }}
</span>
</div>
</div>
<
<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"
>Neuen Link anfordern</a
>{{ 'resetPassword.requestNewLink' | translate }}</a
>
</div>
</div>
@@ -55,25 +52,24 @@
<div class="code-intro">
<mat-icon>error_outline</mat-icon>
<div>
<strong>Link nicht mehr gültig</strong>
<strong>{{ 'resetPassword.linkExpired' | translate }}</strong>
<span>
Der Link zum Zurücksetzen des Passworts ist abgelaufen oder wurde
bereits verwendet.
{{ 'resetPassword.expiredMessage' | translate }}
</span>
</div>
</div>
<div class="form-actions">
<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>
} @else {
<form class="login-form" [formGroup]="form" (ngSubmit)="resetPassword()">
<mat-form-field class="field" appearance="outline">
<mat-label>Neues Passwort</mat-label>
<mat-label>{{ 'resetPassword.newPassword' | translate }}</mat-label>
<input
matInput
[type]="showPasswords() ? 'text' : 'password'"
@@ -85,7 +81,7 @@
matSuffix
type="button"
[attr.aria-label]="
showPasswords() ? 'Passwort verbergen' : 'Passwort anzeigen'
(showPasswords() ? 'login.hidePassword' : 'login.showPassword') | translate
"
(click)="showPasswords.set(!showPasswords())">
<mat-icon>
@@ -94,16 +90,16 @@
</button>
@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')) {
<mat-error>Passwort muss mindestens 8 Zeichen haben.</mat-error>
<mat-error>{{ 'login.passwordLength' | translate }}</mat-error>
} @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 class="field" appearance="outline">
<mat-label>Neues Passwort wiederholen</mat-label>
<mat-label>{{ 'resetPassword.repeatPassword' | translate }}</mat-label>
<input
matInput
[type]="showPasswords() ? 'text' : 'password'"
@@ -115,7 +111,7 @@
matSuffix
type="button"
[attr.aria-label]="
showPasswords() ? 'Passwort verbergen' : 'Passwort anzeigen'
(showPasswords() ? 'login.hidePassword' : 'login.showPassword') | translate
"
(click)="showPasswords.set(!showPasswords())">
<mat-icon>
@@ -124,11 +120,11 @@
</button>
@if (form.controls.confirmPassword.hasError('required')) {
<mat-error>Bitte wiederhole das neue Passwort.</mat-error>
<mat-error>{{ 'resetPassword.repeatRequired' | translate }}</mat-error>
} @else if (
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>
@@ -136,7 +132,7 @@
<div class="code-intro">
<mat-icon>error_outline</mat-icon>
<div>
<strong>Fehler</strong>
<strong>{{ 'errorPage.error' | translate }}</strong>
<span>{{ errorMessage() }}</span>
</div>
</div>
@@ -149,14 +145,14 @@
type="submit"
[disabled]="form.invalid || isSubmitting()">
@if (isSubmitting()) {
Passwort wird geändert...
{{ 'resetPassword.changing' | translate }}
} @else {
Passwort ändern
{{ 'resetPassword.change' | translate }}
}
</button>
<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>
</form>
}
@@ -19,6 +19,8 @@ import { MatInputModule } from '@angular/material/input';
import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar';
import { CredentialService } from '../../shared/services/credential.service';
import { TranslatePipe } from '../../shared/i18n/translate.pipe';
import { LanguageService } from '../../shared/i18n/language.service';
@Component({
selector: 'app-reset-password',
@@ -31,6 +33,7 @@ import { CredentialService } from '../../shared/services/credential.service';
MatButtonModule,
MatIconModule,
MatSnackBarModule,
TranslatePipe,
],
templateUrl: './reset-password.component.html',
styleUrl: '../app-login/app-login.component.scss',
@@ -39,6 +42,7 @@ export class ResetPasswordComponent {
private readonly destroyRef = inject(DestroyRef);
private readonly snackBar = inject(MatSnackBar);
private readonly resetToken = signal<string | undefined>(undefined);
private readonly languageService = inject(LanguageService);
readonly isSubmitting = signal(false);
readonly passwordChanged = signal(false);
@@ -81,7 +85,7 @@ export class ResetPasswordComponent {
if (!this.hasToken()) {
this.linkInvalid.set(true);
this.errorMessage.set(
'Der Link zum Zurücksetzen des Passworts ist ungültig oder unvollständig.',
this.languageService.translate('resetPassword.invalidLinkMessage'),
);
return;
}
@@ -125,7 +129,7 @@ export class ResetPasswordComponent {
) {
this.linkInvalid.set(true);
this.snackBar.open(
'Der Link zum Zurücksetzen des Passworts ist abgelaufen oder wurde bereits verwendet.',
this.languageService.translate('resetPassword.expiredMessage'),
'OK',
{ duration: 7000 },
);
@@ -133,7 +137,7 @@ export class ResetPasswordComponent {
}
this.errorMessage.set(
'Das Passwort konnte nicht geändert werden. Bitte versuche es später erneut.',
this.languageService.translate('resetPassword.changeError'),
);
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 { LanguageService } from '../../shared/i18n/language.service';
@Injectable()
export class PaginatorIntl extends MatPaginatorIntl {
override itemsPerPageLabel = 'Einträge pro Seite';
override nextPageLabel = 'Nächste Seite';
override previousPageLabel = 'Vorherige Seite';
private readonly languageService = inject(LanguageService);
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) => {
if (length === 0 || pageSize === 0) {
return '0 von ' + length;
return `0 ${this.languageService.translate('paginator.of')} ${length}`;
}
length = Math.max(length, 0);
const startIndex = page * pageSize;
@@ -17,6 +29,6 @@ export class PaginatorIntl extends MatPaginatorIntl {
startIndex < length
? Math.min(startIndex + pageSize, length)
: 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