From fcb7f28f343732b2f1589628df4544c629a10221 Mon Sep 17 00:00:00 2001 From: amnix Date: Tue, 12 Nov 2024 18:20:17 +0900 Subject: [PATCH] enum naming changes --- .../komoju/mobile/sdk/i18n/EnglishStrings.kt | 30 +++++++++--------- .../komoju/mobile/sdk/i18n/I18nStringKey.kt | 31 ++++++++++--------- .../komoju/mobile/sdk/i18n/JapaneseStrings.kt | 30 +++++++++--------- .../payment/KomojuPaymentScreenModel.kt | 2 +- .../payment/composables/BitCashForm.kt | 2 +- .../payment/composables/KonbiniBrandsRow.kt | 6 ++-- .../payment/composables/OffSitePayForm.kt | 6 ++-- .../payment/composables/PaymentMethodsRow.kt | 12 +++---- .../payment/composables/WebMoneyForm.kt | 2 +- 9 files changed, 61 insertions(+), 60 deletions(-) diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/i18n/EnglishStrings.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/i18n/EnglishStrings.kt index 89c6c1d..bcca861 100644 --- a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/i18n/EnglishStrings.kt +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/i18n/EnglishStrings.kt @@ -2,7 +2,7 @@ package com.komoju.mobile.sdk.i18n object EnglishStrings : I18nStrings { override fun get(key: I18nStringKey): String = when (key) { - I18nStringKey.cadrholder_name_cannot_be_empty -> "The entered cardholder name cannot be empty" + I18nStringKey.cardholder_name_cannot_be_empty -> "The entered cardholder name cannot be empty" I18nStringKey.the_entered_cardholder_name_is_not_valid -> "The entered cardholder name is not valid" I18nStringKey.the_entered_card_number_is_not_valid -> "The entered card number is not valid" I18nStringKey.the_entered_expiry_date_is_not_valid -> "The entered expiry date is not valid" @@ -44,9 +44,9 @@ object EnglishStrings : I18nStrings { I18nStringKey.daily_yamazaki -> "Daily Yamazaki" I18nStringKey.family_mart -> "Family Mart" I18nStringKey.lawson -> "Lawson" - I18nStringKey.ministop -> "MiniStop" - I18nStringKey.seicomart -> "SeicoMart" - I18nStringKey._7_eleven -> "7-Eleven" + I18nStringKey.mini_stop -> "MiniStop" + I18nStringKey.seico_mart -> "SeicoMart" + I18nStringKey.seven_eleven -> "7-Eleven" I18nStringKey.full_name_on_receipt -> "Full name on receipt" I18nStringKey.name_shown_on_receipt -> "Name (shown on receipt)" I18nStringKey.email -> "Email" @@ -66,11 +66,11 @@ object EnglishStrings : I18nStrings { I18nStringKey.you_will_be_redirected_to_rakuten -> "You will be redirected to Rakuten to complete the payment" I18nStringKey.you_will_be_redirected_to_line_pay -> "You will be redirected to Line Pay to complete the payment" I18nStringKey.continue_to_alipay -> "Continue to Alipay" - I18nStringKey.continue_to_aupay -> "Continue to AuPay" - I18nStringKey.continue_to_merpay -> "Continue to MerPay" + I18nStringKey.continue_to_au_pay -> "Continue to AuPay" + I18nStringKey.continue_to_mer_pay -> "Continue to MerPay" I18nStringKey.continue_to_paypay -> "Continue to PayPay" I18nStringKey.continue_to_rakuten -> "Continue to Rakuten" - I18nStringKey.continue_to_linepay -> "Continue to LinePay" + I18nStringKey.continue_to_line_pay -> "Continue to LinePay" I18nStringKey.continue_to_paidy -> "Continue to Paidy" I18nStringKey.webview_open_info -> "Note a web window will be opened.After purchase you will be redirected back." I18nStringKey.full_name -> "Full Name" @@ -81,28 +81,28 @@ object EnglishStrings : I18nStrings { I18nStringKey.first_name -> "First Name" I18nStringKey.last_name_phonetic -> "Last Name (Phonetic)" I18nStringKey.first_name_phonetic -> "First Name (Phonetic)" - I18nStringKey.webmoney_information -> "WebMoney Information" + I18nStringKey.web_money_information -> "WebMoney Information" I18nStringKey.prepaid_number -> "Prepaid number" I18nStringKey.payment_success -> "Payment Success" I18nStringKey.thank_you_for_your_order -> "Thank you for your order" - I18nStringKey.bitcash_information -> "BitCash Information" + I18nStringKey.bit_cash_information -> "BitCash Information" I18nStringKey.hiragana_id -> "Hiragana id" I18nStringKey.bank_transfer -> "Bank Transfer" - I18nStringKey.bitcash -> "BitCash" + I18nStringKey.bit_cash -> "BitCash" I18nStringKey.credit_card -> "Credit card" I18nStringKey.konbini -> "Konbini" - I18nStringKey.netcash -> "NetCash" - I18nStringKey.aupay -> "au Pay" + I18nStringKey.net_cash -> "NetCash" + I18nStringKey.au_pay -> "au Pay" I18nStringKey.alipay -> "AliPay" - I18nStringKey.merpay -> "Mer Pay" + I18nStringKey.mer_pay -> "Mer Pay" I18nStringKey.paypay -> "PayPay" I18nStringKey.rakuten_pay -> "Rakuten Pay" I18nStringKey.line_pay -> "Line Pay" I18nStringKey.unknown -> "Unknown" I18nStringKey.other -> "Other" I18nStringKey.paidy -> "Paidy" - I18nStringKey.payeasy -> "PayEasy" - I18nStringKey.webmoney -> "WebMoney" + I18nStringKey.pay_easy -> "PayEasy" + I18nStringKey.web_money -> "WebMoney" I18nStringKey.total_payment -> "Total Payment" I18nStringKey.the_entered_name_cannot_be_empty -> "The entered name cannot be empty" I18nStringKey.the_entered_email_is_not_valid -> "The entered email is not valid" diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/i18n/I18nStringKey.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/i18n/I18nStringKey.kt index c6308cf..28c77ce 100644 --- a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/i18n/I18nStringKey.kt +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/i18n/I18nStringKey.kt @@ -1,7 +1,8 @@ package com.komoju.mobile.sdk.i18n +@Suppress("EnumEntryName") enum class I18nStringKey { - cadrholder_name_cannot_be_empty, + cardholder_name_cannot_be_empty, the_entered_cardholder_name_is_not_valid, the_entered_card_number_is_not_valid, the_entered_expiry_date_is_not_valid, @@ -37,9 +38,9 @@ enum class I18nStringKey { daily_yamazaki, family_mart, lawson, - ministop, - seicomart, - _7_eleven, + mini_stop, + seico_mart, + seven_eleven, full_name_on_receipt, name_shown_on_receipt, email, @@ -59,11 +60,11 @@ enum class I18nStringKey { you_will_be_redirected_to_rakuten, you_will_be_redirected_to_line_pay, continue_to_alipay, - continue_to_aupay, - continue_to_merpay, + continue_to_au_pay, + continue_to_mer_pay, continue_to_paypay, continue_to_rakuten, - continue_to_linepay, + continue_to_line_pay, continue_to_paidy, webview_open_info, full_name, @@ -74,28 +75,28 @@ enum class I18nStringKey { first_name, last_name_phonetic, first_name_phonetic, - webmoney_information, + web_money_information, prepaid_number, payment_success, thank_you_for_your_order, - bitcash_information, + bit_cash_information, hiragana_id, bank_transfer, - bitcash, + bit_cash, credit_card, konbini, - netcash, - aupay, + net_cash, + au_pay, alipay, - merpay, + mer_pay, paypay, rakuten_pay, line_pay, unknown, other, paidy, - payeasy, - webmoney, + pay_easy, + web_money, total_payment, the_entered_name_cannot_be_empty, the_entered_email_is_not_valid, diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/i18n/JapaneseStrings.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/i18n/JapaneseStrings.kt index 4dca3cf..f00127a 100644 --- a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/i18n/JapaneseStrings.kt +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/i18n/JapaneseStrings.kt @@ -2,7 +2,7 @@ package com.komoju.mobile.sdk.i18n object JapaneseStrings : I18nStrings { override fun get(key: I18nStringKey): String = when (key) { - I18nStringKey.cadrholder_name_cannot_be_empty -> "入力したカード所有者名は空欄にできません" + I18nStringKey.cardholder_name_cannot_be_empty -> "入力したカード所有者名は空欄にできません" I18nStringKey.the_entered_cardholder_name_is_not_valid -> "入力したカード所有者名は無効です" I18nStringKey.the_entered_card_number_is_not_valid -> "入力したカード番号は無効です" I18nStringKey.the_entered_expiry_date_is_not_valid -> "入力した有効期限は無効です" @@ -38,9 +38,9 @@ object JapaneseStrings : I18nStrings { I18nStringKey.daily_yamazaki -> "デイリーヤマザキ" I18nStringKey.family_mart -> "ファミリーマート" I18nStringKey.lawson -> "ローソン" - I18nStringKey.ministop -> "ミニストップ" - I18nStringKey.seicomart -> "セイコーマート" - I18nStringKey._7_eleven -> "セブンイレブン" + I18nStringKey.mini_stop -> "ミニストップ" + I18nStringKey.seico_mart -> "セイコーマート" + I18nStringKey.seven_eleven -> "セブンイレブン" I18nStringKey.full_name_on_receipt -> "レシートのフルネーム" I18nStringKey.name_shown_on_receipt -> "名前(カードに記載)領収書)" I18nStringKey.email -> "メール" @@ -60,11 +60,11 @@ object JapaneseStrings : I18nStrings { I18nStringKey.you_will_be_redirected_to_rakuten -> "支払いを完了するには、Rakuten にリダイレクトされますお支払い" I18nStringKey.you_will_be_redirected_to_line_pay -> "お支払いを完了するには、Line Pay にリダイレクトされます" I18nStringKey.continue_to_alipay -> "Alipay に進みます" - I18nStringKey.continue_to_aupay -> "AuPay に進みます" - I18nStringKey.continue_to_merpay -> "MerPay に進みます" + I18nStringKey.continue_to_au_pay -> "AuPay に進みます" + I18nStringKey.continue_to_mer_pay -> "MerPay に進みます" I18nStringKey.continue_to_paypay -> "PayPay に進みます" I18nStringKey.continue_to_rakuten -> "Rakuten に進みます" - I18nStringKey.continue_to_linepay -> "LinePay に進みます" + I18nStringKey.continue_to_line_pay -> "LinePay に進みます" I18nStringKey.continue_to_paidy -> "Paidy に進みます" I18nStringKey.webview_open_info -> "注: Web ウィンドウが開きます。購入後、元のウィンドウに戻ります。" I18nStringKey.full_name -> "氏名" @@ -75,28 +75,28 @@ object JapaneseStrings : I18nStrings { I18nStringKey.first_name -> "名" I18nStringKey.last_name_phonetic -> "姓(フリガナ)" I18nStringKey.first_name_phonetic -> "名(フリガナ)" - I18nStringKey.webmoney_information -> "WebMoney情報" + I18nStringKey.web_money_information -> "WebMoney情報" I18nStringKey.prepaid_number -> "プリペイド番号" I18nStringKey.payment_success -> "お支払い完了" I18nStringKey.thank_you_for_your_order -> "ご注文ありがとうございます" - I18nStringKey.bitcash_information -> "BitCash情報" + I18nStringKey.bit_cash_information -> "BitCash情報" I18nStringKey.hiragana_id -> "ひらがなID" I18nStringKey.bank_transfer -> "銀行振込" - I18nStringKey.bitcash -> "BitCash" + I18nStringKey.bit_cash -> "BitCash" I18nStringKey.credit_card -> "カード" I18nStringKey.konbini -> "コンビニ" - I18nStringKey.netcash -> "NetCash" - I18nStringKey.aupay -> "au Pay" + I18nStringKey.net_cash -> "NetCash" + I18nStringKey.au_pay -> "au Pay" I18nStringKey.alipay -> "AliPay" - I18nStringKey.merpay -> "メルペイ" + I18nStringKey.mer_pay -> "メルペイ" I18nStringKey.paypay -> "PayPay" I18nStringKey.rakuten_pay -> "楽天ペイ" I18nStringKey.line_pay -> "Line Pay" I18nStringKey.unknown -> "不明" I18nStringKey.other -> "その他" I18nStringKey.paidy -> "Paidy" - I18nStringKey.payeasy -> "PayEasy" - I18nStringKey.webmoney -> "WebMoney" + I18nStringKey.pay_easy -> "PayEasy" + I18nStringKey.web_money -> "WebMoney" I18nStringKey.total_payment -> "合計支払額" I18nStringKey.the_entered_name_cannot_be_empty -> "入力した名前は空欄にできません" I18nStringKey.the_entered_email_is_not_valid -> "入力したメールアドレスは無効です" diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/KomojuPaymentScreenModel.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/KomojuPaymentScreenModel.kt index 9c6cdc1..6529a51 100644 --- a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/KomojuPaymentScreenModel.kt +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/KomojuPaymentScreenModel.kt @@ -370,7 +370,7 @@ internal class KomojuPaymentScreenModel(private val config: KomojuMobileSDKConfi private fun CreditCardDisplayData.validate(): Boolean { val fullNameOnCardError = when { - fullNameOnCard.isBlank() -> I18nStringKey.cadrholder_name_cannot_be_empty + fullNameOnCard.isBlank() -> I18nStringKey.cardholder_name_cannot_be_empty fullNameOnCard.all { char -> char.isValidCardHolderNameChar() } -> null else -> I18nStringKey.the_entered_cardholder_name_is_not_valid } diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/BitCashForm.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/BitCashForm.kt index 8fde537..578be78 100644 --- a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/BitCashForm.kt +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/BitCashForm.kt @@ -33,7 +33,7 @@ internal fun BitCashForm( Column { TextField( value = bitCashDisplayData.bitCashId, - title = i18nStringResource(I18nStringKey.bitcash_information), + title = i18nStringResource(I18nStringKey.bit_cash_information), placeholder = i18nStringResource(I18nStringKey.hiragana_id), onValueChange = { onBitCashDisplayDataChange(bitCashDisplayData.copy(bitCashId = it)) diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/KonbiniBrandsRow.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/KonbiniBrandsRow.kt index 502ea40..48fb25f 100644 --- a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/KonbiniBrandsRow.kt +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/KonbiniBrandsRow.kt @@ -77,9 +77,9 @@ private val KonbiniBrand.displayText is KonbiniBrand.DailyYamazaki -> i18nStringResource(I18nStringKey.daily_yamazaki) is KonbiniBrand.FamilyMart -> i18nStringResource(I18nStringKey.family_mart) is KonbiniBrand.Lawson -> i18nStringResource(I18nStringKey.lawson) - is KonbiniBrand.MiniStop -> i18nStringResource(I18nStringKey.ministop) - is KonbiniBrand.SeicoMart -> i18nStringResource(I18nStringKey.seicomart) - is KonbiniBrand.SevenEleven -> i18nStringResource(I18nStringKey._7_eleven) + is KonbiniBrand.MiniStop -> i18nStringResource(I18nStringKey.mini_stop) + is KonbiniBrand.SeicoMart -> i18nStringResource(I18nStringKey.seico_mart) + is KonbiniBrand.SevenEleven -> i18nStringResource(I18nStringKey.seven_eleven) } private val KonbiniBrand.displayIcon diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/OffSitePayForm.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/OffSitePayForm.kt index 8c8a923..6ab12db 100644 --- a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/OffSitePayForm.kt +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/OffSitePayForm.kt @@ -61,11 +61,11 @@ internal fun OffSitePayForm(paymentMethod: PaymentMethod.OffSitePayment, onPayBu val paymentButtonKey = remember(paymentMethod) { when (paymentMethod.type) { OffSitePaymentType.ALI_PAY -> I18nStringKey.continue_to_alipay - OffSitePaymentType.AU_PAY -> I18nStringKey.continue_to_aupay - OffSitePaymentType.MER_PAY -> I18nStringKey.continue_to_merpay + OffSitePaymentType.AU_PAY -> I18nStringKey.continue_to_au_pay + OffSitePaymentType.MER_PAY -> I18nStringKey.continue_to_mer_pay OffSitePaymentType.PAY_PAY -> I18nStringKey.continue_to_paypay OffSitePaymentType.RAKUTEN_PAY -> I18nStringKey.continue_to_rakuten - OffSitePaymentType.LINE_PAY -> I18nStringKey.continue_to_linepay + OffSitePaymentType.LINE_PAY -> I18nStringKey.continue_to_line_pay else -> null } } diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/PaymentMethodsRow.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/PaymentMethodsRow.kt index 6d4f90b..7728ab6 100644 --- a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/PaymentMethodsRow.kt +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/PaymentMethodsRow.kt @@ -88,14 +88,14 @@ private val PaymentMethod.displayName @Composable get() = when (this) { is PaymentMethod.BankTransfer -> i18nStringResource(I18nStringKey.bank_transfer) - is PaymentMethod.BitCash -> i18nStringResource(I18nStringKey.bitcash) + is PaymentMethod.BitCash -> i18nStringResource(I18nStringKey.bit_cash) is PaymentMethod.CreditCard -> i18nStringResource(I18nStringKey.credit_card) is PaymentMethod.Konbini -> i18nStringResource(I18nStringKey.konbini) - is PaymentMethod.NetCash -> i18nStringResource(I18nStringKey.netcash) + is PaymentMethod.NetCash -> i18nStringResource(I18nStringKey.net_cash) is PaymentMethod.OffSitePayment -> when (type) { - OffSitePaymentType.AU_PAY -> i18nStringResource(I18nStringKey.aupay) + OffSitePaymentType.AU_PAY -> i18nStringResource(I18nStringKey.au_pay) OffSitePaymentType.ALI_PAY -> i18nStringResource(I18nStringKey.alipay) - OffSitePaymentType.MER_PAY -> i18nStringResource(I18nStringKey.merpay) + OffSitePaymentType.MER_PAY -> i18nStringResource(I18nStringKey.mer_pay) OffSitePaymentType.PAY_PAY -> i18nStringResource(I18nStringKey.paypay) OffSitePaymentType.RAKUTEN_PAY -> i18nStringResource(I18nStringKey.rakuten_pay) OffSitePaymentType.LINE_PAY -> i18nStringResource(I18nStringKey.line_pay) @@ -103,8 +103,8 @@ private val PaymentMethod.displayName } is PaymentMethod.Other -> i18nStringResource(I18nStringKey.other) is PaymentMethod.Paidy -> i18nStringResource(I18nStringKey.paidy) - is PaymentMethod.PayEasy -> i18nStringResource(I18nStringKey.payeasy) - is PaymentMethod.WebMoney -> i18nStringResource(I18nStringKey.webmoney) + is PaymentMethod.PayEasy -> i18nStringResource(I18nStringKey.pay_easy) + is PaymentMethod.WebMoney -> i18nStringResource(I18nStringKey.web_money) } private val PaymentMethod.displayIcon diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/WebMoneyForm.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/WebMoneyForm.kt index 8e44680..459e66b 100644 --- a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/WebMoneyForm.kt +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/WebMoneyForm.kt @@ -33,7 +33,7 @@ internal fun WebMoneyForm( Column { TextField( value = webMoneyDisplayData.prepaidNumber, - title = i18nStringResource(I18nStringKey.webmoney_information), + title = i18nStringResource(I18nStringKey.web_money_information), placeholder = i18nStringResource(I18nStringKey.prepaid_number), onValueChange = { onWebMoneyDisplayDataChange(webMoneyDisplayData.copy(prepaidNumber = it))