From 08ca3753c385055c27404b99a87d608aac0c9890 Mon Sep 17 00:00:00 2001 From: Preyea Regmi Date: Tue, 24 Sep 2019 15:45:03 +0900 Subject: [PATCH] Translation key added for domestic remit --- .../presenter/DomesticRemitPresenterImpl.java | 46 ++++++++++--------- .../send/view/DomesticRemitActivity.java | 2 +- .../res/layout/activity_domestic_remit.xml | 14 +++--- app/src/main/res/values/strings.xml | 13 +++++- 4 files changed, 44 insertions(+), 31 deletions(-) diff --git a/app/src/main/java/com/gmeremit/online/gmeremittance_native/domesticremit/send/presenter/DomesticRemitPresenterImpl.java b/app/src/main/java/com/gmeremit/online/gmeremittance_native/domesticremit/send/presenter/DomesticRemitPresenterImpl.java index 072a2beb..e441ba15 100644 --- a/app/src/main/java/com/gmeremit/online/gmeremittance_native/domesticremit/send/presenter/DomesticRemitPresenterImpl.java +++ b/app/src/main/java/com/gmeremit/online/gmeremittance_native/domesticremit/send/presenter/DomesticRemitPresenterImpl.java @@ -50,15 +50,15 @@ public class DomesticRemitPresenterImpl extends BasePresenter implements Domesti @Override public void getDomesticRemitRelatedInfo() { - compositeDisposable.add( - this.gateway.getDomesticRelatedData(gateway.getAuth(), gateway.getUserIDNumber()) - .doOnSubscribe(disposable -> view.showProgressBar(true, getStringfromStringId(R.string.processing_request_text))) - .subscribeOn(Schedulers.io()) - .observeOn(AndroidSchedulers.mainThread()) - .doFinally(() -> view.showProgressBar(false, "")) - .subscribeWith(new DomesticRelatedDataObserver()) - ); -// mockDomesticRemitRelatedData(); +// compositeDisposable.add( +// this.gateway.getDomesticRelatedData(gateway.getAuth(), gateway.getUserIDNumber()) +// .doOnSubscribe(disposable -> view.showProgressBar(true, getStringfromStringId(R.string.processing_request_text))) +// .subscribeOn(Schedulers.io()) +// .observeOn(AndroidSchedulers.mainThread()) +// .doFinally(() -> view.showProgressBar(false, "")) +// .subscribeWith(new DomesticRelatedDataObserver()) +// ); + mockDomesticRemitRelatedData(); } @@ -67,7 +67,7 @@ public class DomesticRemitPresenterImpl extends BasePresenter implements Domesti domesticRemitDataValidator.setServiceCharge(serviceCharge); - String messageServiceCharge = "Service charge: " + Utils.formatCurrencyWithoutTruncatingDecimal(serviceCharge) + " " + Constants.KRW_STRING; + String messageServiceCharge = getStringfromStringId(R.string.service_charge_text)+": " + Utils.formatCurrencyWithoutTruncatingDecimal(serviceCharge) + " " + Constants.KRW_STRING; view.updateServiceCharge(messageServiceCharge); } @@ -199,7 +199,7 @@ public class DomesticRemitPresenterImpl extends BasePresenter implements Domesti DomesticReicipientInfoDTO data = gateway.getMockedDomesticRecipientInfo(view.getContext()); - String message = "The provided account number is associated with name \"ooo\". Do you want to continue?"; + String message = getStringfromStringId(R.string.check_recipient_name_text); String formattedMessage = message.replace("ooo", data.getRecipientName()); view.promptToConfirmRecipientName(getStringfromStringId(R.string.important_text),formattedMessage, new GenericPromptDialog.GenericDialogPromptListener() { @@ -257,7 +257,7 @@ public class DomesticRemitPresenterImpl extends BasePresenter implements Domesti domesticRemitDataValidator.setCurrentBalance(balance); - view.showCurrentBalance("Available Balance: " + Utils.formatCurrencyWithoutTruncatingDecimal(balance) + " " + Constants.KRW_STRING); + view.showCurrentBalance(getStringfromStringId(R.string.available_balance_text)+": " + Utils.formatCurrencyWithoutTruncatingDecimal(balance) + " " + Constants.KRW_STRING); view.showCheckBalanceButton(false); domesticRemitDataValidator.validateCurrentBalanceWithSendingAmount(); @@ -341,7 +341,9 @@ public class DomesticRemitPresenterImpl extends BasePresenter implements Domesti this.sendAmount = commaRemovedAmount; if (sendAmountFormatted < 10000) { - view.setErrorOnWidgetAmount("Minimum sending amount should be at least 10,000 KRW"); + String errorMessage=getStringfromStringId(R.string.amount_minimum_error_text); + + view.setErrorOnWidgetAmount(errorMessage.replace("ooo","10,000")); isValidSendAmount = false; } else { view.setErrorOnWidgetAmount(null); @@ -356,7 +358,7 @@ public class DomesticRemitPresenterImpl extends BasePresenter implements Domesti public void validateRecipientBank(DomesticBankDTO selectedReceiverBank) { this.selectedRecipientBank=selectedReceiverBank; if (selectedReceiverBank == null) { - view.setErrorOnWidgetRecipientBank("Please select a bank"); + view.setErrorOnWidgetRecipientBank(getStringfromStringId(R.string.bank_empty_error)); view.showSelectedRecipientBankNameAndIcon(null, 0); isValidRecipientBank = false; } else { @@ -370,11 +372,11 @@ public class DomesticRemitPresenterImpl extends BasePresenter implements Domesti public void validateRecipientBankAccNo(String bankAcNo) { if (bankAcNo == null || bankAcNo.length() < 1) { - view.setErrorOnWidgetBankAccountNo("Bank account number cannot be empty"); + view.setErrorOnWidgetBankAccountNo(getStringfromStringId(R.string.account_number_empty_error)); isValidBankAcNo = false; this.bankAcNo = null; } else if (bankAcNo.length() < 9) { - view.setErrorOnWidgetBankAccountNo("Bank account number length must be greater than 9 digits"); + view.setErrorOnWidgetBankAccountNo(getStringfromStringId(R.string.min_length_account_error_text)); isValidBankAcNo = false; this.bankAcNo = null; } else { @@ -388,7 +390,7 @@ public class DomesticRemitPresenterImpl extends BasePresenter implements Domesti public void validateRecipientFullName(String recipientFullName) { if (recipientFullName == null || recipientFullName.length() < 1) { - view.setErrorOnWidgetFullName("Recipient name cannot be empty"); + view.setErrorOnWidgetFullName(getStringfromStringId(R.string.empty_field_error_text)); isValidFullName = false; this.recipientFullName = null; } else { @@ -428,7 +430,7 @@ public class DomesticRemitPresenterImpl extends BasePresenter implements Domesti //Business requirement, not checking lower bound as it will be handled by server // else if (formattedCurrentBalance <=formattedServiceCharge || netSendingAmount > formattedCurrentBalance) else if (netSendingAmount > formattedCurrentBalance) { - view.setErrorOnWidgetAmount("You don't have sufficient amount to do the transaction"); + view.setErrorOnWidgetAmount(getStringfromStringId(R.string.insufficient_amount_error_text)); isValidSendAmount = false; } else { //User sending Amount is valid @@ -480,12 +482,12 @@ public class DomesticRemitPresenterImpl extends BasePresenter implements Domesti domesticRemitDataValidator.setServiceCharge(serviceCharge); - String messageServiceCharge = "Service charge: " + Utils.formatCurrencyWithoutTruncatingDecimal(serviceCharge) + " " + Constants.KRW_STRING; + String messageServiceCharge = getStringfromStringId(R.string.service_charge_text)+": " + Utils.formatCurrencyWithoutTruncatingDecimal(serviceCharge) + " " + Constants.KRW_STRING; view.updateServiceCharge(messageServiceCharge); if(t.getData().getAccountList()==null||t.getData().getAccountList().size()<1) { - String message="Please register an auto-debit account inorder to use this service."; + String message=getStringfromStringId(R.string.doesnt_have_auto_debit_text); view.showPopUpMessage(message, CustomAlertDialog.AlertType.ALERT, alertType -> view.exitView()); } @@ -519,7 +521,7 @@ public class DomesticRemitPresenterImpl extends BasePresenter implements Domesti if (t.getErrorCode().equalsIgnoreCase(Constants.SUCCESS_CODE_V2)) { DomesticReicipientInfoDTO data = t.getData(); - String message = "The provided account number is associated with name \"ooo\". Do you want to continue?"; + String message = getStringfromStringId(R.string.check_recipient_name_text); String formattedMessage = message.replace("ooo", data.getRecipientName()); view.promptToConfirmRecipientName(getStringfromStringId(R.string.important_text),formattedMessage, new GenericPromptDialog.GenericDialogPromptListener() { @@ -572,7 +574,7 @@ public class DomesticRemitPresenterImpl extends BasePresenter implements Domesti domesticRemitDataValidator.setCurrentBalance(balance); - view.showCurrentBalance("Available Balance: " + Utils.formatCurrencyWithoutTruncatingDecimal(balance) + " " + Constants.KRW_STRING); + view.showCurrentBalance(getStringfromStringId(R.string.available_balance_text)+": " + Utils.formatCurrencyWithoutTruncatingDecimal(balance) + " " + Constants.KRW_STRING); view.showCheckBalanceButton(false); domesticRemitDataValidator.validateCurrentBalanceWithSendingAmount(); diff --git a/app/src/main/java/com/gmeremit/online/gmeremittance_native/domesticremit/send/view/DomesticRemitActivity.java b/app/src/main/java/com/gmeremit/online/gmeremittance_native/domesticremit/send/view/DomesticRemitActivity.java index 2a73d39c..91b95559 100644 --- a/app/src/main/java/com/gmeremit/online/gmeremittance_native/domesticremit/send/view/DomesticRemitActivity.java +++ b/app/src/main/java/com/gmeremit/online/gmeremittance_native/domesticremit/send/view/DomesticRemitActivity.java @@ -557,7 +557,7 @@ public class DomesticRemitActivity extends BaseActivity implements DomesticRemit presenter.onSenderAccountSelected(account); senderAccountListingDialog.dismiss(); }); - senderAccountListingDialog.setHintAndTitle(getString(R.string.search_account_text), getString(R.string.select_account_text), getString(R.string.no_account_found_text)); + senderAccountListingDialog.setHintAndTitle(getString(R.string.search_account_text), getString(R.string.select_auto_debit_account_text), getString(R.string.no_account_found_text)); senderAccountListingDialog.disableSearch(false); if (!senderAccountListingDialog.isAdded()) senderAccountListingDialog.show(getSupportFragmentManager(), "AccountSelector"); diff --git a/app/src/main/res/layout/activity_domestic_remit.xml b/app/src/main/res/layout/activity_domestic_remit.xml index 2758e0f5..71ebaa9c 100644 --- a/app/src/main/res/layout/activity_domestic_remit.xml +++ b/app/src/main/res/layout/activity_domestic_remit.xml @@ -45,7 +45,7 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" - android:hint="Select account" + android:hint="@string/select_auto_debit_account_text" android:visibility="visible" app:edFormCursorVisible="false" app:edFormFocusable="false" /> @@ -95,7 +95,7 @@ android:layout_marginStart="10dp" android:layout_marginEnd="10dp" android:background="@drawable/ic_rounded_country_listing_gray" - android:text="Check Balance" + android:text="@string/account_balance_button_text" android:textColor="@color/colorPrimaryDark" android:textSize="17sp" android:visibility="gone" @@ -118,7 +118,7 @@ android:layout_marginStart="10dp" android:layout_marginEnd="10dp" android:gravity="right|center_vertical" - android:text="Service Charge " + android:text="@string/service_fee_text" android:textColor="@color/colorPrimaryDark" android:textSize="17sp" android:visibility="invisible" @@ -143,7 +143,7 @@ android:layout_height="wrap_content" android:layout_marginEnd="10dp" android:visibility="visible" - android:hint="Enter Sending Amount (KRW)" /> + android:hint="@string/enter_send_amount_text" /> + android:hint="@string/select_korea_bank" /> + android:hint="@string/account_number_text" /> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index c550e5aa..3f3680cc 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -190,7 +190,7 @@ Transaction Details Paying Amount Exchange Rate - Service Chage + Service Charge Payout Agent/Bank I have read and agreed to Gme Remittance User Agreement @@ -633,6 +633,17 @@ Recent Recipients Domestic International + Select Your Auto-Debit Account + Enter Send Amount (KRW) + Select Korea Bank + Enter Account Number + Verify Bank + View Account Balance + The provided account number is associated with name \"ooo\". Do you want to continue? + Please register an auto-debit account inorder to use this service. + You don\'t have sufficient amount to do the transaction + Account number length cannot be less than 9 digits + Minimum sending amount should be at least ooo KRW