You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
当前问题
现在的 agent 采用了在
agents
目录维护英文版,在 locales 目录下自动生成其他语言的模式。这导致本地语言的 agent 制作者无法维护,不利于 agents 的迭代与升级。解决思路
agents 目录更新为
src
目录,用于存放原始提交的 agent,所有提交的 agent 原始文件都放在该目录下;agent 原始文件作为维护的 SoT,用于派生其余 locale 的 agent;
src 目录下的 agent 采用
<id>.<locale>.json
的方式保存,其中语言为英文时,可以省略locale
,例如:dva-to-zustand.zh-CN.json
(中文)business-email.json
(英文)生成 locales 时,基于后缀名判断原始的
entryLocale
,再依次生成目标语言(默认目标语言为 zh-CN 和 en),例如:business-email.json
识别为英文,生成的目标语言就是business-email.zh-CN.json
;dva-to-zustand.zh-CN.json
识别为中文,生成的目标语言为dva-to-zustand.json
针对需要更新 agents 的场景,新增一个字段
localeMode
,用于控制 locale 的生成模式,计划支持四种模式:once
(默认): 在没有 locale 时自动生成,后续变更 src 时不会更新 locale 的内容;manual
:人工控制生成,生成 locale 时,需要带有 manual 标记的指令,才会触发重新生成;always
: 在每次变更 src 后,均会重新触发 locale 生成;none
: 不生成 locale ,针对一些翻译类 agent,建议将其配置为 none该字段只在 src 下存在,发布到生产时需要被移除。
Beta Was this translation helpful? Give feedback.
All reactions