diff --git a/src/core/base/AcademicDegree.ts b/src/core/base/AcademicDegree.ts index 68818920..48a2cf07 100644 --- a/src/core/base/AcademicDegree.ts +++ b/src/core/base/AcademicDegree.ts @@ -50,20 +50,22 @@ export interface SCAcademicDegree * Meta information about academic degrees */ export class SCAcademicDegreeMeta - extends SCThingMeta - implements SCMetaTranslations { + extends SCThingMeta implements SCMetaTranslations { /** * Translations of fields */ fieldTranslations = { de: { - ...SCThingMeta.getInstance().fieldTranslations.de, + ...SCThingMeta.getInstance().fieldTranslations.de, academicDegree: 'Hochschulgrad', academicDegreewithField: 'Abschlussbezeichnungen', academicDegreewithFieldShort: 'Abschlussbezeichnungen (kurz)', }, en: { - ...SCThingMeta.getInstance().fieldTranslations.en, + ...SCThingMeta.getInstance().fieldTranslations.en, + academicDegree: 'academic degree', + academicDegreewithField: 'acedemic degree and discipline', + academicDegreewithFieldShort: 'acedemic degree and discipline (short)', }, }; @@ -72,7 +74,7 @@ export class SCAcademicDegreeMeta */ fieldValueTranslations = { de: { - ...SCThingMeta.getInstance().fieldValueTranslations.de, + ...SCThingMeta.getInstance().fieldValueTranslations.de, academicDegree: { 'bachelor': 'Bachelor', 'diploma': 'Diplom', @@ -85,7 +87,7 @@ export class SCAcademicDegreeMeta }, }, en: { - ...SCThingMeta.getInstance().fieldValueTranslations.en, + ...SCThingMeta.getInstance().fieldValueTranslations.en, }, }; } diff --git a/src/core/base/AcademicTerm.ts b/src/core/base/AcademicTerm.ts index 0bd81dfb..1cde5d0d 100644 --- a/src/core/base/AcademicTerm.ts +++ b/src/core/base/AcademicTerm.ts @@ -65,10 +65,20 @@ export class SCAcademicTermWithoutReferencesMeta */ fieldTranslations = { de: { - ...SCThingMeta.getInstance().fieldTranslations.de, + ...SCThingMeta.getInstance().fieldTranslations.de, + acronym: 'Akronym', + endDate: 'Enddatum', + eventsEndDate: 'Enddatum der Veranstaltungen', + eventsStartDate: 'Startdatum der Veranstaltungen', + startDate: 'Startdatum', }, en: { - ...SCThingMeta.getInstance().fieldTranslations.en, + ...SCThingMeta.getInstance().fieldTranslations.en, + acronym: 'acronym', + endDate: 'end date', + eventsEndDate: 'end date of events', + eventsStartDate: 'start date of events', + startDate: 'start date', }, }; @@ -77,10 +87,10 @@ export class SCAcademicTermWithoutReferencesMeta */ fieldValueTranslations = { de: { - ...SCThingMeta.getInstance().fieldValueTranslations.de, + ...SCThingMeta.getInstance().fieldValueTranslations.de, }, en: { - ...SCThingMeta.getInstance().fieldValueTranslations.en, + ...SCThingMeta.getInstance().fieldValueTranslations.en, }, }; } diff --git a/src/core/base/CreativeWork.ts b/src/core/base/CreativeWork.ts index 97ae5067..1590e053 100644 --- a/src/core/base/CreativeWork.ts +++ b/src/core/base/CreativeWork.ts @@ -20,6 +20,7 @@ import {SCISO8601Date} from '../types/Time'; import { SCAcademicPriceGroup, SCThingThatCanBeOffered, + SCThingThatCanBeOfferedMeta, SCThingThatCanBeOfferedTranslatableProperties, SCThingThatCanBeOfferedWithoutReferences, } from './ThingThatCanBeOffered'; @@ -92,10 +93,22 @@ export class SCCreativeWorkMeta */ fieldTranslations = { de: { - ...SCThingMeta.getInstance().fieldTranslations.de, + ... SCThingMeta.getInstance().fieldTranslations.de, + ... SCThingThatCanBeOfferedMeta.getInstance().fieldTranslations.de, + authors: 'Authoren', + datePublished: 'Veröffentlichungsdatum', + inLanguages: 'verfügbare Übersetzungen', + keywords: 'Schlagwörter', + publishers: 'Verleger', }, en: { - ...SCThingMeta.getInstance().fieldTranslations.en, + ... SCThingMeta.getInstance().fieldTranslations.en, + ... SCThingThatCanBeOfferedMeta.getInstance().fieldTranslations.en, + authors: 'authors', + datePublished: 'release date', + inLanguages: 'available Languages', + keywords: 'keywords', + publishers: 'publishers', }, }; @@ -104,10 +117,12 @@ export class SCCreativeWorkMeta */ fieldValueTranslations = { de: { - ...SCThingMeta.getInstance().fieldValueTranslations.de, + ...SCThingMeta.getInstance().fieldValueTranslations.de, + ... SCThingThatCanBeOfferedMeta.getInstance().fieldValueTranslations.en, }, en: { - ...SCThingMeta.getInstance().fieldValueTranslations.en, + ...SCThingMeta.getInstance().fieldValueTranslations.en, + ... SCThingThatCanBeOfferedMeta.getInstance().fieldValueTranslations.en, }, }; } diff --git a/src/core/base/Event.ts b/src/core/base/Event.ts index 735b27f9..6b0957b5 100644 --- a/src/core/base/Event.ts +++ b/src/core/base/Event.ts @@ -82,10 +82,24 @@ export class SCEventMeta */ fieldTranslations = { de: { - ...SCThingMeta.getInstance().fieldTranslations.de, + ... SCThingMeta.getInstance().fieldTranslations.de, + academicTerms: 'Semester', + catalogs: 'Verzeichnis', + creativeWorks: 'begleitende Werke', + maximumParticipants: 'maximale Anzahl an Teilnehmern', + organizers: 'Origanisatoren', + performers: 'Vortragende', + remainingAttendeeCapacity: 'verfügbare Anzahl an Teilnehmern', }, en: { - ...SCThingMeta.getInstance().fieldTranslations.en, + ... SCThingMeta.getInstance().fieldTranslations.en, + academicTerms: 'academic terms', + catalogs: 'catalogs', + creativeWorks: 'related material', + maximumParticipants: 'maximum participants', + organizers: 'organizers', + performers: 'performers', + remainingAttendeeCapacity: 'remaining attendee capacity', }, }; @@ -94,10 +108,10 @@ export class SCEventMeta */ fieldValueTranslations = { de: { - ...SCThingMeta.getInstance().fieldValueTranslations.de, + ...SCThingMeta.getInstance().fieldValueTranslations.de, }, en: { - ...SCThingMeta.getInstance().fieldValueTranslations.en, + ...SCThingMeta.getInstance().fieldValueTranslations.en, }, }; } diff --git a/src/core/base/Place.ts b/src/core/base/Place.ts index abb3489c..e8d33af8 100644 --- a/src/core/base/Place.ts +++ b/src/core/base/Place.ts @@ -76,10 +76,16 @@ export class SCPlaceWithoutReferencesMeta */ fieldTranslations = { de: { - ...SCThingMeta.getInstance().fieldTranslations.de, + ...SCThingMeta.getInstance().fieldTranslations.de, + address: 'Adresse', + geo: 'Geoinformation', + openingHours: 'Öffnungszeiten', }, en: { - ...SCThingMeta.getInstance().fieldTranslations.en, + ...SCThingMeta.getInstance().fieldTranslations.en, + address: 'address', + geo: 'geographic information', + openingHours: 'opening hours', }, }; @@ -88,10 +94,10 @@ export class SCPlaceWithoutReferencesMeta */ fieldValueTranslations = { de: { - ...SCThingMeta.getInstance().fieldValueTranslations.de, + ...SCThingMeta.getInstance().fieldValueTranslations.de, }, en: { - ...SCThingMeta.getInstance().fieldValueTranslations.en, + ...SCThingMeta.getInstance().fieldValueTranslations.en, }, }; } diff --git a/src/core/base/ThingInPlace.ts b/src/core/base/ThingInPlace.ts index f5cb2b52..e78549e9 100644 --- a/src/core/base/ThingInPlace.ts +++ b/src/core/base/ThingInPlace.ts @@ -34,11 +34,11 @@ export class SCThingInPlaceMeta */ fieldTranslations = { de: { - ...SCThingMeta.getInstance().fieldTranslations.de, + ...SCThingMeta.getInstance().fieldTranslations.de, inPlace: 'Ort', }, en: { - ...SCThingMeta.getInstance().fieldTranslations.en, + ...SCThingMeta.getInstance().fieldTranslations.en, inPlace: 'location', }, }; @@ -48,10 +48,10 @@ export class SCThingInPlaceMeta */ fieldValueTranslations = { de: { - ...SCThingMeta.getInstance().fieldValueTranslations.de, + ...SCThingMeta.getInstance().fieldValueTranslations.de, }, en: { - ...SCThingMeta.getInstance().fieldValueTranslations.en, + ...SCThingMeta.getInstance().fieldValueTranslations.en, }, }; } diff --git a/src/core/base/ThingThatAcceptsPayments.ts b/src/core/base/ThingThatAcceptsPayments.ts index 7128f3c4..fca6591c 100644 --- a/src/core/base/ThingThatAcceptsPayments.ts +++ b/src/core/base/ThingThatAcceptsPayments.ts @@ -19,9 +19,9 @@ import {SCMetaTranslations} from '../types/i18n'; * Types of payment that are accepted at a place. */ export type SCThingThatAcceptsPaymentsAcceptedPayments = - 'Cash' - | 'Credit' - | 'Cafeteria Card'; + 'cash' + | 'credit' + | 'cafeteria card'; /** * A thing without references that accepts payments @@ -52,10 +52,12 @@ export class SCThingThatAcceptsPaymentsWithoutReferencesMeta */ fieldTranslations = { de: { - ...SCThingMeta.getInstance().fieldTranslations.de, + ... SCThingMeta.getInstance().fieldTranslations.de, + paymentsAccepted: 'Bezahlmethoden', }, en: { - ...SCThingMeta.getInstance().fieldTranslations.en, + ... SCThingMeta.getInstance().fieldTranslations.en, + paymentsAccepted: 'accepted payment methods', }, }; @@ -64,10 +66,15 @@ export class SCThingThatAcceptsPaymentsWithoutReferencesMeta */ fieldValueTranslations = { de: { - ...SCThingMeta.getInstance().fieldValueTranslations.de, + ... SCThingMeta.getInstance().fieldValueTranslations.de, + paymentsAccepted: { + 'cafeteria card': 'Mensakarte', + 'cash': 'Bar', + 'credit': 'Kreditkarte', + }, }, en: { - ...SCThingMeta.getInstance().fieldValueTranslations.en, + ...SCThingMeta.getInstance().fieldValueTranslations.en, }, }; } diff --git a/src/core/base/ThingThatCanBeOffered.ts b/src/core/base/ThingThatCanBeOffered.ts index a1949d08..0bfaa061 100644 --- a/src/core/base/ThingThatCanBeOffered.ts +++ b/src/core/base/ThingThatCanBeOffered.ts @@ -12,10 +12,10 @@ * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ -import {SCThing, SCThingTranslatableProperties, SCThingWithoutReferences} from '../Thing'; +import {SCThing, SCThingMeta, SCThingTranslatableProperties, SCThingWithoutReferences} from '../Thing'; import {SCOrganizationWithoutReferences} from '../things/Organization'; import {SCPersonWithoutReferences} from '../things/Person'; -import {SCTranslations} from '../types/i18n'; +import {SCMetaTranslations, SCTranslations} from '../types/i18n'; import {SCInPlace} from '../types/Places'; import {SCISO8601Date} from '../types/Time'; @@ -134,3 +134,47 @@ export type SCThingThatCanBeOfferedAvailability = | 'out of stock' | 'online only' | 'limited availability'; + +/** + * Meta information about a thing without references that accepts payments + */ +export class SCThingThatCanBeOfferedMeta implements + SCMetaTranslations> { + + protected static _instance: any; + + /** + * Translations of fields + */ + fieldTranslations = { + de: { + ... SCThingMeta.getInstance().fieldTranslations.de, + offers: 'Angebote', + }, + en: { + ... SCThingMeta.getInstance().fieldTranslations.en, + offers: 'offers', + }, + }; + + /** + * Translations of values of fields + */ + fieldValueTranslations = { + de: { + ... SCThingMeta.getInstance().fieldValueTranslations.de, + }, + en: { + ... SCThingMeta.getInstance().fieldValueTranslations.en, + }, + }; + + /** + * Function to retrieve typed singleton instance (including generics) + */ + public static getInstance(): SCThingThatCanBeOfferedMeta { + return this._instance || (this._instance = new this()); + } + + protected constructor() {} +} diff --git a/src/core/base/ThingWithCategories.ts b/src/core/base/ThingWithCategories.ts index 531f79a9..7ab8940a 100644 --- a/src/core/base/ThingWithCategories.ts +++ b/src/core/base/ThingWithCategories.ts @@ -102,17 +102,21 @@ export interface SCThingWithCategoriesSpecificValues { export class SCThingWithCategoriesWithoutReferencesMeta implements SCMetaTranslations> { - protected static _instance: SCThingMeta; + protected static _instance: any; /** * Translations of fields */ fieldTranslations = { de: { - ...SCThingMeta.getInstance().fieldTranslations.de, + ...SCThingMeta.getInstance().fieldTranslations.de, + categories: 'Kategorien', + categorySpecificValues: 'besondere Kategorien', }, en: { - ...SCThingMeta.getInstance().fieldTranslations.en, + ...SCThingMeta.getInstance().fieldTranslations.en, + categories: 'categories', + categorySpecificValues: 'category with specific values', }, }; @@ -121,10 +125,10 @@ export class SCThingWithCategoriesWithoutReferencesMeta */ fieldValueTranslations = { de: { - ...SCThingMeta.getInstance().fieldValueTranslations.de, + ...SCThingMeta.getInstance().fieldValueTranslations.de, }, en: { - ...SCThingMeta.getInstance().fieldValueTranslations.en, + ...SCThingMeta.getInstance().fieldValueTranslations.en, }, }; diff --git a/src/core/things/AcademicEvent.ts b/src/core/things/AcademicEvent.ts index 6d076e15..4f19a69f 100644 --- a/src/core/things/AcademicEvent.ts +++ b/src/core/things/AcademicEvent.ts @@ -77,6 +77,7 @@ export type SCAcademicEventCategories = | 'seminar' | 'integrated course' | 'written exam' + | 'oral exam' | 'tutorial' | 'project' | 'colloquium' @@ -114,14 +115,22 @@ export class SCAcademicEventMeta */ fieldTranslations = { de: { - ...SCEventMeta.getInstance().fieldTranslations.de, - ...SCThingWithCategoriesWithoutReferencesMeta.getInstance().fieldTranslations.de, + ...SCEventMeta.getInstance().fieldTranslations.de, + ...SCThingWithCategoriesWithoutReferencesMeta.getInstance< + SCAcademicEventCategories, + SCThingWithCategoriesSpecificValues + >().fieldTranslations.de, + majors: 'Hauptfächer', + originalCategory: 'ursprüngliche Kategorie', }, en: { - ...SCEventMeta.getInstance().fieldTranslations.en, - ...SCThingWithCategoriesWithoutReferencesMeta.getInstance().fieldTranslations.en, + ...SCEventMeta.getInstance().fieldTranslations.en, + ...SCThingWithCategoriesWithoutReferencesMeta.getInstance< + SCAcademicEventCategories, + SCThingWithCategoriesSpecificValues + >().fieldTranslations.en, + majors: 'majors', + originalCategory: 'original category', }, }; @@ -130,15 +139,35 @@ export class SCAcademicEventMeta */ fieldValueTranslations = { de: { - ...SCEventMeta.getInstance().fieldValueTranslations.de, - ...SCThingWithCategoriesWithoutReferencesMeta.getInstance().fieldValueTranslations.de, + ...SCEventMeta.getInstance().fieldValueTranslations.de, + ...SCThingWithCategoriesWithoutReferencesMeta.getInstance< + SCAcademicEventCategories, + SCThingWithCategoriesSpecificValues + >().fieldValueTranslations.de, + categories: { + 'colloquium': 'Kolloquium', + 'course': 'Kurs', + 'excursion': 'Exkursion', + 'integrated course': '', + 'introductory class': 'Einführungsveranstaltung', + 'lecture': 'Vorlesung', + 'oral exam': 'mündliche Prüfung', + 'practicum': 'Praktikum', + 'practicum introduction': 'Einführungspraktikum', + 'project': 'Projekt', + 'seminar': 'Seminar', + 'special': 'Sonderveranstalltung', + 'tutorial': 'Tutorium', + 'written exam': 'Schriftilche Prüfung', + }, type: 'akademische Veranstaltung', }, en: { - ...SCEventMeta.getInstance().fieldValueTranslations.en, - ...SCThingWithCategoriesWithoutReferencesMeta.getInstance().fieldValueTranslations.en, + ...SCEventMeta.getInstance().fieldValueTranslations.en, + ...SCThingWithCategoriesWithoutReferencesMeta.getInstance< + SCAcademicEventCategories, + SCThingWithCategoriesSpecificValues + >().fieldValueTranslations.en, type: SCThingType.AcademicEvent, }, }; diff --git a/src/core/things/Article.ts b/src/core/things/Article.ts index 22573cb2..c08bb826 100644 --- a/src/core/things/Article.ts +++ b/src/core/things/Article.ts @@ -95,14 +95,22 @@ export class SCArticleMeta */ fieldTranslations = { de: { - ...SCCreativeWorkMeta.getInstance().fieldTranslations.de, - ...SCThingWithCategoriesWithoutReferencesMeta.getInstance().fieldTranslations.de, + ...SCCreativeWorkMeta.getInstance().fieldTranslations + .de, + ...SCThingWithCategoriesWithoutReferencesMeta.getInstance< + SCArticleCategories, + SCThingWithCategoriesSpecificValues + >().fieldTranslations.de, + articleBody: 'Artikelinhalt', }, en: { - ...SCCreativeWorkMeta.getInstance().fieldTranslations.en, - ...SCThingWithCategoriesWithoutReferencesMeta.getInstance().fieldTranslations.en, + ...SCCreativeWorkMeta.getInstance().fieldTranslations + .en, + ...SCThingWithCategoriesWithoutReferencesMeta.getInstance< + SCArticleCategories, + SCThingWithCategoriesSpecificValues + >().fieldTranslations.en, + articleBody: 'article body', }, }; @@ -111,15 +119,24 @@ export class SCArticleMeta */ fieldValueTranslations = { de: { - ...SCCreativeWorkMeta.getInstance().fieldValueTranslations.de, - ...SCThingWithCategoriesWithoutReferencesMeta.getInstance().fieldValueTranslations.de, + ...SCCreativeWorkMeta.getInstance() + .fieldValueTranslations.de, + ...SCThingWithCategoriesWithoutReferencesMeta.getInstance< + SCArticleCategories, + SCThingWithCategoriesSpecificValues + >().fieldValueTranslations.de, + categories: { + 'unipedia': 'Unipedia', + }, type: 'Artikel', }, en: { - ...SCCreativeWorkMeta.getInstance().fieldValueTranslations.en, - ...SCThingWithCategoriesWithoutReferencesMeta.getInstance().fieldValueTranslations.en, + ...SCCreativeWorkMeta.getInstance() + .fieldValueTranslations.en, + ...SCThingWithCategoriesWithoutReferencesMeta.getInstance< + SCArticleCategories, + SCThingWithCategoriesSpecificValues + >().fieldValueTranslations.en, type: SCThingType.Article, }, }; diff --git a/src/core/things/Book.ts b/src/core/things/Book.ts index 4559d945..3c563e99 100644 --- a/src/core/things/Book.ts +++ b/src/core/things/Book.ts @@ -97,10 +97,18 @@ export class SCBookMeta extends SCThingMeta implements SCMetaTranslations().fieldTranslations + .de, + bookEdition: 'Buchausgabe', + isbn: 'ISBN', + numberOfPages: 'Seitenzahl', }, en: { - ...SCCreativeWorkMeta.getInstance().fieldTranslations.en, + ...SCCreativeWorkMeta.getInstance().fieldTranslations + .en, + bookEdition: 'book edition', + isbn: 'ISBN', + numberOfPages: 'number of pages', }, }; @@ -109,11 +117,13 @@ export class SCBookMeta extends SCThingMeta implements SCMetaTranslations() + .fieldValueTranslations.de, type: 'Buch', }, en: { - ...SCCreativeWorkMeta.getInstance().fieldValueTranslations.en, + ...SCCreativeWorkMeta.getInstance() + .fieldValueTranslations.en, type: SCThingType.Book, }, }; diff --git a/src/core/things/Building.ts b/src/core/things/Building.ts index af091122..47e153f8 100644 --- a/src/core/things/Building.ts +++ b/src/core/things/Building.ts @@ -97,15 +97,24 @@ export class SCBuildingMeta */ fieldTranslations = { de: { - ...SCThingWithCategoriesWithoutReferencesMeta.getInstance().fieldTranslations.de, - ...SCPlaceWithoutReferencesMeta.getInstance().fieldTranslations.de, + ...SCThingWithCategoriesWithoutReferencesMeta.getInstance< + SCBuildingCategories, + SCThingWithCategoriesSpecificValues + >().fieldTranslations.de, + ...SCPlaceWithoutReferencesMeta.getInstance< + SCPlaceWithoutReferencesMeta + >().fieldTranslations.de, floors: 'Etagen', }, en: { - ...SCThingWithCategoriesWithoutReferencesMeta.getInstance().fieldTranslations.en, - ...SCPlaceWithoutReferencesMeta.getInstance().fieldTranslations.en, + ...SCThingWithCategoriesWithoutReferencesMeta.getInstance< + SCBuildingCategories, + SCThingWithCategoriesSpecificValues + >().fieldTranslations.en, + ...SCPlaceWithoutReferencesMeta.getInstance< + SCPlaceWithoutReferencesMeta + >().fieldTranslations.en, + floors: 'floors', }, }; @@ -114,9 +123,13 @@ export class SCBuildingMeta */ fieldValueTranslations = { de: { - ...SCThingWithCategoriesWithoutReferencesMeta.getInstance().fieldValueTranslations.de, - ...SCPlaceWithoutReferencesMeta.getInstance().fieldValueTranslations.de, + ...SCThingWithCategoriesWithoutReferencesMeta.getInstance< + SCBuildingCategories, + SCThingWithCategoriesSpecificValues + >().fieldValueTranslations.de, + ...SCPlaceWithoutReferencesMeta.getInstance< + SCPlaceWithoutReferencesMeta + >().fieldValueTranslations.de, categories: { 'cafe': 'Café', 'canteen': 'Kantine', @@ -130,9 +143,13 @@ export class SCBuildingMeta type: 'Gebäude', }, en: { - ...SCThingWithCategoriesWithoutReferencesMeta.getInstance().fieldValueTranslations.en, - ...SCPlaceWithoutReferencesMeta.getInstance().fieldValueTranslations.en, + ...SCThingWithCategoriesWithoutReferencesMeta.getInstance< + SCBuildingCategories, + SCThingWithCategoriesSpecificValues + >().fieldValueTranslations.en, + ...SCPlaceWithoutReferencesMeta.getInstance< + SCPlaceWithoutReferencesMeta + >().fieldValueTranslations.en, type: SCThingType.Building, }, }; diff --git a/src/core/things/Catalog.ts b/src/core/things/Catalog.ts index 16608afa..b446b649 100644 --- a/src/core/things/Catalog.ts +++ b/src/core/things/Catalog.ts @@ -85,12 +85,24 @@ export class SCCatalogMeta */ fieldTranslations = { de: { - ...SCThingWithCategoriesWithoutReferencesMeta.getInstance().fieldTranslations.de, + ...SCThingWithCategoriesWithoutReferencesMeta.getInstance< + SCCatalogCategories, + SCThingWithCategoriesSpecificValues + >().fieldTranslations.de, + academicTerm: 'Semester', + level: 'Ebene', + superCatalog: 'übergeordnetes Verzeichniss', + superCatalogs: 'übergeordnete Verzeichnisse', }, en: { - ...SCThingWithCategoriesWithoutReferencesMeta.getInstance().fieldTranslations.en, + ...SCThingWithCategoriesWithoutReferencesMeta.getInstance< + SCCatalogCategories, + SCThingWithCategoriesSpecificValues + >().fieldTranslations.en, + academicTerm: 'academic term', + level: 'level', + superCatalog: 'parent catalog', + superCatalogs: 'parent catalogs', }, }; @@ -99,13 +111,20 @@ export class SCCatalogMeta */ fieldValueTranslations = { de: { - ...SCThingWithCategoriesWithoutReferencesMeta.getInstance().fieldValueTranslations.de, + ...SCThingWithCategoriesWithoutReferencesMeta.getInstance< + SCCatalogCategories, + SCThingWithCategoriesSpecificValues + >().fieldValueTranslations.de, + categories: { + 'university events': 'Universitätsveranstaltung', + }, type: 'Verzeichnis', }, en: { - ...SCThingWithCategoriesWithoutReferencesMeta.getInstance().fieldValueTranslations.en, + ...SCThingWithCategoriesWithoutReferencesMeta.getInstance< + SCCatalogCategories, + SCThingWithCategoriesSpecificValues + >().fieldValueTranslations.en, type: SCThingType.Catalog, }, }; diff --git a/src/core/things/CourseOfStudies.ts b/src/core/things/CourseOfStudies.ts index f3f0a506..55dc815e 100644 --- a/src/core/things/CourseOfStudies.ts +++ b/src/core/things/CourseOfStudies.ts @@ -16,6 +16,7 @@ import {SCAcademicDegree, SCAcademicDegreeMeta, SCAcademicDegreeWithoutReference import { SCAcademicPriceGroup, SCThingThatCanBeOffered, + SCThingThatCanBeOfferedMeta, SCThingThatCanBeOfferedTranslatableProperties, SCThingThatCanBeOfferedWithoutReferences, } from '../base/ThingThatCanBeOffered'; @@ -114,10 +115,30 @@ export class SCCourseOfStudiesMeta */ fieldTranslations = { de: { - ...SCAcademicDegreeMeta.getInstance().fieldTranslations.de, + ...SCAcademicDegreeMeta.getInstance() + .fieldTranslations.de, + ...SCThingThatCanBeOfferedMeta.getInstance() + .fieldTranslations.de, + department: 'Fachbereich', + mainLanguage: 'Unterrichtssprache', + major: 'Studienfach', + mode: 'Studiengangsart', + secretary: 'Sekretariat', + startDates: 'Startdatum', + timeMode: 'Zeitmodell', }, en: { - ...SCAcademicDegreeMeta.getInstance().fieldTranslations.en, + ...SCAcademicDegreeMeta.getInstance() + .fieldTranslations.en, + ...SCThingThatCanBeOfferedMeta.getInstance() + .fieldTranslations.de, + department: 'department', + mainLanguage: 'main language', + major: 'major', + mode: 'mode', + secretary: 'secretary', + startDates: 'start dates', + timeMode: 'time mode', }, }; @@ -129,7 +150,11 @@ export class SCCourseOfStudiesMeta ...SCAcademicDegreeMeta.getInstance().fieldValueTranslations.de, modes: { combination: 'Kombinationsstudiengang', - dual: 'Dualer Studiengang', + 'double-degree': 'Doppelstudium', + dual: 'duales Studium', + standard: 'Studium', + }, + timeMode: { fulltime: 'Vollzeitstudiengang', parttime: 'Teilzeitstudiengang', }, @@ -137,11 +162,16 @@ export class SCCourseOfStudiesMeta }, en: { ...SCAcademicDegreeMeta.getInstance().fieldValueTranslations.en, - academicDegree: 'Hochschulabschluss', - department: 'Fachbereich', - major: 'Studienfach', - modes: 'Studiengangsarten', - secretary: 'Sekretariat', + modes: { + combination: 'combination course of studies', + 'double-degree': 'double degree course of studies', + dual: 'dual course of studies', + standard: 'course of studies', + }, + timeMode: { + fulltime: 'full-time', + parttime: 'part-time', + }, type: SCThingType.CourseOfStudies, }, }; diff --git a/src/core/things/DateSeries.ts b/src/core/things/DateSeries.ts index 7f0a813a..13a1f34c 100644 --- a/src/core/things/DateSeries.ts +++ b/src/core/things/DateSeries.ts @@ -22,6 +22,7 @@ import { import {SCThingMeta, SCThingType} from '../Thing'; import {SCMetaTranslations, SCTranslations} from '../types/i18n'; import {SCISO8601Date, SCISO8601Duration} from '../types/Time'; +import {SCThingThatCanBeOfferedMeta} from './../base/ThingThatCanBeOffered'; import {SCAcademicEventWithoutReferences} from './AcademicEvent'; import {SCPersonWithoutReferences} from './Person'; import {SCSportCourseWithoutReferences} from './SportCourse'; @@ -115,10 +116,28 @@ export class SCDateSeriesMeta */ fieldTranslations = { de: { - ...SCThingInPlaceMeta.getInstance().fieldTranslations.de, + ...SCThingInPlaceMeta.getInstance().fieldTranslations + .de, + ...SCThingThatCanBeOfferedMeta.getInstance() + .fieldTranslations.de, + dates: 'Einzeltermine', + duration: 'Dauer', + event: 'Event', + exceptions: 'Ausnahmen', + frequency: 'Frequenz', + performers: 'Vortragende', }, en: { - ...SCThingInPlaceMeta.getInstance().fieldTranslations.en, + ...SCThingInPlaceMeta.getInstance().fieldTranslations + .en, + ...SCThingThatCanBeOfferedMeta.getInstance() + .fieldTranslations.en, + dates: 'dates', + duration: 'duration', + event: 'event', + exceptions: 'exceptions', + frequency: 'frequency', + performers: 'performers', }, }; @@ -127,14 +146,17 @@ export class SCDateSeriesMeta */ fieldValueTranslations = { de: { - ...SCThingInPlaceMeta.getInstance().fieldValueTranslations.de, - dates: 'Einzeltermine', - duration: 'Dauer', - frequency: 'Wiederholung', - type: 'Wiederholungreihe', + ...SCThingInPlaceMeta.getInstance() + .fieldValueTranslations.de, + ...SCThingThatCanBeOfferedMeta.getInstance() + .fieldValueTranslations.de, + type: 'Terminserie', }, en: { - ...SCThingInPlaceMeta.getInstance().fieldValueTranslations.en, + ...SCThingInPlaceMeta.getInstance() + .fieldValueTranslations.en, + ...SCThingThatCanBeOfferedMeta.getInstance() + .fieldValueTranslations.en, type: SCThingType.DateSeries, }, }; diff --git a/src/core/things/Diff.ts b/src/core/things/Diff.ts index 9e46318a..bc6ed8c7 100644 --- a/src/core/things/Diff.ts +++ b/src/core/things/Diff.ts @@ -73,13 +73,18 @@ export class SCDiffMeta */ fieldTranslations = { de: { - ...SCThingMeta.getInstance().fieldTranslations.de, + ...SCThingMeta.getInstance().fieldTranslations.de, action: 'Aktion', changes: 'Änderungen', dateCreated: 'Erstellungsdatum', + object: 'Objekt', }, en: { - ...SCThingMeta.getInstance().fieldTranslations.en, + ...SCThingMeta.getInstance().fieldTranslations.en, + action: 'action', + changes: 'changes', + dateCreated: 'date created', + object: 'object', }, }; @@ -89,6 +94,10 @@ export class SCDiffMeta fieldValueTranslations = { de: { ...SCThingMeta.getInstance().fieldValueTranslations.de, + action: { + 'changed': 'geändert', + 'removed': 'gelöscht', + }, type: 'Unterschied', }, en: { diff --git a/src/core/things/Dish.ts b/src/core/things/Dish.ts index 0a072835..2eedf1db 100644 --- a/src/core/things/Dish.ts +++ b/src/core/things/Dish.ts @@ -27,6 +27,7 @@ import { } from '../base/ThingWithCategories'; import {SCThingMeta, SCThingType} from '../Thing'; import {SCMetaTranslations, SCTranslations} from '../types/i18n'; +import {SCThingThatCanBeOfferedMeta} from './../base/ThingThatCanBeOffered'; /** * A dish without references @@ -176,12 +177,28 @@ export class SCDishMeta */ fieldTranslations = { de: { - ...SCThingWithCategoriesWithoutReferencesMeta.getInstance().fieldTranslations.de, + ...SCThingWithCategoriesWithoutReferencesMeta.getInstance< + SCDishCategories, + SCThingWithCategoriesSpecificValues + >().fieldTranslations.de, + ...SCThingThatCanBeOfferedMeta.getInstance() + .fieldTranslations.de, + additives: 'Zusatzstoffe', + characteristics: 'Merkmale', + dishAddOns: 'Beilagen', + nutrition: 'Nährwertangaben', }, en: { - ...SCThingWithCategoriesWithoutReferencesMeta.getInstance().fieldTranslations.en, + ...SCThingWithCategoriesWithoutReferencesMeta.getInstance< + SCDishCategories, + SCThingWithCategoriesSpecificValues + >().fieldTranslations.en, + ...SCThingThatCanBeOfferedMeta.getInstance() + .fieldTranslations.en, + additives: 'additives', + characteristics: 'characteristics', + dishAddOns: 'side dishes', + nutrition: 'nutrition information', }, }; @@ -190,8 +207,12 @@ export class SCDishMeta */ fieldValueTranslations = { de: { - ...SCThingWithCategoriesWithoutReferencesMeta.getInstance().fieldValueTranslations.de, + ...SCThingWithCategoriesWithoutReferencesMeta.getInstance< + SCDishCategories, + SCThingWithCategoriesSpecificValues + >().fieldValueTranslations.de, + ...SCThingThatCanBeOfferedMeta.getInstance() + .fieldValueTranslations.de, categories: { appetizer: 'Vorspeise', dessert: 'Nachtisch', @@ -203,8 +224,12 @@ export class SCDishMeta type: 'Essen', }, en: { - ...SCThingWithCategoriesWithoutReferencesMeta.getInstance().fieldValueTranslations.en, + ...SCThingWithCategoriesWithoutReferencesMeta.getInstance< + SCDishCategories, + SCThingWithCategoriesSpecificValues + >().fieldValueTranslations.en, + ...SCThingThatCanBeOfferedMeta.getInstance() + .fieldValueTranslations.en, type: SCThingType.Dish, }, }; diff --git a/src/core/things/Floor.ts b/src/core/things/Floor.ts index dda38b5e..a0e9a325 100644 --- a/src/core/things/Floor.ts +++ b/src/core/things/Floor.ts @@ -107,10 +107,16 @@ export class SCFloorMeta */ fieldTranslations = { de: { - ...SCThingInPlaceMeta.getInstance().fieldTranslations.de, + ...SCThingInPlaceMeta.getInstance().fieldTranslations + .de, + floorName: 'Etagenbezeichnung', + plan: 'Grundriss', }, en: { - ...SCThingInPlaceMeta.getInstance().fieldTranslations.en, + ...SCThingInPlaceMeta.getInstance().fieldTranslations + .en, + floorName: 'floor name', + plan: 'plan', }, }; @@ -119,11 +125,13 @@ export class SCFloorMeta */ fieldValueTranslations = { de: { - ...SCThingInPlaceMeta.getInstance().fieldValueTranslations.de, + ...SCThingInPlaceMeta.getInstance() + .fieldValueTranslations.de, type: 'Etage', }, en: { - ...SCThingInPlaceMeta.getInstance().fieldValueTranslations.en, + ...SCThingInPlaceMeta.getInstance() + .fieldValueTranslations.en, type: SCThingType.Floor, }, }; diff --git a/src/core/things/Message.ts b/src/core/things/Message.ts index 1da314eb..1b9e207e 100644 --- a/src/core/things/Message.ts +++ b/src/core/things/Message.ts @@ -102,10 +102,18 @@ export class SCMessageMeta */ fieldTranslations = { de: { - ...SCCreativeWorkMeta.getInstance().fieldTranslations.de, + ...SCCreativeWorkMeta.getInstance().fieldTranslations + .de, + audiences: 'Zielgruppen', + dateCreated: 'Erstellungsdatum', + messageBody: 'Nachrichteninhalt', }, en: { - ...SCCreativeWorkMeta.getInstance().fieldTranslations.en, + ...SCCreativeWorkMeta.getInstance().fieldTranslations + .en, + audiences: 'audiences', + dateCreated: 'date created', + messageBody: 'message body', }, }; @@ -114,11 +122,18 @@ export class SCMessageMeta */ fieldValueTranslations = { de: { - ...SCCreativeWorkMeta.getInstance().fieldValueTranslations.de, + ...SCCreativeWorkMeta.getInstance() + .fieldValueTranslations.de, + audiences: { + 'employees': 'Angestellte', + 'guests': 'Gäste', + 'students': 'Studenten', + }, type: 'Nachricht', }, en: { - ...SCCreativeWorkMeta.getInstance().fieldValueTranslations.en, + ...SCCreativeWorkMeta.getInstance() + .fieldValueTranslations.en, type: SCThingType.Message, }, }; diff --git a/src/core/things/Organization.ts b/src/core/things/Organization.ts index aac3111c..9dbb983c 100644 --- a/src/core/things/Organization.ts +++ b/src/core/things/Organization.ts @@ -12,8 +12,9 @@ * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ -import {SCThingInPlace} from '../base/ThingInPlace'; +import {SCThingInPlace, SCThingInPlaceMeta} from '../base/ThingInPlace'; import {SCThingMeta, SCThingType, SCThingWithoutReferences} from '../Thing'; +import {SCMetaTranslations} from '../types/i18n'; /** * An organization without references @@ -42,5 +43,31 @@ export interface SCOrganization /** * Meta information about an organization */ -export class SCOrganizationMeta extends SCThingMeta { +export class SCOrganizationMeta + extends SCThingMeta implements SCMetaTranslations { + /** + * Translations of fields + */ + fieldTranslations = { + de: { + ...SCThingInPlaceMeta.getInstance().fieldTranslations.de, + }, + en: { + ...SCThingInPlaceMeta.getInstance().fieldTranslations.en, + }, + }; + + /** + * Translations of values of fields + */ + fieldValueTranslations = { + de: { + ...SCThingInPlaceMeta.getInstance().fieldValueTranslations.de, + type: 'Einrichtung', + }, + en: { + ...SCThingInPlaceMeta.getInstance().fieldValueTranslations.en, + type: SCThingType.Organization, + }, + }; } diff --git a/src/core/things/Person.ts b/src/core/things/Person.ts index 2539e2b6..c4a11b16 100644 --- a/src/core/things/Person.ts +++ b/src/core/things/Person.ts @@ -139,10 +139,40 @@ export class SCPersonMeta */ fieldTranslations = { de: { - ...SCThingMeta.getInstance().fieldTranslations.de, + ...SCThingMeta.getInstance().fieldTranslations.de, + additionalName: 'Zusatzname', + affiliations: 'Zugehörigkeiten', + birthDate: 'Geburtsdatum', + email: 'E-Mail', + familyName: 'Nachname', + faxNumber: 'Faxnummer', + gender: 'Geschlecht', + givenName: 'Vorname', + homeLocations: 'Heimatstandorte', + honorificPrefix: 'Ehrentitel', + honorificSuffix: 'Ehrentitel (Suffix)', + jobTitles: 'Berufsbezeichnungen', + nationality: 'Staatsangehörigkeit', + telephone: 'Telefonnummer', + workLocations: 'Arbeitsorte', }, en: { - ...SCThingMeta.getInstance().fieldTranslations.en, + ...SCThingMeta.getInstance().fieldTranslations.en, + additionalName: 'additional name', + affiliations: 'affiliations', + birthDate: 'birth date', + email: 'email', + familyName: 'family name', + faxNumber: 'fax', + gender: 'gender', + givenName: 'given name', + homeLocations: 'home locations', + honorificPrefix: 'honorific title', + honorificSuffix: 'honorific title (suffix)', + jobTitles: 'job titles', + nationality: 'nationality', + telephone: 'telephone', + workLocations: 'work locations', }, }; @@ -151,11 +181,17 @@ export class SCPersonMeta */ fieldValueTranslations = { de: { - ...SCThingMeta.getInstance().fieldValueTranslations.de, + ...SCThingMeta.getInstance().fieldValueTranslations.de, + gender: { + 'female': 'weiblich', + 'inter': 'divers', + 'male': 'männlich', + 'undefined': 'undefiniert', + }, type: 'Person', }, en: { - ...SCThingMeta.getInstance().fieldValueTranslations.en, + ...SCThingMeta.getInstance().fieldValueTranslations.en, type: SCThingType.Person, }, }; diff --git a/src/core/things/PointOfInterest.ts b/src/core/things/PointOfInterest.ts index 5083314d..1d23ba59 100644 --- a/src/core/things/PointOfInterest.ts +++ b/src/core/things/PointOfInterest.ts @@ -13,7 +13,7 @@ * this program. If not, see . */ import {SCPlace, SCPlaceWithoutReferences, SCPlaceWithoutReferencesMeta} from '../base/Place'; -import {SCThingInPlace} from '../base/ThingInPlace'; +import {SCThingInPlace, SCThingInPlaceMeta} from '../base/ThingInPlace'; import { SCThingWithCategories, SCThingWithCategoriesSpecificValues, @@ -81,16 +81,26 @@ export class SCPointOfInterestMeta */ fieldTranslations = { de: { - // tslint:disable-next-line:max-line-length - ...SCThingWithCategoriesWithoutReferencesMeta.getInstance().fieldTranslations.de, - ...SCPlaceWithoutReferencesMeta.getInstance().fieldTranslations.de, + ...SCThingWithCategoriesWithoutReferencesMeta.getInstance< + SCPointOfInterestCategories, + SCThingWithCategoriesSpecificValues + >().fieldTranslations.de, + ...SCPlaceWithoutReferencesMeta.getInstance< + SCPlaceWithoutReferencesMeta + >().fieldTranslations.de, + ...SCThingInPlaceMeta.getInstance().fieldTranslations + .de, }, en: { - // tslint:disable-next-line:max-line-length - ...SCThingWithCategoriesWithoutReferencesMeta.getInstance().fieldTranslations.en, - ...SCPlaceWithoutReferencesMeta.getInstance().fieldTranslations.en, + ...SCThingWithCategoriesWithoutReferencesMeta.getInstance< + SCPointOfInterestCategories, + SCThingWithCategoriesSpecificValues + >().fieldTranslations.en, + ...SCPlaceWithoutReferencesMeta.getInstance< + SCPlaceWithoutReferencesMeta + >().fieldTranslations.en, + ...SCThingInPlaceMeta.getInstance().fieldTranslations + .en, }, }; @@ -99,15 +109,30 @@ export class SCPointOfInterestMeta */ fieldValueTranslations = { de: { - ...SCThingWithCategoriesWithoutReferencesMeta.getInstance().fieldValueTranslations.de, - ...SCPlaceWithoutReferencesMeta.getInstance().fieldValueTranslations.de, + ...SCThingWithCategoriesWithoutReferencesMeta.getInstance< + SCPointOfInterestCategories, + SCThingWithCategoriesSpecificValues + >().fieldValueTranslations.de, + ...SCPlaceWithoutReferencesMeta.getInstance< + SCPlaceWithoutReferencesMeta + >().fieldValueTranslations.de, + categories: { + 'card charger': 'Kartenaufwerter', + 'computer': 'Computer', + 'disabled access': 'barrierefreier Zugang', + 'printer': 'Drucker', + 'validator': 'Validierer', + }, type: 'Sonderziel', }, en: { - ...SCThingWithCategoriesWithoutReferencesMeta.getInstance().fieldValueTranslations.en, - ...SCPlaceWithoutReferencesMeta.getInstance().fieldValueTranslations.en, + ...SCThingWithCategoriesWithoutReferencesMeta.getInstance< + SCPointOfInterestCategories, + SCThingWithCategoriesSpecificValues + >().fieldValueTranslations.en, + ...SCPlaceWithoutReferencesMeta.getInstance< + SCPlaceWithoutReferencesMeta + >().fieldValueTranslations.en, type: SCThingType.PointOfInterest, }, }; diff --git a/src/core/things/Room.ts b/src/core/things/Room.ts index 174fc2f4..66ab3ee6 100644 --- a/src/core/things/Room.ts +++ b/src/core/things/Room.ts @@ -121,18 +121,36 @@ export class SCRoomMeta */ fieldTranslations = { de: { - ...SCPlaceWithoutReferencesMeta.getInstance().fieldTranslations.de, - ...SCThingThatAcceptsPaymentsWithoutReferencesMeta.getInstance().fieldTranslations.de, - ...SCThingWithCategoriesWithoutReferencesMeta.getInstance().fieldTranslations.de, - ...SCThingInPlaceMeta.getInstance().fieldTranslations.de, + ...SCPlaceWithoutReferencesMeta.getInstance< + SCPlaceWithoutReferencesMeta + >().fieldTranslations.de, + ...SCThingThatAcceptsPaymentsWithoutReferencesMeta.getInstance< + SCThingThatAcceptsPaymentsWithoutReferencesMeta + >().fieldTranslations.de, + ...SCThingWithCategoriesWithoutReferencesMeta.getInstance< + SCRoomCategories, + SCRoomSpecificValues + >().fieldTranslations.de, + ...SCThingInPlaceMeta.getInstance().fieldTranslations + .de, + floorName: 'Etagenbezeichnung', + inventory: 'Bestand', }, en: { - ...SCPlaceWithoutReferencesMeta.getInstance().fieldTranslations.en, - ...SCThingThatAcceptsPaymentsWithoutReferencesMeta.getInstance().fieldTranslations.en, - ...SCThingWithCategoriesWithoutReferencesMeta.getInstance().fieldTranslations.en, - ...SCThingInPlaceMeta.getInstance().fieldTranslations.en, + ...SCPlaceWithoutReferencesMeta.getInstance< + SCPlaceWithoutReferencesMeta + >().fieldTranslations.en, + ...SCThingThatAcceptsPaymentsWithoutReferencesMeta.getInstance< + SCThingThatAcceptsPaymentsWithoutReferencesMeta + >().fieldTranslations.en, + ...SCThingWithCategoriesWithoutReferencesMeta.getInstance< + SCRoomCategories, + SCRoomSpecificValues + >().fieldTranslations.en, + ...SCThingInPlaceMeta.getInstance().fieldTranslations + .en, + floorName: 'floor name', + inventory: 'inventory', }, }; @@ -141,11 +159,18 @@ export class SCRoomMeta */ fieldValueTranslations = { de: { - ...SCPlaceWithoutReferencesMeta.getInstance().fieldValueTranslations.de, - ...SCThingThatAcceptsPaymentsWithoutReferencesMeta.getInstance().fieldValueTranslations.de, - ...SCThingWithCategoriesWithoutReferencesMeta.getInstance().fieldValueTranslations.de, - ...SCThingInPlaceMeta.getInstance().fieldValueTranslations.de, + ...SCPlaceWithoutReferencesMeta.getInstance< + SCPlaceWithoutReferencesMeta + >().fieldValueTranslations.de, + ...SCThingThatAcceptsPaymentsWithoutReferencesMeta.getInstance< + SCThingThatAcceptsPaymentsWithoutReferencesMeta + >().fieldValueTranslations.de, + ...SCThingWithCategoriesWithoutReferencesMeta.getInstance< + SCRoomCategories, + SCRoomSpecificValues + >().fieldValueTranslations.de, + ...SCThingInPlaceMeta.getInstance() + .fieldValueTranslations.de, categories: { 'cafe': 'Café', 'canteen': 'Kantine', @@ -164,11 +189,18 @@ export class SCRoomMeta type: 'Raum', }, en: { - ...SCPlaceWithoutReferencesMeta.getInstance().fieldValueTranslations.en, - ...SCThingThatAcceptsPaymentsWithoutReferencesMeta.getInstance().fieldValueTranslations.en, - ...SCThingWithCategoriesWithoutReferencesMeta.getInstance().fieldValueTranslations.en, - ...SCThingInPlaceMeta.getInstance().fieldValueTranslations.en, + ...SCPlaceWithoutReferencesMeta.getInstance< + SCPlaceWithoutReferencesMeta + >().fieldValueTranslations.en, + ...SCThingThatAcceptsPaymentsWithoutReferencesMeta.getInstance< + SCThingThatAcceptsPaymentsWithoutReferencesMeta + >().fieldValueTranslations.en, + ...SCThingWithCategoriesWithoutReferencesMeta.getInstance< + SCRoomCategories, + SCRoomSpecificValues + >().fieldValueTranslations.en, + ...SCThingInPlaceMeta.getInstance() + .fieldValueTranslations.en, type: SCThingType.Room, }, }; diff --git a/src/core/things/Semester.ts b/src/core/things/Semester.ts index f2571cc9..75252e30 100644 --- a/src/core/things/Semester.ts +++ b/src/core/things/Semester.ts @@ -62,7 +62,9 @@ export class SCSemesterMeta */ fieldTranslations = { de: { - ...SCAcademicTermWithoutReferencesMeta.getInstance().fieldTranslations.de, + ...SCAcademicTermWithoutReferencesMeta.getInstance< + SCAcademicTermWithoutReferencesMeta + >().fieldTranslations.de, acronym: 'Abkürzung', endDate: 'Ende', eventsEndDate: 'Vorlesungsschluss', @@ -70,7 +72,14 @@ export class SCSemesterMeta startDate: 'Beginn', }, en: { - ...SCAcademicTermWithoutReferencesMeta.getInstance().fieldTranslations.en, + ...SCAcademicTermWithoutReferencesMeta.getInstance< + SCAcademicTermWithoutReferencesMeta + >().fieldTranslations.en, + acronym: 'acronym', + endDate: 'end date', + eventsEndDate: 'semester ending', + eventsStartDate: 'semester beginning', + startDate: 'start date', }, }; @@ -79,11 +88,15 @@ export class SCSemesterMeta */ fieldValueTranslations = { de: { - ...SCAcademicTermWithoutReferencesMeta.getInstance().fieldValueTranslations.de, + ...SCAcademicTermWithoutReferencesMeta.getInstance< + SCAcademicTermWithoutReferencesMeta + >().fieldValueTranslations.de, type: 'Semester', }, en: { - ...SCAcademicTermWithoutReferencesMeta.getInstance().fieldValueTranslations.en, + ...SCAcademicTermWithoutReferencesMeta.getInstance< + SCAcademicTermWithoutReferencesMeta + >().fieldValueTranslations.en, type: SCThingType.Semester, }, }; diff --git a/src/core/things/Setting.ts b/src/core/things/Setting.ts index b657423d..b5a9fa8b 100644 --- a/src/core/things/Setting.ts +++ b/src/core/things/Setting.ts @@ -22,13 +22,15 @@ import { import {SCThing, SCThingMeta, SCThingType} from '../Thing'; import {SCMetaTranslations, SCTranslations} from '../types/i18n'; -export type SCSettingCategories = string; - /** * A setting without references */ export interface SCSettingWithoutReferences extends SCThingWithCategoriesWithoutReferences { + /** + * Categories of a setting + */ + categories: SCSettingCategories[]; /** * The default value of a setting */ @@ -59,6 +61,15 @@ export interface SCSettingWithoutReferences values?: SCSettingValues; } +/** + * A list of categories for settings + */ +export type SCSettingCategories = + 'profile' + | 'privacy' + | 'credentials' + | 'others'; + /** * The types of input/value a setting object can carry */ @@ -117,20 +128,26 @@ export class SCSettingMeta extends SCThingMeta implements SCMetaTranslations().fieldTranslations.de, + ...SCThingWithCategoriesWithoutReferencesMeta.getInstance< + SCSettingCategories, + SCThingWithCategoriesSpecificValues + >().fieldTranslations.de, defaultValue: 'Standard Wert', inputType: 'Eingabetyp', + order: 'Position', value: 'Wert', values: 'Werte', }, en: { - // tslint:disable-next-line:max-line-length - ...SCThingWithCategoriesWithoutReferencesMeta.getInstance().fieldTranslations.en, + ...SCThingWithCategoriesWithoutReferencesMeta.getInstance< + SCSettingCategories, + SCThingWithCategoriesSpecificValues + >().fieldTranslations.en, defaultValue: 'default value', inputType: 'input type', + order: 'position', + value: 'value', + values: 'values', }, }; @@ -139,9 +156,16 @@ export class SCSettingMeta extends SCThingMeta implements SCMetaTranslations().fieldValueTranslations.de, + ...SCThingWithCategoriesWithoutReferencesMeta.getInstance< + SCSettingCategories, + SCThingWithCategoriesSpecificValues + >().fieldValueTranslations.de, + categories: { + credentials: 'Anmeldedaten', + others: 'Andere', + privacy: 'Privatsphäre', + profile: 'Profil', + }, inputType: { 'multiple choice': 'mehrfach Auswahl', number: 'Zahl', @@ -152,9 +176,10 @@ export class SCSettingMeta extends SCThingMeta implements SCMetaTranslations().fieldValueTranslations.en, + ...SCThingWithCategoriesWithoutReferencesMeta.getInstance< + SCSettingCategories, + SCThingWithCategoriesSpecificValues + >().fieldValueTranslations.en, type: SCThingType.Setting, }, }; diff --git a/src/core/things/SportCourse.ts b/src/core/things/SportCourse.ts index 54e7e789..17a1f7c8 100644 --- a/src/core/things/SportCourse.ts +++ b/src/core/things/SportCourse.ts @@ -51,12 +51,10 @@ export class SCSportCourseMeta */ fieldTranslations = { de: { - ...SCThingMeta.getInstance().fieldTranslations.de, - ...SCEventMeta.getInstance().fieldTranslations.de, + ...SCEventMeta.getInstance().fieldTranslations.de, }, en: { - ...SCThingMeta.getInstance().fieldTranslations.en, - ...SCEventMeta.getInstance().fieldTranslations.en, + ...SCEventMeta.getInstance().fieldTranslations.en, }, }; @@ -65,13 +63,11 @@ export class SCSportCourseMeta */ fieldValueTranslations = { de: { - ...SCThingMeta.getInstance().fieldValueTranslations.de, - ...SCEventMeta.getInstance().fieldValueTranslations.de, + ...SCEventMeta.getInstance().fieldValueTranslations.de, type: 'Sportkurs', }, en: { - ...SCThingMeta.getInstance().fieldValueTranslations.en, - ...SCEventMeta.getInstance().fieldValueTranslations.en, + ...SCEventMeta.getInstance().fieldValueTranslations.en, type: SCThingType.SportCourse, }, }; diff --git a/src/core/things/StudyModule.ts b/src/core/things/StudyModule.ts index 47ce505e..16e29d59 100644 --- a/src/core/things/StudyModule.ts +++ b/src/core/things/StudyModule.ts @@ -21,6 +21,7 @@ import { import {SCThingMeta, SCThingType} from '../Thing'; import {SCLanguage, SCMetaTranslations, SCTranslations} from '../types/i18n'; import {SCMap} from '../types/Map'; +import {SCThingThatCanBeOfferedMeta} from './../base/ThingThatCanBeOffered'; import {SCAcademicEventWithoutReferences} from './AcademicEvent'; import {SCOrganizationWithoutReferences} from './Organization'; import {SCPersonWithoutReferences} from './Person'; @@ -142,6 +143,8 @@ export class SCStudyModuleMeta fieldTranslations = { de: { ...SCThingMeta.getInstance().fieldTranslations.de, + ...SCThingThatCanBeOfferedMeta.getInstance() + .fieldTranslations.de, academicEvents: 'Veranstaltungen', ects: 'ECTS-Punkte', faculty: 'Fachbereich', @@ -154,6 +157,8 @@ export class SCStudyModuleMeta }, en: { ...SCThingMeta.getInstance().fieldTranslations.en, + ...SCThingThatCanBeOfferedMeta.getInstance() + .fieldTranslations.en, academicEvents: 'academic events', ects: 'ECTS points', faculty: 'faculty', @@ -171,7 +176,9 @@ export class SCStudyModuleMeta */ fieldValueTranslations = { de: { - ...SCThingMeta.getInstance().fieldValueTranslations.de, + ...SCThingMeta.getInstance().fieldValueTranslations.de, + ...SCThingThatCanBeOfferedMeta.getInstance() + .fieldValueTranslations.de, necessity: { 'elective': 'Wahlfach', 'optional': 'optional', @@ -180,7 +187,9 @@ export class SCStudyModuleMeta type: 'Studiengangmodul', }, en: { - ...SCThingMeta.getInstance().fieldValueTranslations.en, + ...SCThingMeta.getInstance().fieldValueTranslations.en, + ...SCThingThatCanBeOfferedMeta.getInstance() + .fieldValueTranslations.en, type: SCThingType.StudyModule, }, }; diff --git a/src/core/things/Ticket.ts b/src/core/things/Ticket.ts index f6600081..6ee95038 100644 --- a/src/core/things/Ticket.ts +++ b/src/core/things/Ticket.ts @@ -67,10 +67,18 @@ export class SCTicketMeta */ fieldTranslations = { de: { - ...SCThingInPlaceMeta.getInstance().fieldTranslations.de, + ...SCThingInPlaceMeta.getInstance().fieldTranslations + .de, + approxWaitingTime: 'ungefähre Wartezeit', + currentTicketNumber: 'aktuelle Ticketnummer', + serviceType: 'Service Kategorie', }, en: { - ...SCThingInPlaceMeta.getInstance().fieldTranslations.en, + ...SCThingInPlaceMeta.getInstance().fieldTranslations + .en, + approxWaitingTime: 'approximate waiting time', + currentTicketNumber: 'current ticket number', + serviceType: 'type of service', }, }; @@ -79,11 +87,13 @@ export class SCTicketMeta */ fieldValueTranslations = { de: { - ...SCThingInPlaceMeta.getInstance().fieldValueTranslations.de, + ...SCThingInPlaceMeta.getInstance() + .fieldValueTranslations.de, type: 'Ticket', }, en: { - ...SCThingInPlaceMeta.getInstance().fieldValueTranslations.en, + ...SCThingInPlaceMeta.getInstance() + .fieldValueTranslations.en, type: SCThingType.Ticket, }, }; diff --git a/src/core/things/ToDo.ts b/src/core/things/ToDo.ts index 0485be17..5e913961 100644 --- a/src/core/things/ToDo.ts +++ b/src/core/things/ToDo.ts @@ -85,12 +85,22 @@ export class SCToDoMeta extends SCThingMeta implements SCMetaTranslations().fieldTranslations.de, + ...SCThingWithCategoriesWithoutReferencesMeta.getInstance< + string, + SCThingWithCategoriesSpecificValues + >().fieldTranslations.de, + done: 'Erledigt', + dueDate: 'Fälligkeitsdatum', + priority: 'Priorität', }, en: { - ...SCThingWithCategoriesWithoutReferencesMeta.getInstance().fieldTranslations.en, + ...SCThingWithCategoriesWithoutReferencesMeta.getInstance< + string, + SCThingWithCategoriesSpecificValues + >().fieldTranslations.en, + done: 'done', + dueDate: 'due date', + priority: 'priority', }, }; diff --git a/src/core/things/Tour.ts b/src/core/things/Tour.ts index 93e210c3..774f232f 100644 --- a/src/core/things/Tour.ts +++ b/src/core/things/Tour.ts @@ -55,6 +55,35 @@ export interface SCTour export class SCTourMeta extends SCThingMeta implements SCMetaTranslations { + /** + * Translations of fields + */ + fieldTranslations = { + de: { + ...SCThingMeta.getInstance().fieldTranslations.de, + init: 'Initiales Skript', + steps: 'Schritte', + }, + en: { + ...SCThingMeta.getInstance().fieldTranslations.en, + init: 'initial script', + steps: 'steps', + }, + }; + + /** + * Translations of values of fields + */ + fieldValueTranslations = { + de: { + ...SCThingMeta.getInstance().fieldValueTranslations.de, + type: 'Tour', + }, + en: { + ...SCThingMeta.getInstance().fieldValueTranslations.en, + type: SCThingType.Tour, + }, + }; } /** diff --git a/src/core/things/Video.ts b/src/core/things/Video.ts index 39061433..0525b618 100644 --- a/src/core/things/Video.ts +++ b/src/core/things/Video.ts @@ -127,10 +127,24 @@ export class SCVideoMeta */ fieldTranslations = { de: { - ...SCCreativeWorkMeta.getInstance().fieldTranslations.de, + ...SCCreativeWorkMeta.getInstance().fieldTranslations + .de, + actors: 'Darsteller', + duration: 'Dauer', + sources: 'Quellen', + thumbnails: 'Vorschaubilder', + tracks: 'Spuren', + transcript: 'Transkript', }, en: { - ...SCCreativeWorkMeta.getInstance().fieldTranslations.en, + ...SCCreativeWorkMeta.getInstance().fieldTranslations + .en, + actors: 'actors', + duration: 'duration', + sources: 'sources', + thumbnails: 'thumbnails', + tracks: 'tracks', + transcript: 'transcript', }, }; @@ -139,11 +153,13 @@ export class SCVideoMeta */ fieldValueTranslations = { de: { - ...SCCreativeWorkMeta.getInstance().fieldValueTranslations.de, + ...SCCreativeWorkMeta.getInstance() + .fieldValueTranslations.de, type: 'Video', }, en: { - ...SCCreativeWorkMeta.getInstance().fieldValueTranslations.en, + ...SCCreativeWorkMeta.getInstance() + .fieldValueTranslations.en, type: SCThingType.Video, }, }; @@ -163,7 +179,7 @@ export type SCVideoMimeType = * Video Track Types */ export type SCVideoTrackTypes = - 'captions' + 'closed captions' | 'chapters' | 'description' | 'metadata' diff --git a/src/core/types/i18n.ts b/src/core/types/i18n.ts index c0548b1c..2cbca3f1 100644 --- a/src/core/types/i18n.ts +++ b/src/core/types/i18n.ts @@ -690,7 +690,7 @@ export interface SCTranslations { * (Source: https://stackoverflow.com/a/51365037) */ type RecursivePartial = { - [P in keyof T]?: + [P in keyof T]-?: T[P] extends Array ? Array> : T[P] extends object ? RecursivePartial : T[P];