Skip to content

Commit e69d112

Browse files
authored
Merge pull request #3448 from ClickHouse/translate_improvements
menu translations and dont allow edit
2 parents ec155df + 9263bde commit e69d112

File tree

7 files changed

+348
-143
lines changed

7 files changed

+348
-143
lines changed

docusaurus.config.jp.js

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const config = {
4646
"ドキュメント、クイックスタートガイド、ユーザーガイド、技術リファレンス、FAQ など、多様な情報をご提供します。",
4747
url: "https://clickhouse.com",
4848
// url: process.env.VERCEL_URL ? `https://${process.env.VERCEL_URL}` : 'https://bookish-disco-5997zvo.pages.github.io',
49-
baseUrl: "/docs/jp/",
49+
baseUrl: "/docs/",
5050
baseUrlIssueBanner: true,
5151
onBrokenLinks: "warn",
5252
onBrokenMarkdownLinks: "warn",
@@ -107,29 +107,8 @@ const config = {
107107
const sidebarItems = await defaultSidebarItemsGenerator(args);
108108
return skipIndex(sidebarItems);
109109
},
110-
editCurrentVersion: true,
110+
editCurrentVersion: false,
111111
breadcrumbs: true,
112-
editUrl: ({ docPath }) => {
113-
if (docPath === "index.md") return false;
114-
if (
115-
docPath.includes("development") ||
116-
docPath.includes("engines") ||
117-
docPath.includes("getting-started") ||
118-
docPath.includes("interfaces") ||
119-
docPath.includes("operations") ||
120-
docPath.includes("sql-reference")
121-
) {
122-
return (
123-
"https://github.com/ClickHouse/ClickHouse/tree/master/docs/en/" +
124-
docPath
125-
);
126-
} else {
127-
return (
128-
"https://github.com/ClickHouse/clickhouse-docs/blob/main/docs/" +
129-
docPath
130-
);
131-
}
132-
},
133112
showLastUpdateTime: false,
134113
sidebarCollapsed: true,
135114
routeBasePath: "/",

i18n/jp/code.json

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,5 +486,74 @@
486486
},
487487
"sidebar.dropdownCategories.category.About": {
488488
"message": "について"
489+
},
490+
"topNav.navItems.Products": {
491+
"message": "製品"
492+
},
493+
"topNav.navItems.Use cases": {
494+
"message": "ユースケース"
495+
},
496+
"topNav.navItems.Pricing": {
497+
"message": "料金"
498+
},
499+
"topNav.navItems.Resources": {
500+
"message": "リソース"
501+
},
502+
"topNav.navItems.Docs": {
503+
"message": "ドキュメント"
504+
},
505+
"topNav.navItems.Contact us": {
506+
"message": "お問合せ"
507+
},
508+
"topNav.navItems.products.clickhouse_cloud_1": {
509+
"message": "ClickHouseを使用する最良の方法。"
510+
},
511+
"topNav.navItems.products.clickhouse_cloud_2": {
512+
"message": "AWS、GCP、Azureで利用可能。"
513+
},
514+
"topNav.navItems.products.byoc_1": {
515+
"message": "BYOC(お客様クラウド利用)"
516+
},
517+
"topNav.navItems.products.byoc_2": {
518+
"message": "完全マネージド型の ClickHouse クラウドサービス、"
519+
},
520+
"topNav.navItems.products.byoc_3": {
521+
"message": "お客様の AWS アカウント内にデプロイ可能。"
522+
},
523+
"topNav.navItems.products.oss": {
524+
"message": "オープンソースのClickHouseでデータベースを立ち上げる。"
525+
},
526+
"topNav.navItems.products.oss_2": {
527+
"message": ""
528+
},
529+
"topNav.navItems.products.integrations": {
530+
"message": "100を超えるインテグレーションを紹介します。"
531+
},
532+
"topNav.navItems.use_cases.Real-time analytics": {
533+
"message": "リアルタイム分析"
534+
},
535+
"topNav.navItems.use_cases.Machine learning and GenAI": {
536+
"message": "機械学習 & 生成AI"
537+
},
538+
"topNav.navItems.use_cases.Business intelligence": {
539+
"message": "ビジネスインテリジェンス"
540+
},
541+
"topNav.navItems.use_cases.Logs, events, and traces": {
542+
"message": "ログ、イベント、トレース"
543+
},
544+
"topNav.navItems.use_cases.All use cases": {
545+
"message": "すべてのユースケース"
546+
},
547+
"topNav.navItems.resources.Blog": {
548+
"message": "ブログ"
549+
},
550+
"topNav.navItems.resources.Comparisons": {
551+
"message": "比較情報"
552+
},
553+
"topNav.navItems.resources.Videos": {
554+
"message": "ビデオ"
555+
},
556+
"topNav.navItems.resources.Demos": {
557+
"message": "デモ"
489558
}
490559
}

