Skip to content

Commit 71c10f4

Browse files
committed
fix: support i18n
1 parent dc4eef9 commit 71c10f4

File tree

4 files changed

+16
-1
lines changed

4 files changed

+16
-1
lines changed

docs/tutorialkit.dev/src/content/docs/reference/configuration.mdx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ type I18nText = {
4848
*/
4949
partTemplate?: string,
5050

51+
/**
52+
* Text of the edit page link.
53+
*
54+
* @default 'Edit this page'
55+
*/
56+
editPage?: string
57+
5158
/**
5259
* Text shown when there are no previews or steps to show in the prepare environment section.
5360
*

packages/astro/src/default/components/TutorialContent.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const { Markdown, editPageLink, prev, next } = lesson;
2424
class="inline-flex flex-items-center text-tk-elements-editPageLink-textColor hover:text-tk-elements-editPageLink-textColorHover hover:underline"
2525
>
2626
<span class="icon i-ph-note-pencil pointer-events-none h-5 w-5 mr-2 text-tk-elements-editPageLink-iconColor group-hover:text-tk-elements-editPageLink-iconColorHover" />
27-
<span>Edit this page</span>
27+
<span>{lesson.data.i18n!.editPage}</span>
2828
</a>
2929
</div>
3030
)

packages/astro/src/default/utils/content.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ export async function getTutorial(): Promise<Tutorial> {
4444
partTemplate: 'Part ${index}: ${title}',
4545
noPreviewNorStepsText: 'No preview to run nor steps to show',
4646
startWebContainerText: 'Run this tutorial',
47+
editPage: 'Edit this page',
4748
} satisfies Lesson['data']['i18n'],
4849
tutorialMetaData.i18n,
4950
);

packages/types/src/schemas/i18n.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ export const i18nSchema = z.object({
88
*/
99
partTemplate: z.string().optional(),
1010

11+
/**
12+
* Text of the edit page link.
13+
*
14+
* @default 'Edit this page'
15+
*/
16+
editPage: z.string().optional(),
17+
1118
/**
1219
* Text shown when there are no previews or steps to show in the prepare environment section.
1320
*

0 commit comments

Comments
 (0)