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:
|
2021-04-18 02:06:17 +08:00
|
|
|
return $localize`Size to generate`;
|
2019-12-29 17:24:47 +08:00
|
|
|
case backendTexts.sizeToGenerate.description:
|
2021-04-18 02:06:17 +08:00
|
|
|
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:
|
2021-04-18 02:06:17 +08:00
|
|
|
return $localize`Indexed only`;
|
2019-12-29 17:24:47 +08:00
|
|
|
case backendTexts.indexedFilesOnly.description:
|
2021-04-18 02:06:17 +08:00
|
|
|
return $localize`Only checks indexed files.`;
|
2021-05-12 19:56:10 +08:00
|
|
|
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.`;
|
2023-08-04 06:17:54 +08:00
|
|
|
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.`;
|
2023-07-30 18:21:11 +08:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
2019-12-31 00:10:01 +08:00
|
|
|
|
|
|
|
public getJobName(job: DefaultsJobs | string): string {
|
|
|
|
if (typeof job === 'string') {
|
2021-04-18 02:06:17 +08:00
|
|
|
job = DefaultsJobs[job as any];
|
2019-12-31 00:10:01 +08:00
|
|
|
}
|
|
|
|
switch (job as DefaultsJobs) {
|
|
|
|
case DefaultsJobs.Indexing:
|
2021-04-18 02:06:17 +08:00
|
|
|
return $localize`Indexing`;
|
2023-01-08 18:31:47 +08:00
|
|
|
case DefaultsJobs['Gallery Reset']:
|
|
|
|
return $localize`Gallery reset`;
|
|
|
|
case DefaultsJobs['Album Reset']:
|
|
|
|
return $localize`Album reset`;
|
2019-12-31 00:10:01 +08:00
|
|
|
case DefaultsJobs['Thumbnail Generation']:
|
2023-01-07 18:34:50 +08:00
|
|
|
return $localize`Thumbnail generation`;
|
2019-12-31 00:10:01 +08:00
|
|
|
case DefaultsJobs['Photo Converting']:
|
2023-01-07 18:34:50 +08:00
|
|
|
return $localize`Photo converting`;
|
2019-12-31 00:10:01 +08:00
|
|
|
case DefaultsJobs['Video Converting']:
|
2023-01-07 18:34:50 +08:00
|
|
|
return $localize`Video converting`;
|
2019-12-31 00:10:01 +08:00
|
|
|
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`;
|
2019-12-31 00:10:01 +08:00
|
|
|
default:
|
|
|
|
return DefaultsJobs[job as DefaultsJobs];
|
|
|
|
}
|
|
|
|
}
|
2019-12-29 17:24:47 +08:00
|
|
|
}
|