Skip to content

Commit 142d7fd

Browse files
author
Vasilii Boldurean
committed
Added: components partial translation.
1 parent 69f0443 commit 142d7fd

11 files changed

+55
-52
lines changed

src/components/Layout/Toc.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@ export function Toc({headings}: {headings: Toc}) {
1313
// Select the max TOC item we have here for now, but remove this after the fix.
1414
const selectedIndex = Math.min(currentIndex, headings.length - 1);
1515
return (
16-
<nav role="navigation" className="pt-20 sticky top-0 right-0">
16+
<nav role="navigation" className="sticky top-0 right-0 pt-20">
1717
{headings.length > 0 && (
18-
<h2 className="mb-3 lg:mb-3 uppercase tracking-wide font-bold text-sm text-secondary dark:text-secondary-dark px-4 w-full">
19-
On this page
18+
<h2 className="w-full px-4 mb-3 text-sm font-bold tracking-wide uppercase lg:mb-3 text-secondary dark:text-secondary-dark">
19+
На этой странице
2020
</h2>
2121
)}
2222
<div
2323
className="h-full overflow-y-auto pl-4 max-h-[calc(100vh-7.5rem)]"
2424
style={{
2525
overscrollBehavior: 'contain',
2626
}}>
27-
<ul className="space-y-2 pb-16">
27+
<ul className="pb-16 space-y-2">
2828
{headings.length > 0 &&
2929
headings.map((h, i) => {
3030
if (h.url == null) {

src/components/MDX/Challenges/Challenge.tsx

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,30 +47,30 @@ export function Challenge({
4747
<div className="p-5 sm:py-8 sm:px-8">
4848
<div>
4949
<H4
50-
className="text-xl text-primary dark:text-primary-dark mb-2 mt-0 font-medium"
50+
className="mt-0 mb-2 text-xl font-medium text-primary dark:text-primary-dark"
5151
id={currentChallenge.id}>
52-
<div className="font-bold block md:inline">
53-
{isRecipes ? 'Example' : 'Challenge'} {currentChallenge.order} of{' '}
52+
<div className="block font-bold md:inline">
53+
{isRecipes ? 'Пример' : 'Испытание'} {currentChallenge.order} из{' '}
5454
{totalChallenges}
5555
<span className="text-primary dark:text-primary-dark">: </span>
5656
</div>
5757
{currentChallenge.name}
5858
</H4>
5959
{currentChallenge.content}
6060
</div>
61-
<div className="flex justify-between items-center mt-4">
61+
<div className="flex items-center justify-between mt-4">
6262
{currentChallenge.hint ? (
6363
<div>
6464
<Button className="mr-2" onClick={toggleHint} active={showHint}>
6565
<IconHint className="mr-1.5" />{' '}
66-
{showHint ? 'Hide hint' : 'Show hint'}
66+
{showHint ? 'Скрыть подсказку' : 'Показать подсказку'}
6767
</Button>
6868
<Button
6969
className="mr-2"
7070
onClick={toggleSolution}
7171
active={showSolution}>
7272
<IconSolution className="mr-1.5" />{' '}
73-
{showSolution ? 'Hide solution' : 'Show solution'}
73+
{showSolution ? 'Скрыть решение' : 'Показать решение'}
7474
</Button>
7575
</div>
7676
) : (
@@ -80,7 +80,7 @@ export function Challenge({
8080
onClick={toggleSolution}
8181
active={showSolution}>
8282
<IconSolution className="mr-1.5" />{' '}
83-
{showSolution ? 'Hide solution' : 'Show solution'}
83+
{showSolution ? 'Скрыть решение' : 'Показать решение'}
8484
</Button>
8585
)
8686
)}
@@ -94,7 +94,8 @@ export function Challenge({
9494
)}
9595
onClick={handleClickNextChallenge}
9696
active>
97-
Next {isRecipes ? 'Example' : 'Challenge'}
97+
{isRecipes ? 'Следующий' : 'Следующее'}{' '}
98+
{isRecipes ? 'Пример' : 'Испытание'}
9899
<IconArrowSmall displayDirection="right" className="block ml-1.5" />
99100
</Button>
100101
)}
@@ -104,12 +105,12 @@ export function Challenge({
104105
{showSolution && (
105106
<div className="mt-6">
106107
<h3 className="text-2xl font-bold text-primary dark:text-primary-dark">
107-
Solution
108+
Решение
108109
</h3>
109110
{currentChallenge.solution}
110-
<div className="flex justify-between items-center mt-4">
111+
<div className="flex items-center justify-between mt-4">
111112
<Button onClick={() => setShowSolution(false)}>
112-
Close solution
113+
Скрыть решение
113114
</Button>
114115
{hasNextChallenge && (
115116
<Button
@@ -118,7 +119,7 @@ export function Challenge({
118119
)}
119120
onClick={handleClickNextChallenge}
120121
active>
121-
Next Challenge
122+
Следующее Испытание
122123
<IconArrowSmall
123124
displayDirection="right"
124125
className="block ml-1.5"

src/components/MDX/Challenges/Challenges.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ export function Challenges({
7878
children,
7979
isRecipes,
8080
noTitle,
81-
titleText = isRecipes ? 'Try out some examples' : 'Try out some challenges',
81+
titleText = isRecipes
82+
? 'Попробуйте несколько примеров'
83+
: 'Выполните несколько задач',
8284
titleId = isRecipes ? 'examples' : 'challenges',
8385
}: ChallengesProps) {
8486
const challenges = parseChallengeContents(children);
@@ -117,12 +119,12 @@ export function Challenges({
117119

118120
const Heading = isRecipes ? H4 : H2;
119121
return (
120-
<div className="max-w-7xl mx-auto py-4 w-full">
122+
<div className="w-full py-4 mx-auto max-w-7xl">
121123
<div
122124
className={cn(
123125
'border-gray-10 bg-card dark:bg-card-dark shadow-inner rounded-none -mx-5 sm:mx-auto sm:rounded-2xl'
124126
)}>
125-
<div ref={scrollAnchorRef} className="py-2 px-5 sm:px-8 pb-0 md:pb-0">
127+
<div ref={scrollAnchorRef} className="px-5 py-2 pb-0 sm:px-8 md:pb-0">
126128
{!noTitle && (
127129
<Heading
128130
id={titleId}

src/components/MDX/ExpandableExample.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ function ExpandableExample({children, excerpt, type}: ExpandableExampleProps) {
5454
}
5555
)}>
5656
<summary
57-
className="list-none p-8"
57+
className="p-8 list-none"
5858
tabIndex={-1 /* there's a button instead */}
5959
onClick={(e) => {
6060
// We toggle using a button instead of this whole area,
@@ -71,7 +71,7 @@ function ExpandableExample({children, excerpt, type}: ExpandableExampleProps) {
7171
{isDeepDive && (
7272
<>
7373
<IconDeepDive className="inline mr-2 dark:text-purple-30 text-purple-40" />
74-
Deep Dive
74+
Глубокое Погружение
7575
</>
7676
)}
7777
{isExample && (
@@ -101,7 +101,7 @@ function ExpandableExample({children, excerpt, type}: ExpandableExampleProps) {
101101
<span className="mr-1">
102102
<IconChevron displayDirection={isExpanded ? 'up' : 'down'} />
103103
</span>
104-
{isExpanded ? 'Hide Details' : 'Show Details'}
104+
{isExpanded ? 'Скрыть подробности' : 'Показать подробности'}
105105
</Button>
106106
</summary>
107107
<div

src/components/MDX/MDXComponents.tsx

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -54,25 +54,25 @@ function CodeStep({children, step}: {children: any; step: number}) {
5454
}
5555

5656
const P = (p: JSX.IntrinsicElements['p']) => (
57-
<p className="whitespace-pre-wrap my-4" {...p} />
57+
<p className="my-4 whitespace-pre-wrap" {...p} />
5858
);
5959

6060
const Strong = (strong: JSX.IntrinsicElements['strong']) => (
6161
<strong className="font-bold" {...strong} />
6262
);
6363

6464
const OL = (p: JSX.IntrinsicElements['ol']) => (
65-
<ol className="ml-6 my-3 list-decimal" {...p} />
65+
<ol className="my-3 ml-6 list-decimal" {...p} />
6666
);
6767
const LI = (p: JSX.IntrinsicElements['li']) => (
68-
<li className="leading-relaxed mb-1" {...p} />
68+
<li className="mb-1 leading-relaxed" {...p} />
6969
);
7070
const UL = (p: JSX.IntrinsicElements['ul']) => (
71-
<ul className="ml-6 my-3 list-disc" {...p} />
71+
<ul className="my-3 ml-6 list-disc" {...p} />
7272
);
7373

7474
const Divider = () => (
75-
<hr className="my-6 block border-b border-t-0 border-border dark:border-border-dark" />
75+
<hr className="block my-6 border-t-0 border-b border-border dark:border-border-dark" />
7676
);
7777
const Wip = ({children}: {children: React.ReactNode}) => (
7878
<ExpandableCallout type="wip">{children}</ExpandableCallout>
@@ -93,9 +93,9 @@ const Blockquote = ({
9393
}: JSX.IntrinsicElements['blockquote']) => {
9494
return (
9595
<blockquote
96-
className="mdx-blockquote py-4 px-8 my-8 shadow-inner-border dark:shadow-inner-border-dark bg-highlight dark:bg-highlight-dark bg-opacity-50 rounded-2xl leading-6 flex relative"
96+
className="relative flex px-8 py-4 my-8 leading-6 bg-opacity-50 mdx-blockquote shadow-inner-border dark:shadow-inner-border-dark bg-highlight dark:bg-highlight-dark rounded-2xl"
9797
{...props}>
98-
<span className="block relative">{children}</span>
98+
<span className="relative block">{children}</span>
9999
</blockquote>
100100
);
101101
};
@@ -110,9 +110,9 @@ function LearnMore({
110110
}) {
111111
return (
112112
<>
113-
<section className="p-8 mt-16 mb-16 flex flex-row shadow-inner-border dark:shadow-inner-border-dark justify-between items-center bg-card dark:bg-card-dark rounded-2xl">
113+
<section className="flex flex-row items-center justify-between p-8 mt-16 mb-16 shadow-inner-border dark:shadow-inner-border-dark bg-card dark:bg-card-dark rounded-2xl">
114114
<div className="flex-col">
115-
<h2 className="text-primary font-display dark:text-primary-dark font-bold text-2xl leading-tight">
115+
<h2 className="text-2xl font-bold leading-tight text-primary font-display dark:text-primary-dark">
116116
Ready to learn this topic?
117117
</h2>
118118
{children}
@@ -173,7 +173,7 @@ function YouWillLearn({
173173
children: any;
174174
isChapter?: boolean;
175175
}) {
176-
let title = isChapter ? 'In this chapter' : 'You will learn';
176+
let title = isChapter ? 'В этой главе' : 'Вы изучите';
177177
return <SimpleCallout title={title}>{children}</SimpleCallout>;
178178
}
179179

@@ -233,16 +233,16 @@ function Illustration({
233233
const {isInBlock} = React.useContext(IllustrationContext);
234234

235235
return (
236-
<div className="relative group before:absolute before:-inset-y-16 before:inset-x-0 my-16 mx-0 2xl:mx-auto max-w-4xl 2xl:max-w-6xl">
237-
<figure className="my-8 flex justify-center">
236+
<div className="relative max-w-4xl mx-0 my-16 group before:absolute before:-inset-y-16 before:inset-x-0 2xl:mx-auto 2xl:max-w-6xl">
237+
<figure className="flex justify-center my-8">
238238
<img
239239
src={src}
240240
alt={alt}
241241
style={{maxHeight: 300}}
242242
className="bg-white rounded-lg"
243243
/>
244244
{caption ? (
245-
<figcaption className="text-center leading-tight mt-4">
245+
<figcaption className="mt-4 leading-tight text-center">
246246
{caption}
247247
</figcaption>
248248
) : null}
@@ -270,21 +270,21 @@ function IllustrationBlock({
270270
);
271271
const images = imageInfos.map((info, index) => (
272272
<figure key={index}>
273-
<div className="bg-white rounded-lg p-4 flex-1 flex xl:p-6 justify-center items-center my-4">
273+
<div className="flex items-center justify-center flex-1 p-4 my-4 bg-white rounded-lg xl:p-6">
274274
<img src={info.src} alt={info.alt} height={info.height} />
275275
</div>
276276
{info.caption ? (
277-
<figcaption className="text-secondary dark:text-secondary-dark text-center leading-tight mt-4">
277+
<figcaption className="mt-4 leading-tight text-center text-secondary dark:text-secondary-dark">
278278
{info.caption}
279279
</figcaption>
280280
) : null}
281281
</figure>
282282
));
283283
return (
284284
<IllustrationContext.Provider value={isInBlockTrue}>
285-
<div className="relative group before:absolute before:-inset-y-16 before:inset-x-0 my-16 mx-0 2xl:mx-auto max-w-4xl 2xl:max-w-6xl">
285+
<div className="relative max-w-4xl mx-0 my-16 group before:absolute before:-inset-y-16 before:inset-x-0 2xl:mx-auto 2xl:max-w-6xl">
286286
{sequential ? (
287-
<ol className="mdx-illustration-block flex">
287+
<ol className="flex mdx-illustration-block">
288288
{images.map((x: any, i: number) => (
289289
<li className="flex-1" key={i}>
290290
{x}

src/components/MDX/Recap.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function Recap({children}: RecapProps) {
1313
return (
1414
<section>
1515
<H2 isPageAnchor id="recap">
16-
Recap
16+
Подведение итогов
1717
</H2>
1818
{children}
1919
</section>

src/components/MDX/Sandpack/CustomPreset.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ const SandboxShell = memo(function SandboxShell({
7474
return (
7575
<>
7676
<div
77-
className="shadow-lg dark:shadow-lg-dark rounded-lg"
77+
className="rounded-lg shadow-lg dark:shadow-lg-dark"
7878
ref={containerRef}
7979
style={{
8080
contain: 'content',
@@ -95,7 +95,7 @@ const SandboxShell = memo(function SandboxShell({
9595
{(isExpandable || isExpanded) && (
9696
<button
9797
translate="yes"
98-
className="sandpack-expand flex text-base justify-between dark:border-card-dark bg-wash dark:bg-card-dark items-center z-10 p-1 w-full order-2 xl:order-last border-b-1 relative top-0"
98+
className="relative top-0 z-10 flex items-center justify-between order-2 w-full p-1 text-base sandpack-expand dark:border-card-dark bg-wash dark:bg-card-dark xl:order-last border-b-1"
9999
onClick={() => {
100100
const nextIsExpanded = !isExpanded;
101101
flushSync(() => {
@@ -119,7 +119,7 @@ const SandboxShell = memo(function SandboxShell({
119119
className="inline mr-1.5 text-xl"
120120
displayDirection={isExpanded ? 'up' : 'down'}
121121
/>
122-
{isExpanded ? 'Show less' : 'Show more'}
122+
{isExpanded ? 'Скрыть' : 'Раскрыть'}
123123
</span>
124124
</button>
125125
)}

src/components/MDX/Sandpack/DownloadButton.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,11 @@ ${css}
9696

9797
return (
9898
<button
99-
className="text-sm text-primary dark:text-primary-dark inline-flex items-center hover:text-link duration-100 ease-in transition mx-1"
99+
className="inline-flex items-center mx-1 text-sm transition duration-100 ease-in text-primary dark:text-primary-dark hover:text-link"
100100
onClick={downloadHTML}
101101
title="Download Sandbox"
102102
type="button">
103-
<IconDownload className="inline mr-1" /> Download
103+
<IconDownload className="inline mr-1" /> Загрузить
104104
</button>
105105
);
106106
}

src/components/MDX/Sandpack/OpenInCodeSandboxButton.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ import {IconNewPage} from '../../Icon/IconNewPage';
88
export const OpenInCodeSandboxButton = () => {
99
return (
1010
<UnstyledOpenInCodeSandboxButton
11-
className="text-sm text-primary dark:text-primary-dark inline-flex items-center hover:text-link duration-100 ease-in transition mx-1 ml-2 md:ml-1"
11+
className="inline-flex items-center mx-1 ml-2 text-sm transition duration-100 ease-in text-primary dark:text-primary-dark hover:text-link md:ml-1"
1212
title="Open in CodeSandbox">
1313
<IconNewPage
1414
className="inline ml-1 mr-1 relative top-[1px]"
1515
width="1em"
1616
height="1em"
1717
/>
18-
<span className="hidden md:block">Fork</span>
18+
<span className="hidden md:block">Отрыть в песочнице</span>
1919
</UnstyledOpenInCodeSandboxButton>
2020
);
2121
};

src/components/MDX/Sandpack/ResetButton.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ export interface ResetButtonProps {
1111
export function ResetButton({onReset}: ResetButtonProps) {
1212
return (
1313
<button
14-
className="text-sm text-primary dark:text-primary-dark inline-flex items-center hover:text-link duration-100 ease-in transition mx-1"
14+
className="inline-flex items-center mx-1 text-sm transition duration-100 ease-in text-primary dark:text-primary-dark hover:text-link"
1515
onClick={onReset}
1616
title="Reset Sandbox"
1717
type="button">
18-
<IconRestart className="inline ml-1 mr-1 relative" /> Reset
18+
<IconRestart className="relative inline ml-1 mr-1" /> Сбросить
1919
</button>
2020
);
2121
}

src/utils/prepareMDX.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ function getTableOfContents(children, depth) {
6565
if (anchors.length > 0) {
6666
anchors.unshift({
6767
url: '#',
68-
text: 'Overview',
68+
text: 'Обзор',
6969
depth: 2,
7070
});
7171
}
@@ -88,13 +88,13 @@ function extractHeaders(children, depth, out) {
8888
header = {
8989
url: '#challenges',
9090
depth: 2,
91-
text: 'Challenges',
91+
text: 'Испытания',
9292
};
9393
} else if (child.type === 'Recap') {
9494
header = {
9595
url: '#recap',
9696
depth: 2,
97-
text: 'Recap',
97+
text: 'Подведение итогов',
9898
};
9999
} else if (child.type === 'TeamMember') {
100100
header = {

0 commit comments

Comments
 (0)