scripts/translate/languages/ru.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"language": "russian",
3+
"lang_code": "ru",
4+
"glossary": {
5+
"Primary Key": "первичный ключ",
6+
"Index": "индекс",
7+
"Shard": "шард",
8+
"Replica": "реплика",
9+
"Query": "запрос",
10+
"Column": "колонка",
11+
"Row": "строка",
12+
"Distributed Table": "распределенная таблица",
13+
"MergeTree": "MergeTree",
14+
"ReplicatedMergeTree": "ReplicatedMergeTree",
15+
"AggregatingMergeTree": "AggregatingMergeTree",
16+
"Materialized View": "Materialized View",
17+
"ReplacingMergeTree": "ReplacingMergeTree",
18+
"Replication": "репликация",
19+
"Partition": "партиция",
20+
"TTL": "время жизни (TTL)",
21+
"Dictionary": "Dictionary",
22+
"Data Lakes": "Data Lakes",
23+
"self-managed": "self-managed",
24+
"data skipping indexes.": "data skipping indexes",
25+
"parts": "parts",
26+
"Columnar": "колоночный",
27+
"Sparse": "разреженный",
28+
"Lightweight Delete": "Lightweight Delete",
29+
"Lightweight Update": "Lightweight Update",
30+
"Nullable": "Nullable",
31+
"ClickPipes": "ClickPipes",
32+
"Kafka": "Kafka"
33+
}
34+
}

src/components/Navigation/index.js

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { NavigationItem } from './parts'
44
import NavigationSubNavProducts from './sub-navs/NavigationSubNavProducts'
55
import NavigationSubNavResources from './sub-navs/NavigationSubNavResources'
66
import NavigationSubNavUseCases from './sub-navs/NavigationSubNavUseCases'
7+
import { translate } from '@docusaurus/Translate';
78
import './styles.scss'
89

