Skip to content

Commit 54487ad

Browse files
committed
Use i18n functionality for button text
1 parent 2dd3edc commit 54487ad

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

locales/en/translation.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,10 @@
6161
"css": "CSS",
6262
"javascript": "JS"
6363
},
64-
"output": "Output"
64+
"output": "Output",
65+
"instructions": {
66+
"cancel": "Cancel"
67+
}
6568
}
6669
},
6770
"utility": {

src/components/InstructionsEditor.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
import React from 'react';
22
import PropTypes from 'prop-types';
3+
import {t} from 'i18next';
34

45
export default function InstructionsEditor({instructions, onCancelEditing}) {
56
return (
67
<div className="instructions-editor">
78
<div className="instructions-editor-menu">
8-
<button onClick={onCancelEditing}>Cancel</button>
9+
<button onClick={onCancelEditing}>
10+
{t('workspace.components.instructions.cancel')}
11+
</button>
912
</div>
1013
<pre contentEditable>
1114
{instructions}

0 commit comments

Comments
 (0)