Skip to content

Localization #2195

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
Dec 11, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
7e075f5
localization routine and tests
alexcjohnson Dec 6, 2017
9a9de77
remove zsmooth that doesn't apply to contourcarpet
alexcjohnson Dec 6, 2017
d859de5
wrap all displayed strings in localize
alexcjohnson Dec 6, 2017
7d057e5
task to collect translation keys and verify syntax
alexcjohnson Dec 6, 2017
8a5eeec
looser placeholder check in titles
alexcjohnson Dec 7, 2017
03dcb5d
lint
alexcjohnson Dec 7, 2017
bf2c6db
move colons into the translations
alexcjohnson Dec 7, 2017
04ed6f0
set default locale to en-US and build this into the library
alexcjohnson Dec 8, 2017
0f8520e
turn log level 1 on by default and move zsmooth messages to logs
alexcjohnson Dec 8, 2017
5d6f267
take <br> out of notifier messages
alexcjohnson Dec 8, 2017
97c0898
include file & line number with translation keys
alexcjohnson Dec 8, 2017
daf0884
disable logging in image server
alexcjohnson Dec 8, 2017
4b48038
convert locales to json, only en(US)? in bundles, and build all local…
alexcjohnson Dec 8, 2017
4b8f980
move geo missing id warn -> log
alexcjohnson Dec 8, 2017
1275661
convert locales back into js instead of json
alexcjohnson Dec 8, 2017
fc03cce
change "unable to bind..." warning to a log
alexcjohnson Dec 8, 2017
cb2f00c
fix command test for warn -> log
alexcjohnson Dec 8, 2017
97821e9
tweak a few of the string literals for consistency
alexcjohnson Dec 8, 2017
e80ec91
fix sankey test and clean log messages from other tests
alexcjohnson Dec 8, 2017
8b9e7d8
remove invalid data from geo_choropleth-text.json
alexcjohnson Dec 8, 2017
6029f94
update finance test for lowercase labels
alexcjohnson Dec 8, 2017
9708b56
update select_test for choropleth mock change
alexcjohnson Dec 9, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dist/plotly-locale-en-us.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/plotly-locale-en.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 56 additions & 0 deletions dist/translation-keys.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
Autoscale // components/modebar/buttons.js:139
Box Select // components/modebar/buttons.js:103
Click to enter Colorscale title // plots/plots.js:437
Click to enter Component A title // plots/ternary/ternary.js:386
Click to enter Component B title // plots/ternary/ternary.js:400
Click to enter Component C title // plots/ternary/ternary.js:411
Click to enter Plot title // plot_api/plot_api.js:579
Click to enter X axis title // plots/plots.js:435
Click to enter Y axis title // plots/plots.js:436
Compare data on hover // components/modebar/buttons.js:167
Double-click on legend to isolate one trace // components/legend/handle_click.js:90
Double-click to zoom back out // plots/cartesian/dragbox.js:299
Download plot as a png // components/modebar/buttons.js:52
Edit in Chart Studio // components/modebar/buttons.js:76
IE only supports svg. Changing format to svg. // components/modebar/buttons.js:60
Lasso Select // components/modebar/buttons.js:112
Orbital rotation // components/modebar/buttons.js:279
Pan // components/modebar/buttons.js:94
Produced with Plotly // components/modebar/modebar.js:256
Reset // components/modebar/buttons.js:432
Reset axes // components/modebar/buttons.js:148
Reset camera to default // components/modebar/buttons.js:314
Reset camera to last save // components/modebar/buttons.js:322
Reset view // components/modebar/buttons.js:583
Reset views // components/modebar/buttons.js:529
Show closest data on hover // components/modebar/buttons.js:157
Snapshot succeeded // components/modebar/buttons.js:66
Sorry, there was a problem downloading your snapshot! // components/modebar/buttons.js:69
Taking snapshot - this may take a few seconds // components/modebar/buttons.js:57
Toggle Spike Lines // components/modebar/buttons.js:548
Toggle show closest data on hover // components/modebar/buttons.js:353
Turntable rotation // components/modebar/buttons.js:288
Zoom // components/modebar/buttons.js:85
Zoom in // components/modebar/buttons.js:121
Zoom out // components/modebar/buttons.js:130
close: // traces/ohlc/transform.js:139
high: // traces/ohlc/transform.js:137
incoming flow count: // traces/sankey/plot.js:142
kde: // traces/violin/calc.js:73
lat: // traces/scattergeo/calc.js:48
lon: // traces/scattergeo/calc.js:49
low: // traces/ohlc/transform.js:138
lower fence: // traces/box/calc.js:134
max: // traces/box/calc.js:132
mean ± σ: // traces/box/calc.js:133
mean: // traces/box/calc.js:133
median: // traces/box/calc.js:128
min: // traces/box/calc.js:129
open: // traces/ohlc/transform.js:136
outgoing flow count: // traces/sankey/plot.js:143
q1: // traces/box/calc.js:130
q3: // traces/box/calc.js:131
source: // traces/sankey/plot.js:140
target: // traces/sankey/plot.js:141
trace // plots/plots.js:439
upper fence: // traces/box/calc.js:135
6 changes: 6 additions & 0 deletions lib/index-basic.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,10 @@ Plotly.register([
require('./pie')
]);

// locales
Plotly.register([
require('./locale-en'),
require('./locale-en-us')
]);

