Skip to content

Commit

Permalink
feat(ad-hoc): Barcode localizations (#247)
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalii-vanziak-cko authored Dec 9, 2024
1 parent 8e3924a commit a3d9ebf
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 12 deletions.
4 changes: 4 additions & 0 deletions sdk/src/main/res/values-ar/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
<string name="po_native_apm_submit_button_text">الدفع</string>
<string name="po_native_apm_cancel_button_text">إلغاء</string>
<string name="po_native_apm_confirm_payment_button_text">لقد دفعت</string>
<string name="po_native_apm_save_barcode_button_text_format">احفظ رمز %s</string>
<string name="po_native_apm_save_barcode_error_title">فشل حفظ الصورة</string>
<string name="po_native_apm_save_barcode_error_message">لم نتمكن من حفظ الصورة. يرجى التحقق من أذوناتك أو محاولة التقاط لقطة شاشة كبديل.</string>
<string name="po_native_apm_save_barcode_error_confirm">فهمت</string>
<string name="po_native_apm_email_placeholder">name@example.com</string>
<string name="po_native_apm_phone_placeholder">أدخل رقم الهاتف</string>
<string name="po_native_apm_success_message">نجاح! تمت الموافقة على الدفع</string>
Expand Down
4 changes: 4 additions & 0 deletions sdk/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
<string name="po_native_apm_submit_button_text">Payer</string>
<string name="po_native_apm_cancel_button_text">Annuler</string>
<string name="po_native_apm_confirm_payment_button_text">J\'ai payé</string>
<string name="po_native_apm_save_barcode_button_text_format">Enregistrer le code %s</string>
<string name="po_native_apm_save_barcode_error_title">Échec de l\'enregistrement de l\'image</string>
<string name="po_native_apm_save_barcode_error_message">Nous n\'avons pas pu enregistrer l\'image. Veuillez vérifier vos permissions ou alternativement prendre une capture d\'écran.</string>
<string name="po_native_apm_save_barcode_error_confirm">Compris</string>
<string name="po_native_apm_email_placeholder">nom@exemple.fr</string>
<string name="po_native_apm_phone_placeholder">Entrez votre numéro de téléphone</string>
<string name="po_native_apm_success_message">Succès !\nPaiement confirmé.</string>
Expand Down
4 changes: 4 additions & 0 deletions sdk/src/main/res/values-pl/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
<string name="po_native_apm_submit_button_text">Zapłać</string>
<string name="po_native_apm_cancel_button_text">Anuluj</string>
<string name="po_native_apm_confirm_payment_button_text">Płatność wykonana</string>
<string name="po_native_apm_save_barcode_button_text_format">Zapisz kod %s</string>
<string name="po_native_apm_save_barcode_error_title">Nie udało się zapisać obrazu</string>
<string name="po_native_apm_save_barcode_error_message">Sprawdź uprawnienia systemu lub zrób zrzut ekranu.</string>
<string name="po_native_apm_save_barcode_error_confirm">Rozumiem</string>
<string name="po_native_apm_email_placeholder">imię@przykład.pl</string>
<string name="po_native_apm_phone_placeholder">Twój numer telefonu</string>
<string name="po_native_apm_success_message">Sukces!\nPłatność przyjęta.</string>
Expand Down
4 changes: 4 additions & 0 deletions sdk/src/main/res/values-pt/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
<string name="po_native_apm_submit_button_text">Pagar</string>
<string name="po_native_apm_cancel_button_text">Cancelar</string>
<string name="po_native_apm_confirm_payment_button_text">Já paguei</string>
<string name="po_native_apm_save_barcode_button_text_format">Guardar código %s</string>
<string name="po_native_apm_save_barcode_error_title">Falha na gravação da imagem</string>
<string name="po_native_apm_save_barcode_error_message">Não conseguimos gravar a imagem. Por favor, verifique as suas permissões ou tire uma captura do ecrā como alternativa.</string>
<string name="po_native_apm_save_barcode_error_confirm">Compreendi</string>
<string name="po_native_apm_email_placeholder">nome@exemplo.pt</string>
<string name="po_native_apm_phone_placeholder">Insira o seu número de telemóvel</string>
<string name="po_native_apm_success_message">Successo!\nPagamento aprovado.</string>
Expand Down
8 changes: 4 additions & 4 deletions sdk/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
<string name="po_native_apm_submit_button_text">Pay</string>
<string name="po_native_apm_cancel_button_text">Cancel</string>
<string name="po_native_apm_confirm_payment_button_text">I\'ve paid</string>
<string name="po_native_apm_save_qr_code_button_text">Save QR Code to Photos</string>
<string name="po_native_apm_save_image_error_title">Image Save Failed</string>
<string name="po_native_apm_save_image_error_message">We couldn\'t save the image. Please check your permissions or try taking a screenshot as an alternative.</string>
<string name="po_native_apm_save_image_error_confirm">Got it</string>
<string name="po_native_apm_save_barcode_button_text_format">Save %s code</string>
<string name="po_native_apm_save_barcode_error_title">Image save failed</string>
<string name="po_native_apm_save_barcode_error_message">We couldn\'t save the image. Please check your permissions or try taking a screenshot as an alternative.</string>
<string name="po_native_apm_save_barcode_error_confirm">Got it</string>
<string name="po_native_apm_email_placeholder">name@example.com</string>
<string name="po_native_apm_phone_placeholder">Enter phone number</string>
<string name="po_native_apm_success_message">Success!\nPayment approved.</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,10 @@ internal class NativeAlternativePaymentViewModel private constructor(
POActionState(
id = it.actionId,
text = options.barcode.saveActionText
?: app.getString(R.string.po_native_apm_save_qr_code_button_text),
?: app.getString(
R.string.po_native_apm_save_barcode_button_text_format,
it.type.rawType.uppercase()
),
primary = false
)
},
Expand Down Expand Up @@ -384,10 +387,10 @@ internal class NativeAlternativePaymentViewModel private constructor(
options.barcode.saveErrorConfirmation?.let {
ConfirmationDialogState(
id = barcode.confirmErrorActionId,
title = it.title ?: app.getString(R.string.po_native_apm_save_image_error_title),
message = it.message ?: app.getString(R.string.po_native_apm_save_image_error_message),
title = it.title ?: app.getString(R.string.po_native_apm_save_barcode_error_title),
message = it.message ?: app.getString(R.string.po_native_apm_save_barcode_error_message),
confirmActionText = it.confirmActionText
?: app.getString(R.string.po_native_apm_save_image_error_confirm),
?: app.getString(R.string.po_native_apm_save_barcode_error_confirm),
dismissActionText = it.dismissActionText
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package com.processout.sdk.ui.napm
import android.os.Parcelable
import androidx.annotation.ColorRes
import androidx.annotation.DrawableRes
import com.processout.sdk.core.annotation.ProcessOutInternalApi
import com.processout.sdk.ui.core.style.*
import com.processout.sdk.ui.shared.configuration.POActionConfirmationConfiguration
import com.processout.sdk.ui.shared.configuration.POBarcodeConfiguration
Expand Down Expand Up @@ -47,7 +46,7 @@ data class PONativeAlternativePaymentConfiguration(
val secondaryAction: SecondaryAction? = null,
val cancellation: CancellationConfiguration = CancellationConfiguration(),
val paymentConfirmation: PaymentConfirmationConfiguration = PaymentConfirmationConfiguration(),
@ProcessOutInternalApi val barcode: POBarcodeConfiguration = POBarcodeConfiguration(),
val barcode: POBarcodeConfiguration = POBarcodeConfiguration(),
val inlineSingleSelectValuesLimit: Int = 5,
val skipSuccessScreen: Boolean = false,
val successMessage: String? = null
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.processout.sdk.ui.shared.configuration

import android.os.Parcelable
import com.processout.sdk.core.annotation.ProcessOutInternalApi
import kotlinx.parcelize.Parcelize

/**
Expand All @@ -10,7 +9,6 @@ import kotlinx.parcelize.Parcelize
* @param[saveActionText] Text on the button that saves barcode.
* @param[saveErrorConfirmation] Requests user confirmation (e.g. dialog) when saving barcode has failed. Use _null_ to disable.
*/
@ProcessOutInternalApi
@Parcelize
data class POBarcodeConfiguration(
val saveActionText: String? = null,
Expand Down

0 comments on commit a3d9ebf

Please # to comment.