-
-
Notifications
You must be signed in to change notification settings - Fork 6
i18n(zh-CN): update Chinese UI strings #135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
97acf73
i18n(zh-CN): update Chinese UI strings
jenxi 6c309a2
Created Chinese pages
jenxi 1ae4231
Update availTranslations.ts
jenxi b8a5e8f
Fixed missing tag
jenxi 6ef2cc2
Delete release-notes.md
jenxi 939b2a9
Update index.mdx
jenxi b29993a
Update studiocms-blog.mdx
jenxi d77ebdd
Update index.mdx
jenxi dcf9b8e
Update sdk.mdx
jenxi 4e8c23e
Updated translations
jenxi 7cef5a1
Update cli.mdx
jenxi f1a3ee4
Update zh-cn.json
jenxi b5e0e7c
Fixed links to use zh-cn
jenxi a520013
Rename zh-cn.json to zh-CN.json
jenxi 9bdde95
Rename zh-CN.json to zh-cn.json
jenxi da04fc3
Fixed links to use zh-cn
jenxi 62ca6aa
Fixed links to use zh-cn
jenxi 424720d
Merge branch 'main' of https://github.com/jenxi/docs
jenxi e0846c7
Fixed links to use zh-cn
jenxi 74c1b89
Rename zh-cn.json to zh-CN.json
jenxi 133ea01
Rename zh-cn.json to zh-CN.json
jenxi 285e3a2
Fixed invalid links
jenxi 3950db7
Merge branch 'main' into main
jenxi 48d9443
Update availTranslations.ts
jenxi 905a534
Rename zh-CN.json to zh-cn.json
jenxi 6d2800e
Fixed invalid links
jenxi fcfa013
Merge branch 'main' of https://github.com/jenxi/docs
jenxi 7da7bb4
Update getting-started.mdx
jenxi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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,227 @@ | ||
| --- | ||
| i18nReady: true | ||
| title: "仪表板配置" | ||
| description: "StudioCMSOptions dashboardConfig 参考文档" | ||
| sidebar: | ||
| order: 6 | ||
| --- | ||
|
|
||
| import ReadMore from '~/components/ReadMore.astro'; | ||
|
|
||
| StudioCMS 集成配置选项架构参考 | ||
|
|
||
| ```ts twoslash title="studiocms.config.mjs" | ||
| import { defineStudioCMSConfig } from 'studiocms/config'; | ||
| // ---cut--- | ||
| export default defineStudioCMSConfig({ | ||
| dashboardConfig: { | ||
| dashboardEnabled: true, | ||
| dashboardRouteOverride: 'dashboard', | ||
| developerConfig: {}, | ||
| faviconURL: '/favicon.svg', | ||
| inject404Route: true, | ||
| versionCheck: true, | ||
| AuthConfig: {}, | ||
| }, | ||
| }); | ||
| ``` | ||
|
|
||
| ## `dashboardEnabled` | ||
|
|
||
| `dashboardEnabled` 是用于确定是否启用仪表板的布尔值。 | ||
|
|
||
| - **类型:** `boolean` | ||
| - **默认值:** `true` | ||
|
|
||
| ### 用法示例 | ||
|
|
||
| ```ts twoslash {3} title="studiocms.config.mjs" | ||
| import { defineStudioCMSConfig } from 'studiocms/config'; | ||
| // ---cut--- | ||
| export default defineStudioCMSConfig({ | ||
| dashboardConfig: { | ||
| dashboardEnabled: true, // 默认值 - 启用仪表板 | ||
| } | ||
| }) | ||
| ``` | ||
|
|
||
| ## `DashboardRouteOverride` | ||
|
|
||
| `DashboardRouteOverride` 是用于设置仪表板路由路径的字符串。 | ||
|
|
||
| - **类型:** `string` | ||
| - **默认值:** `'dashboard'` | ||
|
|
||
| ### 用法示例 | ||
|
|
||
| ```ts twoslash {3} title="studiocms.config.mjs" | ||
| import { defineStudioCMSConfig } from 'studiocms/config'; | ||
| // ---cut--- | ||
| export default defineStudioCMSConfig({ | ||
| dashboardConfig: { | ||
| dashboardRouteOverride: 'dashboard', // 默认值 - 设置仪表板路由为 /dashboard | ||
| } | ||
| }) | ||
| ``` | ||
|
|
||
| ## `developerConfig` | ||
|
|
||
| `developerConfig` 是用于配置仪表板开发者设置的对象。 | ||
|
|
||
| ### 用法示例 | ||
|
|
||
| ```ts twoslash {3-5} title="studiocms.config.mjs" | ||
| import { defineStudioCMSConfig } from 'studiocms/config'; | ||
| // ---cut--- | ||
| export default defineStudioCMSConfig({ | ||
| dashboardConfig: { | ||
| developerConfig: { | ||
| demoMode: false, // 默认值 - 禁用演示模式 | ||
| }, | ||
| } | ||
| }) | ||
| ``` | ||
|
|
||
| ## `faviconURL` | ||
|
|
||
| `faviconURL` 是用于设置仪表板网站图标的路径字符串。 | ||
|
|
||
| - **类型:** `string` | ||
| - **默认值:** `'/favicon.svg'` | ||
|
|
||
| ### 用法示例 | ||
|
|
||
| ```ts twoslash {3} title="studiocms.config.mjs" | ||
| import { defineStudioCMSConfig } from 'studiocms/config'; | ||
| // ---cut--- | ||
| export default defineStudioCMSConfig({ | ||
| dashboardConfig: { | ||
| faviconURL: '/favicon.svg', // 默认值 - 设置仪表板网站图标 | ||
| } | ||
| }) | ||
| ``` | ||
|
|
||
| ## `inject404Route` | ||
|
|
||
| `inject404Route` 是用于确定是否注入404路由的布尔值。 | ||
|
|
||
| - **类型:** `boolean` | ||
| - **默认值:** `true` | ||
|
|
||
| ### 用法示例 | ||
|
|
||
| ```ts twoslash {3} title="studiocms.config.mjs" | ||
| import { defineStudioCMSConfig } from 'studiocms/config'; | ||
| // ---cut--- | ||
| export default defineStudioCMSConfig({ | ||
| dashboardConfig: { | ||
| inject404Route: true, // 默认值 - 注入404路由 | ||
| } | ||
| }) | ||
| ``` | ||
|
|
||
| ## `versionCheck` | ||
|
|
||
| `versionCheck` 是用于确定是否启用版本检查的布尔值。 | ||
|
|
||
| - **类型:** `boolean` | ||
| - **默认值:** `true` | ||
|
|
||
| ### 用法示例 | ||
|
|
||
| ```ts twoslash {3} title="studiocms.config.mjs" | ||
| import { defineStudioCMSConfig } from 'studiocms/config'; | ||
| // ---cut--- | ||
| export default defineStudioCMSConfig({ | ||
| dashboardConfig: { | ||
| versionCheck: true, // 默认值 - 启用版本检查 | ||
| } | ||
| }) | ||
| ``` | ||
|
|
||
| ## `AuthConfig` | ||
|
|
||
| `AuthConfig` 是用于配置仪表板认证设置的对象。 | ||
|
|
||
| ### 用法示例 | ||
|
|
||
| ```ts twoslash {3-5} title="studiocms.config.mjs" | ||
| import { defineStudioCMSConfig } from 'studiocms/config'; | ||
| // ---cut--- | ||
| export default defineStudioCMSConfig({ | ||
| dashboardConfig: { | ||
| AuthConfig: { | ||
| enabled: true, // 默认值 - 启用认证功能 | ||
| }, | ||
| } | ||
| }) | ||
| ``` | ||
|
|
||
| ### `providers` | ||
|
|
||
| `providers` 是用于配置仪表板认证提供商的对象。 | ||
|
|
||
| - **类型:** [`AuthProviders`](#authprovider) | ||
| - **默认值:** `{}` | ||
|
|
||
| #### 用法示例 | ||
|
|
||
| ```ts twoslash {4-11} title="studiocms.config.mjs" | ||
| import { defineStudioCMSConfig } from 'studiocms/config'; | ||
| // ---cut--- | ||
| export default defineStudioCMSConfig({ | ||
| dashboardConfig: { | ||
| AuthConfig: { | ||
| providers: { | ||
| google: true, | ||
| github: true, | ||
| discord: true, | ||
| auth0: true, | ||
| usernameAndPassword: true, | ||
| usernameAndPasswordConfig: {}, | ||
| }, | ||
| }, | ||
| }, | ||
| }) | ||
| ``` | ||
|
|
||
| #### `usernameAndPasswordConfig` | ||
|
|
||
| `usernameAndPasswordConfig` 是用于配置用户名密码认证设置的对象。 | ||
|
|
||
| - **类型:** `{ allowUserRegistration?: boolean }` | ||
| - **默认值:** `{}` | ||
|
|
||
| ##### 用法示例 | ||
|
|
||
| ```ts twoslash {5-8} title="studiocms.config.mjs" | ||
| import { defineStudioCMSConfig } from 'studiocms/config'; | ||
| // ---cut--- | ||
| export default defineStudioCMSConfig({ | ||
| dashboardConfig: { | ||
| AuthConfig: { | ||
| providers: { | ||
| usernameAndPassword: true, | ||
| usernameAndPasswordConfig: { | ||
| allowUserRegistration: true, // 默认值 - 允许用户注册 | ||
| }, | ||
| }, | ||
| }, | ||
| }, | ||
| }) | ||
| ``` | ||
|
|
||
| ###### `AuthProvider` | ||
|
|
||
| ```ts | ||
| type AuthProviders: { | ||
| github?: boolean | undefined; | ||
| discord?: boolean | undefined; | ||
| google?: boolean | undefined; | ||
| auth0?: boolean | undefined; | ||
| usernameAndPassword?: boolean | undefined; | ||
| usernameAndPasswordConfig?: { | ||
| allowUserRegistration?: boolean | undefined; | ||
| } | undefined; | ||
| } | undefined | ||
| ``` |
119 changes: 119 additions & 0 deletions
119
src/content/docs/zh-cn/config-reference/default-frontend-config.mdx
This file contains hidden or 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,119 @@ | ||
| --- | ||
| i18nReady: true | ||
| title: "默认前端配置" | ||
| description: "StudioCMSOptions defaultFrontEndConfig 参考文档" | ||
| sidebar: | ||
| order: 5 | ||
| --- | ||
|
|
||
| import ReadMore from '~/components/ReadMore.astro'; | ||
|
|
||
| StudioCMS 集成配置选项架构参考 | ||
|
|
||
| ```ts twoslash title="studiocms.config.mjs" | ||
| import { defineStudioCMSConfig } from 'studiocms/config'; | ||
| // ---cut--- | ||
| export default defineStudioCMSConfig({ | ||
| defaultFrontEndConfig: { | ||
| favicon: '/favicon.svg', | ||
| htmlDefaultLanguage: 'en', | ||
| htmlDefaultHead: [], | ||
| injectQuickActionsMenu: true, | ||
| }, | ||
| }); | ||
| ``` | ||
|
|
||
| ## `favicon` | ||
|
|
||
| `favicon` 是用于设置网站图标路径的字符串。 | ||
|
|
||
| - **类型:** `string` | ||
| - **默认值:** `'/favicon.svg'` | ||
|
|
||
| ### 用法示例 | ||
|
|
||
| ```ts twoslash {3} title="studiocms.config.mjs" | ||
| import { defineStudioCMSConfig } from 'studiocms/config'; | ||
| // ---cut--- | ||
| export default defineStudioCMSConfig({ | ||
| defaultFrontEndConfig: { | ||
| favicon: '/favicon.svg', // 默认值 - 使用默认网站图标 | ||
| } | ||
| }) | ||
| ``` | ||
|
|
||
| ## `htmlDefaultLanguage` | ||
|
|
||
| `htmlDefaultLanguage` 是用于设置网站默认语言的字符串。 | ||
|
|
||
| - **类型:** `string` | ||
| - **默认值:** `'en'` | ||
|
|
||
| ### 用法示例 | ||
|
|
||
| ```ts twoslash {3} title="studiocms.config.mjs" | ||
| import { defineStudioCMSConfig } from 'studiocms/config'; | ||
| // ---cut--- | ||
| export default defineStudioCMSConfig({ | ||
| defaultFrontEndConfig: { | ||
| htmlDefaultLanguage: 'en', // 默认值 - 使用默认语言 | ||
| } | ||
| }) | ||
| ``` | ||
|
|
||
| ## `htmlDefaultHead` | ||
|
|
||
| **类型:** [`HeadConfig[]`](#headconfig) | ||
|
|
||
| 向网站头部区域添加自定义标签。适用于添加分析工具脚本和第三方资源。 | ||
|
|
||
| ```ts twoslash {3} title="studiocms.config.mjs" | ||
| import { defineStudioCMSConfig } from 'studiocms/config'; | ||
| // ---cut--- | ||
| export default defineStudioCMSConfig({ | ||
| defaultFrontEndConfig: { | ||
| htmlDefaultHead: [ | ||
| // 示例:添加 Fathom 分析脚本 | ||
| { | ||
| tag: 'script', | ||
| attrs: { | ||
| src: 'https://cdn.usefathom.com/script.js', | ||
| 'data-site': 'MY-FATHOM-ID', | ||
| defer: true, | ||
| }, | ||
| }, | ||
| ], | ||
| }, | ||
| }); | ||
| ``` | ||
|
|
||
| `htmlDefaultHead` 中的内容会直接转换为 HTML 元素,不会经过 Astro 的 [脚本处理](https://docs.astro.build/zh-cn/guides/client-side-scripts/#script-processing) 或 [样式处理](https://docs.astro.build/zh-cn/guides/styling/#styling-in-astro)。 | ||
|
|
||
| #### `HeadConfig` | ||
|
|
||
| ```ts | ||
| interface HeadConfig { | ||
| tag: string; // HTML标签名 | ||
| attrs?: Record<string, string | boolean | undefined>; // 标签属性 | ||
| content?: string; // 标签内容 | ||
| } | ||
| ``` | ||
|
|
||
| ## `injectQuickActionsMenu` | ||
|
|
||
| **类型:** `boolean` | ||
| **默认值:** `true` | ||
|
|
||
| 在网站右下角注入快速操作菜单界面,允许用户快速访问 StudioCMS 管理后台。 | ||
|
|
||
| ### 用法示例 | ||
|
|
||
| ```ts twoslash {3} title="studiocms.config.mjs" | ||
| import { defineStudioCMSConfig } from 'studiocms/config'; | ||
| // ---cut--- | ||
| export default defineStudioCMSConfig({ | ||
| defaultFrontEndConfig: { | ||
| injectQuickActionsMenu: true, // 默认值 - 注入快速操作菜单 | ||
| } | ||
| }) | ||
| ``` |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.