Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f3323f6

Browse files
committed
Add french translations
1 parent 710ac15 commit f3323f6

File tree

10 files changed

+169
-51
lines changed

10 files changed

+169
-51
lines changed

src/components/legend/handle_click.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ module.exports = function handleClick(g, gd, numClicks) {
8787
}
8888

8989
if(numClicks === 1 && SHOWISOLATETIP && gd.data && gd._context.showTips) {
90-
Lib.notifier('Double click on legend to isolate individual trace', 'long');
90+
Lib.notifier(require('../../core').uiTexts.isolateTip, 'long');
9191
SHOWISOLATETIP = false;
9292
} else {
9393
SHOWISOLATETIP = false;

src/components/modebar/buttons.js

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -47,31 +47,31 @@ var modeBarButtons = module.exports = {};
4747

4848
modeBarButtons.toImage = {
4949
name: 'toImage',
50-
title: 'Download plot as a png',
50+
title: require('../../core').uiTexts.toImageButton,
5151
icon: Icons.camera,
5252
click: function(gd) {
5353
var format = 'png';
5454

55-
Lib.notifier('Taking snapshot - this may take a few seconds', 'long');
55+
Lib.notifier(require('../../core').uiTexts.pngSnapshotTip, 'long');
5656

5757
if(Lib.isIE()) {
58-
Lib.notifier('IE only supports svg. Changing format to svg.', 'long');
58+
Lib.notifier(require('../../core').uiTexts.svgSnapshotTip, 'long');
5959
format = 'svg';
6060
}
6161

6262
downloadImage(gd, {'format': format})
6363
.then(function(filename) {
64-
Lib.notifier('Snapshot succeeded - ' + filename, 'long');
64+
Lib.notifier(require('../../core').uiTexts.snapshotSuccessTip + filename, 'long');
6565
})
6666
.catch(function() {
67-
Lib.notifier('Sorry there was a problem downloading your snapshot!', 'long');
67+
Lib.notifier(require('../../core').uiTexts.snapshotErrorTip, 'long');
6868
});
6969
}
7070
};
7171

7272
modeBarButtons.sendDataToCloud = {
7373
name: 'sendDataToCloud',
74-
title: 'Save and edit plot in cloud',
74+
title: require('../../core').uiTexts.sendDataToCloudButton,
7575
icon: Icons.disk,
7676
click: function(gd) {
7777
Plots.sendDataToCloud(gd);
@@ -80,7 +80,7 @@ modeBarButtons.sendDataToCloud = {
8080

8181
modeBarButtons.zoom2d = {
8282
name: 'zoom2d',
83-
title: 'Zoom',
83+
title: require('../../core').uiTexts.zoomButton,
8484
attr: 'dragmode',
8585
val: 'zoom',
8686
icon: Icons.zoombox,
@@ -89,7 +89,7 @@ modeBarButtons.zoom2d = {
8989

9090
modeBarButtons.pan2d = {
9191
name: 'pan2d',
92-
title: 'Pan',
92+
title: require('../../core').uiTexts.panButton,
9393
attr: 'dragmode',
9494
val: 'pan',
9595
icon: Icons.pan,
@@ -98,7 +98,7 @@ modeBarButtons.pan2d = {
9898

9999
modeBarButtons.select2d = {
100100
name: 'select2d',
101-
title: 'Box Select',
101+
title: require('../../core').uiTexts.boxSelectButton,
102102
attr: 'dragmode',
103103
val: 'select',
104104
icon: Icons.selectbox,
@@ -107,7 +107,7 @@ modeBarButtons.select2d = {
107107

108108
modeBarButtons.lasso2d = {
109109
name: 'lasso2d',
110-
title: 'Lasso Select',
110+
title: require('../../core').uiTexts.lassoSelectButton,
111111
attr: 'dragmode',
112112
val: 'lasso',
113113
icon: Icons.lasso,
@@ -116,7 +116,7 @@ modeBarButtons.lasso2d = {
116116

117117
modeBarButtons.zoomIn2d = {
118118
name: 'zoomIn2d',
119-
title: 'Zoom in',
119+
title: require('../../core').uiTexts.zoomInButton,
120120
attr: 'zoom',
121121
val: 'in',
122122
icon: Icons.zoom_plus,
@@ -125,7 +125,7 @@ modeBarButtons.zoomIn2d = {
125125

126126
modeBarButtons.zoomOut2d = {
127127
name: 'zoomOut2d',
128-
title: 'Zoom out',
128+
title: require('../../core').uiTexts.zoomOutButton,
129129
attr: 'zoom',
130130
val: 'out',
131131
icon: Icons.zoom_minus,
@@ -134,7 +134,7 @@ modeBarButtons.zoomOut2d = {
134134

135135
modeBarButtons.autoScale2d = {
136136
name: 'autoScale2d',
137-
title: 'Autoscale',
137+
title: require('../../core').uiTexts.autoscaleButton,
138138
attr: 'zoom',
139139
val: 'auto',
140140
icon: Icons.autoscale,
@@ -143,7 +143,7 @@ modeBarButtons.autoScale2d = {
143143

144144
modeBarButtons.resetScale2d = {
145145
name: 'resetScale2d',
146-
title: 'Reset axes',
146+
title: require('../../core').uiTexts.resetAxesButton,
147147
attr: 'zoom',
148148
val: 'reset',
149149
icon: Icons.home,
@@ -152,7 +152,7 @@ modeBarButtons.resetScale2d = {
152152

153153
modeBarButtons.hoverClosestCartesian = {
154154
name: 'hoverClosestCartesian',
155-
title: 'Show closest data on hover',
155+
title: require('../../core').uiTexts.closestDataOnHoverButton,
156156
attr: 'hovermode',
157157
val: 'closest',
158158
icon: Icons.tooltip_basic,
@@ -162,7 +162,7 @@ modeBarButtons.hoverClosestCartesian = {
162162

163163
modeBarButtons.hoverCompareCartesian = {
164164
name: 'hoverCompareCartesian',
165-
title: 'Compare data on hover',
165+
title: require('../../core').uiTexts.compareDataOnHoverButton,
166166
attr: 'hovermode',
167167
val: function(gd) {
168168
return gd._fullLayout._isHoriz ? 'y' : 'x';
@@ -256,7 +256,7 @@ function handleCartesian(gd, ev) {
256256

257257
modeBarButtons.zoom3d = {
258258
name: 'zoom3d',
259-
title: 'Zoom',
259+
title: require('../../core').uiTexts.zoomButton,
260260
attr: 'scene.dragmode',
261261
val: 'zoom',
262262
icon: Icons.zoombox,
@@ -265,7 +265,7 @@ modeBarButtons.zoom3d = {
265265

266266
modeBarButtons.pan3d = {
267267
name: 'pan3d',
268-
title: 'Pan',
268+
title: require('../../core').uiTexts.panButton,
269269
attr: 'scene.dragmode',
270270
val: 'pan',
271271
icon: Icons.pan,
@@ -274,7 +274,7 @@ modeBarButtons.pan3d = {
274274

275275
modeBarButtons.orbitRotation = {
276276
name: 'orbitRotation',
277-
title: 'orbital rotation',
277+
title: require('../../core').uiTexts.orbitalRotationButton,
278278
attr: 'scene.dragmode',
279279
val: 'orbit',
280280
icon: Icons['3d_rotate'],
@@ -283,7 +283,7 @@ modeBarButtons.orbitRotation = {
283283

284284
modeBarButtons.tableRotation = {
285285
name: 'tableRotation',
286-
title: 'turntable rotation',
286+
title: require('../../core').uiTexts.turntableRotationButton,
287287
attr: 'scene.dragmode',
288288
val: 'turntable',
289289
icon: Icons['z-axis'],
@@ -309,15 +309,15 @@ function handleDrag3d(gd, ev) {
309309

310310
modeBarButtons.resetCameraDefault3d = {
311311
name: 'resetCameraDefault3d',
312-
title: 'Reset camera to default',
312+
title: require('../../core').uiTexts.resetCameraButton,
313313
attr: 'resetDefault',
314314
icon: Icons.home,
315315
click: handleCamera3d
316316
};
317317

318318
modeBarButtons.resetCameraLastSave3d = {
319319
name: 'resetCameraLastSave3d',
320-
title: 'Reset camera to last save',
320+
title: require('../../core').uiTexts.resetSavedCameraButton,
321321
attr: 'resetLastSave',
322322
icon: Icons.movie,
323323
click: handleCamera3d
@@ -348,7 +348,7 @@ function handleCamera3d(gd, ev) {
348348

349349
modeBarButtons.hoverClosest3d = {
350350
name: 'hoverClosest3d',
351-
title: 'Toggle show closest data on hover',
351+
title: require('../../core').uiTexts.closestDataOnHoverButton,
352352
attr: 'hovermode',
353353
val: null,
354354
toggle: true,
@@ -409,7 +409,7 @@ function handleHover3d(gd, ev) {
409409

410410
modeBarButtons.zoomInGeo = {
411411
name: 'zoomInGeo',
412-
title: 'Zoom in',
412+
title: require('../../core').uiTexts.zoomInButton,
413413
attr: 'zoom',
414414
val: 'in',
415415
icon: Icons.zoom_plus,
@@ -418,7 +418,7 @@ modeBarButtons.zoomInGeo = {
418418

419419
modeBarButtons.zoomOutGeo = {
420420
name: 'zoomOutGeo',
421-
title: 'Zoom out',
421+
title: require('../../core').uiTexts.zoomOutButton,
422422
attr: 'zoom',
423423
val: 'out',
424424
icon: Icons.zoom_minus,
@@ -427,7 +427,7 @@ modeBarButtons.zoomOutGeo = {
427427

428428
modeBarButtons.resetGeo = {
429429
name: 'resetGeo',
430-
title: 'Reset',
430+
title: require('../../core').uiTexts.resetGeoButton,
431431
attr: 'reset',
432432
val: null,
433433
icon: Icons.autoscale,
@@ -436,7 +436,7 @@ modeBarButtons.resetGeo = {
436436

437437
modeBarButtons.hoverClosestGeo = {
438438
name: 'hoverClosestGeo',
439-
title: 'Toggle show closest data on hover',
439+
title: require('../../core').uiTexts.closestDataOnHoverButton,
440440
attr: 'hovermode',
441441
val: null,
442442
toggle: true,
@@ -469,7 +469,7 @@ function handleGeo(gd, ev) {
469469

470470
modeBarButtons.hoverClosestGl2d = {
471471
name: 'hoverClosestGl2d',
472-
title: 'Toggle show closest data on hover',
472+
title: require('../../core').uiTexts.closestDataOnHoverButton,
473473
attr: 'hovermode',
474474
val: null,
475475
toggle: true,
@@ -480,7 +480,7 @@ modeBarButtons.hoverClosestGl2d = {
480480

481481
modeBarButtons.hoverClosestPie = {
482482
name: 'hoverClosestPie',
483-
title: 'Toggle show closest data on hover',
483+
title: require('../../core').uiTexts.closestDataOnHoverButton,
484484
attr: 'hovermode',
485485
val: 'closest',
486486
icon: Icons.tooltip_basic,
@@ -506,7 +506,7 @@ function toggleHover(gd) {
506506

507507
modeBarButtons.toggleHover = {
508508
name: 'toggleHover',
509-
title: 'Toggle show closest data on hover',
509+
title: require('../../core').uiTexts.closestDataOnHoverButton,
510510
attr: 'hovermode',
511511
val: null,
512512
toggle: true,
@@ -524,7 +524,7 @@ modeBarButtons.toggleHover = {
524524

525525
modeBarButtons.resetViews = {
526526
name: 'resetViews',
527-
title: 'Reset views',
527+
title: require('../../core').uiTexts.resetViewsButton,
528528
icon: Icons.home,
529529
click: function(gd, ev) {
530530
var button = ev.currentTarget;
@@ -543,7 +543,7 @@ modeBarButtons.resetViews = {
543543

544544
modeBarButtons.toggleSpikelines = {
545545
name: 'toggleSpikelines',
546-
title: 'Toggle Spike Lines',
546+
title: require('../../core').uiTexts.spikeLinesButton,
547547
icon: Icons.spikeline,
548548
attr: '_cartesianSpikesEnabled',
549549
val: 'on',
@@ -578,7 +578,7 @@ function setSpikelineVisibility(gd) {
578578

579579
modeBarButtons.resetViewMapbox = {
580580
name: 'resetViewMapbox',
581-
title: 'Reset view',
581+
title: require('../../core').uiTexts.resetViewButton,
582582
attr: 'reset',
583583
icon: Icons.home,
584584
click: function(gd) {

src/components/modebar/manage.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ var scatterSubTypes = require('../../traces/scatter/subtypes');
1414
var Registry = require('../../registry');
1515

1616
var createModeBar = require('./modebar');
17-
var modeBarButtons = require('./buttons');
1817

1918
/**
2019
* ModeBar wrapper around 'create' and 'update',
@@ -81,6 +80,7 @@ function getButtonGroups(gd, buttonsToRemove, buttonsToAdd) {
8180
var hasGL2D = fullLayout._has('gl2d');
8281
var hasTernary = fullLayout._has('ternary');
8382
var hasMapbox = fullLayout._has('mapbox');
83+
var modeBarButtons = require('./buttons');
8484

8585
var groups = [];
8686

@@ -208,6 +208,7 @@ function appendButtonsToGroups(groups, buttons) {
208208

209209
// fill in custom buttons referring to default mode bar buttons
210210
function fillCustomButton(customButtons) {
211+
var modeBarButtons = require('./buttons');
211212
for(var i = 0; i < customButtons.length; i++) {
212213
var buttonGroup = customButtons[i];
213214

0 commit comments

Comments
 (0)