mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-21 17:12:43 +00:00
refactor: change meta class structure to include types.
Introduce requiredness of translations via implemented interface.
This commit is contained in:
committed by
Karl-Philipp Wulfert
parent
90e3d22399
commit
62975b9ded
@@ -14,6 +14,7 @@
|
||||
*/
|
||||
import {SCThing} from '../Thing';
|
||||
import {SCThingMeta} from '../Thing';
|
||||
import {SCMetaTranslations} from '../types/i18n';
|
||||
|
||||
/**
|
||||
* An academic degree without references
|
||||
@@ -40,19 +41,31 @@ export interface SCAcademicDegreeWithoutReferences extends SCThing {
|
||||
export interface SCAcademicDegree extends SCAcademicDegreeWithoutReferences {
|
||||
}
|
||||
|
||||
export class SCAcademicDegreeMeta extends SCThingMeta {
|
||||
static fieldTranslations = {
|
||||
...SCThingMeta.fieldTranslations,
|
||||
/**
|
||||
* Meta information about academic degrees
|
||||
*/
|
||||
export class SCAcademicDegreeMeta extends SCThingMeta implements SCMetaTranslations<SCAcademicDegree> {
|
||||
/**
|
||||
* Translations of fields
|
||||
*/
|
||||
fieldTranslations = {
|
||||
de: {
|
||||
...SCThingMeta.getInstance().fieldTranslations.de,
|
||||
academicDegree: 'Hochschulgrad',
|
||||
academicDegreewithField: 'Abschlussbezeichnungen',
|
||||
academicDegreewithFieldShort: 'Abschlussbezeichnungen (kurz)',
|
||||
},
|
||||
en: {
|
||||
...SCThingMeta.getInstance().fieldTranslations.en,
|
||||
},
|
||||
};
|
||||
|
||||
static fieldValueTranslations = {
|
||||
...SCThingMeta.fieldValueTranslations,
|
||||
/**
|
||||
* Translations of values of fields
|
||||
*/
|
||||
fieldValueTranslations = {
|
||||
de: {
|
||||
...SCThingMeta.getInstance().fieldValueTranslations.de,
|
||||
academicDegree: {
|
||||
'bachelor': 'Bachelor',
|
||||
'diploma': 'Diplom',
|
||||
@@ -64,6 +77,9 @@ export class SCAcademicDegreeMeta extends SCThingMeta {
|
||||
'state examination': 'Staatsexamen',
|
||||
},
|
||||
},
|
||||
en: {
|
||||
...SCThingMeta.getInstance().fieldValueTranslations.en,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user