44
55Menubar . Add = function ( editor ) {
66
7+ var strings = editor . strings ;
8+
79 var container = new UI . Panel ( ) ;
810 container . setClass ( 'menu' ) ;
911
1012 var title = new UI . Panel ( ) ;
1113 title . setClass ( 'title' ) ;
12- title . setTextContent ( 'Add' ) ;
14+ title . setTextContent ( strings . getKey ( 'menubar/add' ) ) ;
1315 container . add ( title ) ;
1416
1517 var options = new UI . Panel ( ) ;
@@ -20,7 +22,7 @@ Menubar.Add = function ( editor ) {
2022
2123 var option = new UI . Row ( ) ;
2224 option . setClass ( 'option' ) ;
23- option . setTextContent ( 'Group' ) ;
25+ option . setTextContent ( strings . getKey ( 'menubar/add/group' ) ) ;
2426 option . onClick ( function ( ) {
2527
2628 var mesh = new THREE . Group ( ) ;
@@ -39,7 +41,7 @@ Menubar.Add = function ( editor ) {
3941
4042 var option = new UI . Row ( ) ;
4143 option . setClass ( 'option' ) ;
42- option . setTextContent ( 'Plane' ) ;
44+ option . setTextContent ( strings . getKey ( 'menubar/add/plane' ) ) ;
4345 option . onClick ( function ( ) {
4446
4547 var geometry = new THREE . PlaneBufferGeometry ( 1 , 1 , 1 , 1 ) ;
@@ -56,7 +58,7 @@ Menubar.Add = function ( editor ) {
5658
5759 var option = new UI . Row ( ) ;
5860 option . setClass ( 'option' ) ;
59- option . setTextContent ( 'Box' ) ;
61+ option . setTextContent ( strings . getKey ( 'menubar/add/box' ) ) ;
6062 option . onClick ( function ( ) {
6163
6264 var geometry = new THREE . BoxBufferGeometry ( 1 , 1 , 1 , 1 , 1 , 1 ) ;
@@ -72,7 +74,7 @@ Menubar.Add = function ( editor ) {
7274
7375 var option = new UI . Row ( ) ;
7476 option . setClass ( 'option' ) ;
75- option . setTextContent ( 'Circle' ) ;
77+ option . setTextContent ( strings . getKey ( 'menubar/add/circle' ) ) ;
7678 option . onClick ( function ( ) {
7779
7880 var geometry = new THREE . CircleBufferGeometry ( 1 , 8 , 0 , Math . PI * 2 ) ;
@@ -88,7 +90,7 @@ Menubar.Add = function ( editor ) {
8890
8991 var option = new UI . Row ( ) ;
9092 option . setClass ( 'option' ) ;
91- option . setTextContent ( 'Cylinder' ) ;
93+ option . setTextContent ( strings . getKey ( 'menubar/add/cylinder' ) ) ;
9294 option . onClick ( function ( ) {
9395
9496 var geometry = new THREE . CylinderBufferGeometry ( 1 , 1 , 1 , 8 , 1 , false , 0 , Math . PI * 2 ) ;
@@ -104,7 +106,7 @@ Menubar.Add = function ( editor ) {
104106
105107 var option = new UI . Row ( ) ;
106108 option . setClass ( 'option' ) ;
107- option . setTextContent ( 'Sphere' ) ;
109+ option . setTextContent ( strings . getKey ( 'menubar/add/sphere' ) ) ;
108110 option . onClick ( function ( ) {
109111
110112 var geometry = new THREE . SphereBufferGeometry ( 1 , 8 , 6 , 0 , Math . PI * 2 , 0 , Math . PI ) ;
@@ -120,7 +122,7 @@ Menubar.Add = function ( editor ) {
120122
121123 var option = new UI . Row ( ) ;
122124 option . setClass ( 'option' ) ;
123- option . setTextContent ( 'Icosahedron' ) ;
125+ option . setTextContent ( strings . getKey ( 'menubar/add/icosahedron' ) ) ;
124126 option . onClick ( function ( ) {
125127
126128 var geometry = new THREE . IcosahedronGeometry ( 1 , 0 ) ;
@@ -136,7 +138,7 @@ Menubar.Add = function ( editor ) {
136138
137139 var option = new UI . Row ( ) ;
138140 option . setClass ( 'option' ) ;
139- option . setTextContent ( 'Torus' ) ;
141+ option . setTextContent ( strings . getKey ( 'menubar/add/torus' ) ) ;
140142 option . onClick ( function ( ) {
141143
142144 var geometry = new THREE . TorusBufferGeometry ( 1 , 0.4 , 8 , 6 , Math . PI * 2 ) ;
@@ -152,7 +154,7 @@ Menubar.Add = function ( editor ) {
152154
153155 var option = new UI . Row ( ) ;
154156 option . setClass ( 'option' ) ;
155- option . setTextContent ( 'TorusKnot' ) ;
157+ option . setTextContent ( strings . getKey ( 'menubar/add/torusknot' ) ) ;
156158 option . onClick ( function ( ) {
157159
158160 var geometry = new THREE . TorusKnotBufferGeometry ( 1 , 0.4 , 64 , 8 , 2 , 3 ) ;
@@ -197,7 +199,7 @@ Menubar.Add = function ( editor ) {
197199
198200 var option = new UI . Row ( ) ;
199201 option . setClass ( 'option' ) ;
200- option . setTextContent ( 'Lathe' ) ;
202+ option . setTextContent ( strings . getKey ( 'menubar/add/lathe' ) ) ;
201203 option . onClick ( function ( ) {
202204
203205 var points = [
@@ -227,7 +229,7 @@ Menubar.Add = function ( editor ) {
227229
228230 var option = new UI . Row ( ) ;
229231 option . setClass ( 'option' ) ;
230- option . setTextContent ( 'Sprite' ) ;
232+ option . setTextContent ( strings . getKey ( 'menubar/add/sprite' ) ) ;
231233 option . onClick ( function ( ) {
232234
233235 var sprite = new THREE . Sprite ( new THREE . SpriteMaterial ( ) ) ;
@@ -246,7 +248,7 @@ Menubar.Add = function ( editor ) {
246248
247249 var option = new UI . Row ( ) ;
248250 option . setClass ( 'option' ) ;
249- option . setTextContent ( 'PointLight' ) ;
251+ option . setTextContent ( strings . getKey ( 'menubar/add/pointlight' ) ) ;
250252 option . onClick ( function ( ) {
251253
252254 var color = 0xffffff ;
@@ -265,7 +267,7 @@ Menubar.Add = function ( editor ) {
265267
266268 var option = new UI . Row ( ) ;
267269 option . setClass ( 'option' ) ;
268- option . setTextContent ( 'SpotLight' ) ;
270+ option . setTextContent ( strings . getKey ( 'menubar/add/spotlight' ) ) ;
269271 option . onClick ( function ( ) {
270272
271273 var color = 0xffffff ;
@@ -289,7 +291,7 @@ Menubar.Add = function ( editor ) {
289291
290292 var option = new UI . Row ( ) ;
291293 option . setClass ( 'option' ) ;
292- option . setTextContent ( 'DirectionalLight' ) ;
294+ option . setTextContent ( strings . getKey ( 'menubar/add/directionallight' ) ) ;
293295 option . onClick ( function ( ) {
294296
295297 var color = 0xffffff ;
@@ -310,7 +312,7 @@ Menubar.Add = function ( editor ) {
310312
311313 var option = new UI . Row ( ) ;
312314 option . setClass ( 'option' ) ;
313- option . setTextContent ( 'HemisphereLight' ) ;
315+ option . setTextContent ( strings . getKey ( 'menubar/add/hemispherelight' ) ) ;
314316 option . onClick ( function ( ) {
315317
316318 var skyColor = 0x00aaff ;
@@ -331,7 +333,7 @@ Menubar.Add = function ( editor ) {
331333
332334 var option = new UI . Row ( ) ;
333335 option . setClass ( 'option' ) ;
334- option . setTextContent ( 'AmbientLight' ) ;
336+ option . setTextContent ( strings . getKey ( 'menubar/add/ambientlight' ) ) ;
335337 option . onClick ( function ( ) {
336338
337339 var color = 0x222222 ;
@@ -352,7 +354,7 @@ Menubar.Add = function ( editor ) {
352354
353355 var option = new UI . Row ( ) ;
354356 option . setClass ( 'option' ) ;
355- option . setTextContent ( 'PerspectiveCamera' ) ;
357+ option . setTextContent ( strings . getKey ( 'menubar/add/perspectivecamera' ) ) ;
356358 option . onClick ( function ( ) {
357359
358360 var camera = new THREE . PerspectiveCamera ( 50 , 1 , 1 , 10000 ) ;
0 commit comments