module.exports = Plotly;
6 changes: 6 additions & 0 deletions lib/index-cartesian.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,10 @@ Plotly.register([
require('./violin')
]);

// locales
Plotly.register([
require('./locale-en'),
require('./locale-en-us')
]);

module.exports = Plotly;
6 changes: 6 additions & 0 deletions lib/index-finance.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,10 @@ Plotly.register([
require('./candlestick')
]);

// locales
Plotly.register([
require('./locale-en'),
require('./locale-en-us')
]);

module.exports = Plotly;
6 changes: 6 additions & 0 deletions lib/index-geo.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,10 @@ Plotly.register([
require('./choropleth')
]);

// locales
Plotly.register([
require('./locale-en'),
require('./locale-en-us')
]);

module.exports = Plotly;
6 changes: 6 additions & 0 deletions lib/index-gl2d.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,10 @@ Plotly.register([
require('./parcoords')
]);

// locales
Plotly.register([
require('./locale-en'),
require('./locale-en-us')
]);

module.exports = Plotly;
6 changes: 6 additions & 0 deletions lib/index-gl3d.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,10 @@ Plotly.register([
require('./mesh3d')
]);

// locales
Plotly.register([
require('./locale-en'),
require('./locale-en-us')
]);

module.exports = Plotly;
6 changes: 6 additions & 0 deletions lib/index-mapbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,10 @@ Plotly.register([
require('./scattermapbox')
]);

// locales
Plotly.register([
require('./locale-en'),
require('./locale-en-us')
]);

module.exports = Plotly;
6 changes: 6 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,10 @@ Plotly.register([
require('./calendars')
]);

// locales
Plotly.register([
require('./locale-en.js'),
require('./locale-en-us.js')
]);

module.exports = Plotly;
17 changes: 17 additions & 0 deletions lib/locale-en-us.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* Copyright 2012-2017, Plotly, Inc.
* All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

'use strict';

module.exports = {
moduleType: 'locale',
name: 'en-US',
dictionary: {
'Click to enter Colorscale title': 'Click to enter Colorscale title'
}
};
17 changes: 17 additions & 0 deletions lib/locale-en.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* Copyright 2012-2017, Plotly, Inc.
* All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

'use strict';

module.exports = {
moduleType: 'locale',
name: 'en',
dictionary: {
'Click to enter Colorscale title': 'Click to enter Colourscale title'
}
};
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"bundle": "node tasks/bundle.js",
"header": "node tasks/header.js",
"stats": "node tasks/stats.js",
"build": "npm run preprocess && npm run bundle && npm run header && npm run stats",
"find-strings": "node tasks/find_locale_strings.js",
"build": "npm run preprocess && npm run find-strings && npm run bundle && npm run header && npm run stats",
"cibuild": "npm run preprocess && node tasks/cibundle.js",
"watch": "node tasks/watch.js",
"lint": "eslint --version && eslint .",
Expand All @@ -36,7 +37,7 @@
"test-image": "node tasks/test_image.js",
"test-image-gl2d": "node tasks/test_image.js gl2d_* --queue",
"test-export": "node tasks/test_export.js",
"test-syntax": "node tasks/test_syntax.js",
"test-syntax": "node tasks/test_syntax.js && npm run find-strings",
"test-bundle": "node tasks/test_bundle.js",
"test": "npm run test-jasmine && npm run test-bundle && npm run test-image && npm run test-image-gl2d && npm run test-syntax && npm run lint",
"start-test_dashboard": "node devtools/test_dashboard/server.js",
Expand Down Expand Up @@ -121,6 +122,7 @@
"glslify": "^4.0.0",
"gzip-size": "^3.0.0",
"image-size": "^0.5.1",
"into-stream": "^3.1.0",
"jasmine-core": "^2.4.1",
"jsdom": "^11.2.0",
"karma": "^1.5.0",
Expand Down
1 change: 0 additions & 1 deletion src/components/colorbar/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ module.exports = overrideAll({
title: {
valType: 'string',
role: 'info',
dflt: 'Click to enter colorscale title',
description: 'Sets the title of the color bar.'
},
titlefont: fontAttrs({
Expand Down
2 changes: 1 addition & 1 deletion src/components/colorbar/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ module.exports = function colorbarDefaults(containerIn, containerOut, layout) {
handleTickMarkDefaults(colorbarIn, colorbarOut, coerce, 'linear',
{outerTicks: false, font: layout.font, noHover: true});

coerce('title');
coerce('title', layout._dfltTitle.colorbar);
Lib.coerceFont(coerce, 'titlefont', layout.font);
coerce('titleside');
};
2 changes: 1 addition & 1 deletion src/components/colorbar/draw.js
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ module.exports = function draw(gd, id) {
propContainer: cbAxisOut,
propName: propName,
traceIndex: trace.index,
dfltName: 'colorscale',
placeholder: fullLayout._dfltTitle.colorbar,
containerGroup: container.select('.cbtitle')
};

Expand Down
2 changes: 1 addition & 1 deletion src/components/legend/handle_click.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ module.exports = function handleClick(g, gd, numClicks) {
}

if(numClicks === 1 && SHOWISOLATETIP && gd.data && gd._context.showTips) {
Lib.notifier('Double click on legend to isolate individual trace', 'long');
Lib.notifier(Lib._(gd, 'Double-click on legend to isolate one trace'), 'long');
SHOWISOLATETIP = false;
} else {
SHOWISOLATETIP = false;
Expand Down
Loading