From 27a5f1293e9937bc4e84229fbc82623c995caacb Mon Sep 17 00:00:00 2001 From: Agriya Dev5 Date: Thu, 20 May 2021 13:26:12 +0530 Subject: [PATCH] #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 = `