910
export default function Navigation({
@@ -36,34 +37,49 @@ export default function Navigation({
3637
<div>
3738
<ul>
3839
<li>
39-
<NavigationItem {...topLevelEvents} label='Products'>
40+
<NavigationItem {...topLevelEvents} label={translate({
41+
id: 'topNav.navItems.Products',
42+
message: 'Products',
43+
})}>
4044
<NavigationSubNavProducts />
4145
</NavigationItem>
4246
</li>
4347
<li>
44-
<NavigationItem {...topLevelEvents} label='Use cases'>
48+
<NavigationItem {...topLevelEvents} label={translate({
49+
id: 'topNav.navItems.Use cases',
50+
message: 'Use cases',
51+
})}>
4552
<NavigationSubNavUseCases />
4653
</NavigationItem>
4754
</li>
4855
<li>
4956
<NavigationItem
5057
{...topLevelEvents}
51-
label='Docs'
58+
label={translate({
59+
id: 'topNav.navItems.Docs',
60+
message: 'Docs',
61+
})}
5262
link={{
5363
href: 'https://clickhouse.com/docs',
5464
onClick: galaxyOnClick('topNav.navItems.docsSelect')
5565
}}
5666
/>
5767
</li>
5868
<li>
59-
<NavigationItem {...topLevelEvents} label='Resources'>
69+
<NavigationItem {...topLevelEvents} label={translate({
70+
id: 'topNav.navItems.Resources',
71+
message: 'Resources',
72+
})}>
6073
<NavigationSubNavResources />
6174
</NavigationItem>
6275
</li>
6376
<li>
6477
<NavigationItem
6578
{...topLevelEvents}
66-
label='Pricing'
79+
label={translate({
80+
id: 'topNav.navItems.Pricing',
81+
message: 'Pricing',
82+
})}
6783
link={{
6884
href: '/pricing',
6985
onClick: galaxyOnClick('topNav.navItems.pricingSelect')
@@ -73,7 +89,10 @@ export default function Navigation({
7389
<li>
7490
<NavigationItem
7591
{...topLevelEvents}
76-
label='Contact us'
92+
label={translate({
93+
id: 'topNav.navItems.Contact us',
94+
message: 'Contact us',
95+
})}
7796
link={{
7897
href: '/company/contact?loc=nav',
7998
onClick: galaxyOnClick('topNav.navItems.contactUsSelect')

src/components/Navigation/sub-navs/NavigationSubNavProducts.js

Lines changed: 59 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@ import React from 'react'
22
import { galaxyOnClick } from '../../../lib/galaxy/galaxy'
33
import LinkWithArrow from '../../LinkWithArrow'
44
import { NavigationLink } from '../parts'
5-
5+
import { translate } from '@docusaurus/Translate';
66
import IconClickhouse from '@site/static/ch-nav-v2-images/icon-clickhouse.svg'
77
import IconClickhouseCloud from '@site/static/ch-nav-v2-images/icon-clickhouse-cloud.svg'
88
import IconClickhouseBYOC from '@site/static/ch-nav-v2-images/icon-cloud-byoc.svg'
99
import IconIntegrations from '@site/static/ch-nav-v2-images/icon-integrations.svg'
10+
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
1011

1112
export default function NavigationSubNavProducts() {
13+
const { i18n } = useDocusaurusContext();
14+
const currentLocale = i18n.currentLocale;
1215
return (
1316
<>
1417
<ul className='ch-nav-v2-sub-nav-products ch-nav-v2-list'>
@@ -23,31 +26,48 @@ export default function NavigationSubNavProducts() {
2326
<span>
2427
ClickHouse Cloud
2528
<div className='nav-with-icon__description'>
26-
The best way to use ClickHouse.
29+
{translate({
30+
id: 'topNav.navItems.products.clickhouse_cloud_1',
31+
message: 'The best way to use ClickHouse.',
32+
})}
2733
<br />
28-
Available on AWS, GCP, and Azure.
34+
{translate({
35+
id: 'topNav.navItems.products.clickhouse_cloud_2',
36+
message: 'Available on AWS, GCP, and Azure.',
37+
})}
2938
</div>
3039
</span>
3140
</NavigationLink>
3241
</li>
33-
<li>
34-
<NavigationLink
35-
href='https://clickhouse.com/cloud/bring-your-own-cloud'
36-
onClick={galaxyOnClick('topNav.productMenu.openSourceSelect')}
37-
className='nav-with-icon'>
38-
<div className='icon'>
39-
<IconClickhouseBYOC />
40-
</div>
41-
<span>
42-
Bring Your Own Cloud
43-
<div className='nav-with-icon__description'>
44-
A fully managed ClickHouse Cloud service,
45-
<br />
46-
deployed in your own AWS account.
42+
{currentLocale === 'en' && (
43+
<li>
44+
<NavigationLink
45+
href='https://clickhouse.com/cloud/bring-your-own-cloud'
46+
onClick={galaxyOnClick('topNav.productMenu.openSourceSelect')}
47+
className='nav-with-icon'>
48+
<div className='icon'>
49+
<IconClickhouseBYOC />
4750
</div>
48-
</span>
49-
</NavigationLink>
50-
</li>
51+
<span>
52+
{translate({
53+
id: 'topNav.navItems.products.byoc_1',
54+
message: 'Bring Your Own Cloud',
55+
})}
56+
<div className='nav-with-icon__description'>
57+
{translate({
58+
id: 'topNav.navItems.products.byoc_2',
59+
message: 'A fully managed ClickHouse Cloud service,',
60+
})}
61+
<br />
62+
{translate({
63+
id: 'topNav.navItems.products.byoc_3',
64+
message: 'deployed in your own AWS account.',
65+
})}
66+
</div>
67+
</span>
68+
</NavigationLink>
69+
</li>
70+
)}
5171
<li>
5272
<NavigationLink
5373
href='https://clickhouse.com/clickhouse'
@@ -59,14 +79,20 @@ export default function NavigationSubNavProducts() {
5979
<span>
6080
ClickHouse
6181
<div className='nav-with-icon__description'>
62-
Spin up a database with open-
82+
{translate({
83+
id: 'topNav.navItems.products.oss',
84+
message: 'Spin up a database with open-source',
85+
})}
6386
<br />
64-
source ClickHouse.
87+
{translate({
88+
id: 'topNav.navItems.products.oss_2',
89+
message: 'ClickHouse',
90+
})}
6591
</div>
6692
</span>
6793
</NavigationLink>
6894
</li>
69-
95+
7096
<li className='ch-nav-v2-mobile-item'>
7197
<NavigationLink
7298
href='https://clickhouse.com/integrations'
@@ -77,7 +103,12 @@ export default function NavigationSubNavProducts() {
77103
<div className='icon'>
78104
<IconIntegrations />
79105
</div>
80-
<span>View 100+ integrations</span>
106+
<span>
107+
{translate({
108+
id: 'topNav.navItems.products.integrations',
109+
message: 'View 100+ integrations',
110+
})}
111+
</span>
81112
</NavigationLink>
82113
</li>
83114
</ul>
@@ -90,7 +121,10 @@ export default function NavigationSubNavProducts() {
90121
paddingLeft: '60px'
91122
}}
92123
className='ch-nav-v2-desktop-item ch-nav-v2-link-with-arrow'>
93-
View 100+ integrations
124+
{translate({
125+
id: 'topNav.navItems.products.integrations',
126+
message: 'View 100+ integrations',
127+
})}
94128
</LinkWithArrow>
95129
</>
96130
)

0 commit comments

Comments
 (0)