From 5362f9eed5650f47cc43a9db84d8287ea4f2bc4d Mon Sep 17 00:00:00 2001 From: xdragon <283824437@qq.com> Date: Thu, 5 Sep 2024 10:23:44 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E4=B8=AD=E6=96=87=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=92=8CNPM=E6=BA=90=E5=9C=A8=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E4=B8=AD=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/src/localization/i18n.ts | 3 ++- settings.json.template | 2 +- src/static/js/pluginfw/LinkInstaller.ts | 1 + 编译说明.md | 30 +++++++++++++++++++++++++ 4 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 编译说明.md diff --git a/admin/src/localization/i18n.ts b/admin/src/localization/i18n.ts index 67ae140e7..8a74282cc 100644 --- a/admin/src/localization/i18n.ts +++ b/admin/src/localization/i18n.ts @@ -50,7 +50,8 @@ i18n .init( { ns: ['translation','ep_admin_pads'], - fallbackLng: 'en' + // 后台默认中文显示 + fallbackLng: 'zh-hans' } ) diff --git a/settings.json.template b/settings.json.template index 66c9a7df2..56625873c 100644 --- a/settings.json.template +++ b/settings.json.template @@ -240,7 +240,7 @@ "rtl": false, "alwaysShowChat": false, "chatAndUsers": false, - "lang": null + "lang": "zh-hans" }, /* diff --git a/src/static/js/pluginfw/LinkInstaller.ts b/src/static/js/pluginfw/LinkInstaller.ts index e5eaf0b5c..ed0a11e56 100644 --- a/src/static/js/pluginfw/LinkInstaller.ts +++ b/src/static/js/pluginfw/LinkInstaller.ts @@ -18,6 +18,7 @@ export class LinkInstaller { constructor() { this.livePluginManager = new PluginManager({ + npmRegistryUrl: 'https://registry.npmmirror.com/', pluginsPath: pluginInstallPath, hostRequire: undefined, cwd: path.join(settings.root, 'src') diff --git a/编译说明.md b/编译说明.md new file mode 100644 index 000000000..7f83a7eef --- /dev/null +++ b/编译说明.md @@ -0,0 +1,30 @@ +1. Download the latest Node.js runtime from [nodejs.org](https://nodejs.org/). +2. Install pnpm: `npm install -g pnpm` (Administrator privileges may be required). +3. Clone the repository: `git clone -b master` +4. Run `pnpm i` +5. Run `pnpm run build:etherpad` +6. Run `pnpm run prod` +7. Visit `http://localhost:9001` in your browser. + + +后台中文设置,找到文件 + etherpad-lite\admin\src\localization>i18n.ts + // 修改 + fallbackLng: 'zh-hans' + +前台中文设置。搜索lang,改成 +lang = 'zh-hans' + +修改文件 +etherpad-lite\src\static\js\pluginfw> LinkInstaller.ts + constructor() { + this.livePluginManager = new PluginManager({ + //增加 插件拉不下来问题解决。 + npmRegistryUrl: 'https://registry.npmmirror.com/', + pluginsPath: pluginInstallPath, + hostRequire: undefined, + cwd: path.join(settings.root, 'src') + }); + this.dependenciesMap = new Map(); + + } \ No newline at end of file