mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-21 00:52:55 +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,9 +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 {SCCreativeWork, SCCreativeWorkWithoutReferences} from '../base/CreativeWork';
|
||||
import {SCCreativeWork, SCCreativeWorkMeta, SCCreativeWorkWithoutReferences} from '../base/CreativeWork';
|
||||
import {SCThingMeta, SCThingType} from '../Thing';
|
||||
import {SCLanguage} from '../types/i18n';
|
||||
import {SCLanguage, SCMetaTranslations} from '../types/i18n';
|
||||
import {SCISO8601Duration} from '../types/Time';
|
||||
import {SCPersonWithoutReferences} from './Person';
|
||||
|
||||
@@ -114,19 +114,33 @@ export interface SCVideo extends SCCreativeWork, SCVideoWithoutReferences {
|
||||
type: SCThingType.Video;
|
||||
}
|
||||
|
||||
export class SCVideoMeta extends SCThingMeta {
|
||||
static fieldValueTranslations = {
|
||||
...SCThingMeta.fieldValueTranslations,
|
||||
/**
|
||||
* Meta information about a video
|
||||
*/
|
||||
export class SCVideoMeta extends SCThingMeta implements SCMetaTranslations<SCVideo> {
|
||||
/**
|
||||
* Translations of fields
|
||||
*/
|
||||
fieldTranslations = {
|
||||
de: {
|
||||
actors: 'Darsteller',
|
||||
duration: 'Länge',
|
||||
height: 'Höhe',
|
||||
language: 'Sprache',
|
||||
size: 'Größe',
|
||||
sources: 'Quellen',
|
||||
transcript: 'Abschrift',
|
||||
... SCCreativeWorkMeta.getInstance().fieldTranslations.de,
|
||||
},
|
||||
en: {
|
||||
... SCCreativeWorkMeta.getInstance().fieldTranslations.en,
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* Translations of values of fields
|
||||
*/
|
||||
fieldValueTranslations = {
|
||||
de: {
|
||||
... SCCreativeWorkMeta.getInstance().fieldValueTranslations.de,
|
||||
type: 'Video',
|
||||
width: 'Breite',
|
||||
},
|
||||
en: {
|
||||
... SCCreativeWorkMeta.getInstance().fieldValueTranslations.en,
|
||||
type: SCThingType.Video,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user