Przeglądaj źródła

fix(api-v13): glossary 的说明与报错文案改为「外挂术语」(不是术语讨论)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
visuddhinanda 1 dzień temu
rodzic
commit
9499f49bba

+ 2 - 2
api-v13/app/Http/Controllers/V3/DiscussionController.php

@@ -76,8 +76,8 @@ class DiscussionController extends Controller
      * 标题可省、正文必填,commentary 的正文必须是义注句子模板 `{{book-para-start-end}}`
      * (可多句并列);可带锚点 pos_* / quote_*;不发通知。
      *
-     * glossary(术语讨论)是评论线程,title 必填、填术语词头;与批注一样只能挂在句子上、
-     * 只有该句所在 channel 的编辑者能发,对所有人公开可见。
+     * glossary(外挂术语:不改译文,给锚点处的译文挂上术语)是评论线程,title 必填、填术语词头;
+     * 与批注一样只能挂在句子上、只有该句所在 channel 的编辑者能发,对所有人公开可见。
      * 锚点只有 note / commentary / issue / glossary 收,其它类型传了 422。
      *
      * @responseStatus 201 创建成功

+ 4 - 1
api-v13/app/Models/Discussion.php

@@ -71,7 +71,10 @@ class Discussion extends Model
     /** 批注类型:作为边注注入阅读页,没有回复以外的线程属性(开关、severity) */
     public const INJECTED_TYPES = [self::TYPE_COMMENTARY, self::TYPE_NOTE];
 
-    /** 术语讨论:针对句子里某个词的译法提问或建议,带锚点、只能挂在句子上 */
+    /**
+     * 外挂术语:不改译文原文,给锚点处的一段译文挂上术语(title 是术语词头),阅读页把那段
+     * 原文渲染成 `[[title#原文]]`。带锚点、只能挂在句子上。与术语表(dhamma terms)是两回事。
+     */
     public const TYPE_GLOSSARY = 'glossary';
 
     /** 评论线程:话题 + 一层回复,有开关状态 */

+ 1 - 1
api-v13/app/Services/PaliContentService.php

@@ -749,7 +749,7 @@ class PaliContentService
      * - `commentary`(注释书对应):content 是义注 / 复注的句子模板 `{{book-para-start-end}}`,
      *   渲染成这几句的译文,作为 {{note}} 边注插在锚点末尾,并追加 <cite> 跳转出处;
      * - `note`(普通边注):content 就是注解正文(markdown),同样插成 {{note}},没有出处;
-     * - `glossary`(术语讨论):锚点处的原文换成 `[[title#原文]]`,渲染成术语(title 是词头);
+     * - `glossary`(外挂术语):锚点处的原文换成 `[[title#原文]]`,渲染成术语(title 是词头);
      * - `issue`:锚点处的原文包一层高亮 span,带 discussion id,阅读器点击看内容;
      *   没有位置的合成一个三角叹号图标放在句尾。只在 html 格式输出。
      * issue / glossary 只注入未关闭的;批注没有开关状态。

+ 1 - 1
api-v13/app/Services/V3/DiscussionService.php

@@ -39,7 +39,7 @@ use Illuminate\Validation\ValidationException;
  * - 其他用户可以回复;没有开关状态,不能与评论线程互转;新建批注不发通知;
  * - 列表与统计不带 type 时只算评论线程,要批注须显式 type=note / commentary。
  *
- * glossary 是评论线程(有回复和开关),但像批注一样只能挂在句子上、只有该句的管理者能发起,
+ * glossary(外挂术语)是评论线程(有回复和开关),但像批注一样只能挂在句子上、只有该句的管理者能发起,
  * 对所有人公开可见。锚点除批注外,issue 与 glossary 也收({@see Discussion::ANCHORED_TYPES})。
  *
  * 写入方(`$actor`)由 {@see AgentGrantService::actor()} 给出:人类直接写,或 AI 模型凭人类

+ 1 - 1
api-v13/resources/lang/en/messages.php

@@ -28,7 +28,7 @@ return [
     'discussion_type_group' => 'A comment thread and an annotation cannot be converted into each other.',
     'discussion_commentary_format' => 'Commentary content must be sentence templates such as {{book-para-start-end}}.',
     'discussion_anchor_thread' => 'This discussion type cannot be anchored to a text position.',
-    'discussion_glossary_target' => 'Glossary discussions can only be attached to sentences.',
+    'discussion_glossary_target' => 'Attached glossary terms can only be added to sentences.',
     'agent_grant_by_model' => 'Only a person can grant an AI model permission to write.',
     'agent_grant_model_not_found' => 'AI model not found.',
     'agent_grant_not_owner' => 'This AI model does not belong to you.',

+ 1 - 1
api-v13/resources/lang/zh-Hans/messages.php

@@ -28,7 +28,7 @@ return [
     'discussion_type_group' => '评论线程与批注之间不能互相转换。',
     'discussion_commentary_format' => '义注的内容必须是句子模板,如 {{book-para-start-end}}。',
     'discussion_anchor_thread' => '这种类型的讨论不能锚定到文本位置。',
-    'discussion_glossary_target' => '术语讨论只能挂在句子上。',
+    'discussion_glossary_target' => '外挂术语只能挂在句子上。',
     'agent_grant_by_model' => '只有人类能给 AI 模型授权写入。',
     'agent_grant_model_not_found' => 'AI 模型不存在。',
     'agent_grant_not_owner' => '这个 AI 模型不属于你。',