diff --git a/README.md b/README.md
index 9a64b3e..f93659f 100644
--- a/README.md
+++ b/README.md
@@ -2,36 +2,46 @@
[![codecov](https://codecov.io/gh/difizen/mana/graph/badge.svg?token=VGJDF8511R)](https://codecov.io/gh/difizen/mana)
-模块化可扩展前端框架
+A modular and extensible front-end framework designed for workbench products.
-- 如果你打算开发 IDE 型的生产力工具
-- 如果你的项目需要丰富的场景定制能力
-- 如果你正在寻找彻底模块化的前端工程方案
+**English** · [简体中文](./README.zh-CN.md)
-请尝试 mana 🌟🌟🌟
+## Features
-### 官网
+- Complete module isolation, state management, and dependency inversion solutions, making it a truly suitable framework for large-scale engineering
+- Integration with the react ecosystem, with innovative page view management and state tracking capabilities, perfectly combining frontend projects with a modular structure
+- Built-in modules such as themes, commands, shortcuts, toolbars, configurations, internationalization, etc., to help you quickly start your project
-💡 请访问 https://mana.difizen.net/
+## Applicable Scenarios
-### 提交issue
+- If you intend to develop IDE-style productivity tool products
+- If you are looking for a thoroughly modular, architecturally advanced frontend engineering solution to solve team collaboration and long-term maintenance issues
+- If your project requires rich scene customization capabilities, allowing downstream producers to do kernel-level customization and develop a module ecosystem
-😊 我们建议您使用[github issue](https://github.com/difizen/mana/issues) 提交您的疑问, 我们通常会在2日内回复。
+Please try mana 🌟🌟🌟
-### 贡献代码
+### Official Website
-🤝 请查阅 [CONTRIBUTING.md](./CONTRIBUTING.md)
+💡 Please visit https://mana.difizen.net/
-### 贡献者
+### Submit Issues
-💪 感谢所有的贡献者
+😊 We recommend using [github issue](https://github.com/difizen/mana/issues) to submit your questions, and we usually respond within two days.
+
+### Contribute Code
+
+🤝 Please refer to [CONTRIBUTING.md](./CONTRIBUTING.md)
+
+### Contributors
+
+💪 Thanks to all the contributors
-### 联系我们
+### Contact Us
-🤗 加入我们的钉钉答疑群与我们联系。
+🤗 Join our DingTalk Q&A group to contact us.
diff --git a/README.zh-CN.md b/README.zh-CN.md
new file mode 100644
index 0000000..fc593a8
--- /dev/null
+++ b/README.zh-CN.md
@@ -0,0 +1,47 @@
+# mana
+
+[![codecov](https://codecov.io/gh/difizen/mana/graph/badge.svg?token=VGJDF8511R)](https://codecov.io/gh/difizen/mana)
+
+一个模块化可扩展前端框架,为工作台产品设计。
+
+[English](./README.md) · **简体中文**
+
+## 特性
+
+- 完整的模块隔离、状态管理、依赖倒置方案,是真正适合大型工程的框架
+- 集成 react 生态,创造性的页面视图管理、状态追踪能力,让前端项目与模块化结构完美结合
+- 内置主题、命令、快捷键、工具栏、配置、国际化...等模块,帮助您快速启动项目
+
+## 适用场景
+
+- 如果您打算开发 IDE 型的生产力工具产品
+- 如果您正在寻找彻底模块化、架构先进的前端工程方案,解决团队的协作和长期维护问题
+- 如果您的项目需要丰富的场景定制能力,允许下游生产者做内核级的定制,发展模块生态
+
+请尝试 mana 🌟🌟🌟
+
+### 官网
+
+💡 请访问 https://mana.difizen.net/
+
+### 提交issue
+
+😊 我们建议您使用[github issue](https://github.com/difizen/mana/issues) 提交您的疑问, 我们通常会在2日内回复。
+
+### 贡献代码
+
+🤝 请查阅 [CONTRIBUTING.md](./CONTRIBUTING.md)
+
+### 贡献者
+
+💪 感谢所有的贡献者
+
+
+
+
+
+### 联系我们
+
+🤗 加入我们的钉钉答疑群与我们联系。
+
+
diff --git a/apps/docs/.dumi/theme/componets/banner/index.tsx b/apps/docs/.dumi/theme/componets/banner/index.tsx
index 001086c..785ec6f 100644
--- a/apps/docs/.dumi/theme/componets/banner/index.tsx
+++ b/apps/docs/.dumi/theme/componets/banner/index.tsx
@@ -1,10 +1,10 @@
+import { l10n } from '@difizen/mana-l10n';
import { Button, message } from 'antd';
import { Link, useSiteData } from 'dumi';
import React, { useEffect, useState } from 'react';
import { CopyToClipboard } from 'react-copy-to-clipboard';
import './index.less';
import '../../tailwind.out.css';
-import { l10n } from '@difizen/mana-l10n';
const Banner: React.FC = () => {
const [animate, setAnimate] = useState({
@@ -20,10 +20,6 @@ const Banner: React.FC = () => {
});
}, []);
- if (!themeConfig.banner) {
- return null;
- }
-
return (
@@ -43,9 +39,7 @@ const Banner: React.FC = () => {
mana
- {l10n.t(
- 'A modular and scalable front-end application framework designed for workbench products.',
- )}
+ {l10n.t('A modular and extensible front-end framework')}
diff --git a/apps/docs/.dumi/theme/modules/lang/bundle.l10n.en-US.json b/apps/docs/.dumi/theme/lang/bundle.l10n.en-US.json
similarity index 50%
rename from apps/docs/.dumi/theme/modules/lang/bundle.l10n.en-US.json
rename to apps/docs/.dumi/theme/lang/bundle.l10n.en-US.json
index 8b11cff..f8a789f 100644
--- a/apps/docs/.dumi/theme/modules/lang/bundle.l10n.en-US.json
+++ b/apps/docs/.dumi/theme/lang/bundle.l10n.en-US.json
@@ -5,5 +5,6 @@
"Community": "Community",
"feedback issues": "feedback issues",
"release notes": "release notes",
- "A modular and scalable front-end application framework designed for workbench products.": "A modular and scalable front-end application framework designed for workbench products."
+ "A modular and extensible front-end framework": "A modular and extensible front-end framework",
+ "Designed for workbench products": "Designed for workbench products"
}
diff --git a/apps/docs/.dumi/theme/modules/lang/bundle.l10n.zh-CN.json b/apps/docs/.dumi/theme/lang/bundle.l10n.zh-CN.json
similarity index 52%
rename from apps/docs/.dumi/theme/modules/lang/bundle.l10n.zh-CN.json
rename to apps/docs/.dumi/theme/lang/bundle.l10n.zh-CN.json
index 56cabdb..2fb5b15 100644
--- a/apps/docs/.dumi/theme/modules/lang/bundle.l10n.zh-CN.json
+++ b/apps/docs/.dumi/theme/lang/bundle.l10n.zh-CN.json
@@ -5,5 +5,6 @@
"Community": "社区",
"feedback issues": "反馈问题",
"release notes": "发布日志",
- "A modular and scalable front-end application framework designed for workbench products.": "一个模块化的可扩展前端应用框架,为工作台产品设计。"
+ "A modular and extensible front-end framework": "一个模块化的可扩展前端应用框架",
+ "Designed for workbench products": "为工作台产品设计"
}
diff --git a/apps/docs/.dumi/theme/modules/lang/index.ts b/apps/docs/.dumi/theme/lang/index.ts
similarity index 60%
rename from apps/docs/.dumi/theme/modules/lang/index.ts
rename to apps/docs/.dumi/theme/lang/index.ts
index 4e4c4f0..55cd13b 100644
--- a/apps/docs/.dumi/theme/modules/lang/index.ts
+++ b/apps/docs/.dumi/theme/lang/index.ts
@@ -1,7 +1,7 @@
import type { LanguageBundles } from '@difizen/mana-l10n';
-import langENUS from './bundle.l10n.en-US.json';
-import langZHCN from './bundle.l10n.zh-CN.json';
+import langENUS from './bundle.l10n.en-US';
+import langZHCN from './bundle.l10n.zh-CN';
export const langBundles: LanguageBundles = {
'zh-CN': langZHCN,
diff --git a/apps/docs/.dumi/theme/layouts/DocLayout.tsx b/apps/docs/.dumi/theme/layouts/DocLayout.tsx
index 389c3bf..c0d03f7 100644
--- a/apps/docs/.dumi/theme/layouts/DocLayout.tsx
+++ b/apps/docs/.dumi/theme/layouts/DocLayout.tsx
@@ -29,7 +29,7 @@ const DocLayout = () => {
return (
- {pathname === '/' ? (
+ {pathname === '/' || pathname === '/zh-CN' || pathname === '/zh-CN/' ? (
) : (
diff --git a/apps/docs/.dumi/theme/modules/module.ts b/apps/docs/.dumi/theme/modules/module.ts
index 6968810..1fe06bc 100644
--- a/apps/docs/.dumi/theme/modules/module.ts
+++ b/apps/docs/.dumi/theme/modules/module.ts
@@ -1,8 +1,9 @@
import { ManaAppPreset, ManaModule } from '@difizen/mana-app';
import { l10n } from '@difizen/mana-l10n';
+import { langBundles } from '../lang/index.js';
+
import { Github } from './github.js';
-import { langBundles } from './lang/index.js';
export const DumiPreset = ManaModule.create()
.preload(() => {
diff --git a/apps/docs/.dumi/theme/slots/Header/index.tsx b/apps/docs/.dumi/theme/slots/Header/index.tsx
index 746f642..aee587c 100644
--- a/apps/docs/.dumi/theme/slots/Header/index.tsx
+++ b/apps/docs/.dumi/theme/slots/Header/index.tsx
@@ -43,7 +43,7 @@ const Header: React.FC = () => {
? urlPath.replace(`/${urlLang}`, '')
: `/${currentLang}${urlPath}`;
history.push({
- pathname: newUrl,
+ pathname: newUrl ? newUrl : '/',
});
}
}, []);
@@ -103,15 +103,14 @@ const Header: React.FC = () => {
onClick={() => {
const urlPath = window.location.pathname;
const currentLang = l10n.getLang();
- const baseUrlPath = urlPath.startsWith(`/${currentLang}`)
+ let baseUrlPath = urlPath.startsWith(`/${currentLang}`)
? urlPath.replace(`/${currentLang}`, '')
: urlPath;
+ baseUrlPath = baseUrlPath ? baseUrlPath : '/';
const targetLang =
currentLang === L10nLang.zhCN ? L10nLang.enUS : L10nLang.zhCN;
- l10n.changeLang(
- currentLang === L10nLang.zhCN ? L10nLang.enUS : L10nLang.zhCN,
- );
+ l10n.changeLang(targetLang);
history.push({
pathname:
diff --git a/packages/mana-core/src/theme/theme-app.ts b/packages/mana-core/src/theme/theme-app.ts
index 195e96d..b1b449b 100644
--- a/packages/mana-core/src/theme/theme-app.ts
+++ b/packages/mana-core/src/theme/theme-app.ts
@@ -28,7 +28,7 @@ export class ThemeApplication implements ApplicationContribution {
onStart(application: Application): void {
this.application = application;
- this.application.onHostChanged(this.update);
+ this.application.onHostChanged(() => this.update());
for (const contribution of this.variableContributions.getContributions()) {
contribution.registerVariables(this.variables);
}