diff --git a/src/lib/i18n.ts b/src/lib/i18n.ts index 9b916e12c..51c7b80c0 100644 --- a/src/lib/i18n.ts +++ b/src/lib/i18n.ts @@ -14,6 +14,7 @@ const resources = { address_copied_to_keyboard: 'Address copied to Clipboard', message_copied_to_clipboard: 'Copied to Clipboard', ok: 'OK', + back: 'Go Back', basic_row_pending: '• Pending', basic_row_failed: '• Failed', type_placeholder: 'type...', @@ -175,6 +176,8 @@ const resources = { contact_form_button_convert_checksum: 'Convert to correct checksum', contact_form_button_add_proposed_contact: 'Add', contact_form_button_add_proposed_contact_ending: 'to your Contacts', + contact_form_alert_title: 'Contact already exists!', + contact_form_edit_existing_button: 'Edit existing contact', transaction_form_label_asset: 'asset', transaction_summary_screen_title: 'Transaction Summary', transaction_summary_send_title: 'Send', diff --git a/src/screens/contacts/ContactFormScreen.tsx b/src/screens/contacts/ContactFormScreen.tsx index 777e48667..eb1ab9570 100644 --- a/src/screens/contacts/ContactFormScreen.tsx +++ b/src/screens/contacts/ContactFormScreen.tsx @@ -102,8 +102,11 @@ export const ContactFormScreen = ({ formState: { errors }, } = methods + // form values const addressObj = watch('address') const nameValue = watch('name') + + // form errors const hasErrors = addressObj.address.length === 0 || nameValue.length === 0 || @@ -145,16 +148,16 @@ export const ContactFormScreen = ({ const contactExists = checkIfContactExists(displayAddress, contacts) if (contactExists) { - Alert.alert('Contact already exists!', undefined, [ + Alert.alert(t('contact_form_alert_title'), undefined, [ { - text: 'Go Back', + text: t('back'), onPress: () => { navigation.replace(contactsStackRouteNames.ContactsList) proposed && navigation.navigate(rootTabsRouteNames.Home) }, }, { - text: 'Edit existing contact', + text: t('contact_form_edit_existing_button'), onPress: () => { dispatch(editContact(contact)) navigation.replace(contactsStackRouteNames.ContactsList) @@ -181,6 +184,7 @@ export const ContactFormScreen = ({ proposed, contacts, checkIfContactExists, + t, ], )