#631 translate changes

This commit is contained in:
agriyadev5
2021-08-30 20:06:59 +05:30
parent 7fc2c93693
commit c60c5847a0
6 changed files with 78 additions and 43 deletions

View File

@@ -1,6 +1,7 @@
/* eslint-disable max-len */
import { jGraduate, jGraduateMethod } from './jgraduate/jQuery.jGraduate.js';
import PaintBox from './PaintBox.js';
import { t } from '../locale.js';
const template = document.createElement('template');
// eslint-disable-next-line no-unsanitized/property
@@ -673,7 +674,7 @@ export class SeColorPicker extends HTMLElement {
*/
init (i18next) {
this.i18next = i18next;
this.setAttribute('config-change_xxx_color', i18next.t('config.change_xxx_color'));
this.setAttribute('config-change_xxx_color', t('config.change_xxx_color'));
}
/**
* @function observedAttributes
@@ -696,7 +697,7 @@ export class SeColorPicker extends HTMLElement {
this.$logo.setAttribute('src', newValue);
break;
case 'label':
this.setAttribute('title', newValue);
this.setAttribute('title', t(newValue));
break;
case 'type':
this.$label.setAttribute('title', 'config.pick_paint_opavity');

View File

@@ -46,7 +46,7 @@ export class SeList extends HTMLElement {
* @returns {any} observed
*/
static get observedAttributes () {
return [ 'label', 'width', 'height' ];
return [ 'label', 'width', 'height', 'title' ];
}
/**
@@ -59,6 +59,9 @@ export class SeList extends HTMLElement {
attributeChangedCallback (name, oldValue, newValue) {
if (oldValue === newValue) return;
switch (name) {
case 'title':
this.$dropdown.setAttribute('title', `${t(newValue)}`);
break;
case 'label':
this.$label.textContent = t(newValue);
break;
@@ -74,6 +77,21 @@ export class SeList extends HTMLElement {
break;
}
}
/**
* @function get
* @returns {any}
*/
get title () {
return this.getAttribute('title');
}
/**
* @function set
* @returns {void}
*/
set title (value) {
this.setAttribute('title', value);
}
/**
* @function get
* @returns {any}