diff --git a/package.json b/package.json index f4fc235ae..a618f4ae4 100644 --- a/package.json +++ b/package.json @@ -14,9 +14,9 @@ }, "scripts": { "lint": "prettier --write \"src/**/*.js\"", - "make:combined-translation-keys": "babel-node scripts/findTranslationKeys.js && babel-node scripts/combineTranslationKeys.js", - "make:translation-keys": "babel-node scripts/findTranslationKeys.js", - "make:arrows": "babel-node scripts/makeArrows.js", + "make:combined-translation-keys": "npm run make:translation-keys && node scripts/combineTranslationKeys.js", + "make:translation-keys": "node scripts/findTranslationKeys.js", + "make:arrows": "node scripts/makeArrows.js", "make:lib": "mkdirp lib && npm run make:lib:js && npm run make:lib:css && npm run make:combined-translation-keys", "make:lib:js": "mkdirp lib && babel src --out-dir lib --ignore=__tests__/* --source-maps", "make:lib:css": "mkdirp lib && babel-node scripts/styles.js && SASS_ENV=ie babel-node scripts/styles.js && babel-node scripts/postcss.js && SASS_ENV=ie babel-node scripts/postcss.js", diff --git a/scripts/combineTranslationKeys.js b/scripts/combineTranslationKeys.js index 952f62c0b..c3a3aef42 100644 --- a/scripts/combineTranslationKeys.js +++ b/scripts/combineTranslationKeys.js @@ -1,23 +1,34 @@ -import path from 'path'; -import fs from 'fs'; +const path = require('path'); +const fs = require('fs'); + +// generalize so we can use this script in other es6 repos +// so you can call: +// combineTranslationKeys ... const pathToCombinedTranslationKeys = path.join( __dirname, './translationKeys/combined-translation-keys.txt' ); -const plotlyJS = { - repository: 'plotly.js', - path: path.join( - __dirname, - '../node_modules/plotly.js/dist/translation-keys.txt' - ), -}; +const plotlyJS = path.join( + __dirname, + '../node_modules/plotly.js/dist/translation-keys.txt' +); + +const editor = path.join(__dirname, './translationKeys/translation-keys.txt'); + +const argvLen = process.argv.length; +const minHasPaths = 4; + +const hasPaths = argvLen >= minHasPaths; -const editor = { - repository: 'react-plotly.js-editor', - path: path.join(__dirname, './translationKeys/translation-keys.txt'), -}; +const inputPaths = hasPaths + ? process.argv.slice(2, argvLen - 1) + : [plotlyJS, editor]; + +const outputPath = hasPaths + ? process.argv[argvLen - 1] + : pathToCombinedTranslationKeys; combineTranslationKeys(); @@ -25,8 +36,10 @@ function combineTranslationKeys() { const dict = {}; let maxLen = 0; - [plotlyJS, editor].forEach(file => { - const lines = fs.readFileSync(file.path, 'utf-8').split(/\r?\n/); + inputPaths.map(relPath => path.resolve(relPath)).forEach(inputPath => { + const lines = fs.readFileSync(inputPath, 'utf-8').split(/\r?\n/); + + const repository = getRepository(inputPath); lines.forEach(line => { const splitString = line.split(/\/\//); @@ -35,9 +48,9 @@ function combineTranslationKeys() { maxLen = Math.max(maxLen, stringToTranslate.length); if (!dict[stringToTranslate]) { - dict[stringToTranslate] = ' // ' + file.repository + ': ' + source; + dict[stringToTranslate] = ' // ' + repository + ': ' + source; } else { - dict[stringToTranslate] += ` && ${file.repository}: ${source}`; + dict[stringToTranslate] += ` && ${repository}: ${source}`; } }); }); @@ -47,10 +60,16 @@ function combineTranslationKeys() { .map(k => k + spaces(maxLen - k.length) + dict[k]) .join('\n'); - fs.writeFile(pathToCombinedTranslationKeys, strings); - console.log( - `combined translation keys were written to: ${pathToCombinedTranslationKeys}` - ); + fs.writeFileSync(outputPath, strings); + console.log(`combined translation keys were written to: ${outputPath}`); +} + +function getRepository(inputPath) { + const dir = path.dirname(inputPath); + if (fs.existsSync(path.join(dir, 'package.json'))) { + return path.basename(dir); + } + return getRepository(dir); } function spaces(len) { diff --git a/scripts/findTranslationKeys.js b/scripts/findTranslationKeys.js index 0f77c8dcc..498bfb6bb 100644 --- a/scripts/findTranslationKeys.js +++ b/scripts/findTranslationKeys.js @@ -1,13 +1,19 @@ -import {transform} from 'babel-core'; -import traverse from 'babel-traverse'; -import fs from 'fs'; -import glob from 'glob'; -import path from 'path'; - -const pathToSrc = path.join(__dirname, '../src'); +const transform = require('babel-core').transform; +const traverse = require('babel-traverse').default; +const fs = require('fs'); +const glob = require('glob'); +const path = require('path'); + +// generalize so we can use this script in other es6 repos +// so you can call: +// findTranslationKeys +const pathToSrc = process.argv[2] || path.join(__dirname, '../src'); const srcGlob = path.join(pathToSrc, '**/*.js'); -const localizeRE = /(^|[\.])(_|localize)$/; +const pathToTranslationKeys = process.argv[3] || path.join( + __dirname, + './translationKeys/translation-keys.txt' +); findLocaleStrings(); @@ -84,11 +90,7 @@ function findLocaleStrings() { .map(k => k + spaces(maxLen - k.length) + ' // ' + dict[k]) .join('\n'); - const pathToTranslationKeys = path.join( - __dirname, - './translationKeys/translation-keys.txt' - ); - fs.writeFile(pathToTranslationKeys, strings); + fs.writeFileSync(pathToTranslationKeys, strings); console.log(`translation keys were written to: ${pathToTranslationKeys}`); }); } diff --git a/scripts/makeArrows.js b/scripts/makeArrows.js index aad64fcfb..eaacc2c0f 100644 --- a/scripts/makeArrows.js +++ b/scripts/makeArrows.js @@ -1,14 +1,22 @@ -import path from 'path'; -import fs from 'fs'; +const path = require('path'); +const fs = require('fs'); -const pathToCombinedTranslationKeys = path.join( +// generalize so we can use this script in other repos +// so you can call: +// makeArrows + +const pathToCombinedTranslationKeys = process.argv[2] || path.join( __dirname, './translationKeys/combined-translation-keys.txt' ); -const pathToArrowsOut = path.join(__dirname, '../src/locales/xx.js'); +const pathToArrowsOut = process.argv[3] || path.join( + __dirname, + '../src/locales/xx.js' +); const wordRE = /^[A-Za-z]+$/; +const maxLineLen = 80; function makeArrows() { const lines = fs @@ -31,7 +39,9 @@ function makeArrows() { const quotedVal = quoteChar + arrowStr + key + arrowStr + quoteChar + ','; const singleLine = ' ' + maybeQuoteKey + ': ' + quotedVal; - if (singleLine.length <= 80) return singleLine; + if (singleLine.length <= maxLineLen) { + return singleLine; + } return ' ' + maybeQuoteKey + ':\n ' + quotedVal; }) @@ -40,13 +50,14 @@ function makeArrows() { const head = 'export default {'; const tail = '};\n'; - fs.writeFile(pathToArrowsOut, [head, entries, tail].join('\n')); + fs.writeFileSync(pathToArrowsOut, [head, entries, tail].join('\n')); console.log('arrows mock translation written to: ' + pathToArrowsOut); } // inferred from the arrow file Greg provided +const arrowFactor = 5.7; function getArrowLen(key) { - return Math.max(1, Math.round(key.length / 5.7)); + return Math.max(1, Math.round(key.length / arrowFactor)); } function arrowPad(n) { diff --git a/scripts/translationKeys/combined-translation-keys.txt b/scripts/translationKeys/combined-translation-keys.txt index 3f8aa0517..a4d6978e7 100644 --- a/scripts/translationKeys/combined-translation-keys.txt +++ b/scripts/translationKeys/combined-translation-keys.txt @@ -1,24 +1,37 @@ -Anchor Point // react-plotly.js-editor: /DefaultEditor.js:249 -Angle // react-plotly.js-editor: /DefaultEditor.js:223 +2D Contour Histogram // react-plotly.js-editor: /components/fields/TraceSelector.js:25 +2D Histogram // react-plotly.js-editor: /components/fields/TraceSelector.js:24 +3D Scatter // react-plotly.js-editor: /components/fields/TraceSelector.js:30 +All // react-plotly.js-editor: /lib/connectAxesToLayout.js:96 +Anchor Point // react-plotly.js-editor: /DefaultEditor.js:248 +Angle // react-plotly.js-editor: /DefaultEditor.js:222 Annotation // react-plotly.js-editor: /components/containers/PanelHeader.js:19 -Arrow // react-plotly.js-editor: /DefaultEditor.js:225 -Arrowhead // react-plotly.js-editor: /DefaultEditor.js:235 -Auto // react-plotly.js-editor: /DefaultEditor.js:174 +Area // react-plotly.js-editor: /components/fields/TraceSelector.js:55 +Arrow // react-plotly.js-editor: /DefaultEditor.js:224 +Arrowhead // react-plotly.js-editor: /DefaultEditor.js:234 +Atlas Map // react-plotly.js-editor: /components/fields/TraceSelector.js:33 +Auto // react-plotly.js-editor: /DefaultEditor.js:173 Autoscale // plotly.js: components/modebar/buttons.js:139 -Axes // react-plotly.js-editor: /DefaultEditor.js:295 -Background Color // react-plotly.js-editor: /DefaultEditor.js:374 -Bar Padding // react-plotly.js-editor: /DefaultEditor.js:144 -Bar Width // react-plotly.js-editor: /DefaultEditor.js:136 +Axes // react-plotly.js-editor: /DefaultEditor.js:294 +Background Color // react-plotly.js-editor: /DefaultEditor.js:373 +Bar // react-plotly.js-editor: /components/fields/TraceSelector.js:21 +Bar Padding // react-plotly.js-editor: /DefaultEditor.js:143 +Bar Width // react-plotly.js-editor: /DefaultEditor.js:135 Bars // react-plotly.js-editor: /components/containers/TraceMarkerSection.js:20 -Blank // react-plotly.js-editor: /DefaultEditor.js:163 -Border Color // react-plotly.js-editor: /DefaultEditor.js:131 -Border Width // react-plotly.js-editor: /DefaultEditor.js:130 -Bottom // react-plotly.js-editor: /DefaultEditor.js:210 -Box Padding // react-plotly.js-editor: /DefaultEditor.js:148 +Blank // react-plotly.js-editor: /DefaultEditor.js:162 +Border Color // react-plotly.js-editor: /DefaultEditor.js:130 +Border Width // react-plotly.js-editor: /DefaultEditor.js:129 +Bottom // react-plotly.js-editor: /DefaultEditor.js:209 +Box // react-plotly.js-editor: /components/fields/TraceSelector.js:20 +Box Padding // react-plotly.js-editor: /DefaultEditor.js:147 Box Select // plotly.js: components/modebar/buttons.js:103 -Box Width // react-plotly.js-editor: /DefaultEditor.js:140 -Canvas // react-plotly.js-editor: /DefaultEditor.js:170 -Center // react-plotly.js-editor: /DefaultEditor.js:261 +Box Width // react-plotly.js-editor: /DefaultEditor.js:139 +Candlestick // react-plotly.js-editor: /components/fields/TraceSelector.js:46 +Canvas // react-plotly.js-editor: /DefaultEditor.js:169 +Carpet // react-plotly.js-editor: /components/fields/TraceSelector.js:42 +Carpet Contour // react-plotly.js-editor: /components/fields/TraceSelector.js:44 +Carpet Scatter // react-plotly.js-editor: /components/fields/TraceSelector.js:43 +Center // react-plotly.js-editor: /DefaultEditor.js:260 +Choropleth // react-plotly.js-editor: /components/fields/TraceSelector.js:34 Click to enter Colorscale title // plotly.js: plots/plots.js:303 Click to enter Component A title // plotly.js: plots/ternary/ternary.js:392 Click to enter Component B title // plotly.js: plots/ternary/ternary.js:406 @@ -26,19 +39,21 @@ Click to enter Component C title Click to enter Plot title // plotly.js: plot_api/plot_api.js:579 Click to enter X axis title // plotly.js: plots/plots.js:301 Click to enter Y axis title // plotly.js: plots/plots.js:302 -Color // react-plotly.js-editor: /DefaultEditor.js:115 +Collapse All // react-plotly.js-editor: /components/containers/PanelHeader.js:55 +Color // react-plotly.js-editor: /DefaultEditor.js:114 Common Case: An 'All' tab might display this message because the X and Y tabs contain different settings. // react-plotly.js-editor: /lib/constants.js:24 Compare data on hover // plotly.js: components/modebar/buttons.js:167 -Connect // react-plotly.js-editor: /DefaultEditor.js:162 -Connect Gaps // react-plotly.js-editor: /DefaultEditor.js:159 +Connect // react-plotly.js-editor: /DefaultEditor.js:161 +Connect Gaps // react-plotly.js-editor: /DefaultEditor.js:158 Continue // react-plotly.js-editor: /components/widgets/text_editors/MultiFormatTextEditor.js:200 Continuing will convert your LaTeX expression into raw text. // react-plotly.js-editor: /components/widgets/text_editors/MultiFormatTextEditor.js:122 Continuing will convert your note to LaTeX-style text. // react-plotly.js-editor: /components/widgets/text_editors/MultiFormatTextEditor.js:117 Continuing will remove your expression. // react-plotly.js-editor: /components/widgets/text_editors/MultiFormatTextEditor.js:127 -Custom // react-plotly.js-editor: /DefaultEditor.js:175 +Contour // react-plotly.js-editor: /components/fields/TraceSelector.js:27 +Custom // react-plotly.js-editor: /DefaultEditor.js:174 Custom Color // react-plotly.js-editor: /components/widgets/ColorPicker.js:52 Default Colors // react-plotly.js-editor: /components/widgets/ColorPicker.js:75 -Display // react-plotly.js-editor: /DefaultEditor.js:91 +Display // react-plotly.js-editor: /DefaultEditor.js:90 Double-click on legend to isolate one trace // plotly.js: components/legend/handle_click.js:90 Double-click to zoom back out // plotly.js: plots/cartesian/dragbox.js:335 Download plot as a png // plotly.js: components/modebar/buttons.js:52 @@ -46,52 +61,63 @@ Edit in Chart Studio Edit in HTML // react-plotly.js-editor: /components/widgets/text_editors/MultiFormatTextEditor.js:35 Edit in Rich Text // react-plotly.js-editor: /components/widgets/text_editors/MultiFormatTextEditor.js:245 Enter Link URL // react-plotly.js-editor: /components/widgets/text_editors/RichText/LinkEditor.js:92 -Filled Area // react-plotly.js-editor: /DefaultEditor.js:101 -Fixed Height // react-plotly.js-editor: /DefaultEditor.js:179 -Fixed Width // react-plotly.js-editor: /DefaultEditor.js:178 -Font Color // react-plotly.js-editor: /DefaultEditor.js:196 -Font Size // react-plotly.js-editor: /DefaultEditor.js:192 -Global Font // react-plotly.js-editor: /DefaultEditor.js:198 +Expand All // react-plotly.js-editor: /components/containers/PanelHeader.js:60 +Filled Area // react-plotly.js-editor: /DefaultEditor.js:100 +Fixed Height // react-plotly.js-editor: /DefaultEditor.js:178 +Fixed Width // react-plotly.js-editor: /DefaultEditor.js:177 +Font Color // react-plotly.js-editor: /DefaultEditor.js:195 +Font Size // react-plotly.js-editor: /DefaultEditor.js:191 +Global Font // react-plotly.js-editor: /DefaultEditor.js:197 Go back // react-plotly.js-editor: /components/widgets/text_editors/MultiFormatTextEditor.js:193 Go to the 'Create' tab to define traces. // react-plotly.js-editor: /components/containers/TraceAccordion.js:54 Heads up! // react-plotly.js-editor: /components/widgets/text_editors/MultiFormatTextEditor.js:180 -Hide // react-plotly.js-editor: /DefaultEditor.js:230 -Horizontal // react-plotly.js-editor: /DefaultEditor.js:123 -Horizontal Positioning // react-plotly.js-editor: /DefaultEditor.js:247 +Heatmap // react-plotly.js-editor: /components/fields/TraceSelector.js:22 +Heatmap GL // react-plotly.js-editor: /components/fields/TraceSelector.js:37 +Hide // react-plotly.js-editor: /DefaultEditor.js:229 +Histogram // react-plotly.js-editor: /components/fields/TraceSelector.js:23 +Horizontal // react-plotly.js-editor: /DefaultEditor.js:122 +Horizontal Positioning // react-plotly.js-editor: /DefaultEditor.js:246 IE only supports svg. Changing format to svg. // plotly.js: components/modebar/buttons.js:60 LaTeX // react-plotly.js-editor: /components/widgets/text_editors/MultiFormatTextEditor.js:30 LaTeX is a math typesetting language that doesn't work with rich text. // react-plotly.js-editor: /components/widgets/text_editors/MultiFormatTextEditor.js:115 Lasso Select // plotly.js: components/modebar/buttons.js:112 -Layout // react-plotly.js-editor: /DefaultEditor.js:169 -Left // react-plotly.js-editor: /DefaultEditor.js:211 -Legend // react-plotly.js-editor: /DefaultEditor.js:347 -Legend Box // react-plotly.js-editor: /DefaultEditor.js:363 -Line Color // react-plotly.js-editor: /DefaultEditor.js:155 -Line Width // react-plotly.js-editor: /DefaultEditor.js:233 -Linear // react-plotly.js-editor: /DefaultEditor.js:319 -Lines // react-plotly.js-editor: /DefaultEditor.js:153 +Layout // react-plotly.js-editor: /DefaultEditor.js:168 +Left // react-plotly.js-editor: /DefaultEditor.js:210 +Legend // react-plotly.js-editor: /DefaultEditor.js:346 +Legend Box // react-plotly.js-editor: /DefaultEditor.js:362 +Line // react-plotly.js-editor: /components/fields/TraceSelector.js:54 +Line Color // react-plotly.js-editor: /DefaultEditor.js:154 +Line Width // react-plotly.js-editor: /DefaultEditor.js:232 +Linear // react-plotly.js-editor: /DefaultEditor.js:318 +Lines // react-plotly.js-editor: /DefaultEditor.js:152 Looks like there aren't any traces defined yet. // react-plotly.js-editor: /components/containers/TraceAccordion.js:53 -Margin Color // react-plotly.js-editor: /DefaultEditor.js:181 -Margins and Padding // react-plotly.js-editor: /DefaultEditor.js:208 -Max // react-plotly.js-editor: /DefaultEditor.js:315 -Middle // react-plotly.js-editor: /DefaultEditor.js:284 -Min // react-plotly.js-editor: /DefaultEditor.js:314 +Margin Color // react-plotly.js-editor: /DefaultEditor.js:180 +Margins and Padding // react-plotly.js-editor: /DefaultEditor.js:207 +Max // react-plotly.js-editor: /DefaultEditor.js:314 +Mesh3d // react-plotly.js-editor: /components/fields/TraceSelector.js:32 +Middle // react-plotly.js-editor: /DefaultEditor.js:283 +Min // react-plotly.js-editor: /DefaultEditor.js:313 Multiple Values // react-plotly.js-editor: /lib/constants.js:18 -Normal // react-plotly.js-editor: /DefaultEditor.js:433 -Note Text // react-plotly.js-editor: /DefaultEditor.js:218 -Notes // react-plotly.js-editor: /DefaultEditor.js:216 -Opacity // react-plotly.js-editor: /DefaultEditor.js:76 +Normal // react-plotly.js-editor: /DefaultEditor.js:432 +Note Text // react-plotly.js-editor: /DefaultEditor.js:217 +Notes // react-plotly.js-editor: /DefaultEditor.js:215 +OHLC // react-plotly.js-editor: /components/fields/TraceSelector.js:45 +Opacity // react-plotly.js-editor: /DefaultEditor.js:75 Orbital rotation // plotly.js: components/modebar/buttons.js:279 -Orientation // react-plotly.js-editor: /DefaultEditor.js:420 -Padding // react-plotly.js-editor: /DefaultEditor.js:213 +Orientation // react-plotly.js-editor: /DefaultEditor.js:419 +Padding // react-plotly.js-editor: /DefaultEditor.js:212 Pan // plotly.js: components/modebar/buttons.js:94 -Plot Background // react-plotly.js-editor: /DefaultEditor.js:180 +Parallel Coordinates // react-plotly.js-editor: /components/fields/TraceSelector.js:38 +Pie // react-plotly.js-editor: /components/fields/TraceSelector.js:26 +Plot Background // react-plotly.js-editor: /DefaultEditor.js:179 +Point Cloud // react-plotly.js-editor: /components/fields/TraceSelector.js:36 Points // react-plotly.js-editor: /components/containers/TraceMarkerSection.js:22 -Position // react-plotly.js-editor: /DefaultEditor.js:268 -Positioning // react-plotly.js-editor: /DefaultEditor.js:378 +Polar Scatter // react-plotly.js-editor: /components/fields/TraceSelector.js:47 +Position // react-plotly.js-editor: /DefaultEditor.js:267 +Positioning // react-plotly.js-editor: /DefaultEditor.js:377 Produced with Plotly // plotly.js: components/modebar/modebar.js:256 -Range // react-plotly.js-editor: /DefaultEditor.js:304 -Relative To // react-plotly.js-editor: /DefaultEditor.js:267 +Range // react-plotly.js-editor: /DefaultEditor.js:303 +Relative To // react-plotly.js-editor: /DefaultEditor.js:266 Reset // plotly.js: components/modebar/buttons.js:431 Reset axes // plotly.js: components/modebar/buttons.js:148 Reset camera to default // plotly.js: components/modebar/buttons.js:313 @@ -99,51 +125,59 @@ Reset camera to last save Reset view // plotly.js: components/modebar/buttons.js:582 Reset views // plotly.js: components/modebar/buttons.js:528 Return to the Graph > Create menu above to add data. // react-plotly.js-editor: /components/containers/TraceAccordion.js:32 -Reversed // react-plotly.js-editor: /DefaultEditor.js:434 +Reversed // react-plotly.js-editor: /DefaultEditor.js:433 Rich Text // react-plotly.js-editor: /components/widgets/text_editors/MultiFormatTextEditor.js:25 Rich text is incompatible with LaTeX. // react-plotly.js-editor: /components/widgets/text_editors/MultiFormatTextEditor.js:121 -Right // react-plotly.js-editor: /DefaultEditor.js:212 -Scale // react-plotly.js-editor: /DefaultEditor.js:237 -Selection // react-plotly.js-editor: /DefaultEditor.js:306 -Shape // react-plotly.js-editor: /DefaultEditor.js:157 -Show // react-plotly.js-editor: /DefaultEditor.js:229 +Right // react-plotly.js-editor: /DefaultEditor.js:211 +Sankey // react-plotly.js-editor: /components/fields/TraceSelector.js:40 +Satellite Map // react-plotly.js-editor: /components/fields/TraceSelector.js:39 +Scale // react-plotly.js-editor: /DefaultEditor.js:236 +Scatter // react-plotly.js-editor: /components/fields/TraceSelector.js:19 +Scatter GL // react-plotly.js-editor: /components/fields/TraceSelector.js:35 +Selection // react-plotly.js-editor: /DefaultEditor.js:305 +Shape // react-plotly.js-editor: /DefaultEditor.js:156 +Show // react-plotly.js-editor: /DefaultEditor.js:228 Show closest data on hover // plotly.js: components/modebar/buttons.js:157 -Size // react-plotly.js-editor: /DefaultEditor.js:128 -Size and Spacing // react-plotly.js-editor: /DefaultEditor.js:134 +Size // react-plotly.js-editor: /DefaultEditor.js:127 +Size and Spacing // react-plotly.js-editor: /DefaultEditor.js:133 Snapshot succeeded // plotly.js: components/modebar/buttons.js:66 Sorry, there was a problem downloading your snapshot! // plotly.js: components/modebar/buttons.js:69 -Symbol // react-plotly.js-editor: /DefaultEditor.js:129 +Surface // react-plotly.js-editor: /components/fields/TraceSelector.js:31 +Symbol // react-plotly.js-editor: /DefaultEditor.js:128 +Table // react-plotly.js-editor: /components/fields/TraceSelector.js:41 Taking snapshot - this may take a few seconds // plotly.js: components/modebar/buttons.js:57 -Text // react-plotly.js-editor: /DefaultEditor.js:358 -Text Attributes // react-plotly.js-editor: /DefaultEditor.js:79 -The anchor point determines which side of the annotation's positioning coordinates refer to. // react-plotly.js-editor: /DefaultEditor.js:252 -The positioning inputs are relative to the anchor points on the text box. // react-plotly.js-editor: /DefaultEditor.js:383 +Ternary Scatter // react-plotly.js-editor: /components/fields/TraceSelector.js:28 +Text // react-plotly.js-editor: /DefaultEditor.js:357 +Text Attributes // react-plotly.js-editor: /DefaultEditor.js:78 +The anchor point determines which side of the annotation's positioning coordinates refer to. // react-plotly.js-editor: /DefaultEditor.js:251 +The positioning inputs are relative to the anchor points on the text box. // react-plotly.js-editor: /DefaultEditor.js:382 This input has multiple values associated with it. Changing this setting will override these custom inputs. // react-plotly.js-editor: /lib/constants.js:20 This trace does not yet have any data. // react-plotly.js-editor: /components/containers/TraceAccordion.js:30 -Tick Labels // react-plotly.js-editor: /DefaultEditor.js:329 -Tick Markers // react-plotly.js-editor: /DefaultEditor.js:337 -Title // react-plotly.js-editor: /DefaultEditor.js:184 -Title and Fonts // react-plotly.js-editor: /DefaultEditor.js:183 -Titles // react-plotly.js-editor: /DefaultEditor.js:296 +Tick Labels // react-plotly.js-editor: /DefaultEditor.js:328 +Tick Markers // react-plotly.js-editor: /DefaultEditor.js:336 +Title // react-plotly.js-editor: /DefaultEditor.js:183 +Title and Fonts // react-plotly.js-editor: /DefaultEditor.js:182 +Titles // react-plotly.js-editor: /DefaultEditor.js:295 Toggle Spike Lines // plotly.js: components/modebar/buttons.js:547 Toggle show closest data on hover // plotly.js: components/modebar/buttons.js:352 -Top // react-plotly.js-editor: /DefaultEditor.js:209 +Top // react-plotly.js-editor: /DefaultEditor.js:208 Trace // react-plotly.js-editor: /components/containers/PanelHeader.js:14 -Trace Order // react-plotly.js-editor: /DefaultEditor.js:429 +Trace Order // react-plotly.js-editor: /DefaultEditor.js:428 Trace opacity is not supported for a scatter trace with fill or for a scatter trace that gets filled by another scatter trace. // react-plotly.js-editor: /components/containers/Section.js:65 Turntable rotation // plotly.js: components/modebar/buttons.js:288 -Type // react-plotly.js-editor: /DefaultEditor.js:156 -Typeface // react-plotly.js-editor: /DefaultEditor.js:187 +Type // react-plotly.js-editor: /DefaultEditor.js:155 +Typeface // react-plotly.js-editor: /DefaultEditor.js:186 URL // react-plotly.js-editor: /components/widgets/text_editors/RichText/LinkEditor.js:93 -Vertical // react-plotly.js-editor: /DefaultEditor.js:122 -Vertical Positioning // react-plotly.js-editor: /DefaultEditor.js:270 -Width // react-plotly.js-editor: /DefaultEditor.js:154 -X Position // react-plotly.js-editor: /DefaultEditor.js:408 -X Vector // react-plotly.js-editor: /DefaultEditor.js:244 -Y Position // react-plotly.js-editor: /DefaultEditor.js:414 -Y Vector // react-plotly.js-editor: /DefaultEditor.js:245 +Vertical // react-plotly.js-editor: /DefaultEditor.js:121 +Vertical Positioning // react-plotly.js-editor: /DefaultEditor.js:269 +Violin // react-plotly.js-editor: /components/fields/TraceSelector.js:29 +Width // react-plotly.js-editor: /DefaultEditor.js:153 +X Position // react-plotly.js-editor: /DefaultEditor.js:407 +X Vector // react-plotly.js-editor: /DefaultEditor.js:243 +Y Position // react-plotly.js-editor: /DefaultEditor.js:413 +Y Vector // react-plotly.js-editor: /DefaultEditor.js:244 Zoom // plotly.js: components/modebar/buttons.js:85 -Zoom Interactivity // react-plotly.js-editor: /DefaultEditor.js:340 +Zoom Interactivity // react-plotly.js-editor: /DefaultEditor.js:339 Zoom in // plotly.js: components/modebar/buttons.js:121 Zoom out // plotly.js: components/modebar/buttons.js:130 close: // plotly.js: traces/ohlc/transform.js:139 @@ -151,7 +185,7 @@ high: incoming flow count: // plotly.js: traces/sankey/plot.js:142 kde: // plotly.js: traces/violin/calc.js:73 lat: // plotly.js: traces/scattergeo/calc.js:48 -log // react-plotly.js-editor: /DefaultEditor.js:320 +log // react-plotly.js-editor: /DefaultEditor.js:319 lon: // plotly.js: traces/scattergeo/calc.js:49 low: // plotly.js: traces/ohlc/transform.js:138 lower fence: // plotly.js: traces/box/calc.js:134 @@ -160,10 +194,12 @@ mean ± σ: mean: // plotly.js: traces/box/calc.js:133 median: // plotly.js: traces/box/calc.js:128 min: // plotly.js: traces/box/calc.js:129 +no results... // react-plotly.js-editor: /components/widgets/Dropdown.js:76 open: // plotly.js: traces/ohlc/transform.js:136 outgoing flow count: // plotly.js: traces/sankey/plot.js:143 q1: // plotly.js: traces/box/calc.js:130 q3: // plotly.js: traces/box/calc.js:131 +select an option... // react-plotly.js-editor: /components/widgets/Dropdown.js:67 source: // plotly.js: traces/sankey/plot.js:140 target: // plotly.js: traces/sankey/plot.js:141 trace // plotly.js: plots/plots.js:305 diff --git a/scripts/translationKeys/translation-keys.txt b/scripts/translationKeys/translation-keys.txt index 76838a4ca..7bec32f00 100644 --- a/scripts/translationKeys/translation-keys.txt +++ b/scripts/translationKeys/translation-keys.txt @@ -1,114 +1,150 @@ -Anchor Point // /DefaultEditor.js:249 -Angle // /DefaultEditor.js:223 +2D Contour Histogram // /components/fields/TraceSelector.js:25 +2D Histogram // /components/fields/TraceSelector.js:24 +3D Scatter // /components/fields/TraceSelector.js:30 +All // /lib/connectAxesToLayout.js:96 +Anchor Point // /DefaultEditor.js:248 +Angle // /DefaultEditor.js:222 Annotation // /components/containers/PanelHeader.js:19 -Arrow // /DefaultEditor.js:225 -Arrowhead // /DefaultEditor.js:235 -Auto // /DefaultEditor.js:174 -Axes // /DefaultEditor.js:295 -Background Color // /DefaultEditor.js:374 -Bar Padding // /DefaultEditor.js:144 -Bar Width // /DefaultEditor.js:136 +Area // /components/fields/TraceSelector.js:55 +Arrow // /DefaultEditor.js:224 +Arrowhead // /DefaultEditor.js:234 +Atlas Map // /components/fields/TraceSelector.js:33 +Auto // /DefaultEditor.js:173 +Axes // /DefaultEditor.js:294 +Background Color // /DefaultEditor.js:373 +Bar // /components/fields/TraceSelector.js:21 +Bar Padding // /DefaultEditor.js:143 +Bar Width // /DefaultEditor.js:135 Bars // /components/containers/TraceMarkerSection.js:20 -Blank // /DefaultEditor.js:163 -Border Color // /DefaultEditor.js:131 -Border Width // /DefaultEditor.js:130 -Bottom // /DefaultEditor.js:210 -Box Padding // /DefaultEditor.js:148 -Box Width // /DefaultEditor.js:140 -Canvas // /DefaultEditor.js:170 -Center // /DefaultEditor.js:261 -Color // /DefaultEditor.js:115 +Blank // /DefaultEditor.js:162 +Border Color // /DefaultEditor.js:130 +Border Width // /DefaultEditor.js:129 +Bottom // /DefaultEditor.js:209 +Box // /components/fields/TraceSelector.js:20 +Box Padding // /DefaultEditor.js:147 +Box Width // /DefaultEditor.js:139 +Candlestick // /components/fields/TraceSelector.js:46 +Canvas // /DefaultEditor.js:169 +Carpet // /components/fields/TraceSelector.js:42 +Carpet Contour // /components/fields/TraceSelector.js:44 +Carpet Scatter // /components/fields/TraceSelector.js:43 +Center // /DefaultEditor.js:260 +Choropleth // /components/fields/TraceSelector.js:34 +Collapse All // /components/containers/PanelHeader.js:55 +Color // /DefaultEditor.js:114 Common Case: An 'All' tab might display this message because the X and Y tabs contain different settings. // /lib/constants.js:24 -Connect // /DefaultEditor.js:162 -Connect Gaps // /DefaultEditor.js:159 +Connect // /DefaultEditor.js:161 +Connect Gaps // /DefaultEditor.js:158 Continue // /components/widgets/text_editors/MultiFormatTextEditor.js:200 Continuing will convert your LaTeX expression into raw text. // /components/widgets/text_editors/MultiFormatTextEditor.js:122 Continuing will convert your note to LaTeX-style text. // /components/widgets/text_editors/MultiFormatTextEditor.js:117 Continuing will remove your expression. // /components/widgets/text_editors/MultiFormatTextEditor.js:127 -Custom // /DefaultEditor.js:175 +Contour // /components/fields/TraceSelector.js:27 +Custom // /DefaultEditor.js:174 Custom Color // /components/widgets/ColorPicker.js:52 Default Colors // /components/widgets/ColorPicker.js:75 -Display // /DefaultEditor.js:91 +Display // /DefaultEditor.js:90 Edit in HTML // /components/widgets/text_editors/MultiFormatTextEditor.js:35 Edit in Rich Text // /components/widgets/text_editors/MultiFormatTextEditor.js:245 Enter Link URL // /components/widgets/text_editors/RichText/LinkEditor.js:92 -Filled Area // /DefaultEditor.js:101 -Fixed Height // /DefaultEditor.js:179 -Fixed Width // /DefaultEditor.js:178 -Font Color // /DefaultEditor.js:196 -Font Size // /DefaultEditor.js:192 -Global Font // /DefaultEditor.js:198 +Expand All // /components/containers/PanelHeader.js:60 +Filled Area // /DefaultEditor.js:100 +Fixed Height // /DefaultEditor.js:178 +Fixed Width // /DefaultEditor.js:177 +Font Color // /DefaultEditor.js:195 +Font Size // /DefaultEditor.js:191 +Global Font // /DefaultEditor.js:197 Go back // /components/widgets/text_editors/MultiFormatTextEditor.js:193 Go to the 'Create' tab to define traces. // /components/containers/TraceAccordion.js:54 Heads up! // /components/widgets/text_editors/MultiFormatTextEditor.js:180 -Hide // /DefaultEditor.js:230 -Horizontal // /DefaultEditor.js:123 -Horizontal Positioning // /DefaultEditor.js:247 +Heatmap // /components/fields/TraceSelector.js:22 +Heatmap GL // /components/fields/TraceSelector.js:37 +Hide // /DefaultEditor.js:229 +Histogram // /components/fields/TraceSelector.js:23 +Horizontal // /DefaultEditor.js:122 +Horizontal Positioning // /DefaultEditor.js:246 LaTeX // /components/widgets/text_editors/MultiFormatTextEditor.js:30 LaTeX is a math typesetting language that doesn't work with rich text. // /components/widgets/text_editors/MultiFormatTextEditor.js:115 -Layout // /DefaultEditor.js:169 -Left // /DefaultEditor.js:211 -Legend // /DefaultEditor.js:347 -Legend Box // /DefaultEditor.js:363 -Line Color // /DefaultEditor.js:155 -Line Width // /DefaultEditor.js:233 -Linear // /DefaultEditor.js:319 -Lines // /DefaultEditor.js:153 +Layout // /DefaultEditor.js:168 +Left // /DefaultEditor.js:210 +Legend // /DefaultEditor.js:346 +Legend Box // /DefaultEditor.js:362 +Line // /components/fields/TraceSelector.js:54 +Line Color // /DefaultEditor.js:154 +Line Width // /DefaultEditor.js:232 +Linear // /DefaultEditor.js:318 +Lines // /DefaultEditor.js:152 Looks like there aren't any traces defined yet. // /components/containers/TraceAccordion.js:53 -Margin Color // /DefaultEditor.js:181 -Margins and Padding // /DefaultEditor.js:208 -Max // /DefaultEditor.js:315 -Middle // /DefaultEditor.js:284 -Min // /DefaultEditor.js:314 +Margin Color // /DefaultEditor.js:180 +Margins and Padding // /DefaultEditor.js:207 +Max // /DefaultEditor.js:314 +Mesh3d // /components/fields/TraceSelector.js:32 +Middle // /DefaultEditor.js:283 +Min // /DefaultEditor.js:313 Multiple Values // /lib/constants.js:18 -Normal // /DefaultEditor.js:433 -Note Text // /DefaultEditor.js:218 -Notes // /DefaultEditor.js:216 -Opacity // /DefaultEditor.js:76 -Orientation // /DefaultEditor.js:420 -Padding // /DefaultEditor.js:213 -Plot Background // /DefaultEditor.js:180 +Normal // /DefaultEditor.js:432 +Note Text // /DefaultEditor.js:217 +Notes // /DefaultEditor.js:215 +OHLC // /components/fields/TraceSelector.js:45 +Opacity // /DefaultEditor.js:75 +Orientation // /DefaultEditor.js:419 +Padding // /DefaultEditor.js:212 +Parallel Coordinates // /components/fields/TraceSelector.js:38 +Pie // /components/fields/TraceSelector.js:26 +Plot Background // /DefaultEditor.js:179 +Point Cloud // /components/fields/TraceSelector.js:36 Points // /components/containers/TraceMarkerSection.js:22 -Position // /DefaultEditor.js:268 -Positioning // /DefaultEditor.js:378 -Range // /DefaultEditor.js:304 -Relative To // /DefaultEditor.js:267 +Polar Scatter // /components/fields/TraceSelector.js:47 +Position // /DefaultEditor.js:267 +Positioning // /DefaultEditor.js:377 +Range // /DefaultEditor.js:303 +Relative To // /DefaultEditor.js:266 Return to the Graph > Create menu above to add data. // /components/containers/TraceAccordion.js:32 -Reversed // /DefaultEditor.js:434 +Reversed // /DefaultEditor.js:433 Rich Text // /components/widgets/text_editors/MultiFormatTextEditor.js:25 Rich text is incompatible with LaTeX. // /components/widgets/text_editors/MultiFormatTextEditor.js:121 -Right // /DefaultEditor.js:212 -Scale // /DefaultEditor.js:237 -Selection // /DefaultEditor.js:306 -Shape // /DefaultEditor.js:157 -Show // /DefaultEditor.js:229 -Size // /DefaultEditor.js:128 -Size and Spacing // /DefaultEditor.js:134 -Symbol // /DefaultEditor.js:129 -Text // /DefaultEditor.js:358 -Text Attributes // /DefaultEditor.js:79 -The anchor point determines which side of the annotation's positioning coordinates refer to. // /DefaultEditor.js:252 -The positioning inputs are relative to the anchor points on the text box. // /DefaultEditor.js:383 +Right // /DefaultEditor.js:211 +Sankey // /components/fields/TraceSelector.js:40 +Satellite Map // /components/fields/TraceSelector.js:39 +Scale // /DefaultEditor.js:236 +Scatter // /components/fields/TraceSelector.js:19 +Scatter GL // /components/fields/TraceSelector.js:35 +Selection // /DefaultEditor.js:305 +Shape // /DefaultEditor.js:156 +Show // /DefaultEditor.js:228 +Size // /DefaultEditor.js:127 +Size and Spacing // /DefaultEditor.js:133 +Surface // /components/fields/TraceSelector.js:31 +Symbol // /DefaultEditor.js:128 +Table // /components/fields/TraceSelector.js:41 +Ternary Scatter // /components/fields/TraceSelector.js:28 +Text // /DefaultEditor.js:357 +Text Attributes // /DefaultEditor.js:78 +The anchor point determines which side of the annotation's positioning coordinates refer to. // /DefaultEditor.js:251 +The positioning inputs are relative to the anchor points on the text box. // /DefaultEditor.js:382 This input has multiple values associated with it. Changing this setting will override these custom inputs. // /lib/constants.js:20 This trace does not yet have any data. // /components/containers/TraceAccordion.js:30 -Tick Labels // /DefaultEditor.js:329 -Tick Markers // /DefaultEditor.js:337 -Title // /DefaultEditor.js:184 -Title and Fonts // /DefaultEditor.js:183 -Titles // /DefaultEditor.js:296 -Top // /DefaultEditor.js:209 +Tick Labels // /DefaultEditor.js:328 +Tick Markers // /DefaultEditor.js:336 +Title // /DefaultEditor.js:183 +Title and Fonts // /DefaultEditor.js:182 +Titles // /DefaultEditor.js:295 +Top // /DefaultEditor.js:208 Trace // /components/containers/PanelHeader.js:14 -Trace Order // /DefaultEditor.js:429 +Trace Order // /DefaultEditor.js:428 Trace opacity is not supported for a scatter trace with fill or for a scatter trace that gets filled by another scatter trace. // /components/containers/Section.js:65 -Type // /DefaultEditor.js:156 -Typeface // /DefaultEditor.js:187 +Type // /DefaultEditor.js:155 +Typeface // /DefaultEditor.js:186 URL // /components/widgets/text_editors/RichText/LinkEditor.js:93 -Vertical // /DefaultEditor.js:122 -Vertical Positioning // /DefaultEditor.js:270 -Width // /DefaultEditor.js:154 -X Position // /DefaultEditor.js:408 -X Vector // /DefaultEditor.js:244 -Y Position // /DefaultEditor.js:414 -Y Vector // /DefaultEditor.js:245 -Zoom Interactivity // /DefaultEditor.js:340 -log // /DefaultEditor.js:320 \ No newline at end of file +Vertical // /DefaultEditor.js:121 +Vertical Positioning // /DefaultEditor.js:269 +Violin // /components/fields/TraceSelector.js:29 +Width // /DefaultEditor.js:153 +X Position // /DefaultEditor.js:407 +X Vector // /DefaultEditor.js:243 +Y Position // /DefaultEditor.js:413 +Y Vector // /DefaultEditor.js:244 +Zoom Interactivity // /DefaultEditor.js:339 +log // /DefaultEditor.js:319 +no results... // /components/widgets/Dropdown.js:76 +select an option... // /components/widgets/Dropdown.js:67 \ No newline at end of file diff --git a/src/PlotlyEditor.js b/src/PlotlyEditor.js index 0ed87ec38..a87a366a7 100644 --- a/src/PlotlyEditor.js +++ b/src/PlotlyEditor.js @@ -1,7 +1,6 @@ import DefaultEditor from './DefaultEditor'; import PropTypes from 'prop-types'; import React, {Component} from 'react'; -import dictionaries from './locales'; import {bem} from './lib'; import {noShame, maybeClearAxisTypes} from './shame'; import {EDITOR_ACTIONS} from './lib/constants'; @@ -40,7 +39,7 @@ class PlotlyEditor extends Component { dataSourceOptions: this.props.dataSourceOptions, dataSourceValueRenderer: this.props.dataSourceValueRenderer, dataSourceOptionRenderer: this.props.dataSourceOptionRenderer, - dictionaries: dictionaries, + dictionaries: this.props.dictionaries || {}, fullData: gd._fullData, fullLayout: gd._fullLayout, graphDiv: gd, @@ -159,6 +158,7 @@ PlotlyEditor.propTypes = { dataSourceOptions: PropTypes.array, dataSourceValueRenderer: PropTypes.func, dataSourceOptionRenderer: PropTypes.func, + dictionaries: PropTypes.object, graphDiv: PropTypes.object, locale: PropTypes.string, revision: PropTypes.any, diff --git a/src/components/containers/PanelHeader.js b/src/components/containers/PanelHeader.js index 79724fc95..392755195 100644 --- a/src/components/containers/PanelHeader.js +++ b/src/components/containers/PanelHeader.js @@ -32,7 +32,15 @@ class PanelHeader extends Component { } render() { - const {children, action, allowCollapse, toggleFolds, hasOpen} = this.props; + const { + children, + action, + allowCollapse, + toggleFolds, + hasOpen, + localize: _, + } = this.props; + return !children && !action && !allowCollapse ? null : (
{children && children.length ? ( @@ -44,12 +52,12 @@ class PanelHeader extends Component { {hasOpen ? ( - Collapse All + {_('Collapse All')} ) : ( - Expand All + {_('Expand All')} )}
diff --git a/src/components/fields/TraceSelector.js b/src/components/fields/TraceSelector.js index a6627642a..0fb3d14d9 100644 --- a/src/components/fields/TraceSelector.js +++ b/src/components/fields/TraceSelector.js @@ -2,29 +2,56 @@ import {UnconnectedDropdown} from './Dropdown'; import PropTypes from 'prop-types'; import React, {Component} from 'react'; import { - capitalize, connectToContainer, customTraceToPlotlyTrace, + localize, plotlyTraceToCustomTrace, } from 'lib'; -function computeTraceOptionsFromSchema(schema) { +function computeTraceOptionsFromSchema(schema, _) { // Filter out Polar "area" type as it is fairly broken and we want to present // scatter with fill as an "area" chart type for convenience. const traceTypes = Object.keys(schema.traces).filter(t => t !== 'area'); - const labels = traceTypes.map(capitalize); - const traceOptions = traceTypes.map((t, i) => ({ - label: labels[i], - value: t, - })); + // explicit map of all supported trace types (as of plotlyjs 1.32) + const traceOptions = [ + {value: 'scatter', label: _('Scatter')}, + {value: 'box', label: _('Box')}, + {value: 'bar', label: _('Bar')}, + {value: 'heatmap', label: _('Heatmap')}, + {value: 'histogram', label: _('Histogram')}, + {value: 'histogram2d', label: _('2D Histogram')}, + {value: 'histogram2dcontour', label: _('2D Contour Histogram')}, + {value: 'pie', label: _('Pie')}, + {value: 'contour', label: _('Contour')}, + {value: 'scatterternary', label: _('Ternary Scatter')}, + {value: 'violin', label: _('Violin')}, + {value: 'scatter3d', label: _('3D Scatter')}, + {value: 'surface', label: _('Surface')}, + {value: 'mesh3d', label: _('Mesh3d')}, + {value: 'scattergeo', label: _('Atlas Map')}, + {value: 'choropleth', label: _('Choropleth')}, + {value: 'scattergl', label: _('Scatter GL')}, + {value: 'pointcloud', label: _('Point Cloud')}, + {value: 'heatmapgl', label: _('Heatmap GL')}, + {value: 'parcoords', label: _('Parallel Coordinates')}, + {value: 'scattermapbox', label: _('Satellite Map')}, + {value: 'sankey', label: _('Sankey')}, + {value: 'table', label: _('Table')}, + {value: 'carpet', label: _('Carpet')}, + {value: 'scattercarpet', label: _('Carpet Scatter')}, + {value: 'contourcarpet', label: _('Carpet Contour')}, + {value: 'ohlc', label: _('OHLC')}, + {value: 'candlestick', label: _('Candlestick')}, + {value: 'scatterpolar', label: _('Polar Scatter')}, + ].filter(obj => traceTypes.indexOf(obj.value) !== -1); const i = traceOptions.findIndex(opt => opt.value === 'scatter'); traceOptions.splice( i + 1, 0, - {label: 'Line', value: 'line'}, - {label: 'Area', value: 'area'} + {label: _('Line'), value: 'line'}, + {label: _('Area'), value: 'area'} ); return traceOptions; @@ -60,12 +87,13 @@ class TraceSelector extends Component { } setLocals(props, context) { + const _ = props.localize; if (props.traceOptions) { this.traceOptions = props.traceOptions; } else if (context.plotSchema) { - this.traceOptions = computeTraceOptionsFromSchema(context.plotSchema); + this.traceOptions = computeTraceOptionsFromSchema(context.plotSchema, _); } else { - this.traceOptions = [{label: 'Scatter', value: 'scatter'}]; + this.traceOptions = [{label: _('Scatter'), value: 'scatter'}]; } this.fullValue = plotlyTraceToCustomTrace(props.container); } @@ -112,7 +140,8 @@ TraceSelector.propTypes = { container: PropTypes.object.isRequired, fullContainer: PropTypes.object.isRequired, fullValue: PropTypes.any.isRequired, + localize: PropTypes.func, updateContainer: PropTypes.func, }; -export default connectToContainer(TraceSelector); +export default connectToContainer(localize(TraceSelector)); diff --git a/src/components/widgets/Dropdown.js b/src/components/widgets/Dropdown.js index acb21e6a8..a2f621485 100644 --- a/src/components/widgets/Dropdown.js +++ b/src/components/widgets/Dropdown.js @@ -2,6 +2,7 @@ import PropTypes from 'prop-types'; import React, {Component} from 'react'; import Select from 'react-select'; import classnames from 'classnames'; +import {localize} from 'lib'; class Dropdown extends Component { constructor(props) { @@ -40,6 +41,7 @@ class Dropdown extends Component { disabled, className, width, + localize: _, } = this.props; const dropdownStyle = {minWidth}; @@ -62,7 +64,7 @@ class Dropdown extends Component {