#631 web component i18n implement new approach

This commit is contained in:
agriyadev5
2021-08-30 19:16:08 +05:30
parent 8e158eea64
commit 7fc2c93693
15 changed files with 141 additions and 95 deletions

View File

@@ -354,7 +354,7 @@ export default {
return {
name: svgEditor.i18next.t(`${name}:name`),
callback() {
const btitle = svgEditor.i18next.t(`${name}:langListTitle`);
const btitle = `${name}:langListTitle`;
// eslint-disable-next-line no-unsanitized/property
const buttonTemplate = `
<se-button id="mode_connect" title="${btitle}" src="${imgPath}/conn.svg"></se-button>

View File

@@ -83,8 +83,8 @@ export default {
name: svgEditor.i18next.t(`${name}:name`),
callback() {
// Add the button and its handler(s)
const title = svgEditor.i18next.t(`${name}:buttons.0.title`);
const key = svgEditor.i18next.t(`${name}:buttons.0.key`);
const title = `${name}:buttons.0.title`;
const key = `${name}:buttons.0.key`;
// eslint-disable-next-line no-unsanitized/property
const buttonTemplate = `
<se-button id="tool_eyedropper" title="${title}" src="${imgPath}/eye_dropper.svg" shortcut=${key}></se-button>

View File

@@ -164,7 +164,7 @@ export default {
callback () {
// Add the button and its handler(s)
const buttonTemplate = document.createElement("template");
const title = svgEditor.i18next.t(`${name}:buttons.0.title`);
const title = `${name}:buttons.0.title`;
// eslint-disable-next-line no-unsanitized/property
buttonTemplate.innerHTML = `

View File

@@ -43,7 +43,7 @@ export default {
callback() {
// Add the button and its handler(s)
const buttonTemplate = document.createElement("template");
const title = svgEditor.i18next.t(`${name}:buttons.0.title`);
const title = `${name}:buttons.0.title`;
// eslint-disable-next-line no-unsanitized/property
buttonTemplate.innerHTML = `
<se-button id="hello_world" title="${title}" src="${imgPath}/hello_world.svg"></se-button>

View File

@@ -46,7 +46,7 @@ export default {
return {
name: svgEditor.i18next.t(`${name}:name`),
callback() {
const btitle = svgEditor.i18next.t(`${name}:buttons.0.title`);
const btitle = `${name}:buttons.0.title`;
// Add the button and its handler(s)
const buttonTemplate = document.createElement("template");
// eslint-disable-next-line no-unsanitized/property

View File

@@ -81,9 +81,9 @@ export default {
callback() {
// Add the button and its handler(s)
// Note: the star extension needs to be loaded before the polygon extension
const fbtitle = svgEditor.i18next.t(`${name}:title`);
const title_star = svgEditor.i18next.t(`${name}:buttons.0.title`);
const title_polygon = svgEditor.i18next.t(`${name}:buttons.1.title`);
const fbtitle = `${name}:title`;
const title_star = `${name}:buttons.0.title`;
const title_polygon = `${name}:buttons.1.title`;
// eslint-disable-next-line no-unsanitized/property
const buttonTemplate = `
<se-flyingbutton id="tools_polygon" title="${fbtitle}">