Skip to content

Commit 9b38306

Browse files
committed
feat: translate
js api update is not done yet though
1 parent 5b9039c commit 9b38306

77 files changed

Lines changed: 3723 additions & 5180 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

components/landing/CustomerWall.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default function CustomerWall() {
44
{/* Section Header */}
55
<div className="text-center mb-20">
66
<h2 className="text-4xl md:text-5xl not-italic font-bold bg-clip-text mb-8 bg-blue-green text-fill-transparent" style={{ lineHeight: 1.5 }}>
7-
Who's Using Loro
7+
谁在使用 Loro
88
</h2>
99
</div>
1010

components/landing/Features.tsx

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,41 +6,39 @@ export default function Features() {
66
<section className="w-full px-5 md:px-15 pt-4 pb-20 md:pt-15 md:pb-15 relative z-10">
77
<FollowOnGitHub className="visible md:hidden mb-10 mt-8" />
88
<p className="text-center text-neutral-400 mb-8">
9-
Loro is a high‑performance CRDT library for local‑first, real‑time collaboration.
9+
Loro 是一个面向本地优先、实时协作的高性能 CRDT 库。
1010
</p>
1111
<main className="flex flex-col space-y-5 gap-0 md:space-y-0 md:grid md:grid-cols-2 md:grid-rows-2 md:gap-5 xl:grid-cols-4 xl:grid-rows-1">
1212
<article className={classes.Card}>
1313
<h3 className="text-base md:text-xl font-extrabold bg-blue-green bg-clip-text text-fill text-fill-transparent md:w-auto">
14-
High Performance
14+
高性能
1515
</h3>
1616
<p className="h-auto md:min-h-18 text-white/60 text-base font-medium leading-normal">
17-
Optimized for memory, CPU, and loading speed with advanced
18-
performance primitives.
17+
针对内存、CPU 与加载速度进行优化,提供先进的性能原语。
1918
</p>
2019
</article>
2120
<article className={classes.Card}>
2221
<h3 className="text-base md:text-xl font-extrabold bg-blue-green bg-clip-text text-fill text-fill-transparent md:w-auto">
23-
Rich CRDT Types Support
22+
丰富的 CRDT 类型支持
2423
</h3>
2524
<p className="h-auto md:min-h-18 text-white/60 text-base font-medium leading-normal">
26-
Turn JSON-like data into collaborative types effortlessly
25+
轻松将类 JSON 数据转换为可协作的数据类型。
2726
</p>
2827
</article>
2928
<article className={classes.Card}>
3029
<h3 className="text-base md:text-xl font-extrabold bg-blue-green bg-clip-text text-fill text-fill-transparent d:w-auto">
31-
Real-Time Collaboration with Version Control
30+
实时协作与版本控制
3231
</h3>
3332
<p className="h-auto md:min-h-18 text-white/60 text-base font-medium leading-normal">
34-
Preserve full version history like Git, even during real-time
35-
collaboration
33+
像 Git 一样保留完整版本历史,即使在实时协作中也不例外。
3634
</p>
3735
</article>
3836
<article className={classes.Card}>
3937
<h3 className="text-base md:text-xl font-extrabold bg-blue-green bg-clip-text text-fill text-fill-transparent md:w-auto">
40-
Simple and Intuitive API
38+
简单直观的 API
4139
</h3>
4240
<p className="h-auto md:min-h-18 text-white/60 text-base font-medium leading-normal">
43-
Designed with developer experience in mind
41+
以开发体验为核心设计。
4442
</p>
4543
</article>
4644
</main>

components/landing/FollowOnGitHub.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ export default function FollowOnGitHub(
1616
href="https://github.com/loro-dev/loro"
1717
target="_blank"
1818
rel="noopener noreferrer"
19-
aria-label="Follow us on GitHub"
19+
aria-label="GitHub 上关注我们"
2020
>
2121
<div className="w-6 h-6 md:w-9.5 md:h-9.5 flex items-center justify-center mr-1">
2222
<GitHubIcon />
2323
</div>
24-
<div className={classes.AdvertisingText}>Follow us on GitHub</div>
24+
<div className={classes.AdvertisingText}>GitHub 上关注我们</div>
2525
</a>
2626
);
2727
}

components/landing/Hero.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ export default function Hero({ }: HeroProps): JSX.Element {
1616
"self-end md:self-start text-base text-[13px]"
1717
)}
1818
>
19-
Implement collaboration effortlessly.
20-
Powered by CRDTs. <br />
21-
Built for local-first software.
19+
轻松实现协作,<br />
20+
由 CRDT 驱动,<br />
21+
为本地优先软件而生。
2222
</p>
2323
</div>
2424
<a href="/blog/loro-now-open-source"><h1 className="py-1.5 flex flex-col gap-y-3.5 md:gap-y-7.5 leading-none">
2525
<GradientText>Reimagine</GradientText>
2626
<GradientText>State</GradientText>
2727
<GradientText>Management</GradientText>
2828
<span className="flex items-center gap-x-7.5">
29-
<GradientText>with</GradientText>
29+
<GradientText>With</GradientText>
3030
<span
3131
className={cn(
3232
classes.HairlineText,

components/landing/Support/index.tsx

Lines changed: 22 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -8,79 +8,73 @@ import classes from "./index.module.css";
88
export default function AlgorithmSection(): JSX.Element {
99
return (
1010
<section className="pt-25 px-5 md:px-15 flex flex-col space-y-5 md:space-y-12.5 relative z-10">
11-
<h2 className={classes.Caption}>Rich CRDTs Algorithm Support</h2>
11+
<h2 className={classes.Caption}>全面的 CRDT 算法支持</h2>
1212
<Card
1313
icon={ToolboxIcon}
14-
caption="Basic Data Structures"
14+
caption="基础数据结构"
1515
text={
1616
<>
17-
Includes support for{" "}
17+
支持用于有序集合的{" "}
1818
<code>
19-
<a href="/docs/tutorial/list">
20-
MovableList
21-
</a>
22-
</code>{" "}
23-
for ordered collections, LWW (Last Write Win){" "}
19+
<a href="/docs/tutorial/list">MovableList</a>
20+
</code>
21+
,用于键值对的 LWW(最后写入获胜){" "}
2422
<code>
2523
<a href="/docs/tutorial/map">Map</a>
26-
</code>{" "}
27-
for key-value pairs,{" "}
24+
</code>
25+
,用于层级数据的{" "}
2826
<code>
2927
<a href="/docs/tutorial/tree">MovableTree</a>
30-
</code>{" "}
31-
for hierarchical data, and{" "}
28+
</code>
29+
,以及用于富文本操作的{" "}
3230
<code>
3331
<a href="/docs/tutorial/text">Text</a>
34-
</code>{" "}
35-
for rich text manipulation, enabling various of applications.
32+
</code>
33+
,覆盖多样化的协作应用场景。
3634
</>
3735
}
3836
/>
3937
<Card
4038
icon={SelectedText}
41-
caption="Text/List Editing with Fugue"
39+
caption="基于 Fugue 的文本/列表编辑"
4240
text={
4341
<>
44-
Loro integrates{" "}
42+
Loro 集成了{" "}
4543
<a
4644
href="https://arxiv.org/abs/2305.00583"
4745
target="_blank"
4846
rel="noreferrer"
4947
>
5048
Fugue
5149
</a>
52-
, a novel CRDT algorithm designed to minimize the interleaving
53-
anomalies when merging concurrent text/list edits.
50+
,这是一种旨在合并并发文本或列表编辑时最大限度减少交错异常的全新 CRDT 算法。
5451
</>
5552
}
5653
/>
5754
<Card
5855
icon={LettersIcon}
59-
caption="Rich Text CRDT"
56+
caption="富文本 CRDT"
6057
text={
6158
<>
62-
Loro manages rich text CRDTs that excel at merging concurrent rich
63-
text style edits, maintaining the original intent of each user's
64-
input as much as possible. Please read our blog,{" "}
59+
Loro 管理的富文本 CRDT 擅长合并并发样式编辑,尽可能保留每位用户的原始意图。欢迎阅读我们的博客{" "}
6560
<a
6661
href="/blog/loro-richtext"
6762
target="_blank"
6863
rel="noreferrer"
6964
className="underline"
7065
>
71-
Loro's Rich Text CRDT
66+
Loro 的富文本 CRDT
7267
</a>
73-
, to learn more.
68+
,了解更多信息。
7469
</>
7570
}
7671
/>
7772
<Card
7873
icon={LineIcon}
79-
caption="Hierarchical Data with Moveable Tree"
74+
caption="可移动树的层级数据"
8075
text={
8176
<>
82-
For applications requiring directory-like data manipulation, Loro
83-
utilizes the algorithm from{" "}
77+
对于需要目录式数据操作的应用,Loro 引入了{" "}
8478
<a
8579
className="underline italic"
8680
href="https://ieeexplore.ieee.org/document/9563274"
@@ -89,7 +83,7 @@ export default function AlgorithmSection(): JSX.Element {
8983
>
9084
A Highly-Available Move Operation for Replicated Trees
9185
</a>
92-
, simplifying moving and reorganizing hierarchical data structures.
86+
论文中的算法,使层级数据的移动与重组更为简单。
9387
</>
9488
}
9589
/>

pages/_meta.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@ export default {
1010
collapsible: true
1111
},
1212
docs: {
13-
title: "Docs",
13+
title: "文档",
1414
type: "page"
1515
},
1616
blog: {
17-
title: "Blog",
17+
title: "博客",
1818
type: "page"
1919
},
2020
changelog: {
21-
title: "Changelog",
21+
title: "更新日志",
2222
type: "page"
2323
},
2424
about: {
25-
title: "About",
25+
title: "关于",
2626
type: "page"
2727
}
2828
}

pages/about.mdx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
# About
1+
# 关于
22

3-
Loro, created by [Zixuan Chen](http://github.com/https://twitter.com/zx_loro) and
4-
[Leon Zhao](https://github.com/Leeeon233) in 2022, has the vision of empowering
5-
local-first software and simplifying the creation of collaborative applications.
3+
Loro[Zixuan Chen](http://github.com/https://twitter.com/zx_loro)
4+
[Leon Zhao](https://github.com/Leeeon233) 2022 年创建,其愿景是赋能
5+
本地优先的软件,并简化协作应用程序的创建。
66

7-
# Contact
7+
# 联系方式
88

99
- Zixuan Chen, zx@loro.dev
1010
- Leon Zhao, lz@loro.dev
1111

12-
# Credits
12+
# 致谢
1313

14-
- [Diamond-types](https://github.com/josephg/diamond-types): The ingenious OT-like merging algorithm from [@josephg](https://github.com/josephg) has been adapted to reduce the computation and space usage of CRDTs.
15-
- [Automerge](https://github.com/automerge/automerge): Their use of columnar encoding for CRDTs has informed our strategies for efficient data encoding.
16-
- [Yjs](https://github.com/yjs/yjs): We have incorporated a similar algorithm for effectively merging collaborative editing operations, thanks to their pioneering contributions.
17-
- [Matthew Weidner](https://mattweidner.com/): His work on the [Fugue](https://arxiv.org/abs/2305.00583) algorithm has been invaluable, enhancing our text editing capabilities.
14+
- [Diamond-types](https://github.com/josephg/diamond-types): 来自 [@josephg](https://github.com/josephg) 的巧妙的类 OT 合并算法已被用于减少 CRDT 的计算和空间使用。
15+
- [Automerge](https://github.com/automerge/automerge): 他们对 CRDT 使用列式编码,为我们的高效数据编码策略提供了信息。
16+
- [Yjs](https://github.com/yjs/yjs): 我们采用了类似的算法来有效合并协作编辑操作,感谢他们的开创性贡献。
17+
- [Matthew Weidner](https://mattweidner.com/): 他在 [Fugue](https://arxiv.org/abs/2305.00583) 算法上的工作非常宝贵,增强了我们的文本编辑能力。

pages/blog.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
import { getPagesUnderRoute } from "nextra/context";
22
import Link from "next/link";
3-
import BlogPostCard from "../components/BlogPostCard";
3+
import BlogPostCard from "../../components/BlogPostCard";
44

55
export function BlogHeader() {
66
return (
77
<div className="max-w-screen-lg mx-auto pt-4 pb-8 mb-16 border-b border-gray-400 border-opacity-20 text-center">
88
<h1>
9-
<span className="font-bold leading-tight lg:text-5xl">Loro Blog</span>
9+
<span className="font-bold leading-tight lg:text-5xl">Loro 博客</span>
1010
</h1>
1111
<p className="text-center text-gray-500 dark:text-gray-400 font-space-grotesk"></p>
1212
<div className="mt-4">
1313
<Link
1414
href="/blog.xml"
1515
className="text-sm font-semibold text-primary-600 hover:text-primary-500 dark:text-primary-400"
1616
>
17-
Subscribe via RSS
17+
通过 RSS 订阅
1818
</Link>
1919
</div>
2020
</div>
2121
);
2222
}
2323

2424
export function BlogIndex() {
25-
const pages = getPagesUnderRoute("/blog");
25+
const pages = getPagesUnderRoute("/zh/blog");
2626
pages.sort((a, b) => {
2727
if (a.frontMatter?.date && b.frontMatter?.date) {
2828
return new Date(b.frontMatter.date) - new Date(a.frontMatter.date);

0 commit comments

Comments
 (0)