From 7fc2c93693bb54850f2e8bc945394c62de70c69d Mon Sep 17 00:00:00 2001 From: agriyadev5 Date: Mon, 30 Aug 2021 19:16:08 +0530 Subject: [PATCH] #631 web component i18n implement new approach --- src/editor/components/seButton.js | 3 +- src/editor/components/seFlyingButton.js | 3 +- src/editor/components/seInput.js | 24 +++- src/editor/components/seList.js | 3 +- src/editor/components/seSpinInput.js | 26 +++- .../extensions/ext-connector/ext-connector.js | 2 +- .../ext-eyedropper/ext-eyedropper.js | 4 +- src/editor/extensions/ext-grid/ext-grid.js | 2 +- .../ext-helloworld/ext-helloworld.js | 2 +- .../extensions/ext-panning/ext-panning.js | 2 +- .../extensions/ext-polystar/ext-polystar.js | 6 +- src/editor/locale/lang.en.js | 1 + src/editor/panels/LayersPanel.js | 12 +- src/editor/panels/LeftPanel.js | 30 ++--- src/editor/panels/TopPanel.js | 116 +++++++++--------- 15 files changed, 141 insertions(+), 95 deletions(-) diff --git a/src/editor/components/seButton.js b/src/editor/components/seButton.js index f6e5478a..1a2f2f26 100644 --- a/src/editor/components/seButton.js +++ b/src/editor/components/seButton.js @@ -1,3 +1,4 @@ +import { t } from '../locale.js'; const template = document.createElement('template'); // eslint-disable-next-line no-unsanitized/property template.innerHTML = ` @@ -75,7 +76,7 @@ export class ToolButton extends HTMLElement { case 'title': { const shortcut = this.getAttribute('shortcut'); - this.$div.setAttribute('title', `${newValue} ${shortcut ? `[${shortcut}]` : ''}`); + this.$div.setAttribute('title', `${t(newValue)} ${shortcut ? `[${t(shortcut)}]` : ''}`); } break; case 'style': diff --git a/src/editor/components/seFlyingButton.js b/src/editor/components/seFlyingButton.js index ddcc957b..330066c8 100644 --- a/src/editor/components/seFlyingButton.js +++ b/src/editor/components/seFlyingButton.js @@ -1,3 +1,4 @@ +import { t } from '../locale.js'; const template = document.createElement('template'); template.innerHTML = `