@@ -2,6 +2,7 @@ import PropTypes from 'prop-types';
22import React from 'react' ;
33import CodeMirror from 'codemirror' ;
44import beautifyJS from 'js-beautify' ;
5+ import { withTranslation } from 'react-i18next' ;
56import 'codemirror/mode/css/css' ;
67import 'codemirror/addon/selection/active-line' ;
78import 'codemirror/addon/lint/lint' ;
@@ -136,7 +137,7 @@ class Editor extends React.Component {
136137 } , 1000 ) ) ;
137138
138139 this . _cm . on ( 'keyup' , ( ) => {
139- const temp = `line ${ parseInt ( ( this . _cm . getCursor ( ) . line ) + 1 , 10 ) } ` ;
140+ const temp = this . props . t ( 'Editor.KeyUpLineNumber' , { lineNumber : parseInt ( ( this . _cm . getCursor ( ) . line ) + 1 , 10 ) } ) ;
140141 document . getElementById ( 'current-line' ) . innerHTML = temp ;
141142 } ) ;
142143
@@ -317,14 +318,14 @@ class Editor extends React.Component {
317318 < section className = { editorSectionClass } >
318319 < header className = "editor__header" >
319320 < button
320- aria-label = "Open Sketch files navigation"
321+ aria-label = { this . props . t ( 'Editor.OpenSketchARIA' ) }
321322 className = "sidebar__contract"
322323 onClick = { this . props . collapseSidebar }
323324 >
324325 < LeftArrowIcon focusable = "false" aria-hidden = "true" />
325326 </ button >
326327 < button
327- aria-label = "Close sketch files navigation"
328+ aria-label = { this . props . t ( 'Editor.CloseSketchARIA' ) }
328329 className = "sidebar__expand"
329330 onClick = { this . props . expandSidebar }
330331 >
@@ -335,7 +336,7 @@ class Editor extends React.Component {
335336 { this . props . file . name }
336337 < span className = "editor__unsaved-changes" >
337338 { this . props . unsavedChanges ?
338- < UnsavedChangesDotIcon role = "img" aria-label = "Sketch has unsaved changes" focusable = "false" /> :
339+ < UnsavedChangesDotIcon role = "img" aria-label = { this . props . t ( 'Editor.UnsavedChangesARIA' ) } focusable = "false" /> :
339340 null }
340341 </ span >
341342 </ span >
@@ -403,12 +404,13 @@ Editor.propTypes = {
403404 showRuntimeErrorWarning : PropTypes . func . isRequired ,
404405 hideRuntimeErrorWarning : PropTypes . func . isRequired ,
405406 runtimeErrorWarningVisible : PropTypes . bool . isRequired ,
406- provideController : PropTypes . func . isRequired
407+ provideController : PropTypes . func . isRequired ,
408+ t : PropTypes . func . isRequired
407409} ;
408410
409411Editor . defaultProps = {
410412 isUserOwner : false ,
411413 consoleEvents : [ ] ,
412414} ;
413415
414- export default Editor ;
416+ export default withTranslation ( ) ( Editor ) ;
0 commit comments