@@ -17,6 +17,8 @@ var downloadImage = require('../../snapshot/download');
17
17
var Icons = require ( '../../../build/ploticon' ) ;
18
18
19
19
20
+ var _ = Lib . _ ;
21
+
20
22
var modeBarButtons = module . exports = { } ;
21
23
22
24
/**
@@ -47,31 +49,31 @@ var modeBarButtons = module.exports = {};
47
49
48
50
modeBarButtons . toImage = {
49
51
name : 'toImage' ,
50
- title : 'Download plot as a png' ,
52
+ title : function ( gd ) { return _ ( gd , 'Download plot as a png' ) ; } ,
51
53
icon : Icons . camera ,
52
54
click : function ( gd ) {
53
55
var format = 'png' ;
54
56
55
- Lib . notifier ( 'Taking snapshot - this may take a few seconds' , 'long' ) ;
57
+ Lib . notifier ( _ ( gd , 'Taking snapshot - this may take a few seconds' ) , 'long' ) ;
56
58
57
59
if ( Lib . isIE ( ) ) {
58
- Lib . notifier ( 'IE only supports svg. Changing format to svg.' , 'long' ) ;
60
+ Lib . notifier ( _ ( gd , 'IE only supports svg. Changing format to svg.' ) , 'long' ) ;
59
61
format = 'svg' ;
60
62
}
61
63
62
64
downloadImage ( gd , { 'format' : format } )
63
65
. then ( function ( filename ) {
64
- Lib . notifier ( 'Snapshot succeeded - ' + filename , 'long' ) ;
66
+ Lib . notifier ( _ ( gd , 'Snapshot succeeded' ) + ' - ' + filename , 'long' ) ;
65
67
} )
66
68
. catch ( function ( ) {
67
- Lib . notifier ( 'Sorry there was a problem downloading your snapshot!' , 'long' ) ;
69
+ Lib . notifier ( _ ( gd , 'Sorry there was a problem downloading your snapshot!' ) , 'long' ) ;
68
70
} ) ;
69
71
}
70
72
} ;
71
73
72
74
modeBarButtons . sendDataToCloud = {
73
75
name : 'sendDataToCloud' ,
74
- title : 'Edit in Chart Studio' ,
76
+ title : function ( gd ) { return _ ( gd , 'Edit in Chart Studio' ) ; } ,
75
77
icon : Icons . disk ,
76
78
click : function ( gd ) {
77
79
Plots . sendDataToCloud ( gd ) ;
@@ -80,7 +82,7 @@ modeBarButtons.sendDataToCloud = {
80
82
81
83
modeBarButtons . zoom2d = {
82
84
name : 'zoom2d' ,
83
- title : 'Zoom' ,
85
+ title : function ( gd ) { return _ ( gd , 'Zoom' ) ; } ,
84
86
attr : 'dragmode' ,
85
87
val : 'zoom' ,
86
88
icon : Icons . zoombox ,
@@ -89,7 +91,7 @@ modeBarButtons.zoom2d = {
89
91
90
92
modeBarButtons . pan2d = {
91
93
name : 'pan2d' ,
92
- title : 'Pan' ,
94
+ title : function ( gd ) { return _ ( gd , 'Pan' ) ; } ,
93
95
attr : 'dragmode' ,
94
96
val : 'pan' ,
95
97
icon : Icons . pan ,
@@ -98,7 +100,7 @@ modeBarButtons.pan2d = {
98
100
99
101
modeBarButtons . select2d = {
100
102
name : 'select2d' ,
101
- title : 'Box Select' ,
103
+ title : function ( gd ) { return _ ( gd , 'Box Select' ) ; } ,
102
104
attr : 'dragmode' ,
103
105
val : 'select' ,
104
106
icon : Icons . selectbox ,
@@ -107,7 +109,7 @@ modeBarButtons.select2d = {
107
109
108
110
modeBarButtons . lasso2d = {
109
111
name : 'lasso2d' ,
110
- title : 'Lasso Select' ,
112
+ title : function ( gd ) { return _ ( gd , 'Lasso Select' ) ; } ,
111
113
attr : 'dragmode' ,
112
114
val : 'lasso' ,
113
115
icon : Icons . lasso ,
@@ -116,7 +118,7 @@ modeBarButtons.lasso2d = {
116
118
117
119
modeBarButtons . zoomIn2d = {
118
120
name : 'zoomIn2d' ,
119
- title : 'Zoom in' ,
121
+ title : function ( gd ) { return _ ( gd , 'Zoom in' ) ; } ,
120
122
attr : 'zoom' ,
121
123
val : 'in' ,
122
124
icon : Icons . zoom_plus ,
@@ -125,7 +127,7 @@ modeBarButtons.zoomIn2d = {
125
127
126
128
modeBarButtons . zoomOut2d = {
127
129
name : 'zoomOut2d' ,
128
- title : 'Zoom out' ,
130
+ title : function ( gd ) { return _ ( gd , 'Zoom out' ) ; } ,
129
131
attr : 'zoom' ,
130
132
val : 'out' ,
131
133
icon : Icons . zoom_minus ,
@@ -134,7 +136,7 @@ modeBarButtons.zoomOut2d = {
134
136
135
137
modeBarButtons . autoScale2d = {
136
138
name : 'autoScale2d' ,
137
- title : 'Autoscale' ,
139
+ title : function ( gd ) { return _ ( gd , 'Autoscale' ) ; } ,
138
140
attr : 'zoom' ,
139
141
val : 'auto' ,
140
142
icon : Icons . autoscale ,
@@ -143,7 +145,7 @@ modeBarButtons.autoScale2d = {
143
145
144
146
modeBarButtons . resetScale2d = {
145
147
name : 'resetScale2d' ,
146
- title : 'Reset axes' ,
148
+ title : function ( gd ) { return _ ( gd , 'Reset axes' ) ; } ,
147
149
attr : 'zoom' ,
148
150
val : 'reset' ,
149
151
icon : Icons . home ,
@@ -152,7 +154,7 @@ modeBarButtons.resetScale2d = {
152
154
153
155
modeBarButtons . hoverClosestCartesian = {
154
156
name : 'hoverClosestCartesian' ,
155
- title : 'Show closest data on hover' ,
157
+ title : function ( gd ) { return _ ( gd , 'Show closest data on hover' ) ; } ,
156
158
attr : 'hovermode' ,
157
159
val : 'closest' ,
158
160
icon : Icons . tooltip_basic ,
@@ -162,7 +164,7 @@ modeBarButtons.hoverClosestCartesian = {
162
164
163
165
modeBarButtons . hoverCompareCartesian = {
164
166
name : 'hoverCompareCartesian' ,
165
- title : 'Compare data on hover' ,
167
+ title : function ( gd ) { return _ ( gd , 'Compare data on hover' ) ; } ,
166
168
attr : 'hovermode' ,
167
169
val : function ( gd ) {
168
170
return gd . _fullLayout . _isHoriz ? 'y' : 'x' ;
@@ -256,7 +258,7 @@ function handleCartesian(gd, ev) {
256
258
257
259
modeBarButtons . zoom3d = {
258
260
name : 'zoom3d' ,
259
- title : 'Zoom' ,
261
+ title : function ( gd ) { return _ ( gd , 'Zoom' ) ; } ,
260
262
attr : 'scene.dragmode' ,
261
263
val : 'zoom' ,
262
264
icon : Icons . zoombox ,
@@ -265,7 +267,7 @@ modeBarButtons.zoom3d = {
265
267
266
268
modeBarButtons . pan3d = {
267
269
name : 'pan3d' ,
268
- title : 'Pan' ,
270
+ title : function ( gd ) { return _ ( gd , 'Pan' ) ; } ,
269
271
attr : 'scene.dragmode' ,
270
272
val : 'pan' ,
271
273
icon : Icons . pan ,
@@ -274,7 +276,7 @@ modeBarButtons.pan3d = {
274
276
275
277
modeBarButtons . orbitRotation = {
276
278
name : 'orbitRotation' ,
277
- title : 'orbital rotation',
279
+ title : function ( gd ) { return _ ( gd , 'Orbital rotation') ; } ,
278
280
attr : 'scene.dragmode' ,
279
281
val : 'orbit' ,
280
282
icon : Icons [ '3d_rotate' ] ,
@@ -283,7 +285,7 @@ modeBarButtons.orbitRotation = {
283
285
284
286
modeBarButtons . tableRotation = {
285
287
name : 'tableRotation' ,
286
- title : 'turntable rotation',
288
+ title : function ( gd ) { return _ ( gd , 'Turntable rotation') ; } ,
287
289
attr : 'scene.dragmode' ,
288
290
val : 'turntable' ,
289
291
icon : Icons [ 'z-axis' ] ,
@@ -309,15 +311,15 @@ function handleDrag3d(gd, ev) {
309
311
310
312
modeBarButtons . resetCameraDefault3d = {
311
313
name : 'resetCameraDefault3d' ,
312
- title : 'Reset camera to default' ,
314
+ title : function ( gd ) { return _ ( gd , 'Reset camera to default' ) ; } ,
313
315
attr : 'resetDefault' ,
314
316
icon : Icons . home ,
315
317
click : handleCamera3d
316
318
} ;
317
319
318
320
modeBarButtons . resetCameraLastSave3d = {
319
321
name : 'resetCameraLastSave3d' ,
320
- title : 'Reset camera to last save' ,
322
+ title : function ( gd ) { return _ ( gd , 'Reset camera to last save' ) ; } ,
321
323
attr : 'resetLastSave' ,
322
324
icon : Icons . movie ,
323
325
click : handleCamera3d
@@ -348,7 +350,7 @@ function handleCamera3d(gd, ev) {
348
350
349
351
modeBarButtons . hoverClosest3d = {
350
352
name : 'hoverClosest3d' ,
351
- title : 'Toggle show closest data on hover' ,
353
+ title : function ( gd ) { return _ ( gd , 'Toggle show closest data on hover' ) ; } ,
352
354
attr : 'hovermode' ,
353
355
val : null ,
354
356
toggle : true ,
@@ -409,7 +411,7 @@ function handleHover3d(gd, ev) {
409
411
410
412
modeBarButtons . zoomInGeo = {
411
413
name : 'zoomInGeo' ,
412
- title : 'Zoom in' ,
414
+ title : function ( gd ) { return _ ( gd , 'Zoom in' ) ; } ,
413
415
attr : 'zoom' ,
414
416
val : 'in' ,
415
417
icon : Icons . zoom_plus ,
@@ -418,7 +420,7 @@ modeBarButtons.zoomInGeo = {
418
420
419
421
modeBarButtons . zoomOutGeo = {
420
422
name : 'zoomOutGeo' ,
421
- title : 'Zoom out' ,
423
+ title : function ( gd ) { return _ ( gd , 'Zoom out' ) ; } ,
422
424
attr : 'zoom' ,
423
425
val : 'out' ,
424
426
icon : Icons . zoom_minus ,
@@ -427,7 +429,7 @@ modeBarButtons.zoomOutGeo = {
427
429
428
430
modeBarButtons . resetGeo = {
429
431
name : 'resetGeo' ,
430
- title : 'Reset' ,
432
+ title : function ( gd ) { return _ ( gd , 'Reset' ) ; } ,
431
433
attr : 'reset' ,
432
434
val : null ,
433
435
icon : Icons . autoscale ,
@@ -436,7 +438,7 @@ modeBarButtons.resetGeo = {
436
438
437
439
modeBarButtons . hoverClosestGeo = {
438
440
name : 'hoverClosestGeo' ,
439
- title : 'Toggle show closest data on hover' ,
441
+ title : function ( gd ) { return _ ( gd , 'Toggle show closest data on hover' ) ; } ,
440
442
attr : 'hovermode' ,
441
443
val : null ,
442
444
toggle : true ,
@@ -469,7 +471,7 @@ function handleGeo(gd, ev) {
469
471
470
472
modeBarButtons . hoverClosestGl2d = {
471
473
name : 'hoverClosestGl2d' ,
472
- title : 'Toggle show closest data on hover' ,
474
+ title : function ( gd ) { return _ ( gd , 'Toggle show closest data on hover' ) ; } ,
473
475
attr : 'hovermode' ,
474
476
val : null ,
475
477
toggle : true ,
@@ -480,7 +482,7 @@ modeBarButtons.hoverClosestGl2d = {
480
482
481
483
modeBarButtons . hoverClosestPie = {
482
484
name : 'hoverClosestPie' ,
483
- title : 'Toggle show closest data on hover' ,
485
+ title : function ( gd ) { return _ ( gd , 'Toggle show closest data on hover' ) ; } ,
484
486
attr : 'hovermode' ,
485
487
val : 'closest' ,
486
488
icon : Icons . tooltip_basic ,
@@ -506,7 +508,7 @@ function toggleHover(gd) {
506
508
507
509
modeBarButtons . toggleHover = {
508
510
name : 'toggleHover' ,
509
- title : 'Toggle show closest data on hover' ,
511
+ title : function ( gd ) { return _ ( gd , 'Toggle show closest data on hover' ) ; } ,
510
512
attr : 'hovermode' ,
511
513
val : null ,
512
514
toggle : true ,
@@ -524,7 +526,7 @@ modeBarButtons.toggleHover = {
524
526
525
527
modeBarButtons . resetViews = {
526
528
name : 'resetViews' ,
527
- title : 'Reset views' ,
529
+ title : function ( gd ) { return _ ( gd , 'Reset views' ) ; } ,
528
530
icon : Icons . home ,
529
531
click : function ( gd , ev ) {
530
532
var button = ev . currentTarget ;
@@ -543,7 +545,7 @@ modeBarButtons.resetViews = {
543
545
544
546
modeBarButtons . toggleSpikelines = {
545
547
name : 'toggleSpikelines' ,
546
- title : 'Toggle Spike Lines' ,
548
+ title : function ( gd ) { return _ ( gd , 'Toggle Spike Lines' ) ; } ,
547
549
icon : Icons . spikeline ,
548
550
attr : '_cartesianSpikesEnabled' ,
549
551
val : 'on' ,
@@ -578,7 +580,7 @@ function setSpikelineVisibility(gd) {
578
580
579
581
modeBarButtons . resetViewMapbox = {
580
582
name : 'resetViewMapbox' ,
581
- title : 'Reset view' ,
583
+ title : function ( gd ) { return _ ( gd , 'Reset view' ) ; } ,
582
584
attr : 'reset' ,
583
585
icon : Icons . home ,
584
586
click : function ( gd ) {
0 commit comments