This is an automated email from the ASF dual-hosted git repository.

LinkinStars pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/answer.git


The following commit(s) were added to refs/heads/dev by this push:
     new 61e8741b fix(i18n): add English messages for three backend error 
reasons (#1672)
61e8741b is described below

commit 61e8741bb47f8308eec663f90d46b51a55166aeb
Author: Faris Basha TM <[email protected]>
AuthorDate: Thu Nov 19 08:00:09 2026 +0530

    fix(i18n): add English messages for three backend error reasons (#1672)
    
    ## Proposed Changes
    
    - Add `backend.error.answer.restrict_answer`,
    `backend.error.upload.source_unsupported` and
    `backend.error.feature.disabled` to `i18n/en_US.yaml`.
    - These keys are used by `reason.AnswerRestrictAnswer` (returned by
    `AnswerController.Add` in `internal/controller/answer_controller.go`
    when "restrict answer" is on and the user already has an answer on the
    question), `reason.UploadFileSourceUnsupported`
    (`internal/controller/upload_controller.go`) and
    `reason.ErrFeatureDisabled` (`FeatureToggleService.EnsureEnabled`). They
    are not in `en_US.yaml` (or `zh_CN.yaml`), so `translator.Tr` falls back
    to the key and the response message is the raw key, e.g.
    `error.answer.restrict_answer`.
    - Only the English source file is changed; other languages come from
    Crowdin.
    
    How I checked: compared every string constant in
    `internal/base/reason/reason.go` with the `backend` section of
    `en_US.yaml`; these three were the only ones missing. The edited file
    parses as YAML and the three keys resolve. I did not run the server
    locally.
    
    Prepared with the help of an AI assistant.
---
 i18n/en_US.yaml | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/i18n/en_US.yaml b/i18n/en_US.yaml
index 63f9140c..a1ad4439 100644
--- a/i18n/en_US.yaml
+++ b/i18n/en_US.yaml
@@ -175,6 +175,8 @@ backend:
         other: Answers cannot be added to this question.
       content_cannot_empty:
         other: Answer content cannot be empty.
+      restrict_answer:
+        other: You can only write one answer to this question.
     comment:
       edit_without_permission:
         other: You do not have permission to edit this comment.
@@ -333,6 +335,11 @@ backend:
     upload:
       unsupported_file_format:
         other: Unsupported file format.
+      source_unsupported:
+        other: Unsupported upload source.
+    feature:
+      disabled:
+        other: This feature is disabled.
     site_info:
       config_not_found:
         other: Site config not found.

Reply via email to