1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00
pigallery2/src/frontend/app/model/backendtext.service.ts

73 lines
2.8 KiB
TypeScript
Raw Normal View History

2022-04-05 01:37:31 +08:00
import { Injectable } from '@angular/core';
import { backendText, backendTexts } from '../../../common/BackendTexts';
import { DefaultsJobs } from '../../../common/entities/job/JobDTO';
2019-12-29 17:24:47 +08:00
@Injectable()
export class BackendtextService {
public get(id: backendText): string {
switch (id) {
case backendTexts.sizeToGenerate.name:
return $localize`Size to generate`;
2019-12-29 17:24:47 +08:00
case backendTexts.sizeToGenerate.description:
return $localize`These thumbnails will be generated. The list should be a subset of the enabled thumbnail sizes`;
2019-12-29 17:24:47 +08:00
case backendTexts.indexedFilesOnly.name:
return $localize`Indexed only`;
2019-12-29 17:24:47 +08:00
case backendTexts.indexedFilesOnly.description:
return $localize`Only checks indexed files.`;
case backendTexts.indexChangesOnly.name:
return $localize`Index changes only`;
2023-07-30 19:04:23 +08:00
case backendTexts.indexChangesOnly.description:
return $localize`Only indexes a folder if it got changed.`;
case backendTexts.mediaPick.name:
return $localize`Media selectors`;
case backendTexts.mediaPick.description:
return $localize`Set these search queries to find photos and videos to email.`;
case backendTexts.emailTo.name:
return $localize`E-mail to`;
case backendTexts.emailTo.description:
return $localize`E-mail address of the recipient.`;
case backendTexts.emailSubject.name:
return $localize`Subject`;
case backendTexts.emailSubject.description:
return $localize`E-mail subject.`;
case backendTexts.emailText.name:
return $localize`Message`;
case backendTexts.emailText.description:
return $localize`E-mail text.`;
2019-12-29 17:24:47 +08:00
default:
return null;
}
}
public getJobName(job: DefaultsJobs | string): string {
if (typeof job === 'string') {
job = DefaultsJobs[job as any];
}
switch (job as DefaultsJobs) {
case DefaultsJobs.Indexing:
return $localize`Indexing`;
case DefaultsJobs['Gallery Reset']:
return $localize`Gallery reset`;
case DefaultsJobs['Album Reset']:
return $localize`Album reset`;
case DefaultsJobs['Thumbnail Generation']:
2023-01-07 18:34:50 +08:00
return $localize`Thumbnail generation`;
case DefaultsJobs['Photo Converting']:
2023-01-07 18:34:50 +08:00
return $localize`Photo converting`;
case DefaultsJobs['Video Converting']:
2023-01-07 18:34:50 +08:00
return $localize`Video converting`;
case DefaultsJobs['Temp Folder Cleaning']:
2023-01-07 18:34:50 +08:00
return $localize`Temp folder cleaning`;
2022-06-26 02:57:45 +08:00
case DefaultsJobs['Preview Filling']:
2023-01-07 18:34:50 +08:00
return $localize`Preview filling`;
2022-06-26 02:57:45 +08:00
case DefaultsJobs['Preview Reset']:
2023-01-07 18:34:50 +08:00
return $localize`Preview reset`;
2022-06-26 02:57:45 +08:00
case DefaultsJobs['GPX Compression']:
2023-01-07 18:34:50 +08:00
return $localize`GPX compression`;
default:
return DefaultsJobs[job as DefaultsJobs];
}
}
2019-12-29 17:24:47 +08:00
}