Skip to content

Commit

Permalink
docs:support lang env (#4288)
Browse files Browse the repository at this point in the history
  • Loading branch information
zjy365 authored Nov 10, 2023
1 parent c39bd89 commit 0429b0d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/website/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
FROM node:20.4 AS builder

ARG SEALOS_LANG=zh-Hans
ARG BD_TOKEN
ENV BD_TOKEN=$BD_TOKEN

Expand Down
5 changes: 3 additions & 2 deletions docs/website/docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// @ts-check
require('dotenv').config()

const generateAlgoliKey = () => "ce5b8e1e4d0d35ff587caf75ac404df4"

/** @type {import('@docusaurus/types').Config} */
Expand All @@ -19,7 +20,7 @@ const config = {
// metadata like html lang. For example, if your site is Chinese, you may want
// to replace "en" with "zh-Hans".
i18n: {
defaultLocale: "en",
defaultLocale: process.env.SEALOS_LANG || 'en',
locales: ["en", "zh-Hans"],
// path: "../4.0/i18n"
},
Expand Down
1 change: 1 addition & 0 deletions docs/website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"@mdx-js/react": "^1.6.22",
"autoprefixer": "^10.4.16",
"docusaurus-plugin-sass": "^0.2.2",
"dotenv": "^16.3.1",
"postcss": "^8.4.31",
"prism-react-renderer": "^1.3.5",
"prismjs": "^1.29.0",
Expand Down
5 changes: 5 additions & 0 deletions docs/website/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3661,6 +3661,11 @@ dot-prop@^5.2.0:
dependencies:
is-obj "^2.0.0"

dotenv@^16.3.1:
version "16.3.1"
resolved "https://registry.npmmirror.com/dotenv/-/dotenv-16.3.1.tgz#369034de7d7e5b120972693352a3bf112172cc3e"
integrity sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==

duplexer3@^0.1.4:
version "0.1.5"
resolved "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.5.tgz"
Expand Down

0 comments on commit 0429b0d

Please sign in to comment.