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,10 +12,42 @@
|
||||
* 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 {SCThing} from '../Thing';
|
||||
import {SCThing, SCThingMeta} from '../Thing';
|
||||
import {SCMetaTranslations} from '../types/i18n';
|
||||
import {SCInPlace} from '../types/Places';
|
||||
|
||||
/**
|
||||
* A thing that is or happens in a place
|
||||
*/
|
||||
export interface SCThingInPlace extends SCThing, SCInPlace {}
|
||||
|
||||
/**
|
||||
* Meta information about thing in a place
|
||||
*/
|
||||
export class SCThingInPlaceMeta extends SCThingMeta implements SCMetaTranslations<SCThingInPlace> {
|
||||
/**
|
||||
* Translations of fields
|
||||
*/
|
||||
fieldTranslations = {
|
||||
de: {
|
||||
... SCThingMeta.getInstance().fieldTranslations.de,
|
||||
inPlace: 'Ort',
|
||||
},
|
||||
en: {
|
||||
... SCThingMeta.getInstance().fieldTranslations.en,
|
||||
inPlace: 'location',
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* Translations of values of fields
|
||||
*/
|
||||
fieldValueTranslations = {
|
||||
de: {
|
||||
... SCThingMeta.getInstance().fieldValueTranslations.de,
|
||||
},
|
||||
en: {
|
||||
... SCThingMeta.getInstance().fieldValueTranslations.en,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user