From b5b99686c9feea30323e832beca8d5d15f279c6d Mon Sep 17 00:00:00 2001 From: Alexander Wang Date: Wed, 2 Aug 2023 12:39:35 -0700 Subject: [PATCH] setup locale --- README.md | 15 +++++++++++++++ docusaurus.config.js | 18 ++++++++++++++++++ .../current/tour/intro.md | 1 + src/styles/navbar.scss | 4 ++-- 4 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 i18n/ko/docusaurus-plugin-content-docs/current/tour/intro.md diff --git a/README.md b/README.md index 46f87f21..cb430723 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,21 @@ yarn yarn run dev ``` +### Translations + +Help wanted for translations. + +Current efforts: + +- Korean (Thanks @Baejw0111) + +To preview in dev mode: `yarn dev --locale ko`. + +Translations are filed under `i18n/ko/docusaurus-plugin-content-docs/current`. + +Once we have enough docs translated for a certain language (e.g. above 80%), we'll enable +the locale switcher on the nav bar for that language. + ### Note Diagrams are auto generated by `ci/render.sh`. diff --git a/docusaurus.config.js b/docusaurus.config.js index d5550695..b0c27ba7 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -10,6 +10,19 @@ const config = { onBrokenMarkdownLinks: "warn", favicon: "img/favicon.ico", + i18n: { + defaultLocale: "en", + locales: ["en", "ko"], + localeConfigs: { + en: { + label: "English", + }, + ko: { + label: "Korean (한국인)", + }, + }, + }, + presets: [ [ "classic", @@ -72,6 +85,11 @@ const config = { position: "right", label: "Playground", }, + // TODO enable when a language has been translated + // { + // type: "localeDropdown", + // position: "right", + // }, { type: "custom-iconLink", position: "right", diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/tour/intro.md b/i18n/ko/docusaurus-plugin-content-docs/current/tour/intro.md new file mode 100644 index 00000000..1333ed77 --- /dev/null +++ b/i18n/ko/docusaurus-plugin-content-docs/current/tour/intro.md @@ -0,0 +1 @@ +TODO diff --git a/src/styles/navbar.scss b/src/styles/navbar.scss index 338b92b1..40527531 100644 --- a/src/styles/navbar.scss +++ b/src/styles/navbar.scss @@ -72,8 +72,8 @@ html[data-theme="dark"] { } .navbar__link { - border: 1px solid var(--border); - border-radius: 4px; + display: flex; + align-items: center; margin-top: 0; font-weight: 600; color: var(--navbar-text-color);