Moin
12월 1, 2024, 6:33오후
5
이 문제는 특정 번역과 관련이 있다고 생각하지 않습니다.
커뮤니티의 플래그로 인해 게시물이 숨겨지면 작성자에게 개인 메시지가 전송됩니다. 이 메시지에는 원인이 포함되어 있습니다. 예를 들어:
이러한 원인은 메시지가 생성될 때 사용됩니다.
이 원인을 메시지에 추가하는 코드는 post_action_type를 사용합니다.
# inform user
if user.present?
options = {
url: url,
edit_delay: SiteSetting.cooldown_minutes_after_hiding_posts,
flag_reason:
I18n.t(
"flag_reasons.#{post_action_type_view.types[post_action_type_id]}",
locale: SiteSetting.default_locale,
base_path: Discourse.base_path,
),
}
message = custom_message
message = hiding_again ? :post_hidden_again : :post_hidden if message.nil?
Jobs.enqueue_in(
5.seconds,
:send_system_message,
user_id: user.id,
This file has been truncated. show original
이것은 기본 플래그 원인의 경우 작동합니다. 예를 들어, 위 스크린샷에서 볼 수 있듯이 flag_reasons.spam입니다.
문제는 사용자 정의 플래그 원인에 대한 문자열이 없다는 것입니다. 예를 들어, "Testing"이라는 이유를 생성하고 Auto hide flagged content를 활성화한다고 가정해 보겠습니다.
그런 경우 flag_reasons.custom_testing이 사용됩니다. 그러나 이 원인은 존재하지 않습니다. 언어와 무관하게, 이것은 사용자 정의 플래그이므로 영어로도 존재하지 않습니다.
또한 게시물이 삭제될 때에도 동일한 이유가 사용됩니다 (RGJ의 게시물에 있는 스크린샷 참조)
message_options: {
flagged_post_raw_content: notify_responders ? options[:parent_post].raw : @post.raw,
flagged_post_response_raw_content: @post.raw,
url: notify_responders ? options[:parent_post].url : @post.url,
flag_reason:
I18n.t(
"flag_reasons#{".responder" if notify_responders}.#{flag_type}",
locale: SiteSetting.default_locale,
base_path: Discourse.base_path,
),
},
그리고 참고로 "responders"의 경우에도 잘못된 이유가 누락되어 있습니다.
4개의 좋아요