-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from ohos-rs/feat-i18n
feat: add i18n
- Loading branch information
Showing
55 changed files
with
2,359 additions
and
416 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { defineConfig } from "vitepress"; | ||
import { shared } from "./shared"; | ||
import { en, zh } from "./i18n"; | ||
|
||
export default defineConfig({ | ||
...shared, | ||
locales: { | ||
root: { label: "简体中文", ...zh }, | ||
en: { label: "English", ...en }, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { DefaultTheme } from "vitepress"; | ||
|
||
export const BasicSideBar: DefaultTheme.SidebarItem[] = [ | ||
{ | ||
text: "Basic", | ||
link: "/en/docs/basic", | ||
items: [ | ||
{ text: "Quick Start", link: "/en/docs/basic/quick-start" }, | ||
{ text: "Simple Project", link: "/en/docs/basic/simple-project" }, | ||
], | ||
}, | ||
{ | ||
text: "Cli", | ||
collapsed: false, | ||
items: [ | ||
{ text: "Init", link: "/en/docs/cli/init" }, | ||
{ text: "Build", link: "/en/docs/cli/build" }, | ||
{ text: "Artifact", link: "/en/docs/cli/artifact" }, | ||
], | ||
}, | ||
{ | ||
text: "Usage", | ||
collapsed: false, | ||
items: [ | ||
{ text: "Basic", link: "/en/docs/usage/basic" }, | ||
{ text: "Task", link: "/en/docs/usage/task" }, | ||
{ text: "ThreadSafeFunction", link: "/en/docs/usage/tsfn" }, | ||
], | ||
}, | ||
{ | ||
text: "CD/CD", | ||
collapsed: false, | ||
items: [{ text: "CI", link: "/en/docs/ci/basic.md" }], | ||
}, | ||
{ | ||
text: "More", | ||
items: [ | ||
{ text: "F & Q", link: "/en/docs/more/f&q" }, | ||
{ text: "Known issue", link: "/en/docs/more/known-issue" }, | ||
{ text: "EMU-TLS", link: "/en/docs/more/emu-tls" }, | ||
], | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { DefaultTheme } from "vitepress"; | ||
|
||
export const BlogSideBar: DefaultTheme.SidebarItem[] = [ | ||
{ | ||
text: "2024-05-27", | ||
link: "/en/blog/2024-05-27", | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { DefaultTheme } from "vitepress"; | ||
|
||
export const EcosystemSideBar: DefaultTheme.SidebarItem[] = [ | ||
{ | ||
text: "@ohos-rs", | ||
collapsed: false, | ||
items: [ | ||
{ text: "crc32", link: "/en/ecosystem/package/crc32" }, | ||
{ text: "jieba", link: "/en/ecosystem/package/jieba" }, | ||
{ text: "argon2", link: "/en/ecosystem/package/argon2" }, | ||
{ text: "bcrypt", link: "/en/ecosystem/package/bcrypt" }, | ||
{ text: "jsonwebtoken", link: "/en/ecosystem/package/jsonwebtoken" }, | ||
{ text: "snappy", link: "/en/ecosystem/package/snappy" }, | ||
{ text: "xxhash", link: "/en/ecosystem/package/xxhash" }, | ||
{ text: "image", link: "/en/ecosystem/package/image" }, | ||
], | ||
}, | ||
{ | ||
text: "Native-binding", | ||
collapsed: false, | ||
items: [ | ||
{ text: "hilog", link: "/en/ecosystem/binding/hilog" }, | ||
{ text: "init", link: "/en/ecosystem/binding/init" }, | ||
], | ||
}, | ||
{ | ||
text: "Polyfill", | ||
collapsed: false, | ||
items: [ | ||
{ text: "AbortController", link: "/en/ecosystem/polyfill/abort-controller" }, | ||
], | ||
}, | ||
{ | ||
text: "Third-Party", | ||
collapsed: false, | ||
items: [ | ||
{ text: "OpenSSL", link: "/en/ecosystem/third/openssl" }, | ||
{ text: "cURL", link: "/en/ecosystem/third/curl" }, | ||
{ text: "MMKV", link: "/en/ecosystem/third/mmkv" }, | ||
{ text: "avif", link: "/en/ecosystem/third/avif" }, | ||
{ text: "cronet", link: "/en/ecosystem/third/cronet" }, | ||
{ text: "BoringSSL", link: "/en/ecosystem/third/boringssl" }, | ||
], | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { defineConfig } from "vitepress"; | ||
import { BasicSideBar } from "./BasicSideBar"; | ||
import { EcosystemSideBar } from "./Ecosystem"; | ||
import { BlogSideBar } from "./Blog"; | ||
|
||
export const en = defineConfig({ | ||
lang: "en-US", | ||
description: | ||
"A framework for building compiled OpenHarmony SDK in Rust via Node-API(Forked from napi-rs)", | ||
themeConfig: { | ||
nav: [ | ||
{ text: "Home", link: "/en" }, | ||
{ text: "Docs", link: "/en/docs/basic" }, | ||
{ text: "Ecosystem", link: "/en/ecosystem/" }, | ||
{ text: "Community", link: "/en/community/" }, | ||
{ text: "Blog", link: "/en/blog/" }, | ||
{ | ||
text: "About", | ||
items: [ | ||
{ text: "Logo", link: "/en/about/" }, | ||
{ text: "Issue", link: "https://github.com/ohos-rs/example/issues" }, | ||
], | ||
}, | ||
], | ||
sidebar: { | ||
"/en/docs": BasicSideBar, | ||
"/en/ecosystem": EcosystemSideBar, | ||
"/en/blog": BlogSideBar, | ||
"/en/about": [], | ||
}, | ||
editLink: { | ||
pattern: | ||
"https://github.com/ohos-rs/ohos-rs.github.io/tree/master/src/:path", | ||
text: "Edit this page on GitHub", | ||
}, | ||
lastUpdated: { | ||
text: "Last updated", | ||
}, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './en'; | ||
export * from './zh'; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { defineConfig } from "vitepress"; | ||
import { BasicSideBar } from "./BasicSideBar"; | ||
import { EcosystemSideBar } from "./Ecosystem"; | ||
import { BlogSideBar } from "./Blog"; | ||
|
||
export const zh = defineConfig({ | ||
lang: 'zh-Hans', | ||
description: | ||
"基于 Rust 实现的鸿蒙原生模块开发框架(基于 napi-rs 实现)", | ||
themeConfig: { | ||
nav: [ | ||
{ text: "主页", link: "/" }, | ||
{ text: "文档", link: "/docs/basic" }, | ||
{ text: "生态", link: "/ecosystem/" }, | ||
{ text: "社区", link: "/community/" }, | ||
{ text: "博客", link: "/blog/" }, | ||
{ | ||
text: "关于", | ||
items: [ | ||
{ text: "Logo", link: "/about/" }, | ||
{ text: "Issue", link: "https://github.com/ohos-rs/example/issues" }, | ||
], | ||
}, | ||
], | ||
sidebar: { | ||
"/docs": BasicSideBar, | ||
"/ecosystem": EcosystemSideBar, | ||
"/blog": BlogSideBar, | ||
"/about": [], | ||
}, | ||
editLink: { | ||
pattern: | ||
"https://github.com/ohos-rs/ohos-rs.github.io/tree/master/src/:path", | ||
text: "编辑本页", | ||
}, | ||
lastUpdated: { | ||
text: "最新更新于", | ||
}, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { defineConfig } from "vitepress"; | ||
|
||
export const shared = defineConfig({ | ||
title: "ohos-rs", | ||
srcDir: "./src", | ||
markdown: { | ||
image: { | ||
lazyLoading: true, | ||
}, | ||
}, | ||
head: [["link", { rel: "icon", href: "/favicon.ico" }]], | ||
themeConfig: { | ||
logo: "/logo.svg", | ||
socialLinks: [{ icon: "github", link: "https://github.com/ohos-rs" }], | ||
search: { | ||
provider: "local", | ||
}, | ||
}, | ||
}); |
Oops, something went wrong.