Skip to content

Translation for Conditional Rendering #348

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions src/components/MDX/Challenges/Challenge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export function Challenge({
className="text-xl text-primary dark:text-primary-dark mb-2 mt-0 font-medium"
id={currentChallenge.id}>
<div className="font-bold block md:inline">
{isRecipes ? 'Example' : 'Challenge'} {currentChallenge.order} of{' '}
{isRecipes ? 'Ví dụ' : 'Thử thách'} {currentChallenge.order} trên{' '}
{totalChallenges}
<span className="text-primary dark:text-primary-dark">: </span>
</div>
Expand All @@ -63,14 +63,14 @@ export function Challenge({
<div>
<Button className="mr-2" onClick={toggleHint} active={showHint}>
<IconHint className="mr-1.5" />{' '}
{showHint ? 'Hide hint' : 'Show hint'}
{showHint ? 'Ẩn gợi ý' : 'Hiện gợi ý'}
</Button>
<Button
className="mr-2"
onClick={toggleSolution}
active={showSolution}>
<IconSolution className="mr-1.5" />{' '}
{showSolution ? 'Hide solution' : 'Show solution'}
{showSolution ? 'Ẩn đáp án' : 'Hiện đáp án'}
</Button>
</div>
) : (
Expand All @@ -80,7 +80,7 @@ export function Challenge({
onClick={toggleSolution}
active={showSolution}>
<IconSolution className="mr-1.5" />{' '}
{showSolution ? 'Hide solution' : 'Show solution'}
{showSolution ? 'Ẩn đáp án' : 'Hiện đáp án'}
</Button>
)
)}
Expand All @@ -94,7 +94,7 @@ export function Challenge({
)}
onClick={handleClickNextChallenge}
active>
Next {isRecipes ? 'Example' : 'Challenge'}
{isRecipes ? 'Ví dụ tiếp theo' : 'Thử thách tiếp theo'}
<IconArrowSmall displayDirection="right" className="block ml-1.5" />
</Button>
)}
Expand All @@ -104,21 +104,19 @@ export function Challenge({
{showSolution && (
<div className="mt-6">
<h3 className="text-2xl font-bold text-primary dark:text-primary-dark">
Solution
Đáp án
</h3>
{currentChallenge.solution}
<div className="flex justify-between items-center mt-4">
<Button onClick={() => setShowSolution(false)}>
Close solution
</Button>
<Button onClick={() => setShowSolution(false)}>Đóng đáp án</Button>
{hasNextChallenge && (
<Button
className={cn(
isRecipes ? 'bg-purple-50' : 'bg-link dark:bg-link-dark'
)}
onClick={handleClickNextChallenge}
active>
Next Challenge
Thử thách tiếp theo
<IconArrowSmall
displayDirection="right"
className="block ml-1.5"
Expand Down
2 changes: 1 addition & 1 deletion src/components/MDX/Challenges/Challenges.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export function Challenges({
children,
isRecipes,
noTitle,
titleText = isRecipes ? 'Try out some examples' : 'Try out some challenges',
titleText = isRecipes ? 'Một vài ví dụ' : 'Một vài thử thách',
titleId = isRecipes ? 'examples' : 'challenges',
}: ChallengesProps) {
const challenges = parseChallengeContents(children);
Expand Down
2 changes: 1 addition & 1 deletion src/components/MDX/ExpandableCallout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const variantMap = {
'linear-gradient(rgba(245, 249, 248, 0), rgba(245, 249, 248, 1)',
},
pitfall: {
title: 'Pitfall',
title: 'Lưu ý',
Icon: IconPitfall,
containerClasses: 'bg-yellow-5 dark:bg-yellow-60 dark:bg-opacity-20',
textColor: 'text-yellow-50 dark:text-yellow-40',
Expand Down
4 changes: 2 additions & 2 deletions src/components/MDX/ExpandableExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function ExpandableExample({children, excerpt, type}: ExpandableExampleProps) {
{isDeepDive && (
<>
<IconDeepDive className="inline mr-2 dark:text-purple-30 text-purple-40" />
Deep Dive
Chuyên sâu
</>
)}
{isExample && (
Expand Down Expand Up @@ -101,7 +101,7 @@ function ExpandableExample({children, excerpt, type}: ExpandableExampleProps) {
<span className="mr-1">
<IconChevron displayDirection={isExpanded ? 'up' : 'down'} />
</span>
{isExpanded ? 'Hide Details' : 'Show Details'}
{isExpanded ? 'Ẩn chi tiết' : 'Hiện chi tiết'}
</Button>
</summary>
<div
Expand Down
2 changes: 1 addition & 1 deletion src/components/MDX/MDXComponents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ function YouWillLearn({
children: any;
isChapter?: boolean;
}) {
let title = isChapter ? 'In this chapter' : 'You will learn';
let title = isChapter ? 'Trong phần này' : 'Danh mục';
return <SimpleCallout title={title}>{children}</SimpleCallout>;
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/MDX/Recap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function Recap({children}: RecapProps) {
return (
<section>
<H2 isPageAnchor id="recap">
Recap
Tóm tắt
</H2>
{children}
</section>
Expand Down
2 changes: 1 addition & 1 deletion src/components/MDX/Sandpack/CustomPreset.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ const SandboxShell = memo(function SandboxShell({
className="inline mr-1.5 text-xl"
displayDirection={isExpanded ? 'up' : 'down'}
/>
{isExpanded ? 'Show less' : 'Show more'}
{isExpanded ? 'Ẩn bớt' : 'Hiện thêm'}
</span>
</button>
)}
Expand Down
2 changes: 1 addition & 1 deletion src/components/MDX/Sandpack/DownloadButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ ${css}
onClick={downloadHTML}
title="Download Sandbox"
type="button">
<IconDownload className="inline mr-1" /> Download
<IconDownload className="inline mr-1" /> Tải về
</button>
);
}
Loading