@@ -13,9 +13,9 @@ import { TutorialContext, SolutionContext } from './contexts';
1313import { parseStackTrace } from '../repl/errors' ;
1414import cx from '../../../lib/cx' ;
1515import { CodeEditor , Runner , ErrorOverlay , Splitter } from '../../routes' ;
16+ import { useTranslation } from '../../../lib/i18n.jsx' ;
1617import { MarkdownRegion } from '../markdown-region' ;
1718import style from './style.module.css' ;
18- import englishTranslations from '../../../locales/en.json' ;
1919
2020const resultHandlers = new Set ( ) ;
2121const realmHandlers = new Set ( ) ;
@@ -215,11 +215,16 @@ export function Tutorial({ html, meta }) {
215215}
216216
217217function ButtonContainer ( { meta, showCode, help } ) {
218+ const previousPage = useTranslation ( 'previousPage' ) ;
219+ const nextPage = useTranslation ( 'nextPage' ) ;
220+ const solve = useTranslation ( 'solve' ) ;
221+ const tutorialBegin = useTranslation ( 'beginTutorial' ) ;
222+
218223 return (
219224 < div class = { style . buttonContainer } >
220225 { meta . prev && (
221226 < a class = { style . prevButton } href = { meta . prev } >
222- { englishTranslations . previous }
227+ { previousPage }
223228 </ a >
224229 ) }
225230 { meta . solvable && (
@@ -229,14 +234,12 @@ function ButtonContainer({ meta, showCode, help }) {
229234 disabled = { ! showCode }
230235 title = "Show solution to this example"
231236 >
232- { englishTranslations . tutorial . solve }
237+ { solve }
233238 </ button >
234239 ) }
235240 { meta . next && (
236241 < a class = { style . nextButton } href = { meta . next } >
237- { meta . code == false
238- ? englishTranslations . tutorial . begin
239- : englishTranslations . next }
242+ { meta . code == false ? tutorialBegin : nextPage }
240243 </ a >
241244 ) }
242245 </ div >
0 commit comments