클라이언트 메시지 다국어 처리
공개 API 변경 없음.
This commit is contained in:
@@ -389,6 +389,88 @@ class SodaMessageSource {
|
||||
)
|
||||
)
|
||||
|
||||
private val messageMessages = mapOf(
|
||||
"message.error.recipient_not_found" to mapOf(
|
||||
Lang.KO to "받는 사람이 없습니다.",
|
||||
Lang.EN to "Recipient not found.",
|
||||
Lang.JA to "受信者が見つかりません。"
|
||||
),
|
||||
"message.error.recipient_inactive" to mapOf(
|
||||
Lang.KO to "탈퇴한 유저에게는 메시지를 보내실 수 없습니다.",
|
||||
Lang.EN to "You cannot send messages to a deactivated user.",
|
||||
Lang.JA to "退会したユーザーにはメッセージを送れません。"
|
||||
),
|
||||
"message.error.blocked_by_recipient" to mapOf(
|
||||
Lang.KO to "%s님의 요청으로 메시지를 보낼 수 없습니다.",
|
||||
Lang.EN to "You cannot send messages at %s's request.",
|
||||
Lang.JA to "%sの要請によりメッセージを送信できません。"
|
||||
),
|
||||
"message.fcm.title" to mapOf(
|
||||
Lang.KO to "메시지",
|
||||
Lang.EN to "Message",
|
||||
Lang.JA to "メッセージ"
|
||||
),
|
||||
"message.fcm.text_received" to mapOf(
|
||||
Lang.KO to "%s님으로 부터 문자메시지가 도착했습니다.",
|
||||
Lang.EN to "You have received a text message from %s.",
|
||||
Lang.JA to "%sからテキストメッセージが届きました。"
|
||||
),
|
||||
"message.fcm.voice_received" to mapOf(
|
||||
Lang.KO to "%s님으로 부터 음성메시지가 도착했습니다.",
|
||||
Lang.EN to "You have received a voice message from %s.",
|
||||
Lang.JA to "%sからボイスメッセージが届きました。"
|
||||
),
|
||||
"message.error.not_found_retry" to mapOf(
|
||||
Lang.KO to "해당하는 메시지가 없습니다.\n다시 확인해 주시기 바랍니다.",
|
||||
Lang.EN to "Message not found. Please check again.",
|
||||
Lang.JA to "該当するメッセージがありません。\nもう一度ご確認ください。"
|
||||
),
|
||||
"message.error.already_kept" to mapOf(
|
||||
Lang.KO to "이미 보관된 메시지 입니다.",
|
||||
Lang.EN to "Message is already kept.",
|
||||
Lang.JA to "すでに保管されたメッセージです。"
|
||||
)
|
||||
)
|
||||
|
||||
private val noticeMessages = mapOf(
|
||||
"notice.error.title_required" to mapOf(
|
||||
Lang.KO to "제목을 입력하세요.",
|
||||
Lang.EN to "Please enter a title.",
|
||||
Lang.JA to "タイトルを入力してください。"
|
||||
),
|
||||
"notice.error.content_required" to mapOf(
|
||||
Lang.KO to "내용을 입력하세요.",
|
||||
Lang.EN to "Please enter content.",
|
||||
Lang.JA to "内容を入力してください。"
|
||||
),
|
||||
"notice.error.update_required" to mapOf(
|
||||
Lang.KO to "수정할 내용을 입력하세요.",
|
||||
Lang.EN to "Please enter content to update.",
|
||||
Lang.JA to "修正する内容を入力してください。"
|
||||
)
|
||||
)
|
||||
|
||||
private val reportMessages = mapOf(
|
||||
"report.received" to mapOf(
|
||||
Lang.KO to "신고가 접수되었습니다.",
|
||||
Lang.EN to "Your report has been received.",
|
||||
Lang.JA to "通報が受け付けられました。"
|
||||
)
|
||||
)
|
||||
|
||||
private val imageValidationMessages = mapOf(
|
||||
"image.error.only_image_allowed" to mapOf(
|
||||
Lang.KO to "이미지 파일만 업로드할 수 있습니다.",
|
||||
Lang.EN to "Only image files can be uploaded.",
|
||||
Lang.JA to "画像ファイルのみアップロードできます。"
|
||||
),
|
||||
"image.error.gif_paid_only" to mapOf(
|
||||
Lang.KO to "GIF 파일은 유료 게시물만 업로드 할 수 있습니다.",
|
||||
Lang.EN to "GIF files can be uploaded only for paid posts.",
|
||||
Lang.JA to "GIFファイルは有料投稿のみアップロードできます。"
|
||||
)
|
||||
)
|
||||
|
||||
fun getMessage(key: String, lang: Lang): String? {
|
||||
val messageGroups = listOf(
|
||||
commonMessages,
|
||||
@@ -410,7 +492,11 @@ class SodaMessageSource {
|
||||
adminContentSeriesMessages,
|
||||
adminContentSeriesBannerMessages,
|
||||
adminContentSeriesGenreMessages,
|
||||
adminContentThemeMessages
|
||||
adminContentThemeMessages,
|
||||
messageMessages,
|
||||
noticeMessages,
|
||||
reportMessages,
|
||||
imageValidationMessages
|
||||
)
|
||||
for (messages in messageGroups) {
|
||||
val translations = messages[key] ?: continue
|
||||
|
||||
Reference in New Issue
Block a user