A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.
fix(review): add translation for review
LinkinStars03b3555ddf0c
diff --git a/i18n/en_US.yaml b/i18n/en_US.yamlindex c1c64a01..d70850e6 100644--- a/i18n/en_US.yaml+++ b/i18n/en_US.yaml@@ -492,6 +492,13 @@ backend:other: acceptaccepted:other: accepted+ review:+ queued_post:+ other: Queued post+ flagged_post:+ other: Flagged post+ suggested_post_edit:+ other: Suggested edits# The following fields are used for interface presentation(Front-end)ui:diff --git a/internal/base/constant/revision.go b/internal/base/constant/revision.goindex 93ccf2ec..0d7dc586 100644--- a/internal/base/constant/revision.go+++ b/internal/base/constant/revision.go@@ -17,3 +17,9 @@ const (ReportOperationUnlistPost = "unlist_post"ReportOperationIgnoreReport = "ignore_report")++const (+ ReviewQueuedPostLabel = "review.queued_post"+ ReviewFlaggedPostLabel = "review.flagged_post"+ ReviewSuggestedPostEditLabel = "review.suggested_post_edit"+)diff --git a/internal/service/content/revision_service.go b/internal/service/content/revision_service.goindex e004ad07..f39e055a 100644--- a/internal/service/content/revision_service.go+++ b/internal/service/content/revision_service.go@@ -25,8 +25,10 @@ import ("time""github.com/apache/incubator-answer/internal/base/constant"+ "github.com/apache/incubator-answer/internal/base/handler""github.com/apache/incubator-answer/internal/base/pager""github.com/apache/incubator-answer/internal/base/reason"+ "github.com/apache/incubator-answer/internal/base/translator""github.com/apache/incubator-answer/internal/entity""github.com/apache/incubator-answer/internal/schema""github.com/apache/incubator-answer/internal/service/activity_queue"@@ -463,7 +465,7 @@ func (rs *RevisionService) GetReviewingType(ctx context.Context, req *schema.Get} else {resp = append(resp, &schema.GetReviewingTypeResp{Name: string(constant.QueuedPost),- Label: "Queued post",+ Label: translator.Tr(handler.GetLangByCtx(ctx), constant.ReviewQueuedPostLabel),TodoAmount: reviewCount,})}@@ -477,7 +479,7 @@ func (rs *RevisionService) GetReviewingType(ctx context.Context, req *schema.Get} else {resp = append(resp, &schema.GetReviewingTypeResp{Name: string(constant.FlaggedPost),- Label: "Flagged post",+ Label: translator.Tr(handler.GetLangByCtx(ctx), constant.ReviewFlaggedPostLabel),TodoAmount: reportCount,})}@@ -490,7 +492,7 @@ func (rs *RevisionService) GetReviewingType(ctx context.Context, req *schema.Get} else {resp = append(resp, &schema.GetReviewingTypeResp{Name: string(constant.SuggestedPostEdit),- Label: "Suggested edits",+ Label: translator.Tr(handler.GetLangByCtx(ctx), constant.ReviewSuggestedPostEditLabel),TodoAmount: countUnreviewedRevision,})}