diff --git a/.github/workflows/release-sdk.yml b/.github/workflows/release-sdk.yml index 480fd4118..4c4858410 100644 --- a/.github/workflows/release-sdk.yml +++ b/.github/workflows/release-sdk.yml @@ -29,11 +29,13 @@ jobs: # No `registry-url:` here on purpose. setup-node's registry-url writes # an .npmrc with `_authToken=${NODE_AUTH_TOKEN}` and exports # NODE_AUTH_TOKEN as the literal sentinel `XXXXX-XXXXX-XXXXX-XXXXX`. - # pnpm then sends that sentinel as a bearer token and skips OIDC - # entirely, so the publish PUT comes back as 404. + # npm/pnpm then send that sentinel as a bearer token and skip OIDC + # entirely, so the publish PUT comes back as 404. Node 24 ships npm + # 11.x which performs the Trusted Publisher OIDC exchange natively + # when no token is configured. uses: actions/setup-node@v4 with: - node-version: 22 + node-version: 24 - name: Enable Corepack run: npm i -g corepack@latest @@ -89,6 +91,10 @@ jobs: # Authenticates via npm Trusted Publisher (OIDC). No NPM_TOKEN. # Requires the package to have GitHub Actions trusted publishing # configured on npmjs.com pointing at this workflow file. + # Uses `pnpm publish` (never plain `npm publish`) so that pnpm-only + # protocols in packages/sdk/package.json — `catalog:` for shared + # versions, `workspace:*` for sibling packages — are resolved into + # real version specifiers before the tarball is produced. if: steps.check-version.outputs.already_published == 'false' run: pnpm --filter @workflowbuilder/sdk publish --no-git-checks --access public --provenance diff --git a/apps/demo/index.html b/apps/demo/index.html index 2adb34648..4a0762e65 100644 --- a/apps/demo/index.html +++ b/apps/demo/index.html @@ -16,6 +16,7 @@
+ diff --git a/packages/sdk/src/features/i18n/index.ts b/packages/sdk/src/features/i18n/index.ts index 86aa753e1..a30a35975 100644 --- a/packages/sdk/src/features/i18n/index.ts +++ b/packages/sdk/src/features/i18n/index.ts @@ -5,6 +5,7 @@ import { initReactI18next } from 'react-i18next'; import { withOptionalComponentPluginsTranslation } from '../plugins-core/adapters/adapter-i18n'; import { en } from './locales/en'; import { pl } from './locales/pl'; +import { zh } from './locales/zh-cn'; export const defaultNS = 'translation'; @@ -15,6 +16,9 @@ const resources = { pl: { translation: pl, } as const, + zh: { + translation: zh, + } as const, }; i18n @@ -23,12 +27,11 @@ i18n .init({ resources: withOptionalComponentPluginsTranslation(resources), defaultNS, - fallbackLng: 'en', + fallbackLng: 'zh', interpolation: { escapeValue: false, }, returnNull: false, - load: 'languageOnly', detection: { order: ['localStorage', 'navigator'], caches: ['localStorage'], diff --git a/packages/sdk/src/features/i18n/locales/zh-cn.ts b/packages/sdk/src/features/i18n/locales/zh-cn.ts new file mode 100644 index 000000000..e34a7a66d --- /dev/null +++ b/packages/sdk/src/features/i18n/locales/zh-cn.ts @@ -0,0 +1,213 @@ +export const zh = { + common: { + close: '关闭', + open: '打开', + cancel: '取消', + collapse: '折叠', + expand: '展开', + edit: '修改', + remove: '删除', + save: '保存', + filter: '筛选', + sort: '排序', + moveUp: '上移', + moveDown: '下移', + accept: '接受', + reject: '拒绝', + goBack: '返回', + openInNewTab: '在新标签页打开', + settings: '设置', + name: '名称', + namePlaceholder: '输入名称', + description: '描述', + descriptionPlaceholder: '输入描述', + type: '类型', + notFound: '未找到匹配结果。', + }, + header: { + folderName: '文件夹名称', + projectSelection: { + rename: '重命名', + duplicateToDrafts: '复制到草稿', + }, + controls: { + saveAsImage: '保存为图片', + archive: '归档', + }, + }, + palette: { + templates: '模板', + nodesLibrary: '节点库', + }, + node: { + action: { + label: '动作', + description: '基于触发器执行动作', + }, + conditional: { + label: '条件', + description: '分支工作流', + }, + decision: { + label: '决策', + description: '路由工作流', + }, + delay: { + label: '延迟', + description: '暂停工作流', + }, + notification: { + label: '通知', + description: '发送提醒或通知', + }, + trigger: { + label: '触发器', + description: '启动工作流', + }, + aiAgent: { + label: 'AI 智能体', + description: '委派任务给 Agent', + }, + }, + propertiesBar: { + label: '属性', + deleteNode: '删除节点', + deleteEdge: '删除连线', + }, + deleteConfirmation: { + text: '您即将永久删除{{selected}}个{{parts}}。请确认继续。', + cancel: '取消', + delete: '删除', + node: '节点', + nodes: '节点', + edge: '连线', + edges: '连线', + andConnected: '及其连接的', + selected: '已选中的', + selectedPlural: '已选中的', + deleteSelection: '删除选中项?', + dontShowMeThisAgain: '不再显示此提示', + }, + aiTools: { + title: 'AI Agent 工具', + addTool: '添加工具', + addToolSlot: '添加工具槽', + modalTitle: '添加工具', + }, + decisionBranches: { + branch: '分支 #{{index}}', + branches: '分支', + addBranch: '添加分支', + label: '标题', + }, + conditions: { + title: '条件编辑器', + subtitle: '定义您的条件规则', + cancel: '取消', + confirm: '确认', + totalNumber: '{{count}} 个条件', + totalNumber_one: '1 个条件', + totalNumber_zero: '暂无条件', + dependencies: '依赖项', + compare: { + or: '或', + and: '且', + one: '一', + all: '全部', + isEqual: '等于', + isNotEqual: '不等于', + isGreaterThan: '大于', + isLessThan: '小于', + isLessThanOrEqual: '小于等于', + isGreaterThanOrEqual: '大于等于', + isContaining: '包含', + isNotContaining: '不包含', + isBefore: '早于', + isAfter: '晚于', + }, + }, + variables: { + variablesListIsEmptyHint: '检查节点是否已连接到图中。', + placeholderForStringOrVariable: '输入或选择变量 {{...', + placeholderTypeNumber: '输入数值', + placeholderTypeString: '输入字符串', + typeValue: '输入值', + pickVariable: '选择变量', + clickToPickVariable: '点击选择变量', + defaultValue: '默认值', + variableNotFound: '未找到变量。', + removeVariableWarning: '删除此变量将永久移除其配置。', + removeVariableIsBlocked: '该变量正在以下节点中使用,无法删除。', + }, + loader: { + text: '加载中...', + }, + templateSelector: { + title: '选择模板', + description: '通过预设模板快速开始
构建您的工作流编辑器', + emptyCanvas: '空白画布', + }, + tooltips: { + exportDiagram: '导出文件', + readOnlyMode: '切换只读模式', + layout: '自动布局', + open: '打开', + close: '关闭', + palette: '节点面板', + propSidebar: '属性侧栏', + remove: '删除', + cantRemoveOnlyOption: '无法删除唯一选项', + addOption: '添加选项', + menu: '菜单', + pickTheProject: '选择项目', + openPalette: '打开节点面板', + closePalette: '关闭节点面板', + openPropertiesBar: '打开属性栏', + closePropertiesBar: '关闭属性栏', + importDiagram: '导入文件', + save: '保存', + changeLanguage: '切换语言', + copy: '复制', + }, + snackbar: { + saveDiagramSuccess: '图表保存成功', + noDiagramToLoad: '没有可加载的图表!', + loadDiagramError: '加载图表时出错', + loadDiagramSuccess: '图表加载成功', + saveDiagramError: '保存图表时出错', + restoreDiagramSuccess: '已恢复保存的数据', + restoreDiagramError: '无法加载保存的数据', + aiConnectionError: '连接 AI 服务器出错', + wrongDiagramFormat: '图表格式错误', + contentCopied: '内容已复制到剪贴板', + variablesListIsEmpty: '可用变量列表为空。', + cantEditReadOnlyMode: '只读模式下禁止编辑。', + }, + workflowsSettings: { + modalTitle: '设置', + modalDescription: '管理工作流属性', + tab: { + general: '常规', + generalDescription: '常规设置', + globalVariables: '全局变量', + globalVariablesDescription: '管理可复用的工作流变量', + addVariable: '添加变量', + editVariable: '编辑变量', + removeVariable: '删除变量', + emptyVariablesList: '暂无定义变量。', + }, + }, + importExport: { + export: '导出', + import: '导入', + ignoreAndImport: '忽略并导入', + importTip: '查看预期模式的最简单方法是创建图表并导出。', + }, + validation: { + error: { + notJSONObject: '提供的值不是有效的 JSON 对象。', + nodesWithoutDefinition: '不支持的节点: {{nodesIds}}', + nodesWithErrors: '有错误的节点: {{nodesIds}}', + }, + }, +} as const;