-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: missing preview i18n #255
Conversation
Run & review this pull request in StackBlitz Codeflow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The preview title is also configurable via previews
option:
---
type: tutorial
previews:
- title: 預覽
port: 5173
---
But it does make sense to be able to configure the default text via i18n
as well.
Oh, I see. When I want to do i18n, I intuitively look for replaceable values in the i18n options. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really nice work! 🌟
I think we can definitely land this. Thanks for the PR! 😃
Co-authored-by: Jòan <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also mention this in documentation:
tutorialkit/docs/tutorialkit.dev/src/content/docs/reference/configuration.mdx
Lines 42 to 81 in c7bad20
```ts | |
type I18nText = { | |
/** | |
* Template for formatting a part. Variables: ${index} and ${title}. | |
* | |
* @default 'Part ${index}: ${title}' | |
*/ | |
partTemplate?: string, | |
/** | |
* Text of the edit page link. | |
* | |
* @default 'Edit this page' | |
*/ | |
editPageText?: string | |
/** | |
* Text of the WebContainer link. | |
* | |
* @default 'Powered by WebContainers' | |
*/ | |
webcontainerLinkText?: string, | |
/** | |
* Text shown when there are no previews or steps to show in the prepare environment section. | |
* | |
* @default 'Start WebContainer' | |
*/ | |
startWebContainerText?: string, | |
/** | |
* Text shown on the call to action button to start webcontainer when boot was blocked | |
* due to memory restrictions. | |
* | |
* @default 'No preview to run nor steps to show' | |
*/ | |
noPreviewNorStepsText?: string, | |
} | |
``` |
Wait a minute while I look at why the test failed. |
All tests are failing. We are pinning a dependency version of transitive dependency in test cases. Another dependency just updated and doesn't support that version. There's fix in #261. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I think the test failure is probably unrelated to this PR.
@ycs77 You have a lint error! Once fixed, we can merge your PR 🙌 |
Problem
I'm currently using the tutorialkit version v0.1.5, if added some i18n texts:
docs/demo/src/content/tutorial/meta.md
The i18n will work on webcontainer starting:
But not working on webcontainer started:
PR Added
Toggle Terminal
i18n text in started<Preview>
Preview
i18n text