mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-20 08:33:11 +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
@@ -12,8 +12,9 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {SCAcademicTermWithoutReferences} from '../base/AcademicTerm';
|
||||
import {SCAcademicTermWithoutReferences, SCAcademicTermWithoutReferencesMeta} from '../base/AcademicTerm';
|
||||
import {SCThingMeta, SCThingType} from '../Thing';
|
||||
import {SCMetaTranslations} from '../types/i18n';
|
||||
|
||||
/**
|
||||
* A semester without references
|
||||
@@ -45,17 +46,37 @@ export interface SCSemester extends SCSemesterWithoutReferences {
|
||||
}
|
||||
|
||||
/**
|
||||
* Semester meta data
|
||||
* Meta information about a semester
|
||||
*/
|
||||
export class SCSemesterMeta extends SCThingMeta {
|
||||
static fieldTranslations = {
|
||||
...SCThingMeta.fieldTranslations,
|
||||
export class SCSemesterMeta extends SCThingMeta implements SCMetaTranslations<SCSemester> {
|
||||
/**
|
||||
* Translations of fields
|
||||
*/
|
||||
fieldTranslations = {
|
||||
de: {
|
||||
... SCAcademicTermWithoutReferencesMeta.getInstance().fieldTranslations.de,
|
||||
acronym: 'Abkürzung',
|
||||
endDate: 'Ende',
|
||||
eventsEndDate: 'Vorlesungsschluss',
|
||||
eventsStartDate: 'Vorlesungsbeginn',
|
||||
startDate: 'Beginn',
|
||||
},
|
||||
en: {
|
||||
... SCAcademicTermWithoutReferencesMeta.getInstance().fieldTranslations.en,
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* Translations of values of fields
|
||||
*/
|
||||
fieldValueTranslations = {
|
||||
de: {
|
||||
... SCAcademicTermWithoutReferencesMeta.getInstance().fieldValueTranslations.de,
|
||||
type: 'Semester',
|
||||
},
|
||||
en: {
|
||||
... SCAcademicTermWithoutReferencesMeta.getInstance().fieldValueTranslations.en,
|
||||
type: SCThingType.Semester,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user