Skip to content

Commit d6221e7

Browse files
committed
feat: localization for "Powered by" text
1 parent 7aecff3 commit d6221e7

File tree

4 files changed

+18
-3
lines changed

4 files changed

+18
-3
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
@@ -55,6 +55,13 @@ type I18nText = {
5555
*/
5656
editPageText?: string
5757

58+
/**
59+
* Text shown before webcontainer link.
60+
*
61+
* @default 'Powered by'
62+
*/
63+
webcontainerLinkText?: string,
64+
5865
/**
5966
* Text shown when there are no previews or steps to show in the prepare environment section.
6067
*

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ const { Markdown, editPageLink, prev, next } = lesson;
4040
</div>
4141

4242
<p class="mt-6 font-size-3.5 text-tk-elements-webcontainersLink-textColor">
43-
Powered by <a
44-
class="underline hover:text-tk-elements-webcontainersLink-textColorHover"
45-
href="https://webcontainers.io/">webcontainers.io</a
43+
{lesson.data.i18n!.webcontainerLinkText}
44+
<a class="underline hover:text-tk-elements-webcontainersLink-textColorHover" href="https://webcontainers.io/"
45+
>webcontainers.io</a
4646
>
4747
</p>
4848
</div>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export const DEFAULT_LOCALIZATION = {
55
noPreviewNorStepsText: 'No preview to run nor steps to show',
66
startWebContainerText: 'Run this tutorial',
77
editPageText: 'Edit this page',
8+
webcontainerLinkText: 'Powered by',
89
filesTitleText: 'Files',
910
prepareEnvironmentTitleText: 'Preparing Environment',
1011
toggleTerminalButtonText: 'Toggle Terminal',

packages/types/src/schemas/i18n.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ export const i18nSchema = z.object({
1515
*/
1616
editPageText: z.string().optional().describe('Text of the edit page link.'),
1717

18+
/**
19+
* Text shown before webcontainer link.
20+
*
21+
* @default 'Powered by'
22+
*/
23+
webcontainerLinkText: z.string().optional().describe('Text shown before webcontainer link.'),
24+
1825
/**
1926
* Text shown when there are no previews or steps to show in the prepare environment section.
2027
*

0 commit comments

Comments
 (0)