From ba5cc7bed9850b22f1347ec170d92dce523aa782 Mon Sep 17 00:00:00 2001 From: Agriya Dev5 Date: Thu, 20 May 2021 11:41:09 +0530 Subject: [PATCH 1/5] #100 secolor picker i18n translate changes --- src/editor/components/seColorPicker.js | 5 +++-- src/editor/locale/lang.en.js | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/editor/components/seColorPicker.js b/src/editor/components/seColorPicker.js index 12d7838a..559ee5fc 100644 --- a/src/editor/components/seColorPicker.js +++ b/src/editor/components/seColorPicker.js @@ -1,4 +1,5 @@ /* eslint-disable max-len */ +/* globals svgEditor */ import { jGraduate, jGraduateMethod } from './jgraduate/jQuery.jGraduate.js'; import PaintBox from './PaintBox.js'; @@ -641,7 +642,7 @@ div.jGraduate_Slider img {
- +
@@ -691,7 +692,7 @@ export class SeColorPicker extends HTMLElement { this.setAttribute('title', newValue); break; case 'type': - this.$label.setAttribute('title', `Pick a ${newValue} Paint and Opacity`); + this.$label.setAttribute('title', svgEditor.i18next.t('config.pick_paint_opavity', { newValue: newValue })); break; default: // eslint-disable-next-line no-console diff --git a/src/editor/locale/lang.en.js b/src/editor/locale/lang.en.js index 2afd6069..fa001ee7 100644 --- a/src/editor/locale/lang.en.js +++ b/src/editor/locale/lang.en.js @@ -208,6 +208,8 @@ export default { snapping_stepsize: 'Snapping Step-Size:', grid_color: 'Grid color:', done: "Done", + change_xxx_color: 'Change xxx color', + pick_paint_opavity: 'Pick a {{newValue}} Paint and Opacity' }, notification: { invalidAttrValGiven: 'Invalid value given', From 27a5f1293e9937bc4e84229fbc82623c995caacb Mon Sep 17 00:00:00 2001 From: Agriya Dev5 Date: Thu, 20 May 2021 13:26:12 +0530 Subject: [PATCH 2/5] #100 components i18n translatio changes --- .../components/jgraduate/jQuery.jPicker.js | 92 +++++-------------- src/editor/components/seColorPicker.js | 1 + src/editor/locale/lang.en.js | 26 +++++- 3 files changed, 48 insertions(+), 71 deletions(-) diff --git a/src/editor/components/jgraduate/jQuery.jPicker.js b/src/editor/components/jgraduate/jQuery.jPicker.js index 6b9f2fb2..d078631b 100755 --- a/src/editor/components/jgraduate/jQuery.jPicker.js +++ b/src/editor/components/jgraduate/jQuery.jPicker.js @@ -17,6 +17,7 @@ */ /* eslint-disable no-bitwise */ /* eslint-disable max-len */ +/* globals svgEditor */ import ColorValuePicker from './ColorValuePicker.js'; import Slider from './Slider.js'; import { findPos, mergeDeep } from './Util.js'; @@ -627,10 +628,11 @@ export function jPickerMethod (elem, options, commitCallback, liveCallback, canc if (settings.window.expandable) { const content = document.createElement('span'); content.classList.add('jPicker'); + // eslint-disable-next-line no-unsanitized/property content.innerHTML = `     -   +     `; that.insertAdjacentElement('afterend', content); @@ -1322,45 +1324,46 @@ export function jPickerMethod (elem, options, commitCallback, liveCallback, canc const all = color.active.val('all'); if (win.alphaPrecision < 0) win.alphaPrecision = 0; else if (win.alphaPrecision > 2) win.alphaPrecision = 2; + // eslint-disable-next-line no-unsanitized/property const controlHtml = ` ${win.expandable ? '' : ''} - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - ` : ' '} + ` : ' '}
 

${win.title || localization.text.title}

   

${win.title || svgEditor.i18next.t('config.jpicker_title')}

   
      
${localization.text.newColor}
  
${localization.text.currentColor}

${svgEditor.i18next.t('config.jpicker_new_color')}
  
${svgEditor.i18next.t('config.jpicker_current_color')}

 ° °
 % %


 %



 %

${win.alphaSupport ? `` : ' '}${win.alphaSupport ? ` %` : ' '}${win.alphaSupport ? `` : ' '}${win.alphaSupport ? ` %` : ' '}
${win.alphaSupport ? `${win.alphaSupport ? `
`; if (win.expandable) { @@ -1871,56 +1874,5 @@ export const jPickerDefaults = { width: 25, height: 24 } - }, - localization: { - text: { - title: 'Drag Markers To Pick A Color', - newColor: 'new', - currentColor: 'current', - ok: 'OK', - cancel: 'Cancel' - }, - tooltips: { - colors: { - newColor: 'New Color - Press “OK” To Commit', - currentColor: 'Click To Revert To Original Color' - }, - buttons: { - ok: 'Commit To This Color Selection', - cancel: 'Cancel And Revert To Original Color' - }, - hue: { - radio: 'Set To “Hue” Color Mode', - textbox: 'Enter A “Hue” Value (0-360°)' - }, - saturation: { - radio: 'Set To “Saturation” Color Mode', - textbox: 'Enter A “Saturation” Value (0-100%)' - }, - value: { - radio: 'Set To “Value” Color Mode', - textbox: 'Enter A “Value” Value (0-100%)' - }, - red: { - radio: 'Set To “Red” Color Mode', - textbox: 'Enter A “Red” Value (0-255)' - }, - green: { - radio: 'Set To “Green” Color Mode', - textbox: 'Enter A “Green” Value (0-255)' - }, - blue: { - radio: 'Set To “Blue” Color Mode', - textbox: 'Enter A “Blue” Value (0-255)' - }, - alpha: { - radio: 'Set To “Alpha” Color Mode', - textbox: 'Enter A “Alpha” Value (0-100)' - }, - hex: { - textbox: 'Enter A “Hex” Color Value (#000000-#ffffff)', - alpha: 'Enter A “Alpha” Value (#00-#ff)' - } - } } }; diff --git a/src/editor/components/seColorPicker.js b/src/editor/components/seColorPicker.js index 559ee5fc..3fcecc57 100644 --- a/src/editor/components/seColorPicker.js +++ b/src/editor/components/seColorPicker.js @@ -4,6 +4,7 @@ import { jGraduate, jGraduateMethod } from './jgraduate/jQuery.jGraduate.js'; import PaintBox from './PaintBox.js'; const template = document.createElement('template'); +// eslint-disable-next-line no-unsanitized/property template.innerHTML = `