UNPKG

graphdb-workbench

Version:
1 lines 1.52 kB
import{Host,h}from"@stencil/core";import{TranslationService}from"../../services/translation.service";export class TranslateLabel{constructor(){this.unsubscribeTranslationChanged=null,this.translationParameters=[]}connectedCallback(){this.unsubscribeTranslationChanged=TranslationService.onTranslate(this.labelKey,this.translationParameters,e=>this.translatedLabel=e)}disconnectedCallback(){this.unsubscribeTranslationChanged&&(this.unsubscribeTranslationChanged(),this.unsubscribeTranslationChanged=null)}render(){return h(Host,{key:"6f43411609ffbb55a072585c7c1bdd149422b066"},this.translatedLabel)}static get is(){return"translate-label"}static get originalStyleUrls(){return{$:["translate-label.scss"]}}static get styleUrls(){return{$:["translate-label.css"]}}static get properties(){return{labelKey:{type:"string",mutable:!1,complexType:{original:"string",resolved:"string",references:{}},required:!1,optional:!1,docs:{tags:[],text:"Represents a label key."},getter:!1,setter:!1,reflect:!1,attribute:"label-key"},translationParameters:{type:"unknown",mutable:!1,complexType:{original:"TranslationParameter[]",resolved:"TranslationParameter[]",references:{TranslationParameter:{location:"import",path:"@ontotext/workbench-api",id:"../api/dist/ontotext-workbench-api.d.ts::TranslationParameter",referenceLocation:"TranslationParameter"}}},required:!1,optional:!1,docs:{tags:[],text:"Represents an array of translation parameters."},getter:!1,setter:!1,defaultValue:"[]"}}}static get states(){return{translatedLabel:{}}}}