feat: 集成n8n中文翻译
详细说明: - 集成n8n-i18n-chinese项目的中文翻译文件 - 配置i18n系统支持中文界面 - 修改默认语言为zh-CN - 修复凭证配置null数据问题 修改的文件: - packages/frontend/@n8n/i18n/src/index.ts - packages/frontend/@n8n/i18n/src/locales/zh-CN.json - packages/frontend/editor-ui/src/components/CredentialEdit/CredentialConfig.vue 影响的功能: - 整个n8n界面显示为中文 - 支持中英文切换 - 提升中国用户使用体验
This commit is contained in:
@@ -55,7 +55,8 @@
|
|||||||
"Bash(export PATH=\"$PNPM_HOME:$PATH\")",
|
"Bash(export PATH=\"$PNPM_HOME:$PATH\")",
|
||||||
"Bash(brew upgrade:*)",
|
"Bash(brew upgrade:*)",
|
||||||
"Bash(npm install:*)",
|
"Bash(npm install:*)",
|
||||||
"Bash(git add:*)"
|
"Bash(git add:*)",
|
||||||
|
"Bash(export N8N_DEFAULT_LOCALE=zh-CN)"
|
||||||
],
|
],
|
||||||
"defaultMode": "acceptEdits",
|
"defaultMode": "acceptEdits",
|
||||||
"additionalDirectories": [
|
"additionalDirectories": [
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import type { INodeProperties, INodePropertyCollection, INodePropertyOptions } f
|
|||||||
import { createI18n } from 'vue-i18n';
|
import { createI18n } from 'vue-i18n';
|
||||||
|
|
||||||
import englishBaseText from './locales/en.json';
|
import englishBaseText from './locales/en.json';
|
||||||
|
import chineseBaseText from './locales/zh-CN.json';
|
||||||
import type { BaseTextKey, INodeTranslationHeaders } from './types';
|
import type { BaseTextKey, INodeTranslationHeaders } from './types';
|
||||||
import {
|
import {
|
||||||
deriveMiddleKey,
|
deriveMiddleKey,
|
||||||
@@ -15,9 +16,12 @@ export * from './types';
|
|||||||
|
|
||||||
export const i18nInstance = createI18n({
|
export const i18nInstance = createI18n({
|
||||||
legacy: false,
|
legacy: false,
|
||||||
locale: 'en',
|
locale: 'zh-CN',
|
||||||
fallbackLocale: 'en',
|
fallbackLocale: 'en',
|
||||||
messages: { en: englishBaseText },
|
messages: {
|
||||||
|
en: englishBaseText,
|
||||||
|
'zh-CN': chineseBaseText
|
||||||
|
},
|
||||||
warnHtmlMessage: false,
|
warnHtmlMessage: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -375,7 +379,7 @@ export class I18nClass {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const loadedLanguages = ['en'];
|
const loadedLanguages = ['en', 'zh-CN'];
|
||||||
|
|
||||||
async function setLanguage(language: string) {
|
async function setLanguage(language: string) {
|
||||||
i18nInstance.global.locale.value = language as 'en';
|
i18nInstance.global.locale.value = language as 'en';
|
||||||
|
|||||||
3454
n8n-n8n-1.109.2/packages/frontend/@n8n/i18n/src/locales/zh-CN.json
Normal file
3454
n8n-n8n-1.109.2/packages/frontend/@n8n/i18n/src/locales/zh-CN.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -91,6 +91,8 @@ onBeforeMount(async () => {
|
|||||||
props.credentialType.name,
|
props.credentialType.name,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (!credTranslation) return;
|
||||||
|
|
||||||
addCredentialTranslation(
|
addCredentialTranslation(
|
||||||
{ [props.credentialType.name]: credTranslation },
|
{ [props.credentialType.name]: credTranslation },
|
||||||
rootStore.defaultLocale,
|
rootStore.defaultLocale,
|
||||||
|
|||||||
Reference in New Issue
Block a user