Languages Editor Example
vce-languages-editor [localized-contents master selected translations]
<div className="e-fullheight">
<div className="e-fullheight__wrapper">
<div className="e-fullheight__container">
<div className="e-fullheight__content e-fullheight__content-6 e-fullheight__content-box">
<div className="e-fullheight__body">
<button id="changeMasterButton">Change master</button>
<br/>
<br/>
<vce-languages-editor
id="languagesEditor"
localized-contents='{
"en-US": {
"content": "English content"
},
"hu-HU": {
"content": "Magyar tartalom",
"other_prop": "2019-05-10T12:51:29.198Z"
},
"de-DE": {
"content": "Deutscher inhalt",
"updated_at": "2019-05-10T12:51:29.198Z"
},
"en-GB": {
"content": "British content"
}
}'
master="en-US"
selected="hu-HU"
translations="{"deleteConfirm":{"title":"Are you sure?","message":"Do you really want to delete this language version?","applyButton":"Delete"}}"
>
<vce-languages-list vce-languages-list />
<vce-languages-dialog vce-languages-dialog />
<vce-languages-change-master-dialog vce-languages-change-master-dialog />
</vce-languages-editor>
</div>
</div>
</div>
</div>
</div>
const changeMasterButton = document.getElementById('changeMasterButton');
const languagesEditor = document.getElementById('languagesEditor');
changeMasterButton.addEventListener('click',(e) => {
languagesEditor.changeMaster();
});