mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-08 06:22:53 +00:00
refactor: align SCCreativeWork to schema.org spec
This commit is contained in:
@@ -12,7 +12,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with
|
* You should have received a copy of the GNU General Public License along with
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
import {SCLanguage, SCMetaTranslations, SCTranslations} from '../../general/i18n';
|
import {SCLanguageCode, SCMetaTranslations, SCTranslations} from '../../general/i18n';
|
||||||
import {SCISO8601Date} from '../../general/time';
|
import {SCISO8601Date} from '../../general/time';
|
||||||
import {SCOrganizationWithoutReferences} from '../organization';
|
import {SCOrganizationWithoutReferences} from '../organization';
|
||||||
import {SCPersonWithoutReferences} from '../person';
|
import {SCPersonWithoutReferences} from '../person';
|
||||||
@@ -30,6 +30,12 @@ import {
|
|||||||
*/
|
*/
|
||||||
export interface SCCreativeWorkWithoutReferences
|
export interface SCCreativeWorkWithoutReferences
|
||||||
extends SCThingWithoutReferences, SCThingThatCanBeOfferedWithoutReferences {
|
extends SCThingWithoutReferences, SCThingThatCanBeOfferedWithoutReferences {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Languages this creative work is available in
|
||||||
|
*/
|
||||||
|
availableLanguages?: SCLanguageCode[];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Date the creative work was published
|
* Date the creative work was published
|
||||||
*
|
*
|
||||||
@@ -38,9 +44,11 @@ export interface SCCreativeWorkWithoutReferences
|
|||||||
datePublished?: SCISO8601Date;
|
datePublished?: SCISO8601Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List of languages this creative work is written/recorded/... in
|
* Languages this creative work is written/recorded/... in
|
||||||
|
*
|
||||||
|
* @filterable
|
||||||
*/
|
*/
|
||||||
inLanguages?: SCLanguage[];
|
inLanguage?: SCLanguageCode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Keywords of the creative work
|
* Keywords of the creative work
|
||||||
@@ -103,9 +111,10 @@ export class SCCreativeWorkMeta
|
|||||||
de: {
|
de: {
|
||||||
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.de,
|
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.de,
|
||||||
...SCThingThatCanBeOfferedMeta.getInstance().fieldTranslations.de,
|
...SCThingThatCanBeOfferedMeta.getInstance().fieldTranslations.de,
|
||||||
authors: 'Authoren',
|
authors: 'Autoren',
|
||||||
|
availableLanguages: 'verfügbare Übersetzungen',
|
||||||
datePublished: 'Veröffentlichungsdatum',
|
datePublished: 'Veröffentlichungsdatum',
|
||||||
inLanguages: 'verfügbare Übersetzungen',
|
inLanguage: 'Inhaltssprache',
|
||||||
keywords: 'Schlagwörter',
|
keywords: 'Schlagwörter',
|
||||||
publishers: 'Verleger',
|
publishers: 'Verleger',
|
||||||
},
|
},
|
||||||
@@ -113,8 +122,9 @@ export class SCCreativeWorkMeta
|
|||||||
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.en,
|
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.en,
|
||||||
...SCThingThatCanBeOfferedMeta.getInstance().fieldTranslations.en,
|
...SCThingThatCanBeOfferedMeta.getInstance().fieldTranslations.en,
|
||||||
authors: 'authors',
|
authors: 'authors',
|
||||||
|
availableLanguages: 'available languages',
|
||||||
datePublished: 'release date',
|
datePublished: 'release date',
|
||||||
inLanguages: 'available Languages',
|
inLanguage: 'content language',
|
||||||
keywords: 'keywords',
|
keywords: 'keywords',
|
||||||
publishers: 'publishers',
|
publishers: 'publishers',
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -267,7 +267,7 @@ export class SCThingTranslator {
|
|||||||
return this.deeptranslate((objTranslatedFromCache as any)[key]);
|
return this.deeptranslate((objTranslatedFromCache as any)[key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const objTranslated = this.translateWholeThingDestructively(clone(obj));
|
const objTranslated = this.translateThingInPlaceDestructively(clone(obj));
|
||||||
this.cache.putObject(objTranslated);
|
this.cache.putObject(objTranslated);
|
||||||
this.sourceCache.putObject(thing);
|
this.sourceCache.putObject(thing);
|
||||||
|
|
||||||
|
|||||||
@@ -21,12 +21,7 @@
|
|||||||
"name": "Symposion Publishing"
|
"name": "Symposion Publishing"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"inLanguages": [
|
"inLanguage": "de",
|
||||||
{
|
|
||||||
"name": "german",
|
|
||||||
"code": "de"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"bookEdition": "2., überarb. u. erw. Aufl.",
|
"bookEdition": "2., überarb. u. erw. Aufl.",
|
||||||
"isbn": "3936608776",
|
"isbn": "3936608776",
|
||||||
"numberOfPages": 537,
|
"numberOfPages": 537,
|
||||||
|
|||||||
Reference in New Issue
Block a user