diff --git a/.env b/.env index 0615df93..cffb653f 100644 --- a/.env +++ b/.env @@ -9,3 +9,6 @@ APPLICATION_THEME=orange #environment can be changed if it is toggled CREDENTIAL_REGISTRY_EDIT=true + +#supported languages( en, fil, ar, hi, kn, ta) +APPLICATION_LANGUAGE=en \ No newline at end of file diff --git a/i18n.ts b/i18n.ts index 240a8ea4..0fb7ee14 100644 --- a/i18n.ts +++ b/i18n.ts @@ -13,6 +13,8 @@ import Storage from './shared/storage'; import { iso6393To1 } from 'iso-639-3'; import { LocalizedField } from './types/vc'; +import { APPLICATION_LANGUAGE } from 'react-native-dotenv'; + const resources = { en, fil, ar, hi, kn, ta }; const languageCodeMap = {}; @@ -41,6 +43,10 @@ i18next i18next.changeLanguage(language); populateLanguageCodeMap(); } + if (!Object.keys(SUPPORTED_LANGUAGES).includes(i18next.language)) { + i18next.changeLanguage('en'); + populateLanguageCodeMap(); + } }); export default i18next; diff --git a/locales/en.json b/locales/en.json index 4ec3a9e3..a4d7b3e9 100644 --- a/locales/en.json +++ b/locales/en.json @@ -62,17 +62,17 @@ "HomeScreenKebabPopUp": { "title": "More Options", "unPinCard": "Unpin Card", - "pinCard" : "Pin Card", + "pinCard": "Pin Card", "offlineAuthenticationDisabled!": "Offline authentication disabled!", "offlineAuthDisabledMessage": "Click here to enable this credential to be used for offline authentication.", "viewActivityLog": "View activity log", "removeFromWallet": "Remove from wallet", "revokeId": "Revoke ID", "revokeMessage": "Revoke the virtual ID for this profile", - "ActivityLog":"View Activity Log" + "ActivityLog": "View Activity Log" }, "WalletBinding": { - "inProgress" : "In Progress", + "inProgress": "In Progress", "profileAuthenticated": "Profile is authenticated!" }, "BindingVcWarningOverlay": { @@ -94,11 +94,11 @@ } } }, - "RemoveVcWarningOverlay":{ + "RemoveVcWarningOverlay": { "alert": "Please Confirm", "RemoveWarning": "Do you want to remove this card", "confirm": "Yes, I confirm", - "no" : "No" + "no": "No" }, "AuthScreen": { "header": "Select App Unlock Method", @@ -147,7 +147,7 @@ "detailes": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since." }, "AddVcModal": { - "header":"Retrieve your card", + "header": "Retrieve your card", "requestingCredential": "Requesting credential...", "errors": { "input": { @@ -212,8 +212,7 @@ "resendCode": "Resend Code" }, "MyVcsTab": { - "generateVc": "Generate your Cards", - "addVcButton": "Download ID", + "generateVc": "Download ID", "bringYourDigitalID": "Bring Your Digital ID", "generateVcDescription": "To download your {{vcLabel}} tap Download {{vcLabel}} below", "downloadingYourId": "Downloading your card, this can take upto 5 minutes", @@ -235,7 +234,9 @@ "stepTwoText": "Once generated, Cards are safely stored on your mobile and can be renamed or shared at any time.", "stepThreeTitle": "Easy sharing", "stepThreeText": "Share and receive Cards switfly using your phone camera to scan QR codes.", - "stepThreeButton": "Get started and add Card", + "stepFourTitle": "Quick Access", + "stepFourText": "Lorem Ipsum is simply a standard text of the printing and typesetting industry", + "stepFourButton": "Get Started", "skip": "Skip", "next": "Next" }, diff --git a/machines/bleShare/scan/scanMachine.typegen.ts b/machines/bleShare/scan/scanMachine.typegen.ts index e194adce..5d050919 100644 --- a/machines/bleShare/scan/scanMachine.typegen.ts +++ b/machines/bleShare/scan/scanMachine.typegen.ts @@ -27,18 +27,23 @@ export interface Typegen0 { 'xstate.stop': { type: 'xstate.stop' }; }; 'invokeSrcNameMap': { - checkBluetoothPermission: 'done.invoke.scan.checkingBluetoothService.checking:invocation[0]'; + checkBluetoothPermission: 'done.invoke.scan.checkBluetoothPermission.checking:invocation[0]'; + checkBluetoothState: + | 'done.invoke.scan.checkBluetoothState.checking:invocation[0]' + | 'done.invoke.scan.recheckBluetoothState.checking:invocation[0]'; checkLocationPermission: 'done.invoke.scan.checkingLocationService.checkingPermission:invocation[0]'; checkLocationStatus: 'done.invoke.scan.checkingLocationService.checkingStatus:invocation[0]'; + checkNearByDevicesPermission: 'done.invoke.scan.checkNearbyDevicesPermission.checking:invocation[0]'; createVp: 'done.invoke.scan.reviewing.creatingVp:invocation[0]'; disconnect: 'done.invoke.scan.clearingConnection:invocation[0]'; monitorConnection: 'done.invoke.scan:invocation[0]'; - requestBluetooth: 'done.invoke.scan.checkingBluetoothService.requesting:invocation[0]'; + requestBluetooth: 'done.invoke.scan.checkBluetoothState.requesting:invocation[0]'; + requestNearByDevicesPermission: 'done.invoke.scan.checkNearbyDevicesPermission.requesting:invocation[0]'; sendVc: 'done.invoke.scan.reviewing.sendingVc:invocation[0]'; startConnection: 'done.invoke.scan.connecting:invocation[0]'; }; 'missingImplementations': { - actions: never; + actions: 'setBleError'; delays: never; guards: never; services: never; @@ -66,6 +71,7 @@ export interface Typegen0 { | 'xstate.after(DESTROY_TIMEOUT)#scan.clearingConnection'; logFailedVerification: 'FACE_INVALID'; logShared: 'VC_ACCEPTED'; + openAppPermission: 'GOTO_SETTINGS'; openBluetoothSettings: 'GOTO_SETTINGS'; openSettings: 'LOCATION_REQUEST'; registerLoggers: @@ -81,12 +87,14 @@ export interface Typegen0 { requestToEnableLocation: 'LOCATION_DISABLED' | 'LOCATION_REQUEST'; resetShouldVerifyPresence: 'CANCEL' | 'CONNECTED'; sendScanData: 'SCAN'; + setBleError: 'BLE_ERROR'; setChildRef: | 'DISCONNECT' | 'DISMISS' | 'xstate.after(DESTROY_TIMEOUT)#scan.clearingConnection'; setCreatedVp: 'done.invoke.scan.reviewing.creatingVp:invocation[0]'; setLinkCode: 'SCAN'; + setReadyForBluetoothStateCheck: 'BLUETOOTH_PERMISSION_ENABLED'; setReason: 'UPDATE_REASON'; setReceiverInfo: 'CONNECTED'; setSelectedVc: 'SELECT_VC'; @@ -107,18 +115,27 @@ export interface Typegen0 { | 'done.invoke.scan.reviewing.creatingVp:invocation[0]'; }; 'eventsCausingGuards': { + isIOS: 'BLUETOOTH_STATE_DISABLED' | 'START_PERMISSION_CHECK'; isOpenIdQr: 'SCAN'; isQrLogin: 'SCAN'; + uptoAndroid11: '' | 'START_PERMISSION_CHECK'; }; 'eventsCausingServices': { QrLogin: 'SCAN'; - checkBluetoothPermission: 'APP_ACTIVE' | 'SCREEN_FOCUS'; + checkBluetoothPermission: + | '' + | 'BLUETOOTH_STATE_DISABLED' + | 'NEARBY_ENABLED' + | 'START_PERMISSION_CHECK'; + checkBluetoothState: '' | 'APP_ACTIVE'; checkLocationPermission: 'APP_ACTIVE' | 'LOCATION_ENABLED'; checkLocationStatus: ''; + checkNearByDevicesPermission: 'APP_ACTIVE' | 'START_PERMISSION_CHECK'; createVp: never; disconnect: '' | 'DISMISS' | 'LOCATION_ENABLED'; monitorConnection: 'xstate.init'; - requestBluetooth: never; + requestBluetooth: 'BLUETOOTH_STATE_DISABLED'; + requestNearByDevicesPermission: 'NEARBY_DISABLED'; sendVc: | 'ACCEPT_REQUEST' | 'FACE_VALID' @@ -127,10 +144,18 @@ export interface Typegen0 { }; 'matchesStates': | 'bluetoothDenied' - | 'checkingBluetoothService' - | 'checkingBluetoothService.checking' - | 'checkingBluetoothService.enabled' - | 'checkingBluetoothService.requesting' + | 'bluetoothPermissionDenied' + | 'checkBluetoothPermission' + | 'checkBluetoothPermission.checking' + | 'checkBluetoothPermission.enabled' + | 'checkBluetoothState' + | 'checkBluetoothState.checking' + | 'checkBluetoothState.enabled' + | 'checkBluetoothState.requesting' + | 'checkNearbyDevicesPermission' + | 'checkNearbyDevicesPermission.checking' + | 'checkNearbyDevicesPermission.enabled' + | 'checkNearbyDevicesPermission.requesting' | 'checkingLocationService' | 'checkingLocationService.checkingPermission' | 'checkingLocationService.checkingStatus' @@ -146,6 +171,10 @@ export interface Typegen0 { | 'handlingBleError' | 'inactive' | 'invalid' + | 'nearByDevicesPermissionDenied' + | 'recheckBluetoothState' + | 'recheckBluetoothState.checking' + | 'recheckBluetoothState.enabled' | 'reviewing' | 'reviewing.accepted' | 'reviewing.cancelling' @@ -163,8 +192,11 @@ export interface Typegen0 { | 'showQrLogin.idle' | 'showQrLogin.navigatingToHome' | 'showQrLogin.storing' + | 'startPermissionCheck' | { - checkingBluetoothService?: 'checking' | 'enabled' | 'requesting'; + checkBluetoothPermission?: 'checking' | 'enabled'; + checkBluetoothState?: 'checking' | 'enabled' | 'requesting'; + checkNearbyDevicesPermission?: 'checking' | 'enabled' | 'requesting'; checkingLocationService?: | 'checkingPermission' | 'checkingStatus' @@ -172,6 +204,7 @@ export interface Typegen0 { | 'disabled' | 'requestingToEnable'; connecting?: 'inProgress' | 'timeout'; + recheckBluetoothState?: 'checking' | 'enabled'; reviewing?: | 'accepted' | 'cancelling' diff --git a/machines/vcItem.ts b/machines/vcItem.ts index 5ef3746f..4c841666 100644 --- a/machines/vcItem.ts +++ b/machines/vcItem.ts @@ -1163,6 +1163,7 @@ export const vcItemMachine = lastVerifiedOn: null, locked: context.locked, walletBindingResponse: null, + credentialRegistry: '', }) ); } diff --git a/screens/Home/MyVcsTab.tsx b/screens/Home/MyVcsTab.tsx index 68245e3b..c1000233 100644 --- a/screens/Home/MyVcsTab.tsx +++ b/screens/Home/MyVcsTab.tsx @@ -9,7 +9,6 @@ import { GetVcModal } from './MyVcs/GetVcModal'; import { useTranslation } from 'react-i18next'; import { VcItem } from '../../components/VcItem'; import { GET_INDIVIDUAL_ID } from '../../shared/constants'; -import { ErrorMessageOverlay } from '../../components/MessageOverlay'; import { Icon } from 'react-native-elements'; export const MyVcsTab: React.FC = (props) => { @@ -112,7 +111,7 @@ export const MyVcsTab: React.FC = (props) => { type="gradient" isVcThere disabled={controller.isRefreshingVcs} - title={t('addVcButton')} + title={t('generateVc')} onPress={controller.DOWNLOAD_ID} /> @@ -134,7 +133,7 @@ export const MyVcsTab: React.FC = (props) => {