diff --git a/src/__tests__/creditCardPlugin.test.ts b/src/__tests__/creditCardPlugin.test.ts index 5fb4d191804..c1845f42f7e 100644 --- a/src/__tests__/creditCardPlugin.test.ts +++ b/src/__tests__/creditCardPlugin.test.ts @@ -1,7 +1,7 @@ import { describe, expect, test } from '@jest/globals' import { sprintf } from 'sprintf-js' -import s from '../locales/strings' +import { lstrings } from '../locales/strings' import { createPriorityArray } from '../plugins/gui/creditCardPlugin' import { FiatProviderError } from '../plugins/gui/fiatProviderTypes' import { getBestError } from '../plugins/gui/pluginUtils' @@ -26,22 +26,22 @@ describe('creditCardPlugin', function () { test('overLimit', function () { const errors: FiatProviderError[] = [new FiatProviderError({ errorType: 'overLimit', errorAmount: 50 })] const result = getBestError(errors, 'USD') - expect(result).toBe(sprintf(s.strings.fiat_plugin_buy_amount_over_limit, '50 USD')) + expect(result).toBe(sprintf(lstrings.fiat_plugin_buy_amount_over_limit, '50 USD')) }) test('underLimit', function () { const errors: FiatProviderError[] = [new FiatProviderError({ errorType: 'underLimit', errorAmount: 50 })] const result = getBestError(errors, 'USD') - expect(result).toBe(sprintf(s.strings.fiat_plugin_buy_amount_under_limit, '50 USD')) + expect(result).toBe(sprintf(lstrings.fiat_plugin_buy_amount_under_limit, '50 USD')) }) test('regionRestricted', function () { const errors: FiatProviderError[] = [new FiatProviderError({ errorType: 'regionRestricted' })] const result = getBestError(errors, 'USD') - expect(result).toBe(s.strings.fiat_plugin_buy_region_restricted) + expect(result).toBe(lstrings.fiat_plugin_buy_region_restricted) }) test('assetUnsupported', function () { const errors: FiatProviderError[] = [new FiatProviderError({ errorType: 'assetUnsupported' })] const result = getBestError(errors, 'USD') - expect(result).toBe(s.strings.fiat_plugin_asset_unsupported) + expect(result).toBe(lstrings.fiat_plugin_asset_unsupported) }) test('underLimit 1 2 3', function () { const errors: FiatProviderError[] = [ @@ -50,7 +50,7 @@ describe('creditCardPlugin', function () { new FiatProviderError({ errorType: 'underLimit', errorAmount: 3 }) ] const result = getBestError(errors, 'USD') - expect(result).toBe(sprintf(s.strings.fiat_plugin_buy_amount_under_limit, '1 USD')) + expect(result).toBe(sprintf(lstrings.fiat_plugin_buy_amount_under_limit, '1 USD')) }) test('overLimit 1 2 3', function () { const errors: FiatProviderError[] = [ @@ -59,7 +59,7 @@ describe('creditCardPlugin', function () { new FiatProviderError({ errorType: 'overLimit', errorAmount: 3 }) ] const result = getBestError(errors, 'USD') - expect(result).toBe(sprintf(s.strings.fiat_plugin_buy_amount_over_limit, '3 USD')) + expect(result).toBe(sprintf(lstrings.fiat_plugin_buy_amount_over_limit, '3 USD')) }) test('overLimit underLimit regionRestricted assetUnsupported', function () { const errors: FiatProviderError[] = [ @@ -69,12 +69,12 @@ describe('creditCardPlugin', function () { new FiatProviderError({ errorType: 'assetUnsupported' }) ] const result = getBestError(errors, 'USD') - expect(result).toBe(sprintf(s.strings.fiat_plugin_buy_amount_under_limit, '2 USD')) + expect(result).toBe(sprintf(lstrings.fiat_plugin_buy_amount_under_limit, '2 USD')) }) test('regionRestricted assetUnsupported', function () { const errors: FiatProviderError[] = [new FiatProviderError({ errorType: 'regionRestricted' }), new FiatProviderError({ errorType: 'assetUnsupported' })] const result = getBestError(errors, 'USD') - expect(result).toBe(s.strings.fiat_plugin_buy_region_restricted) + expect(result).toBe(lstrings.fiat_plugin_buy_region_restricted) }) }) }) diff --git a/src/__tests__/reducers/sendConfirmationReducer.test.ts b/src/__tests__/reducers/sendConfirmationReducer.test.ts index 9a2fbe35c7b..40bfbfcd091 100644 --- a/src/__tests__/reducers/sendConfirmationReducer.test.ts +++ b/src/__tests__/reducers/sendConfirmationReducer.test.ts @@ -2,7 +2,7 @@ import { describe, expect, test } from '@jest/globals' import { EdgeTransaction } from 'edge-core-js' import { cloneDeep } from 'lodash' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { initialState, sendConfirmation } from '../../reducers/scenes/SendConfirmationReducer' describe('sendConfirmation reducer', () => { @@ -125,7 +125,7 @@ describe('sendConfirmation reducer', () => { signedTx: '', txid: '' } - const error = new Error(s.strings.incorrect_pin) + const error = new Error(lstrings.incorrect_pin) // use initialState after sendConfirmation reducer not longer mutates state const initialStateClone: any = cloneDeep(initialState) const actual = sendConfirmation(initialStateClone, { diff --git a/src/actions/AccountActions.tsx b/src/actions/AccountActions.tsx index afd00943a0c..d1cb8fbcc43 100644 --- a/src/actions/AccountActions.tsx +++ b/src/actions/AccountActions.tsx @@ -3,7 +3,7 @@ import * as React from 'react' import { TextInputModal } from '../components/modals/TextInputModal' import { Airship, showError } from '../components/services/AirshipInstance' -import s from '../locales/strings' +import { lstrings } from '../locales/strings' import { ThunkAction } from '../types/reduxTypes' import { NavigationBase } from '../types/routerTypes' @@ -30,7 +30,7 @@ interface ValidatePasswordOptions { export function validatePassword(opts: ValidatePasswordOptions = {}): ThunkAction> { return async (dispatch, getState) => { - const { message, submitLabel, title = s.strings.confirm_password_text, warningMessage } = opts + const { message, submitLabel, title = lstrings.confirm_password_text, warningMessage } = opts const state = getState() const { account } = state.core const password = await Airship.show(bridge => ( @@ -38,7 +38,7 @@ export function validatePassword(opts: ValidatePasswordOptions = {}): ThunkActio autoFocus={warningMessage == null} autoCorrect={false} bridge={bridge} - inputLabel={s.strings.enter_your_password} + inputLabel={lstrings.enter_your_password} message={message} returnKeyType="go" secureTextEntry @@ -47,7 +47,7 @@ export function validatePassword(opts: ValidatePasswordOptions = {}): ThunkActio warningMessage={warningMessage} onSubmit={async password => { const isOk = await account.checkPassword(password) - if (!isOk) return s.strings.password_reminder_invalid + if (!isOk) return lstrings.password_reminder_invalid dispatch({ type: 'PASSWORD_USED' }) return true }} diff --git a/src/actions/CreateWalletActions.tsx b/src/actions/CreateWalletActions.tsx index b0de3c7806d..7d5a6432e4c 100644 --- a/src/actions/CreateWalletActions.tsx +++ b/src/actions/CreateWalletActions.tsx @@ -9,7 +9,7 @@ import { AccountPaymentParams } from '../components/scenes/CreateWalletAccountSe import { Airship, showError } from '../components/services/AirshipInstance' import { WalletCreateItem } from '../components/themed/WalletList' import { getPluginId, SPECIAL_CURRENCY_INFO } from '../constants/WalletAndCurrencyConstants' -import s from '../locales/strings' +import { lstrings } from '../locales/strings' import { HandleAvailableStatus } from '../reducers/scenes/CreateWalletReducer' import { getExchangeDenomination } from '../selectors/DenominationSelectors' import { config } from '../theme/appConfig' @@ -199,21 +199,21 @@ export function createAccountTransaction( if (error) { console.log(error) setTimeout(() => { - Alert.alert(s.strings.create_wallet_account_error_sending_transaction) + Alert.alert(lstrings.create_wallet_account_error_sending_transaction) }, 750) } else if (edgeTransaction) { logEvent('Activate_Wallet_Done', { currencyCode: createdWalletCurrencyCode }) const edgeMetadata: EdgeMetadata = { - name: sprintf(s.strings.create_wallet_account_metadata_name, createdWalletCurrencyCode), - category: 'Expense:' + sprintf(s.strings.create_wallet_account_metadata_category, createdWalletCurrencyCode), - notes: sprintf(s.strings.create_wallet_account_metadata_notes, createdWalletCurrencyCode, createdWalletCurrencyCode, config.supportEmail) + name: sprintf(lstrings.create_wallet_account_metadata_name, createdWalletCurrencyCode), + category: 'Expense:' + sprintf(lstrings.create_wallet_account_metadata_category, createdWalletCurrencyCode), + notes: sprintf(lstrings.create_wallet_account_metadata_notes, createdWalletCurrencyCode, createdWalletCurrencyCode, config.supportEmail) } paymentWallet.saveTxMetadata(edgeTransaction.txid, currencyCode, edgeMetadata).then(() => { navigation.navigate('walletsTab', { screen: 'walletList' }) setTimeout(() => { - Alert.alert(s.strings.create_wallet_account_payment_sent_title, s.strings.create_wallet_account_payment_sent_message) + Alert.alert(lstrings.create_wallet_account_payment_sent_title, lstrings.create_wallet_account_payment_sent_message) }, 750) }) } @@ -245,9 +245,9 @@ export function createHandleUnavailableModal(navigation: NavigationBase, newWall await Airship.show<'ok' | undefined>(bridge => ( )) navigation.pop() @@ -306,7 +306,7 @@ export function enableTokensAcrossWallets(newTokenItems: TokenWalletCreateItem[] export const getUniqueWalletName = (account: EdgeAccount, pluginId: string): string => { const { currencyWallets, currencyConfig } = account const { displayName } = currencyConfig[pluginId].currencyInfo - const defaultName = SPECIAL_CURRENCY_INFO[pluginId]?.initWalletName ?? sprintf(s.strings.my_crypto_wallet_name, displayName) + const defaultName = SPECIAL_CURRENCY_INFO[pluginId]?.initWalletName ?? sprintf(lstrings.my_crypto_wallet_name, displayName) const existingWalletNames = Object.keys(currencyWallets) .filter(walletId => currencyWallets[walletId].currencyInfo.pluginId === pluginId) diff --git a/src/actions/CryptoExchangeActions.tsx b/src/actions/CryptoExchangeActions.tsx index 8982ab10083..cfd782613ed 100644 --- a/src/actions/CryptoExchangeActions.tsx +++ b/src/actions/CryptoExchangeActions.tsx @@ -18,7 +18,7 @@ import { trackConversion } from '../actions/TrackingActions' import { InsufficientFeesModal } from '../components/modals/InsufficientFeesModal' import { Airship, showError } from '../components/services/AirshipInstance' import { formatNumber } from '../locales/intl' -import s from '../locales/strings' +import { lstrings } from '../locales/strings' import { getDisplayDenomination, getExchangeDenomination } from '../selectors/DenominationSelectors' import { convertCurrency } from '../selectors/WalletSelectors' import { RootState, ThunkAction } from '../types/reduxTypes' @@ -222,7 +222,7 @@ function processSwapQuoteError(error: unknown): ThunkAction { return dispatch({ type: 'GENERIC_SHAPE_SHIFT_ERROR', - data: sprintf(s.strings.amount_above_limit, displayMax, currentCurrencyDenomination.name) + data: sprintf(lstrings.amount_above_limit, displayMax, currentCurrencyDenomination.name) }) } @@ -238,7 +238,7 @@ function processSwapQuoteError(error: unknown): ThunkAction { return dispatch({ type: 'GENERIC_SHAPE_SHIFT_ERROR', - data: sprintf(s.strings.amount_below_limit, displayMin, currentCurrencyDenomination.name) + data: sprintf(lstrings.amount_below_limit, displayMin, currentCurrencyDenomination.name) }) } @@ -246,7 +246,7 @@ function processSwapQuoteError(error: unknown): ThunkAction { if (currencyError != null) { return dispatch({ type: 'GENERIC_SHAPE_SHIFT_ERROR', - data: sprintf(s.strings.ss_unable, fromCurrencyCode, toCurrencyCode) + data: sprintf(lstrings.ss_unable, fromCurrencyCode, toCurrencyCode) }) } @@ -254,7 +254,7 @@ function processSwapQuoteError(error: unknown): ThunkAction { if (permissionError?.reason === 'geoRestriction') { return dispatch({ type: 'GENERIC_SHAPE_SHIFT_ERROR', - data: s.strings.ss_geolock + data: lstrings.ss_geolock }) } @@ -292,7 +292,7 @@ export function shiftCryptoCurrency(navigation: NavigationBase, swapInfo: GuiSwa const name = isTransfer ? toWalletName : swapInfo.displayName const swapType = isTransfer ? 'transfer' : 'exchange' const swapTarget = isTransfer ? toWalletName : toCurrencyCode - const category = `${swapType}:${fromCurrencyCode} ${s.strings.word_to_in_convert_from_to_string} ${swapTarget}` + const category = `${swapType}:${fromCurrencyCode} ${lstrings.word_to_in_convert_from_to_string} ${swapTarget}` const result: EdgeSwapResult = await quote.approve({ metadata: { name, category } }) @@ -337,7 +337,7 @@ export function shiftCryptoCurrency(navigation: NavigationBase, swapInfo: GuiSwa logEvent('Exchange_Shift_Failed', { error: String(error) }) // TODO: Do we need to parse/clean all cases? dispatch({ type: 'DONE_SHIFT_TRANSACTION' }) setTimeout(() => { - showError(`${s.strings.exchange_failed}. ${error.message}`) + showError(`${lstrings.exchange_failed}. ${error.message}`) }, 1) } } @@ -390,7 +390,7 @@ export function checkEnabledExchanges(): ThunkAction { } if (!isAnyExchangeEnabled) { - Alert.alert(s.strings.no_exchanges_available, s.strings.check_exchange_settings) + Alert.alert(lstrings.no_exchanges_available, lstrings.check_exchange_settings) } } } diff --git a/src/actions/DeepLinkingActions.ts b/src/actions/DeepLinkingActions.ts index dfe5842fc35..5fcb6ea411b 100644 --- a/src/actions/DeepLinkingActions.ts +++ b/src/actions/DeepLinkingActions.ts @@ -4,7 +4,7 @@ import { launchPriceChangeBuySellSwapModal } from '../components/modals/PriceCha import { pickWallet } from '../components/modals/WalletListModal' import { showError, showToast } from '../components/services/AirshipInstance' import { guiPlugins } from '../constants/plugins/GuiPlugins' -import s from '../locales/strings' +import { lstrings } from '../locales/strings' import { asFiatPaymentType } from '../plugins/gui/fiatPluginTypes' import { DeepLink } from '../types/DeepLinkTypes' import { Dispatch, RootState, ThunkAction } from '../types/reduxTypes' @@ -174,7 +174,7 @@ export async function handleLink(navigation: NavigationBase, dispatch: Dispatch, if (matchingWalletIdsAndUris.length === 0) { if (!allWalletsLoaded) return false - showError(s.strings.alert_deep_link_no_wallet_for_uri) + showError(lstrings.alert_deep_link_no_wallet_for_uri) return true } @@ -194,7 +194,7 @@ export async function handleLink(navigation: NavigationBase, dispatch: Dispatch, }) const walletListResult = await pickWallet({ account, allowedWalletIds, assets, navigation }) if (walletListResult == null) { - showError(s.strings.scan_camera_no_matching_wallet) + showError(lstrings.scan_camera_no_matching_wallet) return true } @@ -220,19 +220,17 @@ export async function handleLink(navigation: NavigationBase, dispatch: Dispatch, return true } } - - return false } async function launchAzteco(navigation: NavigationBase, edgeWallet: EdgeCurrencyWallet, uri: string): Promise { const address = await edgeWallet.getReceiveAddress() const response = await fetch(`${uri}${address.publicAddress}`) if (response.ok) { - showToast(s.strings.azteco_success) + showToast(lstrings.azteco_success) } else if (response.status === 400) { - showError(s.strings.azteco_invalid_code) + showError(lstrings.azteco_invalid_code) } else { - showError(s.strings.azteco_service_unavailable) + showError(lstrings.azteco_service_unavailable) } navigation.navigate('walletsTab', { screen: 'walletList' }) } diff --git a/src/actions/DeleteWalletModalActions.tsx b/src/actions/DeleteWalletModalActions.tsx index 8832f97a2e2..3101da33784 100644 --- a/src/actions/DeleteWalletModalActions.tsx +++ b/src/actions/DeleteWalletModalActions.tsx @@ -3,7 +3,7 @@ import * as React from 'react' import { ButtonsModal } from '../components/modals/ButtonsModal' import { Airship } from '../components/services/AirshipInstance' import { ModalMessage } from '../components/themed/ModalParts' -import s from '../locales/strings' +import { lstrings } from '../locales/strings' import { B } from '../styles/common/textStyles' import { ThunkAction } from '../types/reduxTypes' import { getWalletName } from '../util/CurrencyWalletHelpers' @@ -17,15 +17,15 @@ export function showDeleteWalletModal(walletId: string, additionalMsg?: string): const resolveValue = await Airship.show<'confirm' | 'cancel' | undefined>(bridge => ( <> - {s.strings.fragmet_wallets_delete_wallet_first_confirm_message_mobile} + {lstrings.fragmet_wallets_delete_wallet_first_confirm_message_mobile} {getWalletName(currencyWallets[walletId])}? {additionalMsg == null ? null : {additionalMsg}} diff --git a/src/actions/FioActions.tsx b/src/actions/FioActions.tsx index 8cf657117bd..67092ff3f76 100644 --- a/src/actions/FioActions.tsx +++ b/src/actions/FioActions.tsx @@ -4,7 +4,7 @@ import React from 'react' import { FioExpiredModal } from '../components/modals/FioExpiredModal' import { Airship } from '../components/services/AirshipInstance' import { FIO_WALLET_TYPE } from '../constants/WalletAndCurrencyConstants' -import s from '../locales/strings' +import { lstrings } from '../locales/strings' import { addToFioAddressCache, getExpiredSoonFioDomains, @@ -85,8 +85,8 @@ export function checkFioObtData(walletId: string, transactions: EdgeTransaction[ if (obtForTx == null) return if (edgeMetadata.notes == null) edgeMetadata.notes = '' - let fioNotes = `${s.strings.fragment_transaction_list_sent_prefix}${s.strings.word_to_in_convert_from_to_string} ${obtForTx.payee_fio_address}` - if (obtForTx.content.memo != null && obtForTx.content.memo !== '') fioNotes += `\n${s.strings.fio_sender_memo_label}: ${obtForTx.content.memo}` + let fioNotes = `${lstrings.fragment_transaction_list_sent_prefix}${lstrings.word_to_in_convert_from_to_string} ${obtForTx.payee_fio_address}` + if (obtForTx.content.memo != null && obtForTx.content.memo !== '') fioNotes += `\n${lstrings.fio_sender_memo_label}: ${obtForTx.content.memo}` edgeMetadata.notes = `${fioNotes}\n${edgeMetadata.notes || ''}` edgeMetadata.name = obtForTx.payer_fio_address diff --git a/src/actions/FioAddressActions.ts b/src/actions/FioAddressActions.ts index fb18a7264d7..490162de5ab 100644 --- a/src/actions/FioAddressActions.ts +++ b/src/actions/FioAddressActions.ts @@ -1,7 +1,7 @@ import { EdgeCurrencyWallet } from 'edge-core-js' import { FIO_WALLET_TYPE } from '../constants/WalletAndCurrencyConstants' -import s from '../locales/strings' +import { lstrings } from '../locales/strings' import { refreshConnectedWalletsForFioAddress, refreshFioNames } from '../modules/FioAddress/util' import { ThunkAction } from '../types/reduxTypes' import { createCurrencyWallet } from './CreateWalletActions' @@ -10,7 +10,7 @@ export function createFioWallet(): ThunkAction> { return async (dispatch, getState) => { const state = getState() const fiatCurrencyCode = state.ui.settings.defaultIsoFiat - return await dispatch(createCurrencyWallet(s.strings.fio_address_register_default_fio_wallet_name, FIO_WALLET_TYPE, fiatCurrencyCode)) + return await dispatch(createCurrencyWallet(lstrings.fio_address_register_default_fio_wallet_name, FIO_WALLET_TYPE, fiatCurrencyCode)) } } diff --git a/src/actions/LogActions.tsx b/src/actions/LogActions.tsx index b897f52aa22..1f381f7b019 100644 --- a/src/actions/LogActions.tsx +++ b/src/actions/LogActions.tsx @@ -11,7 +11,7 @@ import { LogsModal } from '../components/modals/LogsModal' import { Airship, showError, showToast } from '../components/services/AirshipInstance' import { asActionProgram, asActionProgramState } from '../controllers/action-queue/cleaners' import { ActionProgram, ActionProgramState } from '../controllers/action-queue/types' -import s from '../locales/strings' +import { lstrings } from '../locales/strings' import { ThunkAction } from '../types/reduxTypes' import { clearLogs, logWithType, readLogs } from '../util/logger' @@ -65,7 +65,7 @@ export function showSendLogsModal(): ThunkAction> { return async (dispatch, getState) => { const state = getState() const { isConnected } = state.network - if (!isConnected) return showError(s.strings.network_alert_title) + if (!isConnected) return showError(lstrings.network_alert_title) const logs = await dispatch(getLogOutput()) await Airship.show(bridge => ) } @@ -76,15 +76,15 @@ export function showClearLogsModal(): ThunkAction> { Airship.show(bridge => ( { await clearAllLogs() - showToast(s.strings.settings_modal_clear_logs_success) + showToast(lstrings.settings_modal_clear_logs_success) return true } }, diff --git a/src/actions/LoginActions.tsx b/src/actions/LoginActions.tsx index 521c42aed90..0766a83fe2f 100644 --- a/src/actions/LoginActions.tsx +++ b/src/actions/LoginActions.tsx @@ -9,7 +9,7 @@ import { FioCreateHandleModal } from '../components/modals/FioCreateHandleModal' import { Airship, showError } from '../components/services/AirshipInstance' import { WalletCreateItem } from '../components/themed/WalletList' import { ENV } from '../env' -import s from '../locales/strings' +import { lstrings } from '../locales/strings' import { getLocalSettings, getSyncedSettings, @@ -120,8 +120,8 @@ export function initializeAccount(navigation: NavigationBase, account: EdgeAccou await Airship.show(bridge => ( )) .finally(async () => { @@ -309,7 +309,7 @@ async function safeCreateWallet(account: EdgeAccount, walletType: string, wallet fiatCurrencyCode }), 20000, - new Error(s.strings.error_creating_wallets) + new Error(lstrings.error_creating_wallets) ) if (account.activeWalletIds.length <= 1) { dispatch({ diff --git a/src/actions/NotificationActions.ts b/src/actions/NotificationActions.ts index 254d2604ac5..89f0796cec3 100644 --- a/src/actions/NotificationActions.ts +++ b/src/actions/NotificationActions.ts @@ -9,7 +9,7 @@ import { asDevicePayload, DeviceUpdatePayload, NewPushEvent } from '../controlle import { asPriceChangeTrigger } from '../controllers/action-queue/types/pushCleaners' import { PriceChangeTrigger } from '../controllers/action-queue/types/pushTypes' import { ENV } from '../env' -import s from '../locales/strings' +import { lstrings } from '../locales/strings' import { getActiveWalletCurrencyInfos } from '../selectors/WalletSelectors' import { ThunkAction } from '../types/reduxTypes' import { base58 } from '../util/encoding' @@ -207,7 +207,7 @@ export const newPriceChangeEvent = ( const changeDownString = '#change#%' const pushMessage = { - title: s.strings.price_alert, + title: lstrings.price_alert, body: '#direction#', data: { type: 'price-change', @@ -221,17 +221,17 @@ export const newPriceChangeEvent = ( directions: [ // [hourUp, hourDown, dayUp, dayDown] - `${sprintf(s.strings.notification_hourly_price_change_up, String.fromCodePoint(0x1f4c8), displayName, currencyCode, changeUpString, fiatSymbolString)}`, + `${sprintf(lstrings.notification_hourly_price_change_up, String.fromCodePoint(0x1f4c8), displayName, currencyCode, changeUpString, fiatSymbolString)}`, `${sprintf( - s.strings.notification_hourly_price_change_down, + lstrings.notification_hourly_price_change_down, String.fromCodePoint(0x1f4c9), displayName, currencyCode, changeDownString, fiatSymbolString )}`, - `${sprintf(s.strings.notification_daily_price_change_up, String.fromCodePoint(0x1f4c8), displayName, currencyCode, changeUpString, fiatSymbolString)}`, - `${sprintf(s.strings.notification_daily_price_change_down, String.fromCodePoint(0x1f4c9), displayName, currencyCode, changeDownString, fiatSymbolString)}` + `${sprintf(lstrings.notification_daily_price_change_up, String.fromCodePoint(0x1f4c8), displayName, currencyCode, changeUpString, fiatSymbolString)}`, + `${sprintf(lstrings.notification_daily_price_change_down, String.fromCodePoint(0x1f4c9), displayName, currencyCode, changeDownString, fiatSymbolString)}` ], pluginId: currencyInfo.pluginId, dailyChange: dailyChangeEnabled ? 10 : undefined, diff --git a/src/actions/PaymentProtoActions.tsx b/src/actions/PaymentProtoActions.tsx index d7baa257a23..6c051c80e84 100644 --- a/src/actions/PaymentProtoActions.tsx +++ b/src/actions/PaymentProtoActions.tsx @@ -6,7 +6,7 @@ import { pickWallet } from '../components/modals/WalletListModal' import { SendScene2Params } from '../components/scenes/SendScene2' import { showError } from '../components/services/AirshipInstance' import { SPECIAL_CURRENCY_INFO } from '../constants/WalletAndCurrencyConstants' -import s from '../locales/strings' +import { lstrings } from '../locales/strings' import { PaymentProtoError } from '../types/PaymentProtoError' import { PaymentProtoInstructionOutput, @@ -198,7 +198,7 @@ export async function launchPaymentProto( } const metadata = params.metadata ?? {} - const paymentIdString = sprintf(s.strings.bitpay_metadata_name, paymentId) + const paymentIdString = sprintf(lstrings.bitpay_metadata_name, paymentId) metadata.notes = metadata.notes ? metadata.notes + '\n\n' + paymentIdString : paymentIdString // Make the spend to generate the tx hexes @@ -231,7 +231,7 @@ export async function launchPaymentProto( tokenId: getTokenId(account, selectedWallet.currencyInfo.pluginId, selectedCurrencyCode ?? selectedWallet.currencyInfo.currencyCode), lockTilesMap: { amount: true, address: true }, onDone: async (error: Error | null, edgeTransaction?: EdgeTransaction) => { - if (error) showError(`${s.strings.create_wallet_account_error_sending_transaction}: ${error.message}`) + if (error) showError(`${lstrings.create_wallet_account_error_sending_transaction}: ${error.message}`) }, alternateBroadcast: async (edgeTransaction: EdgeTransaction) => { const unsignedHex = edgeTransaction.otherParams?.unsignedTx diff --git a/src/actions/RecoveryReminderActions.tsx b/src/actions/RecoveryReminderActions.tsx index 6085de19417..21f8969ed7a 100644 --- a/src/actions/RecoveryReminderActions.tsx +++ b/src/actions/RecoveryReminderActions.tsx @@ -2,7 +2,7 @@ import * as React from 'react' import { ButtonsModal } from '../components/modals/ButtonsModal' import { Airship, showError } from '../components/services/AirshipInstance' -import s from '../locales/strings' +import { lstrings } from '../locales/strings' import { setPasswordRecoveryRemindersAsync } from '../modules/Core/Account/settings' import { ThunkAction } from '../types/reduxTypes' import { NavigationBase } from '../types/routerTypes' @@ -43,11 +43,11 @@ async function showReminderModal(navigation: NavigationBase) { const reply = await Airship.show<'ok' | 'cancel' | undefined>(bridge => ( )) diff --git a/src/actions/RequestReviewActions.tsx b/src/actions/RequestReviewActions.tsx index 6641669e88f..5b1a5e06fa9 100644 --- a/src/actions/RequestReviewActions.tsx +++ b/src/actions/RequestReviewActions.tsx @@ -5,7 +5,7 @@ import { sprintf } from 'sprintf-js' import { ButtonsModal } from '../components/modals/ButtonsModal' import { Airship } from '../components/services/AirshipInstance' -import s from '../locales/strings' +import { lstrings } from '../locales/strings' import { config } from '../theme/appConfig' import { RootState } from '../types/reduxTypes' @@ -16,20 +16,20 @@ const requestReview = async () => { if (Platform.OS === 'ios') { StoreReview.requestReview() } else if (Platform.OS === 'android') { - const title = sprintf(s.strings.request_review_question_title, config.appNameShort) + const title = sprintf(lstrings.request_review_question_title, config.appNameShort) const result = await Airship.show<'ok' | 'cancel' | undefined>(bridge => ( )) if (result === 'ok') { - Linking.openURL(s.strings.request_review_android_page_link) + Linking.openURL(lstrings.request_review_android_page_link) } } else { console.warn(`Unhandled Platform.OS: ${Platform.OS}. Unable to request review from user`) diff --git a/src/actions/ResyncWalletModalActions.tsx b/src/actions/ResyncWalletModalActions.tsx index 533689a1b41..606d7eff5c3 100644 --- a/src/actions/ResyncWalletModalActions.tsx +++ b/src/actions/ResyncWalletModalActions.tsx @@ -2,7 +2,7 @@ import * as React from 'react' import { ButtonsModal } from '../components/modals/ButtonsModal' import { Airship } from '../components/services/AirshipInstance' -import s from '../locales/strings' +import { lstrings } from '../locales/strings' import { ThunkAction } from '../types/reduxTypes' import { getWalletName } from '../util/CurrencyWalletHelpers' @@ -15,11 +15,11 @@ export function showResyncWalletModal(walletId: string): ThunkAction(bridge => ( )) diff --git a/src/actions/ScamWarningActions.tsx b/src/actions/ScamWarningActions.tsx index cd123b59574..8f41a78e5b9 100644 --- a/src/actions/ScamWarningActions.tsx +++ b/src/actions/ScamWarningActions.tsx @@ -5,7 +5,7 @@ import { ConfirmContinueModal } from '../components/modals/ConfirmContinueModal' import { Airship } from '../components/services/AirshipInstance' import { ModalMessage } from '../components/themed/ModalParts' import { SCAM_WARNING } from '../constants/constantSettings' -import s from '../locales/strings' +import { lstrings } from '../locales/strings' let isWarningChecked = false @@ -16,10 +16,10 @@ export const dismissScamWarning = async (disklet: Disklet) => { await disklet.getText(SCAM_WARNING) } catch (error: any) { Airship.show(bridge => { - const warningMessage = `\u2022 ${s.strings.warning_scam_message_financial_advice}\n\n\u2022 ${s.strings.warning_scam_message_irreversibility}\n\n\u2022 ${s.strings.warning_scam_message_unknown_recipients}` + const warningMessage = `\u2022 ${lstrings.warning_scam_message_financial_advice}\n\n\u2022 ${lstrings.warning_scam_message_irreversibility}\n\n\u2022 ${lstrings.warning_scam_message_unknown_recipients}` return ( - + {warningMessage} ) diff --git a/src/actions/ScanActions.tsx b/src/actions/ScanActions.tsx index 09dc5c6405a..6113d3dcde4 100644 --- a/src/actions/ScanActions.tsx +++ b/src/actions/ScanActions.tsx @@ -9,7 +9,7 @@ import { ConfirmContinueModal } from '../components/modals/ConfirmContinueModal' import { upgradeCurrencyCodes, WalletListModal, WalletListResult } from '../components/modals/WalletListModal' import { Airship, showError, showWarning } from '../components/services/AirshipInstance' import { getSpecialCurrencyInfo } from '../constants/WalletAndCurrencyConstants' -import s from '../locales/strings' +import { lstrings } from '../locales/strings' import { config } from '../theme/appConfig' import { RequestAddressLink } from '../types/DeepLinkTypes' import { Dispatch, ThunkAction } from '../types/reduxTypes' @@ -45,23 +45,23 @@ export const doRequestAddress = async (navigation: NavigationBase, account: Edge const { assets, post, redir, payer } = link try { // Check if all required fields are provided in the request - if (assets.length === 0) throw new Error(s.strings.reqaddr_error_no_currencies_found) - if ((post == null || post === '') && (redir == null || redir === '')) throw new Error(s.strings.reqaddr_error_post_redir) + if (assets.length === 0) throw new Error(lstrings.reqaddr_error_no_currencies_found) + if ((post == null || post === '') && (redir == null || redir === '')) throw new Error(lstrings.reqaddr_error_post_redir) } catch (e: any) { showError(e.message) } // Present the request to the user for confirmation - const payerStr = payer ?? s.strings.reqaddr_application_fragment + const payerStr = payer ?? lstrings.reqaddr_application_fragment const assetsStr = toListString(assets.map(asset => asset.tokenCode)) const confirmResult = await Airship.show<'yes' | 'no' | undefined>(bridge => ( )) @@ -80,7 +80,7 @@ export const doRequestAddress = async (navigation: NavigationBase, account: Edge // Show warnings or errors for unsupported native currencies if (unsupportedNativeCodes.length > 0) { - const unsupportedMessage = sprintf(s.strings.reqaddr_error_unsupported_chains, config.appName, toListString(unsupportedNativeCodes)) + const unsupportedMessage = sprintf(lstrings.reqaddr_error_unsupported_chains, config.appName, toListString(unsupportedNativeCodes)) if (unsupportedNativeCodes.length === assets.length) { showError(unsupportedMessage) // All requested assets unsupported return @@ -94,7 +94,7 @@ export const doRequestAddress = async (navigation: NavigationBase, account: Edge const tokenId = upgradeCurrencyCodes(lookup, [`${supportedAsset.nativeCode}-${supportedAsset.tokenCode}`]) await Airship.show(bridge => ( - + )).then(async ({ walletId, currencyCode }) => { if (walletId != null && currencyCode != null) { const { currencyWallets } = account @@ -109,7 +109,7 @@ export const doRequestAddress = async (navigation: NavigationBase, account: Edge // Handle POST and redir if (Object.keys(jsonPayloadMap).length === 0) { - showError(s.strings.reqaddr_error_no_wallets_selected) + showError(lstrings.reqaddr_error_no_wallets_selected) } else { if (post != null && post !== '') { // Setup and POST the JSON payload @@ -121,7 +121,7 @@ export const doRequestAddress = async (navigation: NavigationBase, account: Edge } try { const response = await fetch(post, initOpts) - if (!response.ok) showError(s.strings.fio_get_requests_error) + if (!response.ok) showError(lstrings.fio_get_requests_error) } catch (e: any) { showError(e.message) } @@ -129,7 +129,7 @@ export const doRequestAddress = async (navigation: NavigationBase, account: Edge if (redir != null && redir !== '') { // Make sure this isn't some malicious link to cause an infinite redir loop const deepLink = parseDeepLink(redir) - if (deepLink.type === 'requestAddress' && deepLink.redir != null) throw new Error(s.strings.reqaddr_error_invalid_redir) + if (deepLink.type === 'requestAddress' && deepLink.redir != null) throw new Error(lstrings.reqaddr_error_invalid_redir) const url = new URL(redir, true) url.set('query', { ...url.query, ...jsonPayloadMap }) @@ -148,8 +148,8 @@ export const addressWarnings = async (parsedUri: any, currencyCode: string) => { (await Airship.show(bridge => ( ))) @@ -159,7 +159,7 @@ export const addressWarnings = async (parsedUri: any, currencyCode: string) => { approve = approve && (await Airship.show(bridge => ( - + ))) } return approve @@ -226,9 +226,9 @@ export function handleWalletUris( await Airship.show<'ok' | undefined>(bridge => ( )) } @@ -236,23 +236,23 @@ export function handleWalletUris( } async function privateKeyModalActivated(wallet: EdgeCurrencyWallet, privateKeys: string[]): Promise { - const message = sprintf(s.strings.private_key_modal_sweep_from_private_key_message, config.appName) + const message = sprintf(lstrings.private_key_modal_sweep_from_private_key_message, config.appName) await Airship.show<'confirm' | 'cancel' | undefined>(bridge => ( @@ -312,30 +312,30 @@ export function checkAndShowGetCryptoModal(navigation: NavigationBase, selectedW let threeButtonModal const { displayBuyCrypto } = getSpecialCurrencyInfo(wallet.currencyInfo.pluginId) if (displayBuyCrypto) { - const messageSyntax = sprintf(s.strings.buy_crypto_modal_message, currencyCode, currencyCode, currencyCode) + const messageSyntax = sprintf(lstrings.buy_crypto_modal_message, currencyCode, currencyCode, currencyCode) threeButtonModal = await Airship.show<'buy' | 'exchange' | 'decline' | undefined>(bridge => ( )) } else { // if we're not targetting for buying, but rather exchange - const messageSyntax = sprintf(s.strings.exchange_crypto_modal_message, currencyCode, currencyCode, currencyCode) + const messageSyntax = sprintf(lstrings.exchange_crypto_modal_message, currencyCode, currencyCode, currencyCode) threeButtonModal = await Airship.show<'exchange' | 'decline' | undefined>(bridge => ( )) diff --git a/src/actions/SendConfirmationActions.tsx b/src/actions/SendConfirmationActions.tsx index 2386b7e64c6..74b2217b543 100644 --- a/src/actions/SendConfirmationActions.tsx +++ b/src/actions/SendConfirmationActions.tsx @@ -8,7 +8,7 @@ import { ButtonsModal } from '../components/modals/ButtonsModal' import { InsufficientFeesModal } from '../components/modals/InsufficientFeesModal' import { Airship, showError } from '../components/services/AirshipInstance' import { FEE_ALERT_THRESHOLD, FIO_STR } from '../constants/WalletAndCurrencyConstants' -import s from '../locales/strings' +import { lstrings } from '../locales/strings' import { addToFioAddressCache, FIO_FEE_EXCEEDS_SUPPLIED_MAXIMUM, recordSend } from '../modules/FioAddress/util' import { initialState, initialTransaction } from '../reducers/scenes/SendConfirmationReducer' import { getExchangeDenomination } from '../selectors/DenominationSelectors' @@ -21,9 +21,9 @@ import { convertNativeToExchange, DECIMAL_PRECISION, getDenomFromIsoCode } from import { playSendSound } from './SoundActions' const XRP_DESTINATION_TAG_ERRORS = { - UNIQUE_IDENTIFIER_EXCEEDS_LENGTH: s.strings.send_make_spend_xrp_dest_tag_length_error, - UNIQUE_IDENTIFIER_EXCEEDS_LIMIT: s.strings.send_make_spend_xrp_dest_tag_limit_error, - UNIQUE_IDENTIFIER_FORMAT: s.strings.send_make_spend_xrp_dest_tag_format_error + UNIQUE_IDENTIFIER_EXCEEDS_LENGTH: lstrings.send_make_spend_xrp_dest_tag_length_error, + UNIQUE_IDENTIFIER_EXCEEDS_LIMIT: lstrings.send_make_spend_xrp_dest_tag_limit_error, + UNIQUE_IDENTIFIER_FORMAT: lstrings.send_make_spend_xrp_dest_tag_format_error } export interface FioSenderInfo { @@ -214,7 +214,7 @@ export function signBroadcastAndSave( } } - if (!spendInfo) throw new Error(s.strings.invalid_spend_request) + if (!spendInfo) throw new Error(lstrings.invalid_spend_request) const authRequired = getAuthRequired(state, spendInfo, selectedWalletId) const pin = state.ui.sendConfirmation.pin @@ -246,7 +246,7 @@ export function signBroadcastAndSave( try { if (authRequired === 'pin') { const isAuthorized = await account.checkPin(pin) - if (!isAuthorized) throw new Error(s.strings.incorrect_pin) + if (!isAuthorized) throw new Error(lstrings.incorrect_pin) } edgeSignedTransaction = await wallet.signTx(edgeUnsignedTransaction) if (guiMakeSpendInfo.alternateBroadcast != null) { @@ -298,8 +298,8 @@ export function signBroadcastAndSave( edgeMetadata.amountFiat = amountFiat } if (payeeFioAddress != null && fioSender != null) { - let fioNotes = `${s.strings.fragment_transaction_list_sent_prefix}${s.strings.fragment_send_from_label.toLowerCase()} ${fioSender.fioAddress}` - fioNotes += fioSender.memo ? `\n${s.strings.fio_sender_memo_label}: ${fioSender.memo}` : '' + let fioNotes = `${lstrings.fragment_transaction_list_sent_prefix}${lstrings.fragment_send_from_label.toLowerCase()} ${fioSender.fioAddress}` + fioNotes += fioSender.memo ? `\n${lstrings.fio_sender_memo_label}: ${fioSender.memo}` : '' edgeMetadata.notes = `${fioNotes}\n${edgeMetadata.notes || ''}` } await wallet.saveTxMetadata(edgeSignedTransaction.txid, edgeSignedTransaction.currencyCode, edgeMetadata) @@ -330,7 +330,7 @@ export function signBroadcastAndSave( }) } catch (e: any) { const message = e?.message ?? '' - message.includes(FIO_FEE_EXCEEDS_SUPPLIED_MAXIMUM) ? showError(s.strings.fio_fee_exceeds_supplied_maximum_record_obt_data) : showError(e) + message.includes(FIO_FEE_EXCEEDS_SUPPLIED_MAXIMUM) ? showError(lstrings.fio_fee_exceeds_supplied_maximum_record_obt_data) : showError(e) } } else if ((guiMakeSpendInfo.publicAddress != null || publicAddress != null) && (!skipRecord || edgeSignedTransaction.currencyCode === FIO_STR)) { const payerPublicAddress = wallet.publicWalletInfo.keys.publicKey @@ -357,11 +357,11 @@ export function signBroadcastAndSave( playSendSound().catch(error => console.log(error)) // Fail quietly if (!guiMakeSpendInfo.dismissAlert) { - Alert.alert(s.strings.transaction_success, s.strings.transaction_success_message, [ + Alert.alert(lstrings.transaction_success, lstrings.transaction_success_message, [ { onPress() {}, style: 'default', - text: s.strings.string_ok + text: lstrings.string_ok } ]) } @@ -377,7 +377,7 @@ export function signBroadcastAndSave( } catch (e: any) { resetSlider() console.log(e) - let message = sprintf(s.strings.transaction_failure_message, e.message) + let message = sprintf(lstrings.transaction_failure_message, e.message) e.message = 'broadcastError' dispatch({ type: 'UI/SEND_CONFIRMATION/UPDATE_TRANSACTION', @@ -389,11 +389,11 @@ export function signBroadcastAndSave( } }) if (e.name === 'ErrorEosInsufficientCpu') { - message = s.strings.send_confirmation_eos_error_cpu + message = lstrings.send_confirmation_eos_error_cpu } else if (e.name === 'ErrorEosInsufficientNet') { - message = s.strings.send_confirmation_eos_error_net + message = lstrings.send_confirmation_eos_error_net } else if (e.name === 'ErrorEosInsufficientRam') { - message = s.strings.send_confirmation_eos_error_ram + message = lstrings.send_confirmation_eos_error_ram } else if ( edgeSignedTransaction && edgeSignedTransaction.otherParams && @@ -403,14 +403,14 @@ export function signBroadcastAndSave( e.json.code === 500 && e.json.error.code === 3050003 ) { - message = s.strings.transfer_fio_address_exception + message = lstrings.transfer_fio_address_exception } - Alert.alert(s.strings.transaction_failure, message, [ + Alert.alert(lstrings.transaction_failure, message, [ { onPress() {}, style: 'default', - text: s.strings.string_ok + text: lstrings.string_ok } ]) } @@ -419,16 +419,16 @@ export function signBroadcastAndSave( export const displayFeeAlert = async (currency: string, fee: string) => { let additionalMessage = '' - if (currency === 'ETH') additionalMessage = s.strings.send_confirmation_fee_modal_alert_message_fragment_eth - const message = `${sprintf(s.strings.send_confirmation_fee_modal_alert_message_fragment, fee)} ${additionalMessage}` + if (currency === 'ETH') additionalMessage = lstrings.send_confirmation_fee_modal_alert_message_fragment_eth + const message = `${sprintf(lstrings.send_confirmation_fee_modal_alert_message_fragment, fee)} ${additionalMessage}` const resolveValue = await Airship.show<'send' | undefined>(bridge => ( )) diff --git a/src/actions/SettingsActions.tsx b/src/actions/SettingsActions.tsx index 7fbdadd63f0..6ae35231493 100644 --- a/src/actions/SettingsActions.tsx +++ b/src/actions/SettingsActions.tsx @@ -4,7 +4,7 @@ import * as React from 'react' import { ButtonsModal } from '../components/modals/ButtonsModal' import { Airship, showError } from '../components/services/AirshipInstance' -import s from '../locales/strings' +import { lstrings } from '../locales/strings' import { setAutoLogoutTimeInSecondsRequest as setAutoLogoutTimeInSecondsRequestAccountSettings, setDefaultFiatRequest as setDefaultFiatRequestAccountSettings, @@ -206,11 +206,11 @@ export function showReEnableOtpModal(): ThunkAction> { const resolveValue = await Airship.show<'confirm' | 'cancel' | undefined>(bridge => ( )) @@ -244,11 +244,11 @@ export function showRestoreWalletsModal(navigation: NavigationBase): ThunkAction const response = await Airship.show<'confirm' | 'cancel' | undefined>(bridge => ( )) diff --git a/src/actions/SpendingLimitsActions.ts b/src/actions/SpendingLimitsActions.ts index 3d07a952a13..873b3f39803 100644 --- a/src/actions/SpendingLimitsActions.ts +++ b/src/actions/SpendingLimitsActions.ts @@ -1,6 +1,6 @@ import { Alert } from 'react-native' -import s from '../locales/strings' +import { lstrings } from '../locales/strings' import { setSpendingLimits as setSpendingLimitsSettingsApi } from '../modules/Core/Account/settings' import { ThunkAction } from '../types/reduxTypes' import { NavigationBase } from '../types/routerTypes' @@ -12,7 +12,7 @@ export function setSpendingLimits(navigation: NavigationBase, spendingLimits: Sp const { account } = state.core account.checkPassword(password).then(isAuthorized => { - if (!isAuthorized) return Alert.alert(s.strings.password_check_incorrect_password_title) + if (!isAuthorized) return Alert.alert(lstrings.password_check_incorrect_password_title) return setSpendingLimitsSettingsApi(account, spendingLimits).then(() => { dispatch({ diff --git a/src/actions/SplitWalletModalActions.tsx b/src/actions/SplitWalletModalActions.tsx index d2ea2ddbe34..8c190e35447 100644 --- a/src/actions/SplitWalletModalActions.tsx +++ b/src/actions/SplitWalletModalActions.tsx @@ -2,7 +2,7 @@ import * as React from 'react' import { ButtonsModal } from '../components/modals/ButtonsModal' import { Airship, showError } from '../components/services/AirshipInstance' -import s from '../locales/strings' +import { lstrings } from '../locales/strings' import { ThunkAction } from '../types/reduxTypes' import { getWalletName } from '../util/CurrencyWalletHelpers' @@ -13,19 +13,19 @@ export function showSplitWalletModal(walletId: string, pluginId: string): ThunkA const { currencyConfig, currencyWallets } = account const edgeWallet = currencyWallets[walletId] - let bodyText = s.strings.fragment_wallets_split_wallet_first_confirm_message_mobile + let bodyText = lstrings.fragment_wallets_split_wallet_first_confirm_message_mobile if (edgeWallet.currencyInfo.currencyCode === 'BCH') { - bodyText = s.strings.fragment_wallets_split_wallet_bch_to_bsv + bodyText = lstrings.fragment_wallets_split_wallet_bch_to_bsv } const resolveValue = await Airship.show<'confirm' | 'cancel' | undefined>(bridge => ( )) diff --git a/src/actions/TokenTermsActions.tsx b/src/actions/TokenTermsActions.tsx index 7c4dbe2f971..44761ff0e75 100644 --- a/src/actions/TokenTermsActions.tsx +++ b/src/actions/TokenTermsActions.tsx @@ -5,12 +5,12 @@ import { sprintf } from 'sprintf-js' import { ConfirmContinueModal } from '../components/modals/ConfirmContinueModal' import { Airship } from '../components/services/AirshipInstance' import { TOKEN_TERMS_AGREEMENT } from '../constants/constantSettings' -import s from '../locales/strings' +import { lstrings } from '../locales/strings' import { config } from '../theme/appConfig' export const approveTokenTerms = async (disklet: Disklet, currencyCode: string) => { - const title = sprintf(s.strings.token_agreement_modal_title, currencyCode) - const body = sprintf(s.strings.token_agreement_modal_message, currencyCode, config.appName) + const title = sprintf(lstrings.token_agreement_modal_title, currencyCode) + const body = sprintf(lstrings.token_agreement_modal_message, currencyCode, config.appName) const filePath = `${currencyCode}-${TOKEN_TERMS_AGREEMENT}` try { diff --git a/src/actions/WalletActions.tsx b/src/actions/WalletActions.tsx index c17dccd237b..8c5486be9ac 100644 --- a/src/actions/WalletActions.tsx +++ b/src/actions/WalletActions.tsx @@ -8,7 +8,7 @@ import { sprintf } from 'sprintf-js' import { ButtonsModal } from '../components/modals/ButtonsModal' import { Airship, showError, showToast } from '../components/services/AirshipInstance' import { FIO_WALLET_TYPE, getSpecialCurrencyInfo } from '../constants/WalletAndCurrencyConstants' -import s from '../locales/strings' +import { lstrings } from '../locales/strings' import { getSyncedSettings, setMostRecentWalletsSelected, setSyncedSettings } from '../modules/Core/Account/settings' import { getDisplayDenomination } from '../selectors/DenominationSelectors' import { convertCurrencyFromExchangeRates } from '../selectors/WalletSelectors' @@ -30,8 +30,8 @@ export interface SelectWalletTokenParams { const activateWalletName: MapObject<{ name: string; notes: string }> = { ripple: { - name: s.strings.activate_wallet_token_transaction_name_xrp, - notes: s.strings.activate_wallet_token_transaction_notes_xrp + name: lstrings.activate_wallet_token_transaction_name_xrp, + notes: lstrings.activate_wallet_token_transaction_notes_xrp } } @@ -142,9 +142,9 @@ function selectEOSWallet(navigation: NavigationBase, walletId: string, currencyC Airship.show<'ok' | undefined>(bridge => ( )) return false @@ -237,7 +237,7 @@ const activateWalletTokens = async ( const { currencyCode, displayName } = getToken(wallet, tokenId) ?? {} return `${displayName} (${currencyCode})` }) - const tileTitle = tokenIds.length > 1 ? s.strings.activate_wallet_tokens_scene_tile_title : s.strings.activate_wallet_token_scene_tile_title + const tileTitle = tokenIds.length > 1 ? lstrings.activate_wallet_tokens_scene_tile_title : lstrings.activate_wallet_token_scene_tile_title const tileBody = tokensText.join(', ') const { networkFee } = activationQuote @@ -253,48 +253,48 @@ const activateWalletTokens = async ( if (lt(fiatFee, '0.001')) fiatFee = '<0.001' fiatFee = round(fiatFee, -3) const feeString = `${displayFee} ${feeDenom.name} (${fiatFee} ${fiatCurrencyCode.replace('iso:', '')})` - let bodyText = s.strings.activate_wallet_token_scene_body + let bodyText = lstrings.activate_wallet_token_scene_body // HACK: XRP causes the reserve requirement to increase per token activated. There's // No good way to parametrize this and abstract away the asset if (wallet.currencyInfo.pluginId === 'ripple') { - bodyText += '\n\n' + s.strings.activate_wallet_token_scene_body_xrp_extra + bodyText += '\n\n' + lstrings.activate_wallet_token_scene_body_xrp_extra } navigation.navigate('confirmScene', { - titleText: s.strings.activate_wallet_token_scene_title, + titleText: lstrings.activate_wallet_token_scene_title, bodyText, infoTiles: [ { label: tileTitle, value: tileBody }, - { label: s.strings.mining_fee, value: feeString } + { label: lstrings.mining_fee, value: feeString } ], onConfirm: (resetSlider: () => void) => { if (lt(wallet.balances[paymentCurrencyCode] ?? '0', nativeFee)) { - const msg = tokenIds.length > 1 ? s.strings.activate_wallet_tokens_insufficient_funds_s : s.strings.activate_wallet_token_insufficient_funds_s + const msg = tokenIds.length > 1 ? lstrings.activate_wallet_tokens_insufficient_funds_s : lstrings.activate_wallet_token_insufficient_funds_s Airship.show<'ok' | undefined>(bridge => ( )) navigation.pop() return } - const name = activateWalletName[pluginId]?.name ?? s.strings.activate_wallet_token_transaction_name_category_generic - const notes = activateWalletName[pluginId]?.notes ?? s.strings.activate_wallet_token_transaction_notes_generic + const name = activateWalletName[pluginId]?.name ?? lstrings.activate_wallet_token_transaction_name_category_generic + const notes = activateWalletName[pluginId]?.notes ?? lstrings.activate_wallet_token_transaction_notes_generic activationQuote .approve({ metadata: { name, - category: `Expense:${s.strings.activate_wallet_token_transaction_name_category_generic}`, + category: `Expense:${lstrings.activate_wallet_token_transaction_name_category_generic}`, notes } }) .then(result => { - showToast(s.strings.activate_wallet_token_success, ACTIVATION_TOAST_AUTO_HIDE_MS) + showToast(lstrings.activate_wallet_token_success, ACTIVATION_TOAST_AUTO_HIDE_MS) navigation.pop() }) .catch(e => { @@ -405,18 +405,18 @@ export function checkCompromisedKeys(navigation: NavigationBase): ThunkAction => { - const message = sprintf(s.strings.migrate_wallets_modal_message, walletNames.join('\n')) + const message = sprintf(lstrings.migrate_wallets_modal_message, walletNames.join('\n')) return await Airship.show<'yes' | 'no' | undefined>(bridge => ( )) diff --git a/src/actions/WalletListActions.tsx b/src/actions/WalletListActions.tsx index dfe53b988c1..118cd1603c6 100644 --- a/src/actions/WalletListActions.tsx +++ b/src/actions/WalletListActions.tsx @@ -6,7 +6,7 @@ import { showFullScreenSpinner } from '../components/modals/AirshipFullScreenSpi import { ButtonsModal } from '../components/modals/ButtonsModal' import { SortOption } from '../components/modals/WalletListSortModal' import { Airship, showError } from '../components/services/AirshipInstance' -import s from '../locales/strings' +import { lstrings } from '../locales/strings' import { setAccountBalanceVisibility, setWalletsSort } from '../modules/Core/Account/settings' import { GetState, ThunkAction } from '../types/reduxTypes' import { NavigationBase } from '../types/routerTypes' @@ -83,16 +83,16 @@ const getFirstCurrencyAddress = async (currencyCode: string, getState: GetState) const { defaultIsoFiat } = state.ui.settings const createWalletTypes = getCreateWalletType(account, currencyCode) - if (!createWalletTypes) throw new Error(s.strings.wallet_list_referral_link_currency_invalid) + if (!createWalletTypes) throw new Error(lstrings.wallet_list_referral_link_currency_invalid) const askUserToCreateWallet = await createWalletCheckModal(currencyCode) - if (!askUserToCreateWallet) throw new Error(s.strings.wallet_list_referral_link_cancelled_wallet_creation) + if (!askUserToCreateWallet) throw new Error(lstrings.wallet_list_referral_link_cancelled_wallet_creation) const createWallet = account.createCurrencyWallet(createWalletTypes.walletType, { name: createWalletTypes.currencyName, fiatCurrencyCode: defaultIsoFiat }) - const wallet = await showFullScreenSpinner(s.strings.wallet_list_referral_link_currency_loading, createWallet) + const wallet = await showFullScreenSpinner(lstrings.wallet_list_referral_link_currency_loading, createWallet) logActivity(`Create Wallet (wallet list): ${account.username} -- ${createWalletTypes.walletType} -- ${defaultIsoFiat ?? ''}`) const receiveAddress = await wallet.getReceiveAddress() @@ -103,11 +103,11 @@ const createWalletCheckModal = async (currencyCode: string): Promise => const result = await Airship.show<'ok' | 'cancel' | undefined>(bridge => ( )) diff --git a/src/actions/WalletListMenuActions.tsx b/src/actions/WalletListMenuActions.tsx index e6dc5ab6975..0ec543f3d69 100644 --- a/src/actions/WalletListMenuActions.tsx +++ b/src/actions/WalletListMenuActions.tsx @@ -9,7 +9,7 @@ import { TextInputModal } from '../components/modals/TextInputModal' import { Airship, showError, showToast } from '../components/services/AirshipInstance' import { ModalMessage } from '../components/themed/ModalParts' import { deleteLoanAccount } from '../controllers/loan-manager/redux/actions' -import s from '../locales/strings' +import { lstrings } from '../locales/strings' import { ThunkAction } from '../types/reduxTypes' import { NavigationProp } from '../types/routerTypes' import { getCurrencyCode } from '../util/CurrencyInfoHelpers' @@ -65,9 +65,9 @@ export function walletListMenuAction( if (Object.values(currencyWallets).length === 1) { Airship.show(bridge => ( - - {s.strings.cannot_delete_last_wallet_modal_message_part_1} - {s.strings.cannot_delete_last_wallet_modal_message_part_2} + + {lstrings.cannot_delete_last_wallet_modal_message_part_1} + {lstrings.cannot_delete_last_wallet_modal_message_part_2} )) return @@ -92,9 +92,9 @@ export function walletListMenuAction( let additionalMsg: string | undefined if (tokenId == null) { if (fioAddress) { - additionalMsg = s.strings.fragmet_wallets_delete_fio_extra_message_mobile + additionalMsg = lstrings.fragmet_wallets_delete_fio_extra_message_mobile } else if (wallet.currencyInfo.metaTokens.length > 0) { - additionalMsg = s.strings.fragmet_wallets_delete_eth_extra_message + additionalMsg = lstrings.fragmet_wallets_delete_eth_extra_message } } @@ -148,11 +148,11 @@ export function walletListMenuAction( const { xpubExplorer } = currencyInfo const copy: ButtonInfo = { - label: s.strings.fragment_request_copy_title, + label: lstrings.fragment_request_copy_title, type: 'secondary' } const link: ButtonInfo = { - label: s.strings.transaction_details_show_advanced_block_explorer, + label: lstrings.transaction_details_show_advanced_block_explorer, type: 'secondary' } const buttons = xpubExplorer != null ? { copy, link } : { copy } @@ -163,13 +163,13 @@ export function walletListMenuAction( buttons={buttons as { copy: ButtonInfo; link: ButtonInfo }} closeArrow message={displayPublicSeed ?? ''} - title={s.strings.fragment_wallets_view_xpub} + title={lstrings.fragment_wallets_view_xpub} /> )).then(result => { switch (result) { case 'copy': Clipboard.setString(displayPublicSeed ?? '') - showToast(s.strings.fragment_wallets_pubkey_copied_title) + showToast(lstrings.fragment_wallets_pubkey_copied_title) break case 'link': if (xpubExplorer != null) { @@ -204,9 +204,9 @@ export function walletListMenuAction( const passwordValid = await dispatch( validatePassword({ - title: s.strings.fragment_wallets_get_seed_title, - submitLabel: s.strings.fragment_wallets_get_seed_wallet, - warningMessage: s.strings.fragment_wallets_get_seed_warning_message + title: lstrings.fragment_wallets_get_seed_title, + submitLabel: lstrings.fragment_wallets_get_seed_wallet, + warningMessage: lstrings.fragment_wallets_get_seed_warning_message }) ) @@ -216,21 +216,21 @@ export function walletListMenuAction( // Add a copy button only for development let devButtons = {} // @ts-expect-error - if (global.__DEV__) devButtons = { copy: { label: s.strings.fragment_wallets_copy_seed } } + if (global.__DEV__) devButtons = { copy: { label: lstrings.fragment_wallets_copy_seed } } await Airship.show<'copy' | 'ok' | undefined>(bridge => ( )).then(buttonPressed => { // @ts-expect-error if (global.__DEV__ && buttonPressed === 'copy') { // @ts-expect-error Clipboard.setString(wallet.displayPrivateSeed) - showToast(s.strings.fragment_wallets_copied_seed) + showToast(lstrings.fragment_wallets_copied_seed) } }) } @@ -241,9 +241,9 @@ export function walletListMenuAction( return async (dispatch, getState) => { const passwordValid = await dispatch( validatePassword({ - title: s.strings.fragment_wallets_get_raw_keys_title, - warningMessage: s.strings.fragment_wallets_get_raw_keys_warning_message, - submitLabel: s.strings.string_get_raw_keys + title: lstrings.fragment_wallets_get_raw_keys_title, + warningMessage: lstrings.fragment_wallets_get_raw_keys_warning_message, + submitLabel: lstrings.string_get_raw_keys }) ) if (passwordValid) { @@ -252,7 +252,7 @@ export function walletListMenuAction( const keys = account.allKeys.find(key => key.id === walletId) const seed = keys ? JSON.stringify(keys.keys, null, 2) : '' - Airship.show(bridge => ) + Airship.show(bridge => ) } } } @@ -269,9 +269,9 @@ export function walletListMenuAction( autoCorrect={false} bridge={bridge} initialValue={walletName} - inputLabel={s.strings.fragment_wallets_rename_wallet} + inputLabel={lstrings.fragment_wallets_rename_wallet} returnKeyType="go" - title={s.strings.fragment_wallets_rename_wallet} + title={lstrings.fragment_wallets_rename_wallet} onSubmit={async name => { await wallet.renameWallet(name) return true diff --git a/src/components/Main.tsx b/src/components/Main.tsx index 2fc2318a108..23aec014eb5 100644 --- a/src/components/Main.tsx +++ b/src/components/Main.tsx @@ -13,7 +13,7 @@ import { showReEnableOtpModal } from '../actions/SettingsActions' import { CryptoExchangeScene as CryptoExchangeSceneComponent } from '../components/scenes/CryptoExchangeScene' import { useMount } from '../hooks/useMount' import { useUnmount } from '../hooks/useUnmount' -import s from '../locales/strings' +import { lstrings } from '../locales/strings' import { FiatPluginEnterAmountScene as FiatPluginEnterAmountSceneComponent } from '../plugins/gui/scenes/EnterAmountScene' import { AppParamList } from '../types/routerTypes' import { logEvent } from '../util/tracking' @@ -245,7 +245,7 @@ const EdgeApp = () => { return true } else { backPressedOnce.current = true - Airship.show(bridge => ).then(() => { + Airship.show(bridge => ).then(() => { backPressedOnce.current = false }) // Timeout the back press after 3 seconds so the state isn't "sticky" @@ -311,7 +311,7 @@ const EdgeAppStack = () => { name="changePassword" component={ChangePasswordScene} options={{ - title: s.strings.title_change_password, + title: lstrings.title_change_password, headerRight: () => null }} /> @@ -319,7 +319,7 @@ const EdgeAppStack = () => { name="changePin" component={ChangePinScene} options={{ - title: s.strings.title_change_pin, + title: lstrings.title_change_pin, headerRight: () => null }} /> @@ -335,7 +335,7 @@ const EdgeAppStack = () => { name="createWalletAccountSelect" component={CreateWalletAccountSelectScene} options={{ - title: s.strings.create_wallet_account_activate, + title: lstrings.create_wallet_account_activate, headerRight: () => }} /> @@ -343,7 +343,7 @@ const EdgeAppStack = () => { name="createWalletAccountSetup" component={CreateWalletAccountSetupScene} options={{ - title: s.strings.create_wallet_create_account, + title: lstrings.create_wallet_create_account, headerRight: () => }} /> @@ -400,7 +400,7 @@ const EdgeAppStack = () => { // @ts-expect-error-error component={SwapSettingsScene} options={{ - title: s.strings.settings_exchange_settings, + title: lstrings.settings_exchange_settings, headerRight: () => null }} /> @@ -437,7 +437,7 @@ const EdgeAppStack = () => { name="fioAddressRegisterSelectWallet" component={FioAddressRegisterSelectWalletScene} options={{ - title: s.strings.title_fio_address_confirmation, + title: lstrings.title_fio_address_confirmation, headerRight: () => null }} /> @@ -453,21 +453,21 @@ const EdgeAppStack = () => { name="fioAddressSettings" component={FioAddressSettingsScene} options={{ - title: s.strings.title_fio_address_settings + title: lstrings.title_fio_address_settings }} /> { name="fioDomainRegisterSelectWallet" component={FioDomainRegisterSelectWalletScene} options={{ - title: s.strings.title_register_fio_domain, + title: lstrings.title_register_fio_domain, headerRight: () => null }} /> @@ -496,7 +496,7 @@ const EdgeAppStack = () => { name="fioDomainSettings" component={FioDomainSettingsScene} options={{ - title: s.strings.title_fio_domain_settings + title: lstrings.title_fio_domain_settings }} /> { name="fioRequestConfirmation" component={FioRequestConfirmationScene} options={{ - title: s.strings.fio_confirm_request_header + title: lstrings.fio_confirm_request_header }} /> @@ -596,7 +596,7 @@ const EdgeAppStack = () => { name="notificationSettings" component={NotificationScene} options={{ - title: s.strings.settings_notifications, + title: lstrings.settings_notifications, headerRight: () => null }} /> @@ -605,7 +605,7 @@ const EdgeAppStack = () => { name="otpSetup" component={OtpSettingsScene} options={{ - title: s.strings.title_otp, + title: lstrings.title_otp, headerRight: () => null }} /> @@ -613,7 +613,7 @@ const EdgeAppStack = () => { name="passwordRecovery" component={ChangeRecoveryScene} options={{ - title: s.strings.title_password_recovery, + title: lstrings.title_password_recovery, headerRight: () => null }} /> @@ -648,7 +648,7 @@ const EdgeAppStack = () => { name="promotionSettings" component={PromotionSettingsScene} options={{ - title: s.strings.title_promotion_settings, + title: lstrings.title_promotion_settings, headerRight: () => null }} /> @@ -666,7 +666,7 @@ const EdgeAppStack = () => { name="settingsOverview" component={SettingsScene} options={{ - title: s.strings.title_settings + title: lstrings.title_settings }} listeners={{ focus: () => dispatch(showReEnableOtpModal()) @@ -676,7 +676,7 @@ const EdgeAppStack = () => { name="spendingLimits" component={SpendingLimitsScene} options={{ - title: s.strings.spending_limits, + title: lstrings.spending_limits, headerRight: () => null }} /> @@ -687,7 +687,7 @@ const EdgeAppStack = () => { name="termsOfService" component={TermsOfServiceComponent} options={{ - title: s.strings.title_terms_of_service + title: lstrings.title_terms_of_service }} /> { name="transactionsExport" component={TransactionsExportScene} options={{ - title: s.strings.title_export_transactions, + title: lstrings.title_export_transactions, headerRight: () => null }} /> diff --git a/src/components/cards/EarnCryptoCard.tsx b/src/components/cards/EarnCryptoCard.tsx index 93de0eac0f9..6ed7940b297 100644 --- a/src/components/cards/EarnCryptoCard.tsx +++ b/src/components/cards/EarnCryptoCard.tsx @@ -7,7 +7,7 @@ import { sprintf } from 'sprintf-js' import { guiPlugins, IONIA_SUPPORTED_FIATS } from '../../constants/plugins/GuiPlugins' import { SPECIAL_CURRENCY_INFO } from '../../constants/WalletAndCurrencyConstants' import { useHandler } from '../../hooks/useHandler' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { getDefaultFiat } from '../../selectors/SettingsSelectors' import { config } from '../../theme/appConfig' import { useSelector } from '../../types/reactRedux' @@ -56,7 +56,7 @@ export const EarnCryptoCard = (props: Props) => { - {sprintf(s.strings.side_menu_rewards_tx_list_button_2s, defaultFiat, currencyCode)} + {sprintf(lstrings.side_menu_rewards_tx_list_button_2s, defaultFiat, currencyCode)} diff --git a/src/components/cards/LoanDetailsSummaryCard.tsx b/src/components/cards/LoanDetailsSummaryCard.tsx index 50408adb581..50615b928e1 100644 --- a/src/components/cards/LoanDetailsSummaryCard.tsx +++ b/src/components/cards/LoanDetailsSummaryCard.tsx @@ -1,7 +1,7 @@ import * as React from 'react' import { View } from 'react-native' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { cacheStyles, Theme, useTheme } from '../services/ThemeContext' import { EdgeText } from '../themed/EdgeText' import { Thermostat } from '../themed/Thermostat' @@ -51,7 +51,7 @@ export const LoanDetailsSummaryCard = (props: Props) => { {ltv != null ? ( - {s.strings.loan_loan_to_value_ratio} + {lstrings.loan_loan_to_value_ratio} ) : null} diff --git a/src/components/cards/LoanSummaryCard.tsx b/src/components/cards/LoanSummaryCard.tsx index 1a2f1274a8f..28d5ce5adeb 100644 --- a/src/components/cards/LoanSummaryCard.tsx +++ b/src/components/cards/LoanSummaryCard.tsx @@ -7,7 +7,7 @@ import { getSymbolFromCurrency } from '../../constants/WalletAndCurrencyConstant import { formatFiatString } from '../../hooks/useFiatText' import { useWatch } from '../../hooks/useWatch' import { toPercentString } from '../../locales/intl' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { BorrowEngine } from '../../plugins/borrow-plugins/types' import { useSelector } from '../../types/reactRedux' import { Theme } from '../../types/Theme' @@ -67,11 +67,11 @@ const LoanSummaryCardComponent = ({ borrowEngine, iconUri, onPress }: { borrowEn - {s.strings.loan_collateral_value} + {lstrings.loan_collateral_value} {displayCollateralTotal} - {s.strings.loan_interest_rate} + {lstrings.loan_interest_rate} {displayInterestTotal} @@ -84,7 +84,7 @@ const LoanSummaryCardComponent = ({ borrowEngine, iconUri, onPress }: { borrowEn showError(err.message) // Render a failed card - return + return } } diff --git a/src/components/cards/StakingReturnsCard.tsx b/src/components/cards/StakingReturnsCard.tsx index 00be2ec0e07..8a922a30160 100644 --- a/src/components/cards/StakingReturnsCard.tsx +++ b/src/components/cards/StakingReturnsCard.tsx @@ -4,7 +4,7 @@ import { View, ViewStyle } from 'react-native' import FastImage from 'react-native-fast-image' import { sprintf } from 'sprintf-js' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { StakeProviderInfo } from '../../plugins/stake-plugins/types' import { getStakeProviderIcon } from '../../util/CdnUris' import { PairIcons } from '../icons/PairIcons' @@ -35,7 +35,7 @@ export function StakingReturnsCard({ fromCurrencyLogos, toCurrencyLogos, apy, st const renderEstimatedReturn = () => { if (apy == null || apy <= 0) return null const estimatedReturnMsg = toFixed(apy.toString(), 1, 1) + '% APR' - return {sprintf(s.strings.stake_estimated_return, estimatedReturnMsg)} + return {sprintf(lstrings.stake_estimated_return, estimatedReturnMsg)} } const renderStakeProvider = () => { diff --git a/src/components/cards/UnderlinedNumInputCard.tsx b/src/components/cards/UnderlinedNumInputCard.tsx index b7546ec8ff7..683cf302a9a 100644 --- a/src/components/cards/UnderlinedNumInputCard.tsx +++ b/src/components/cards/UnderlinedNumInputCard.tsx @@ -3,7 +3,7 @@ import { TouchableOpacity, View } from 'react-native' import FastImage from 'react-native-fast-image' import { useLayout } from '../../hooks/useLayout' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { zeroString } from '../../util/utils' import { cacheStyles, Theme, useTheme } from '../services/ThemeContext' import { EdgeText } from '../themed/EdgeText' @@ -17,7 +17,7 @@ const UnderlinedNumInputCardComponent = (props: { onPress?: () => void | Promise title: string }) => { - const { currencyCode, emptyPlaceholder = s.strings.string_amount, formattedAmount, iconUri, onPress, title } = props + const { currencyCode, emptyPlaceholder = lstrings.string_amount, formattedAmount, iconUri, onPress, title } = props const theme = useTheme() const styles = getStyles(theme) diff --git a/src/components/common/ExchangeRate.tsx b/src/components/common/ExchangeRate.tsx index 7eff25ab576..6b67dcb7f4c 100644 --- a/src/components/common/ExchangeRate.tsx +++ b/src/components/common/ExchangeRate.tsx @@ -4,7 +4,7 @@ import * as React from 'react' import { TextStyle } from 'react-native' import { formatNumber } from '../../locales/intl' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { connect } from '../../types/reactRedux' import { GuiCurrencyInfo } from '../../types/types' import { DECIMAL_PRECISION } from '../../util/utils' @@ -53,7 +53,7 @@ class ExchangeRateComponent extends React.Component{s.strings.drawer_exchange_rate_loading} + return {lstrings.drawer_exchange_rate_loading} } const primaryText = `${formattedPrimaryAmount} ${primaryDisplayName} = ` diff --git a/src/components/data/row/CurrencyRow.tsx b/src/components/data/row/CurrencyRow.tsx index 18f8f5dbcaa..2bc3fa60a27 100644 --- a/src/components/data/row/CurrencyRow.tsx +++ b/src/components/data/row/CurrencyRow.tsx @@ -5,7 +5,7 @@ import { Text } from 'react-native' import { SPECIAL_CURRENCY_INFO } from '../../../constants/WalletAndCurrencyConstants' import { useWalletBalance } from '../../../hooks/useWalletBalance' import { useWalletName } from '../../../hooks/useWalletName' -import s from '../../../locales/strings' +import { lstrings } from '../../../locales/strings' import { useSelector } from '../../../types/reactRedux' import { CryptoIcon } from '../../icons/CryptoIcon' import { useTheme } from '../../services/ThemeContext' @@ -45,7 +45,7 @@ const CurrencyRowComponent = (props: Props) => { if (compromised) { name = ( <> - {s.strings.compromised_key_label} {name} + {lstrings.compromised_key_label} {name} ) } diff --git a/src/components/data/row/PaymentMethodRow.tsx b/src/components/data/row/PaymentMethodRow.tsx index 090f84f8066..de4917f958c 100644 --- a/src/components/data/row/PaymentMethodRow.tsx +++ b/src/components/data/row/PaymentMethodRow.tsx @@ -6,7 +6,7 @@ import buyPluginJsonRaw from '../../../constants/plugins/buyPluginList.json' import { guiPlugins } from '../../../constants/plugins/GuiPlugins' import sellPluginJsonRaw from '../../../constants/plugins/sellPluginList.json' import { PaymentMethod } from '../../../controllers/action-queue/WyreClient' -import s from '../../../locales/strings' +import { lstrings } from '../../../locales/strings' import { asGuiPluginJson } from '../../../types/GuiPluginTypes' import { getPartnerIconUri } from '../../../util/CdnUris' import { FiatIcon } from '../../icons/FiatIcon' @@ -80,7 +80,7 @@ const PaymentMethodRowComponent = (props: Props) => { icon={mainIcon} leftText={fiatCurrencyCode} leftSubtext={name} - rightSubText={s.strings.plugin_powered_by_space + ' '} + rightSubText={lstrings.plugin_powered_by_space + ' '} rightSubTextExtended={renderPluginDisplay()} marginRem={marginRem} /> diff --git a/src/components/modals/AccelerateTxModal.tsx b/src/components/modals/AccelerateTxModal.tsx index 16b265b18c8..11b99c14034 100644 --- a/src/components/modals/AccelerateTxModal.tsx +++ b/src/components/modals/AccelerateTxModal.tsx @@ -3,7 +3,7 @@ import React, { PureComponent } from 'react' import { Text, View } from 'react-native' import { AirshipBridge } from 'react-native-airship' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { getDisplayDenominationFromState, getExchangeDenominationFromState } from '../../selectors/DenominationSelectors' import { connect } from '../../types/reactRedux' import { GuiExchangeRates } from '../../types/types' @@ -109,11 +109,11 @@ export class AccelerateTxModalComponent extends PureComponent { return ( - {s.strings.transaction_details_accelerate_transaction_header} - {s.strings.transaction_details_accelerate_transaction_instructional} + {lstrings.transaction_details_accelerate_transaction_header} + {lstrings.transaction_details_accelerate_transaction_instructional} - - {newFee == null ? null : } + + {newFee == null ? null : } {error == null ? null : ( @@ -127,7 +127,7 @@ export class AccelerateTxModalComponent extends PureComponent { disabled={isSending || !!error} onSlidingComplete={this.handleConfirmation} showSpinner={isSending} - disabledText={s.strings.transaction_details_accelerate_transaction_slider_disabled} + disabledText={lstrings.transaction_details_accelerate_transaction_slider_disabled} /> diff --git a/src/components/modals/AddressModal.tsx b/src/components/modals/AddressModal.tsx index 82c49dcd2cf..e72745073da 100644 --- a/src/components/modals/AddressModal.tsx +++ b/src/components/modals/AddressModal.tsx @@ -10,7 +10,7 @@ import { refreshAllFioAddresses } from '../../actions/FioAddressActions' import ENS_LOGO from '../../assets/images/ens_logo.png' import FIO_LOGO from '../../assets/images/fio/fio_logo.png' import { ENS_DOMAINS, UNSTOPPABLE_DOMAINS } from '../../constants/WalletAndCurrencyConstants' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { checkPubAddress, FioAddresses, getFioAddressCache } from '../../modules/FioAddress/util' import { connect } from '../../types/reactRedux' import { ResolutionError } from '../../types/ResolutionError' @@ -64,7 +64,7 @@ export class AddressModalComponent extends React.Component { this.fioCheckQueue = 0 this.state = { uri: '', - statusLabel: s.strings.fragment_send_address, + statusLabel: lstrings.fragment_send_address, cryptoAddress: undefined, fieldError: undefined, fioAddresses: { addresses: {} }, @@ -180,7 +180,7 @@ export class AddressModalComponent extends React.Component { resolveAddress = async (domain: string, currencyTicker: string) => { if (!domain) return try { - this.setStatusLabel(s.strings.resolving) + this.setStatusLabel(lstrings.resolving) let addr: string if (this.checkIfUnstoppableDomain(domain)) addr = await this.fetchUnstoppableDomainAddress(domain, currencyTicker) else if (this.checkIfEnsDomain(domain)) addr = await this.fetchEnsAddress(domain) @@ -191,8 +191,8 @@ export class AddressModalComponent extends React.Component { this.setCryptoAddress(addr) } catch (err: any) { if (err instanceof ResolutionError) { - const message = sprintf(s.strings[err.code], domain, currencyTicker) - if (domain === '') this.setStatusLabel(s.strings.fragment_send_address) + const message = sprintf(lstrings[err.code], domain, currencyTicker) + if (domain === '') this.setStatusLabel(lstrings.fragment_send_address) else { this.setStatusLabel(message) this.setCryptoAddress(undefined) @@ -202,7 +202,7 @@ export class AddressModalComponent extends React.Component { } checkFioPubAddressQueue(uri: string) { - this.setStatusLabel(s.strings.resolving) + this.setStatusLabel(lstrings.resolving) this.fioCheckQueue++ setTimeout(async () => { // do not check if user continue typing fio address @@ -214,16 +214,16 @@ export class AddressModalComponent extends React.Component { const { currencyCode, coreWallet, fioPlugin } = this.props if (!fioPlugin) return await checkPubAddress(fioPlugin, uri.toLowerCase(), coreWallet.currencyInfo.currencyCode, currencyCode) - this.setStatusLabel(s.strings.fragment_send_address) + this.setStatusLabel(lstrings.fragment_send_address) } catch (e: any) { - this.setStatusLabel(s.strings.fragment_send_address) + this.setStatusLabel(lstrings.fragment_send_address) return this.setState({ fieldError: e.message }) } }, 1000) } checkFioAddressExistQueue = (fioAddress: string) => { - this.setStatusLabel(s.strings.resolving) + this.setStatusLabel(lstrings.resolving) this.fioCheckQueue++ setTimeout(async () => { // do not check if user continue typing fio address @@ -235,12 +235,12 @@ export class AddressModalComponent extends React.Component { const { fioPlugin } = this.props if (!fioPlugin) return const doesAccountExist = await fioPlugin.otherMethods.doesAccountExist(fioAddress) - this.setStatusLabel(s.strings.fragment_send_address) + this.setStatusLabel(lstrings.fragment_send_address) if (!doesAccountExist) { - return this.setState({ fieldError: s.strings.err_no_address_title }) + return this.setState({ fieldError: lstrings.err_no_address_title }) } } catch (e: any) { - this.setStatusLabel(s.strings.fragment_send_address) + this.setStatusLabel(lstrings.fragment_send_address) return this.setState({ fieldError: e.message }) } }, 1000) @@ -316,7 +316,7 @@ export class AddressModalComponent extends React.Component { return ( - {title || s.strings.address_modal_default_header} + {title || lstrings.address_modal_default_header} { )} - + diff --git a/src/components/modals/AdvancedDetailsModal.tsx b/src/components/modals/AdvancedDetailsModal.tsx index e362936f929..952aeab2836 100644 --- a/src/components/modals/AdvancedDetailsModal.tsx +++ b/src/components/modals/AdvancedDetailsModal.tsx @@ -3,7 +3,7 @@ import React, { PureComponent } from 'react' import { ScrollView, View } from 'react-native' import { AirshipBridge } from 'react-native-airship' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { openBrowserUri } from '../../util/WebUtils' import { cacheStyles, Theme, ThemeProps, withTheme } from '../services/ThemeContext' import { EdgeText } from '../themed/EdgeText' @@ -12,15 +12,15 @@ import { ThemedModal } from '../themed/ThemedModal' import { Tile } from '../tiles/Tile' const localizedFeeText = { - satPerVByte: s.strings.transaction_details_advance_details_satpervbyte, - gasPrice: s.strings.transaction_details_advance_details_gasprice, - gasLimit: s.strings.transaction_details_advance_details_gaslimit + satPerVByte: lstrings.transaction_details_advance_details_satpervbyte, + gasPrice: lstrings.transaction_details_advance_details_gasprice, + gasLimit: lstrings.transaction_details_advance_details_gaslimit } const feeString = { - high: s.strings.mining_fee_high_label_choice, - standard: s.strings.mining_fee_standard_label_choice, - low: s.strings.mining_fee_low_label_choice + high: lstrings.mining_fee_high_label_choice, + standard: lstrings.mining_fee_standard_label_choice, + low: lstrings.mining_fee_low_label_choice } interface OwnProps { @@ -52,10 +52,10 @@ export class AdvancedDetailsModalComponent extends PureComponent { const { networkFeeOption, requestedCustomFee } = this.props.transaction if (networkFeeOption === 'custom') { - return `${s.strings.mining_fee_custom_label_choice}\n${this.renderFees(requestedCustomFee)}` + return `${lstrings.mining_fee_custom_label_choice}\n${this.renderFees(requestedCustomFee)}` } - return networkFeeOption != null ? feeString[networkFeeOption] : s.strings.mining_fee_standard_label_choice + return networkFeeOption != null ? feeString[networkFeeOption] : lstrings.mining_fee_standard_label_choice } renderFees(fees: any = {}): string { @@ -83,38 +83,36 @@ export class AdvancedDetailsModalComponent extends PureComponent { return ( - {s.strings.transaction_details_advance_details_header} + {lstrings.transaction_details_advance_details_header} - + {url != null && url !== '' && ( )} - {receiveAddressesString != null && } - {networkFeeOption != null && ( - - )} - {feeRateUsed != null && } - {txSecret != null && } + {receiveAddressesString != null && } + {networkFeeOption != null && } + {feeRateUsed != null && } + {txSecret != null && } {txSecret != null && recipientAddress !== '' && txid !== '' && ( )} {signedTx != null && signedTx !== '' ? ( - + ) : null} - {deviceDescription != null && } + {deviceDescription != null && } diff --git a/src/components/modals/AutoLogoutModal.tsx b/src/components/modals/AutoLogoutModal.tsx index 221d16dfdab..f3f7bf9353d 100644 --- a/src/components/modals/AutoLogoutModal.tsx +++ b/src/components/modals/AutoLogoutModal.tsx @@ -4,7 +4,7 @@ import { Appearance, Platform, Text, View } from 'react-native' import { AirshipBridge } from 'react-native-airship' import IonIcon from 'react-native-vector-icons/Ionicons' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { dayText } from '../../styles/common/textStyles' import { THEME } from '../../theme/variables/airbitz' import { DisplayTime, displayToSeconds, secondsToDisplay } from '../../util/displayTime' @@ -50,7 +50,7 @@ export class AutoLogoutModalComponent extends React.Component { const pickerColor: any = Platform.OS === 'android' ? theme.pickerTextLight : null const textColor = Appearance.getColorScheme() === 'dark' && Platform.OS === 'android' ? theme.pickerTextDark : theme.pickerTextLight - const numberPickerOptions = [] + const numberPickerOptions = [] for (let i = 1; i < 60; i++) { const text = String(i) numberPickerOptions.push() @@ -64,10 +64,10 @@ export class AutoLogoutModalComponent extends React.Component { const measurementPicker = ( this.setState({ measurement })}> - - - - + + + + ) @@ -81,7 +81,7 @@ export class AutoLogoutModalComponent extends React.Component { // @ts-expect-error style={dayText('title')} > - {s.strings.dialog_title} + {lstrings.dialog_title} @@ -92,10 +92,10 @@ export class AutoLogoutModalComponent extends React.Component { - {s.strings.string_cancel_cap} + {lstrings.string_cancel_cap} - {s.strings.string_save} + {lstrings.string_save} diff --git a/src/components/modals/CategoryModal.tsx b/src/components/modals/CategoryModal.tsx index c7c4379697b..29fac4be928 100644 --- a/src/components/modals/CategoryModal.tsx +++ b/src/components/modals/CategoryModal.tsx @@ -6,7 +6,7 @@ import { AirshipBridge } from 'react-native-airship' import { getSubcategories, setNewSubcategory } from '../../actions/TransactionDetailsActions' import { useAsyncEffect } from '../../hooks/useAsyncEffect' import { useHandler } from '../../hooks/useHandler' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { THEME } from '../../theme/variables/airbitz' import { useDispatch, useSelector } from '../../types/reactRedux' import { Category, displayCategories, formatCategory, joinCategory, splitCategory } from '../../util/categories' @@ -121,9 +121,9 @@ export function CategoryModal(props: Props) { - {s.strings.transaction_details_category_title} + {lstrings.transaction_details_category_title} - {s.strings.tx_detail_picker_title} + {lstrings.tx_detail_picker_title} {categoryOrder.map(item => ( setCategory(item)} key={item}> @@ -145,7 +145,7 @@ export function CategoryModal(props: Props) { autoFocus returnKeyType="done" autoCapitalize="none" - label={s.strings.transaction_details_choose_a_sub_category} + label={lstrings.transaction_details_choose_a_sub_category} fontSize={THEME.rem(0.9)} labelFontSize={THEME.rem(0.65)} onChangeText={setSubcategory} diff --git a/src/components/modals/ConfirmContinueModal.tsx b/src/components/modals/ConfirmContinueModal.tsx index c92732ffb05..2e4b8e7abee 100644 --- a/src/components/modals/ConfirmContinueModal.tsx +++ b/src/components/modals/ConfirmContinueModal.tsx @@ -4,7 +4,7 @@ import { AirshipBridge } from 'react-native-airship' import Feather from 'react-native-vector-icons/Feather' import Ionicons from 'react-native-vector-icons/Ionicons' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { cacheStyles, Theme, useTheme } from '../services/ThemeContext' import { EdgeText } from '../themed/EdgeText' import { Fade } from '../themed/Fade' @@ -60,17 +60,17 @@ export function ConfirmContinueModal(props: Props) { {children} {body != null ? {body} : null} - {s.strings.confirm_continue_modal_body} + {lstrings.confirm_continue_modal_body} - {s.strings.confirm_continue_modal_button_text} + {lstrings.confirm_continue_modal_button_text} {isAgreed && } - + {isSkippable && } diff --git a/src/components/modals/ContactListModal.tsx b/src/components/modals/ContactListModal.tsx index 5d735d6b2dd..d7255668330 100644 --- a/src/components/modals/ContactListModal.tsx +++ b/src/components/modals/ContactListModal.tsx @@ -4,7 +4,7 @@ import { AirshipBridge } from 'react-native-airship' import IonIcon from 'react-native-vector-icons/Ionicons' import { sprintf } from 'sprintf-js' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { useSelector } from '../../types/reactRedux' import { GuiContact } from '../../types/types' import { normalizeForSearch } from '../../util/utils' @@ -58,7 +58,7 @@ export function ContactListModal({ bridge, contactType, contactName }: Props) { return ( @@ -38,7 +38,7 @@ export function ContactsPermissionModal(props: Props) { - {s.strings.contacts_permission_modal_title} + {lstrings.contacts_permission_modal_title} {message1} diff --git a/src/components/modals/CountryListModal.tsx b/src/components/modals/CountryListModal.tsx index a0caaf69552..abf56aae37b 100644 --- a/src/components/modals/CountryListModal.tsx +++ b/src/components/modals/CountryListModal.tsx @@ -7,7 +7,7 @@ import { getCountry } from 'react-native-localize' import { FLAG_LOGO_URL } from '../../constants/CdnConstants' import { COUNTRY_CODES } from '../../constants/CountryConstants' import { useHandler } from '../../hooks/useHandler' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { CountryData } from '../../types/types' import { cacheStyles, Theme, useTheme } from '../services/ThemeContext' import { SelectableRow } from '../themed/SelectableRow' @@ -75,8 +75,8 @@ export const CountryListModal = ({ countryCode = getCountry() ?? 'US', bridge }: return ( { backgroundColor={darkMode ? theme.dateModalBackgroundDark : theme.dateModalBackgroundLight} > - {s.strings.string_done_cap} + {lstrings.string_done_cap} diff --git a/src/components/modals/FiatListModal.tsx b/src/components/modals/FiatListModal.tsx index 2dc9a45ce16..3f8a8f5f646 100644 --- a/src/components/modals/FiatListModal.tsx +++ b/src/components/modals/FiatListModal.tsx @@ -5,7 +5,7 @@ import FastImage from 'react-native-fast-image' import { FIAT_COUNTRY } from '../../constants/CountryConstants' import { useHandler } from '../../hooks/useHandler' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { getDefaultFiat } from '../../selectors/SettingsSelectors' import { useSelector } from '../../types/reactRedux' import { GuiFiatType } from '../../types/types' @@ -45,7 +45,7 @@ export const FiatListModal = (props: Props) => { const fiatCountry = FIAT_COUNTRY[item.value] const key = `currency_label_${item.value}` - const subTitle = s.strings[key as keyof typeof s.strings] ?? s.strings.currency_label_ + const subTitle = lstrings[key as keyof typeof lstrings] ?? lstrings.currency_label_ return ( { return ( { - {parseMarkedText(s.strings.fio_free_handle_title_m)} + {parseMarkedText(lstrings.fio_free_handle_title_m)} - {s.strings.fio_free_handle_congrats} + {lstrings.fio_free_handle_congrats} - {s.strings.fio_free_handle_message} + {lstrings.fio_free_handle_message} - - + + ) } diff --git a/src/components/modals/FioExpiredModal.tsx b/src/components/modals/FioExpiredModal.tsx index fc4c6ff86d2..a7141d0052a 100644 --- a/src/components/modals/FioExpiredModal.tsx +++ b/src/components/modals/FioExpiredModal.tsx @@ -1,21 +1,21 @@ import * as React from 'react' import { AirshipBridge } from 'react-native-airship' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { MainButton } from '../themed/MainButton' import { ModalFooter, ModalMessage, ModalTitle } from '../themed/ModalParts' import { ThemedModal } from '../themed/ThemedModal' export function FioExpiredModal(props: { bridge: AirshipBridge; fioName: string }) { const { bridge, fioName } = props - const title = `${s.strings.fio_address_confirm_screen_fio_label} ${s.strings.string_expiration}` + const title = `${lstrings.fio_address_confirm_screen_fio_label} ${lstrings.string_expiration}` return ( bridge.resolve(false)}> {title} - {s.strings.fio_domain_details_expired_soon} + {lstrings.fio_domain_details_expired_soon} {fioName} - bridge.resolve(true)} /> + bridge.resolve(true)} /> bridge.resolve(false)} /> ) diff --git a/src/components/modals/FlipInputModal.tsx b/src/components/modals/FlipInputModal.tsx index a7481396647..f06dbc0c6a4 100644 --- a/src/components/modals/FlipInputModal.tsx +++ b/src/components/modals/FlipInputModal.tsx @@ -11,7 +11,7 @@ import { sprintf } from 'sprintf-js' import { updateMaxSpend, updateTransactionAmount } from '../../actions/SendConfirmationActions' import { getSpecialCurrencyInfo } from '../../constants/WalletAndCurrencyConstants' import { formatNumber } from '../../locales/intl' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { getDisplayDenomination, getExchangeDenomination } from '../../selectors/DenominationSelectors' import { getExchangeRate } from '../../selectors/WalletSelectors' import { connect } from '../../types/reactRedux' @@ -158,7 +158,7 @@ export class FlipInputModalComponent extends React.PureComponent { return ( - {s.strings.string_rate} + {lstrings.string_rate} ) @@ -171,7 +171,7 @@ export class FlipInputModalComponent extends React.PureComponent { const balance = `${formatNumber(div(balanceCrypto, multiplier, DECIMAL_PRECISION))} ${name} ` return ( - {s.strings.send_confirmation_balance} + {lstrings.send_confirmation_balance} {balance} ( @@ -200,7 +200,7 @@ export class FlipInputModalComponent extends React.PureComponent { isFiatOnTop={eq(overridePrimaryExchangeAmount, '0')} /> {getSpecialCurrencyInfo(pluginId).noMaxSpend !== true && this.props.hideMaxButton !== true ? ( - + ) : null} ) @@ -216,7 +216,7 @@ export class FlipInputModalComponent extends React.PureComponent { return ( - {s.strings.string_fee} + {lstrings.string_fee} {this.props.onFeesChange ? : null} @@ -373,7 +373,7 @@ export const FlipInputModal = connect( balanceCrypto: getAvailableBalance(wallet, currencyCode), // FlipInput - flipInputHeaderText: sprintf(s.strings.send_from_wallet, name), + flipInputHeaderText: sprintf(lstrings.send_from_wallet, name), primaryInfo, secondaryInfo, fiatPerCrypto: fiatPerCrypto ?? '0', diff --git a/src/components/modals/FlipInputModal2.tsx b/src/components/modals/FlipInputModal2.tsx index 7f3c4ba7274..73e39e214fc 100644 --- a/src/components/modals/FlipInputModal2.tsx +++ b/src/components/modals/FlipInputModal2.tsx @@ -13,7 +13,7 @@ import { useHandler } from '../../hooks/useHandler' import { useWalletName } from '../../hooks/useWalletName' import { useWatch } from '../../hooks/useWatch' import { formatNumber } from '../../locales/intl' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { getCurrencyCode } from '../../util/CurrencyInfoHelpers' import { DECIMAL_PRECISION } from '../../util/utils' import { Card } from '../cards/Card' @@ -99,7 +99,7 @@ const FlipInputModal2Component = React.forwardRef((pro const feeDisplayDenom = useDisplayDenom(pluginId, feeCurrencyCode) const walletName = useWalletName(wallet) - const flipInputHeaderText = headerText ?? sprintf(s.strings.send_from_wallet, walletName) + const flipInputHeaderText = headerText ?? sprintf(lstrings.send_from_wallet, walletName) const theme = useTheme() const styles = getStyles(theme) @@ -143,7 +143,7 @@ const FlipInputModal2Component = React.forwardRef((pro const renderExchangeRates = () => { return ( - {s.strings.string_rate} + {lstrings.string_rate} ) @@ -156,7 +156,7 @@ const FlipInputModal2Component = React.forwardRef((pro const parenString = ')' return ( - {s.strings.send_confirmation_balance} + {lstrings.send_confirmation_balance} {balance} @@ -176,7 +176,7 @@ const FlipInputModal2Component = React.forwardRef((pro return ( - {s.strings.string_fee} + {lstrings.string_fee} {onFeesChange ? : null} @@ -203,7 +203,7 @@ const FlipInputModal2Component = React.forwardRef((pro onNext={handleCloseModal} /> {getSpecialCurrencyInfo(pluginId).noMaxSpend !== true && hideMaxButton !== true ? ( - + ) : null} ) diff --git a/src/components/modals/HelpModal.tsx b/src/components/modals/HelpModal.tsx index 7d883abda8a..f062f4ff020 100644 --- a/src/components/modals/HelpModal.tsx +++ b/src/components/modals/HelpModal.tsx @@ -6,7 +6,7 @@ import { WebView } from 'react-native-webview' import { sprintf } from 'sprintf-js' import { Fontello } from '../../assets/vector' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { config } from '../../theme/appConfig' import { Airship } from '../services/AirshipInstance' import { cacheStyles, Theme, ThemeProps, withTheme } from '../services/ThemeContext' @@ -81,12 +81,12 @@ export class HelpModalComponent extends React.Component { render() { const { bridge, theme } = this.props const styles = getStyles(theme) - const versionText = `${s.strings.help_version} ${versionNumber}` - const buildText = `${s.strings.help_build} ${buildNumber}` + const versionText = `${lstrings.help_version} ${versionNumber}` + const buildText = `${lstrings.help_build} ${buildNumber}` const optionMarginRem = [0.75, 0, 0.5, 1] const optionPaddingRem = [0, 1, 1, 0] - const helpModalTitle = sprintf(s.strings.help_modal_title_thanks, config.appName) - const helpSiteMoreInfoText = sprintf(s.strings.help_site_more_info_text, config.appName) + const helpModalTitle = sprintf(lstrings.help_modal_title_thanks, config.appName) + const helpSiteMoreInfoText = sprintf(lstrings.help_site_more_info_text, config.appName) return ( @@ -102,10 +102,10 @@ export class HelpModalComponent extends React.Component { icon={} marginRem={optionMarginRem} paddingRem={optionPaddingRem} - subTitle={s.strings.help_knowledge_base_text} - title={s.strings.help_knowledge_base} + subTitle={lstrings.help_knowledge_base_text} + title={lstrings.help_knowledge_base} underline - onPress={() => showWebViewModal(HELP_URIS.knowledgeBase, s.strings.help_knowledge_base)} + onPress={() => showWebViewModal(HELP_URIS.knowledgeBase, lstrings.help_knowledge_base)} /> { icon={} marginRem={optionMarginRem} paddingRem={optionPaddingRem} - subTitle={s.strings.help_support_text} - title={s.strings.help_support} + subTitle={lstrings.help_support_text} + title={lstrings.help_support} underline - onPress={() => showWebViewModal(HELP_URIS.support, s.strings.help_support)} + onPress={() => showWebViewModal(HELP_URIS.support, lstrings.help_support)} /> { icon={} marginRem={optionMarginRem} paddingRem={optionPaddingRem} - subTitle={s.strings.help_call_text} - title={s.strings.help_call} + subTitle={lstrings.help_call_text} + title={lstrings.help_call} underline onPress={async () => await Linking.openURL(`tel:${HELP_URIS.call}`)} /> @@ -136,7 +136,7 @@ export class HelpModalComponent extends React.Component { marginRem={optionMarginRem} paddingRem={optionPaddingRem} subTitle={helpSiteMoreInfoText} - title={sprintf(s.strings.help_visit_site, config.appName)} + title={sprintf(lstrings.help_visit_site, config.appName)} onPress={() => this.handleEdgeSitePress(helpSiteMoreInfoText)} /> diff --git a/src/components/modals/InsufficientFeesModal.tsx b/src/components/modals/InsufficientFeesModal.tsx index c0f6f10c5e1..13c41949344 100644 --- a/src/components/modals/InsufficientFeesModal.tsx +++ b/src/components/modals/InsufficientFeesModal.tsx @@ -6,7 +6,7 @@ import { sprintf } from 'sprintf-js' import { selectWalletForExchange } from '../../actions/CryptoExchangeActions' import { useDisplayDenom } from '../../hooks/useDisplayDenom' import { useHandler } from '../../hooks/useHandler' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { useDispatch } from '../../types/reactRedux' import { NavigationBase } from '../../types/routerTypes' import { roundedFee } from '../../util/utils' @@ -53,11 +53,11 @@ export function InsufficientFeesModal(props: Props) { return ( - {s.strings.buy_crypto_modal_title} - {sprintf(s.strings.buy_parent_crypto_modal_message_2s, amountString, name)} - - - + {lstrings.buy_crypto_modal_title} + {sprintf(lstrings.buy_parent_crypto_modal_message_2s, amountString, name)} + + + ) } diff --git a/src/components/modals/LoanWelcomeModal.tsx b/src/components/modals/LoanWelcomeModal.tsx index 8051023e51a..e73ececb438 100644 --- a/src/components/modals/LoanWelcomeModal.tsx +++ b/src/components/modals/LoanWelcomeModal.tsx @@ -3,7 +3,7 @@ import { AirshipBridge } from 'react-native-airship' import FastImage from 'react-native-fast-image' import { sprintf } from 'sprintf-js' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { borrowPlugins } from '../../plugins/helpers/borrowPluginHelpers' import { config } from '../../theme/appConfig' import { getBorrowPluginIconUri } from '../../util/CdnUris' @@ -22,10 +22,10 @@ export const LoanWelcomeModal = (props: { bridge: AirshipBridge<'ok' | undefined const iconUri = getBorrowPluginIconUri(defaultBorrowPlugin.borrowInfo) return ( - + - {sprintf(s.strings.loan_welcome_6s, config.appName, s.strings.loan_aave_fragment, 'BTC', 'USDC', '10', '120')} + {sprintf(lstrings.loan_welcome_6s, config.appName, lstrings.loan_aave_fragment, 'BTC', 'USDC', '10', '120')} ) diff --git a/src/components/modals/LogsModal.tsx b/src/components/modals/LogsModal.tsx index ad46e72894e..31b29574812 100644 --- a/src/components/modals/LogsModal.tsx +++ b/src/components/modals/LogsModal.tsx @@ -5,7 +5,7 @@ import RNFS from 'react-native-fs' import Share, { ShareOptions } from 'react-native-share' import { MultiLogOutput, sendLogs } from '../../actions/LogActions' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { WarningCard } from '../cards/WarningCard' import { showToast } from '../services/AirshipInstance' import { MainButton } from '../themed/MainButton' @@ -37,9 +37,9 @@ export const LogsModal = (props: Props) => { const path = `${dir}/edge-log-${username}.json`.replace('-.json', '.json') const shareOptions: ShareOptions = { - title: s.strings.settings_button_export_logs, - subject: s.strings.settings_button_export_logs, - message: s.strings.settings_button_export_logs, + title: lstrings.settings_button_export_logs, + subject: lstrings.settings_button_export_logs, + message: lstrings.settings_button_export_logs, urls: [`file://${path}`], type: 'application/json', failOnCancel: false @@ -56,13 +56,13 @@ export const LogsModal = (props: Props) => { await Promise.all([ sendLogs(logs.activity).catch((e: any) => { - throw new Error(`${s.strings.settings_modal_send_logs_failure} activity logs code ${e?.message}`) + throw new Error(`${lstrings.settings_modal_send_logs_failure} activity logs code ${e?.message}`) }), sendLogs(logs.info).catch((e: any) => { - throw new Error(`${s.strings.settings_modal_send_logs_failure} info logs code ${e?.message}`) + throw new Error(`${lstrings.settings_modal_send_logs_failure} info logs code ${e?.message}`) }) ]) - showToast(s.strings.settings_modal_send_logs_success) + showToast(lstrings.settings_modal_send_logs_success) bridge.resolve() } @@ -73,13 +73,13 @@ export const LogsModal = (props: Props) => { return ( - {s.strings.settings_button_export_logs} - {!isDangerous ? null : } - {isDangerous ? null : {s.strings.settings_modal_export_logs_message}} + {lstrings.settings_button_export_logs} + {!isDangerous ? null : } + {isDangerous ? null : {lstrings.settings_modal_export_logs_message}} { value={userMessage} /> {isDangerous ? null : ( - + )} - + ) diff --git a/src/components/modals/PasswordReminderModal.tsx b/src/components/modals/PasswordReminderModal.tsx index d831c711379..33083c6942c 100644 --- a/src/components/modals/PasswordReminderModal.tsx +++ b/src/components/modals/PasswordReminderModal.tsx @@ -3,7 +3,7 @@ import * as React from 'react' import { Platform, ScrollView, View } from 'react-native' import { AirshipBridge } from 'react-native-airship' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { connect } from '../../types/reactRedux' import { NavigationBase } from '../../types/routerTypes' import { showToast } from '../services/AirshipInstance' @@ -66,10 +66,10 @@ export class PasswordReminderModalComponent extends React.PureComponent bridge.resolve(), 10) } else { - this.setState({ errorMessage: s.strings.password_reminder_invalid, spinning: false }) + this.setState({ errorMessage: lstrings.password_reminder_invalid, spinning: false }) } }) } @@ -82,15 +82,15 @@ export class PasswordReminderModalComponent extends React.PureComponent - {s.strings.password_reminder_remember_your_password} + {lstrings.password_reminder_remember_your_password} - {s.strings.password_reminder_you_will_need_your_password} - {s.strings.password_reminder_enter_password_below} + {lstrings.password_reminder_you_will_need_your_password} + {lstrings.password_reminder_enter_password_below} ) : ( - + )} - + ) diff --git a/src/components/modals/PermissionsSettingModal.tsx b/src/components/modals/PermissionsSettingModal.tsx index 9ea51710b7c..284b3f05e7c 100644 --- a/src/components/modals/PermissionsSettingModal.tsx +++ b/src/components/modals/PermissionsSettingModal.tsx @@ -5,7 +5,7 @@ import { sprintf } from 'sprintf-js' import { useAsyncEffect } from '../../hooks/useAsyncEffect' import { useIsAppForeground } from '../../hooks/useIsAppForeground' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { Permission, permissionNames } from '../../reducers/PermissionsReducer' import { showError } from '../services/AirshipInstance' import { checkIfDenied } from '../services/PermissionsManager' @@ -23,8 +23,8 @@ export function PermissionsSettingModal(props: { const isAppForeground = useIsAppForeground() const message = mandatory - ? sprintf(s.strings.contacts_permission_modal_enable_settings_mandatory, name, permission) - : sprintf(s.strings.contacts_permission_modal_enable_settings, name, permission) + ? sprintf(lstrings.contacts_permission_modal_enable_settings_mandatory, name, permission) + : sprintf(lstrings.contacts_permission_modal_enable_settings, name, permission) useAsyncEffect(async () => { if (!isAppForeground || !mandatory) return @@ -43,7 +43,7 @@ export function PermissionsSettingModal(props: { return ( {message} - + ) diff --git a/src/components/modals/PriceChangeBuySellSwapModal.tsx b/src/components/modals/PriceChangeBuySellSwapModal.tsx index ea777010fb2..0378d8c638e 100644 --- a/src/components/modals/PriceChangeBuySellSwapModal.tsx +++ b/src/components/modals/PriceChangeBuySellSwapModal.tsx @@ -2,7 +2,7 @@ import * as React from 'react' import { sprintf } from 'sprintf-js' import { PriceChangePayload } from '../../controllers/action-queue/types/pushPayloadTypes' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { ThunkAction } from '../../types/reduxTypes' import { NavigationBase } from '../../types/routerTypes' import { Airship } from '../services/AirshipInstance' @@ -17,12 +17,12 @@ export function launchPriceChangeBuySellSwapModal(navigation: NavigationBase, da const threeButtonModal = await Airship.show<'buy' | 'sell' | 'exchange' | undefined>(bridge => ( )) diff --git a/src/components/modals/RawTextModal.tsx b/src/components/modals/RawTextModal.tsx index e057b76f2f4..4b17df487bc 100644 --- a/src/components/modals/RawTextModal.tsx +++ b/src/components/modals/RawTextModal.tsx @@ -3,7 +3,7 @@ import * as React from 'react' import { ScrollView } from 'react-native' import { AirshipBridge } from 'react-native-airship' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { showToast } from '../services/AirshipInstance' import { MainButton } from '../themed/MainButton' import { ModalFooter, ModalMessage, ModalTitle } from '../themed/ModalParts' @@ -22,7 +22,7 @@ export function RawTextModal(props: Props) { const handleCancel = () => bridge.resolve(undefined) const handleCopy = () => { Clipboard.setString(body) - showToast(s.strings.fragment_copied) + showToast(lstrings.fragment_copied) bridge.resolve() } @@ -33,7 +33,7 @@ export function RawTextModal(props: Props) { {body} {disableCopy ? null : ( - + )} diff --git a/src/components/modals/ScanModal.tsx b/src/components/modals/ScanModal.tsx index 12fd444d1cd..7c7e7c9c663 100644 --- a/src/components/modals/ScanModal.tsx +++ b/src/components/modals/ScanModal.tsx @@ -9,7 +9,7 @@ import Ionicon from 'react-native-vector-icons/Ionicons' import RNQRGenerator from 'rn-qr-generator' import { useLayout } from '../../hooks/useLayout' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { useSelector } from '../../types/reactRedux' import { triggerHaptic } from '../../util/haptic' import { QrPeephole } from '../common/QrPeephole' @@ -96,7 +96,7 @@ export const ScanModal = (props: Props) => { const asset = result.assets != null ? result.assets[0] : undefined if (asset == null) { - showWarning(s.strings.scan_camera_missing_qrcode) + showWarning(lstrings.scan_camera_missing_qrcode) return } @@ -106,7 +106,7 @@ export const ScanModal = (props: Props) => { }) if (response.values.length === 0) { - showWarning(s.strings.scan_camera_missing_qrcode) + showWarning(lstrings.scan_camera_missing_qrcode) return } @@ -172,15 +172,15 @@ export const ScanModal = (props: Props) => { - {s.strings.fragment_send_flash} + {lstrings.fragment_send_flash} - {s.strings.fragment_send_album} + {lstrings.fragment_send_album} - {s.strings.enter_as_in_enter_address_with_keyboard} + {lstrings.enter_as_in_enter_address_with_keyboard} @@ -191,8 +191,8 @@ export const ScanModal = (props: Props) => { return ( - {s.strings.scan_camera_permission_denied} - + {lstrings.scan_camera_permission_denied} + ) } diff --git a/src/components/modals/SwapVerifyTermsModal.tsx b/src/components/modals/SwapVerifyTermsModal.tsx index 0fef189f2db..dfc20ac99ea 100644 --- a/src/components/modals/SwapVerifyTermsModal.tsx +++ b/src/components/modals/SwapVerifyTermsModal.tsx @@ -4,7 +4,7 @@ import { Linking, Text, View } from 'react-native' import { AirshipBridge } from 'react-native-airship' import FastImage from 'react-native-fast-image' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { getSwapPluginIconUri } from '../../util/CdnUris' import { Airship } from '../services/AirshipInstance' import { cacheStyles, Theme, useTheme } from '../services/ThemeContext' @@ -64,23 +64,23 @@ function SwapVerifyTermsModal(props: Props) { {displayName} - {s.strings.swap_terms_statement} - bridge.resolve(true)} /> - bridge.resolve(false)} /> + {lstrings.swap_terms_statement} + bridge.resolve(true)} /> + bridge.resolve(false)} /> {termsUri == null ? null : ( await Linking.openURL(termsUri)}> - {s.strings.swap_terms_terms_link} + {lstrings.swap_terms_terms_link} )} {privacyUri == null ? null : ( await Linking.openURL(privacyUri)}> - {s.strings.swap_terms_privacy_link} + {lstrings.swap_terms_privacy_link} )} {kycUri == null ? null : ( await Linking.openURL(kycUri)}> - {s.strings.swap_terms_kyc_link} + {lstrings.swap_terms_kyc_link} )} diff --git a/src/components/modals/TextInputModal.tsx b/src/components/modals/TextInputModal.tsx index 73f574b70ee..b727856eda5 100644 --- a/src/components/modals/TextInputModal.tsx +++ b/src/components/modals/TextInputModal.tsx @@ -2,7 +2,7 @@ import * as React from 'react' import { Platform, View } from 'react-native' import { AirshipBridge } from 'react-native-airship' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { showError } from '../services/AirshipInstance' import { Alert } from '../themed/Alert' import { MainButton } from '../themed/MainButton' @@ -55,7 +55,7 @@ export function TextInputModal(props: Props) { returnKeyType, secureTextEntry, multiline = false, - submitLabel = s.strings.submit, + submitLabel = lstrings.submit, title, maxLength, warning, @@ -94,7 +94,7 @@ export function TextInputModal(props: Props) { bridge.resolve(undefined)}> {title != null ? {title} : null} {typeof message === 'string' ? {message} : <>{message}} - {warningMessage != null ? : null} + {warningMessage != null ? : null} bridge.resolve() - const message = sprintf(s.strings.update_fresh_new_version, config.appName) + const message = sprintf(lstrings.update_fresh_new_version, config.appName) return ( bridge.resolve()}> - {s.strings.update_header} + {lstrings.update_header} {message} - - + + ) diff --git a/src/components/modals/WalletListMenuModal.tsx b/src/components/modals/WalletListMenuModal.tsx index 02041723497..c1945fc38d3 100644 --- a/src/components/modals/WalletListMenuModal.tsx +++ b/src/components/modals/WalletListMenuModal.tsx @@ -9,7 +9,7 @@ import { walletListMenuAction, WalletListMenuKey } from '../../actions/WalletLis import { getSpecialCurrencyInfo } from '../../constants/WalletAndCurrencyConstants' import { useAsyncEffect } from '../../hooks/useAsyncEffect' import { useWatch } from '../../hooks/useWatch' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { useDispatch, useSelector } from '../../types/reactRedux' import { NavigationProp } from '../../types/routerTypes' import { getCurrencyCode, getCurrencyInfos } from '../../util/CurrencyInfoHelpers' @@ -57,23 +57,23 @@ export const WALLET_LIST_MENU: Array<{ value: WalletListMenuKey }> = [ { - label: s.strings.string_rename, + label: lstrings.string_rename, value: 'rename' }, { - label: s.strings.string_resync, + label: lstrings.string_resync, value: 'resync' }, { - label: s.strings.fragment_wallets_export_transactions, + label: lstrings.fragment_wallets_export_transactions, value: 'exportWalletTransactions' }, { - label: s.strings.string_master_private_key, + label: lstrings.string_master_private_key, value: 'getSeed' }, { - label: s.strings.string_add_edit_tokens, + label: lstrings.string_add_edit_tokens, value: 'manageTokens' }, { @@ -103,15 +103,15 @@ export const WALLET_LIST_MENU: Array<{ 'piratechain', 'zcash' ], - label: s.strings.fragment_wallets_view_xpub, + label: lstrings.fragment_wallets_view_xpub, value: 'viewXPub' }, { - label: s.strings.string_get_raw_keys, + label: lstrings.string_get_raw_keys, value: 'getRawKeys' }, { - label: s.strings.string_archive_wallet, + label: lstrings.string_archive_wallet, value: 'delete' } ] @@ -138,8 +138,8 @@ export function WalletListMenuModal(props: Props) { useAsyncEffect(async () => { if (wallet == null) { setOptions([ - { label: s.strings.string_get_raw_keys, value: 'getRawKeys' }, - { label: s.strings.string_archive_wallet, value: 'rawDelete' } + { label: lstrings.string_get_raw_keys, value: 'getRawKeys' }, + { label: lstrings.string_archive_wallet, value: 'rawDelete' } ]) return } @@ -147,19 +147,19 @@ export function WalletListMenuModal(props: Props) { if (tokenId != null) { setOptions([ { - label: s.strings.string_resync, + label: lstrings.string_resync, value: 'resync' }, { - label: s.strings.fragment_wallets_export_transactions, + label: lstrings.fragment_wallets_export_transactions, value: 'exportWalletTransactions' }, { - label: s.strings.string_add_edit_tokens, + label: lstrings.string_add_edit_tokens, value: 'manageTokens' }, { - label: s.strings.fragment_wallets_delete_wallet, + label: lstrings.fragment_wallets_delete_wallet, value: 'delete' } ]) @@ -187,7 +187,7 @@ export function WalletListMenuModal(props: Props) { for (const splitWalletType of splittable) { const info = currencyInfos.find(({ walletType }) => walletType === splitWalletType) if (info == null || getSpecialCurrencyInfo(info.pluginId).isSplittingDisabled) continue - result.push({ label: sprintf(s.strings.string_split_wallet, info.displayName), value: `split${info.pluginId}` }) + result.push({ label: sprintf(lstrings.string_split_wallet, info.displayName), value: `split${info.pluginId}` }) } setOptions(result) diff --git a/src/components/modals/WalletListModal.tsx b/src/components/modals/WalletListModal.tsx index 1d9f64ebd87..0099c45f969 100644 --- a/src/components/modals/WalletListModal.tsx +++ b/src/components/modals/WalletListModal.tsx @@ -9,7 +9,7 @@ import { SPECIAL_CURRENCY_INFO } from '../../constants/WalletAndCurrencyConstant import { PaymentMethod, PaymentMethodsMap } from '../../controllers/action-queue/WyreClient' import { useAsyncValue } from '../../hooks/useAsyncValue' import { useHandler } from '../../hooks/useHandler' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { config } from '../../theme/appConfig' import { useSelector } from '../../types/reactRedux' import { NavigationBase } from '../../types/routerTypes' @@ -153,7 +153,7 @@ export function WalletListModal(props: Props) { const handleWalletListPress = useHandler((walletId: string, currencyCode: string, _tokenId?: string, customAsset?: CustomAsset) => { if (walletId === '') { handleCancel() - showError(s.strings.network_alert_title) + showError(lstrings.network_alert_title) } else bridge.resolve({ walletId, currencyCode, customAsset }) }) const handleSearchClear = useHandler(() => { @@ -168,10 +168,10 @@ export function WalletListModal(props: Props) { const result = await Airship.show<'continue' | undefined>(bridge => ( )) @@ -198,7 +198,7 @@ export function WalletListModal(props: Props) { if (bankAccountsMap == null) return null if (!showBankOptions) return null if (Object.keys(bankAccountsMap).length === 0) { - return + return } return ( @@ -235,10 +235,10 @@ export function WalletListModal(props: Props) { {headerTitle} {bankSection} {customAssetSection} - {showBankOptions || showCustomAssets ? {s.strings.your_wallets} : null} + {showBankOptions || showCustomAssets ? {lstrings.your_wallets} : null} { ) }) - return + return } diff --git a/src/components/modals/WcSmartContractModal.tsx b/src/components/modals/WcSmartContractModal.tsx index beae9c16124..cd5305aebea 100644 --- a/src/components/modals/WcSmartContractModal.tsx +++ b/src/components/modals/WcSmartContractModal.tsx @@ -7,7 +7,7 @@ import { sprintf } from 'sprintf-js' import WalletConnectLogo from '../../assets/images/walletconnect-logo.png' import { FlashNotification } from '../../components/navigation/FlashNotification' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { getDenominationFromCurrencyInfo } from '../../selectors/DenominationSelectors' import { useSelector } from '../../types/reactRedux' import { getCurrencyIconUris } from '../../util/CdnUris' @@ -85,7 +85,7 @@ export const WcSmartContractModal = (props: Props) => { const handleSubmit = () => { wcRequestResponse(wallet, uri, true, payload) - .then(async () => await Airship.show(bridge => )) + .then(async () => await Airship.show(bridge => )) .catch(showError) .finally(props.bridge.resolve) } @@ -99,8 +99,8 @@ export const WcSmartContractModal = (props: Props) => { ) : ( @@ -108,8 +108,8 @@ export const WcSmartContractModal = (props: Props) => { numberOfLines={0} // @ts-expect-error marginTop={0.5} - title={s.strings.wc_smartcontract_warning_title} - message={s.strings.wc_smartcontract_warning_text} + title={lstrings.wc_smartcontract_warning_title} + message={lstrings.wc_smartcontract_warning_text} type="warning" /> ) @@ -118,7 +118,7 @@ export const WcSmartContractModal = (props: Props) => { const contractAddress = metaTokens.find(token => token.currencyCode === amountCurrencyCode)?.contractAddress const walletImageUri = getCurrencyIconUris(pluginId, contractAddress).symbolImage const slider = isInsufficientBal ? null : ( - + ) // FIXME: HACK!!1! This is a shortcut so we can remove currency code from the fiat text component without completely refactoring this file @@ -128,35 +128,35 @@ export const WcSmartContractModal = (props: Props) => { - {s.strings.wc_smartcontract_title} + {lstrings.wc_smartcontract_title} {renderWarning()} {!zeroString(amountCrypto) && ( )} - + {walletName} - + {dAppName} {!zeroString(networkFeeCrypto) && ( )} {!zeroString(totalNativeCrypto) && ( - + )} {slider} diff --git a/src/components/navigation/AlertDropdown.tsx b/src/components/navigation/AlertDropdown.tsx index 3eacbfeee43..45ec98a8052 100644 --- a/src/components/navigation/AlertDropdown.tsx +++ b/src/components/navigation/AlertDropdown.tsx @@ -4,7 +4,7 @@ import { AirshipBridge } from 'react-native-airship' import AntDesignIcon from 'react-native-vector-icons/AntDesign' import EntypoIcon from 'react-native-vector-icons/Entypo' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { textStyle } from '../../styles/common/textStylesThemed' import { AirshipDropdown } from '../common/AirshipDropdown' import { cacheStyles, Theme, useTheme } from '../services/ThemeContext' @@ -28,7 +28,7 @@ export function AlertDropdown(props: Props) { - {warning ? s.strings.alert_dropdown_warning : s.strings.alert_dropdown_alert} + {warning ? lstrings.alert_dropdown_warning : lstrings.alert_dropdown_alert} {message} diff --git a/src/components/navigation/HeaderTextButton.tsx b/src/components/navigation/HeaderTextButton.tsx index ff035104be7..4d6ab08e93b 100644 --- a/src/components/navigation/HeaderTextButton.tsx +++ b/src/components/navigation/HeaderTextButton.tsx @@ -3,7 +3,7 @@ import * as React from 'react' import { TouchableOpacity } from 'react-native' import { useHandler } from '../../hooks/useHandler' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { triggerHaptic } from '../../util/haptic' import { showHelpModal } from '../modals/HelpModal' import { cacheStyles, Theme, useTheme } from '../services/ThemeContext' @@ -15,8 +15,8 @@ interface Props { } const title = { - exit: s.strings.string_exit, - help: s.strings.string_help + exit: lstrings.string_exit, + help: lstrings.string_help } export const HeaderTextButton = (props: Props) => { diff --git a/src/components/navigation/TransactionDropdown.tsx b/src/components/navigation/TransactionDropdown.tsx index 76980be9b68..5e310c19b40 100644 --- a/src/components/navigation/TransactionDropdown.tsx +++ b/src/components/navigation/TransactionDropdown.tsx @@ -5,7 +5,7 @@ import { sprintf } from 'sprintf-js' import { playReceiveSound } from '../../actions/SoundActions' import { selectWalletToken } from '../../actions/WalletActions' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { getDisplayDenomination } from '../../selectors/DenominationSelectors' import { connect } from '../../types/reactRedux' import { NavigationBase } from '../../types/routerTypes' @@ -83,12 +83,12 @@ const ConnectedTransactionDropdown = connect - {s.strings.loan_status_failed_title} + {lstrings.loan_status_failed_title} {nodeError.message} diff --git a/src/components/scenes/ChangeMiningFeeScene.tsx b/src/components/scenes/ChangeMiningFeeScene.tsx index 73308666d13..cdfefa8ed4c 100644 --- a/src/components/scenes/ChangeMiningFeeScene.tsx +++ b/src/components/scenes/ChangeMiningFeeScene.tsx @@ -5,7 +5,7 @@ import Evilicons from 'react-native-vector-icons/EvilIcons' import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons' import { FEE_STRINGS } from '../../constants/WalletAndCurrencyConstants' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { NavigationProp, RouteProp } from '../../types/routerTypes' import { FeeOption } from '../../types/types' import { SceneWrapper } from '../common/SceneWrapper' @@ -31,15 +31,15 @@ interface State { const feeOptions = { high: { - text: s.strings.mining_fee_high_label_choice, + text: lstrings.mining_fee_high_label_choice, icon: 'speedometer' }, standard: { - text: s.strings.mining_fee_standard_label_choice, + text: lstrings.mining_fee_standard_label_choice, icon: 'speedometer-medium' }, low: { - text: s.strings.mining_fee_low_label_choice, + text: lstrings.mining_fee_low_label_choice, icon: 'speedometer-slow' } } @@ -93,7 +93,7 @@ export class ChangeMiningFeeComponent extends React.PureComponent }) .catch(e => { let message = e.message - if (e.name === 'ErrorBelowMinimumFee') message = `${s.strings.invalid_custom_fee} ${e.message}` + if (e.name === 'ErrorBelowMinimumFee') message = `${lstrings.invalid_custom_fee} ${e.message}` showError(message) }) } @@ -107,7 +107,7 @@ export class ChangeMiningFeeComponent extends React.PureComponent return ( - + {Object.keys(feeOptions).map(feeSetting => { return ( @@ -130,8 +130,8 @@ export class ChangeMiningFeeComponent extends React.PureComponent })} {customFormat != null ? ( this.setState({ networkFeeOption: 'custom' })} > @@ -140,7 +140,7 @@ export class ChangeMiningFeeComponent extends React.PureComponent ) : null} {customFormat != null ? this.renderCustomFeeTextInput(customFormat) : null} {this.renderFeeWarning()} - + ) @@ -181,11 +181,11 @@ export class ChangeMiningFeeComponent extends React.PureComponent const { theme } = this.props const styles = getStyles(theme) if (networkFeeOption !== 'custom' && networkFeeOption !== 'low') return null - const title = networkFeeOption === 'custom' ? s.strings.warning_custom_fee_selected : s.strings.warning_low_fee_selected + const title = networkFeeOption === 'custom' ? lstrings.warning_custom_fee_selected : lstrings.warning_low_fee_selected return ( - + ) } diff --git a/src/components/scenes/ChangeMiningFeeScene2.tsx b/src/components/scenes/ChangeMiningFeeScene2.tsx index e01982bcc0f..e65cc171de2 100644 --- a/src/components/scenes/ChangeMiningFeeScene2.tsx +++ b/src/components/scenes/ChangeMiningFeeScene2.tsx @@ -5,7 +5,7 @@ import Evilicons from 'react-native-vector-icons/EvilIcons' import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons' import { FEE_STRINGS } from '../../constants/WalletAndCurrencyConstants' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { NavigationProp, RouteProp } from '../../types/routerTypes' import { FeeOption } from '../../types/types' import { SceneWrapper } from '../common/SceneWrapper' @@ -30,15 +30,15 @@ interface State { const feeOptions = { high: { - text: s.strings.mining_fee_high_label_choice, + text: lstrings.mining_fee_high_label_choice, icon: 'speedometer' }, standard: { - text: s.strings.mining_fee_standard_label_choice, + text: lstrings.mining_fee_standard_label_choice, icon: 'speedometer-medium' }, low: { - text: s.strings.mining_fee_low_label_choice, + text: lstrings.mining_fee_low_label_choice, icon: 'speedometer-slow' } } @@ -86,7 +86,7 @@ export class ChangeMiningFeeComponent extends React.PureComponent return ( - + {Object.keys(feeOptions).map(feeSetting => { return ( @@ -109,8 +109,8 @@ export class ChangeMiningFeeComponent extends React.PureComponent })} {customFormat != null ? ( this.setState({ networkFeeOption: 'custom' })} > @@ -119,7 +119,7 @@ export class ChangeMiningFeeComponent extends React.PureComponent ) : null} {customFormat != null ? this.renderCustomFeeTextInput(customFormat) : null} {this.renderFeeWarning()} - + ) @@ -160,11 +160,11 @@ export class ChangeMiningFeeComponent extends React.PureComponent const { theme } = this.props const styles = getStyles(theme) if (networkFeeOption !== 'custom' && networkFeeOption !== 'low') return null - const title = networkFeeOption === 'custom' ? s.strings.warning_custom_fee_selected : s.strings.warning_low_fee_selected + const title = networkFeeOption === 'custom' ? lstrings.warning_custom_fee_selected : lstrings.warning_low_fee_selected return ( - + ) } diff --git a/src/components/scenes/CoinRankingDetailsScene.tsx b/src/components/scenes/CoinRankingDetailsScene.tsx index 4efb2d7b0cc..c78b34f50e8 100644 --- a/src/components/scenes/CoinRankingDetailsScene.tsx +++ b/src/components/scenes/CoinRankingDetailsScene.tsx @@ -5,7 +5,7 @@ import FastImage from 'react-native-fast-image' import { USD_FIAT } from '../../constants/WalletAndCurrencyConstants' import { formatFiatString } from '../../hooks/useFiatText' import { toLocaleDate, toPercentString } from '../../locales/intl' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { CoinRankingData, CoinRankingDataPercentChange } from '../../types/coinrankTypes' import { RouteProp } from '../../types/routerTypes' import { formatLargeNumberString as formatLargeNumber } from '../../util/utils' @@ -24,31 +24,31 @@ const COINRANKINGDATA_TITLE_MAP: { [key: string]: string } = { currencyCode: '', currencyName: '', imageUrl: '', - marketCap: s.strings.coin_rank_title_market_cap, + marketCap: lstrings.coin_rank_title_market_cap, percentChange: '', // Display the children of this field instead // Keys of percentChange - hours1: s.strings.coin_rank_title_hours_1, - hours24: s.strings.coin_rank_title_hours_24, - days7: s.strings.coin_rank_title_days_7, - days30: s.strings.coin_rank_title_days_30, - year1: s.strings.coin_rank_title_year_1, - - price: s.strings.coin_rank_price, - rank: s.strings.coin_rank_rank, - volume24h: s.strings.coin_rank_title_volume_24h, - high24h: s.strings.coin_rank_title_high_24h, - low24h: s.strings.coin_rank_title_low_24h, - priceChange24h: s.strings.coin_rank_title_price_change_24h, + hours1: lstrings.coin_rank_title_hours_1, + hours24: lstrings.coin_rank_title_hours_24, + days7: lstrings.coin_rank_title_days_7, + days30: lstrings.coin_rank_title_days_30, + year1: lstrings.coin_rank_title_year_1, + + price: lstrings.coin_rank_price, + rank: lstrings.coin_rank_rank, + volume24h: lstrings.coin_rank_title_volume_24h, + high24h: lstrings.coin_rank_title_high_24h, + low24h: lstrings.coin_rank_title_low_24h, + priceChange24h: lstrings.coin_rank_title_price_change_24h, priceChangePercent24h: '', // Duplicate of percentChange children - marketCapChange24h: s.strings.coin_rank_title_market_cap_change_24h, + marketCapChange24h: lstrings.coin_rank_title_market_cap_change_24h, marketCapChangePercent24h: '', // Appended to marketCapChange24h - circulatingSupply: s.strings.coin_rank_title_circulating_supply, - totalSupply: s.strings.coin_rank_title_total_supply, - maxSupply: s.strings.coin_rank_title_max_supply, - allTimeHigh: s.strings.coin_rank_title_all_time_high, + circulatingSupply: lstrings.coin_rank_title_circulating_supply, + totalSupply: lstrings.coin_rank_title_total_supply, + maxSupply: lstrings.coin_rank_title_max_supply, + allTimeHigh: lstrings.coin_rank_title_all_time_high, allTimeHighDate: '', // Appended to allTimeHigh - allTimeLow: s.strings.coin_rank_title_all_time_low, + allTimeLow: lstrings.coin_rank_title_all_time_low, allTimeLowDate: '' // Appended to allTimeLow } diff --git a/src/components/scenes/CoinRankingScene.tsx b/src/components/scenes/CoinRankingScene.tsx index 3df15d07f13..6d69939ab49 100644 --- a/src/components/scenes/CoinRankingScene.tsx +++ b/src/components/scenes/CoinRankingScene.tsx @@ -4,7 +4,7 @@ import { TouchableOpacity, View } from 'react-native' import { useAsyncEffect } from '../../hooks/useAsyncEffect' import { useHandler } from '../../hooks/useHandler' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { asCoinranking, AssetSubText, CoinRanking, PercentChangeTimeFrame } from '../../types/coinrankTypes' import { useState } from '../../types/reactHooks' import { NavigationProp } from '../../types/routerTypes' @@ -41,8 +41,8 @@ const percentChangeStrings: { [pc: string]: string } = { year1: '1y' } const assetSubTextStrings: { [pc: string]: string } = { - marketCap: s.strings.coin_rank_market_cap_abbreviation, - volume24h: s.strings.coin_rank_volume_24hr_abbreviation + marketCap: lstrings.coin_rank_market_cap_abbreviation, + volume24h: lstrings.coin_rank_volume_24hr_abbreviation } type Timeout = ReturnType @@ -197,7 +197,7 @@ const CoinRankingComponent = (props: Props) => { { {searching && ( - {s.strings.string_done_cap} + {lstrings.string_done_cap} )} - {s.strings.coin_rank_rank} + {lstrings.coin_rank_rank} {assetSubTextString} @@ -225,7 +225,7 @@ const CoinRankingComponent = (props: Props) => { {timeFrameString} - {s.strings.coin_rank_price} + {lstrings.coin_rank_price} diff --git a/src/components/scenes/ConfirmScene.tsx b/src/components/scenes/ConfirmScene.tsx index e1e7628e963..09fa07adfe8 100644 --- a/src/components/scenes/ConfirmScene.tsx +++ b/src/components/scenes/ConfirmScene.tsx @@ -3,7 +3,7 @@ import { View } from 'react-native' import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view' import { useHandler } from '../../hooks/useHandler' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { NavigationProp, RouteProp } from '../../types/routerTypes' import { SceneWrapper } from '../common/SceneWrapper' import { cacheStyles, Theme, useTheme } from '../services/ThemeContext' @@ -64,7 +64,7 @@ const ConfirmComponent = (props: Props) => { {renderInfoTiles()} - + diff --git a/src/components/scenes/CrashScene.tsx b/src/components/scenes/CrashScene.tsx index dc397dd0df9..c7b1143b950 100644 --- a/src/components/scenes/CrashScene.tsx +++ b/src/components/scenes/CrashScene.tsx @@ -3,7 +3,7 @@ import { Text } from 'react-native' import AntDesignIcon from 'react-native-vector-icons/AntDesign' import { sprintf } from 'sprintf-js' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { config } from '../../theme/appConfig' import { SceneWrapper } from '../common/SceneWrapper' import { cacheStyles, Theme, ThemeProps, withTheme } from '../services/ThemeContext' @@ -18,8 +18,8 @@ function CrashSceneComponent(props: ThemeProps): React.ReactNode { return ( - {s.strings.error_boundary_title} - {sprintf(s.strings.error_boundary_message_s, config.supportEmail)} + {lstrings.error_boundary_title} + {sprintf(lstrings.error_boundary_message_s, config.supportEmail)} ) } diff --git a/src/components/scenes/CreateWalletAccountSelectScene.tsx b/src/components/scenes/CreateWalletAccountSelectScene.tsx index 313697bcbde..42e515558a8 100644 --- a/src/components/scenes/CreateWalletAccountSelectScene.tsx +++ b/src/components/scenes/CreateWalletAccountSelectScene.tsx @@ -11,7 +11,7 @@ import { } from '../../actions/CreateWalletActions' import { CryptoIcon } from '../../components/icons/CryptoIcon' import { WalletListModal, WalletListResult } from '../../components/modals/WalletListModal' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { getExchangeDenomination } from '../../selectors/DenominationSelectors' import { config } from '../../theme/appConfig' import { THEME } from '../../theme/variables/airbitz' @@ -108,7 +108,7 @@ export class CreateWalletAccountSelect extends React.Component { const { supportedAssets } = this.props Airship.show(bridge => ( - + )).then(({ walletId, currencyCode }: WalletListResult) => { if (walletId && currencyCode) { this.onSelectWallet(walletId, currencyCode) @@ -155,12 +155,12 @@ export class CreateWalletAccountSelect extends React.Component { {isSelectWalletDisabled ? ( ) : ( - {s.strings.create_wallet_account_select_wallet} + {lstrings.create_wallet_account_select_wallet} )} - {s.strings.create_wallet_account_amount_due} + {lstrings.create_wallet_account_amount_due} {activationCost} {currencyCode} @@ -205,17 +205,17 @@ export class CreateWalletAccountSelect extends React.Component { - {s.strings.create_wallet_crypto_type_label} {selectedWalletType.currencyCode} + {lstrings.create_wallet_crypto_type_label} {selectedWalletType.currencyCode} - {s.strings.create_wallet_fiat_type_label} {selectedFiat.label} + {lstrings.create_wallet_fiat_type_label} {selectedFiat.label} - {s.strings.create_wallet_name_label} {accountName} + {lstrings.create_wallet_name_label} {accountName} - {s.strings.create_wallet_account_confirm} + {lstrings.create_wallet_account_confirm} @@ -223,7 +223,7 @@ export class CreateWalletAccountSelect extends React.Component { {isContinueButtonDisabled ? ( ) : ( - {s.strings.legacy_address_modal_continue} + {lstrings.legacy_address_modal_continue} )} @@ -237,13 +237,13 @@ export class CreateWalletAccountSelect extends React.Component { const { walletId } = this.state const instructionSyntax = sprintf( - s.strings.create_wallet_account_select_instructions_with_cost, + lstrings.create_wallet_account_select_instructions_with_cost, selectedWalletType.currencyCode, selectedWalletType.currencyCode, config.appNameShort, `${activationCost} ${selectedWalletType.currencyCode}` ) - const confirmMessageSyntax = sprintf(s.strings.create_wallet_account_make_payment, selectedWalletType.currencyCode) + const confirmMessageSyntax = sprintf(lstrings.create_wallet_account_make_payment, selectedWalletType.currencyCode) const { tokenId } = guessFromCurrencyCode(account, { currencyCode: selectedWalletType.currencyCode }) diff --git a/src/components/scenes/CreateWalletAccountSetupScene.tsx b/src/components/scenes/CreateWalletAccountSetupScene.tsx index bddc8dc9c3e..9c23f9d18be 100644 --- a/src/components/scenes/CreateWalletAccountSetupScene.tsx +++ b/src/components/scenes/CreateWalletAccountSetupScene.tsx @@ -7,7 +7,7 @@ import { checkHandleAvailability } from '../../actions/CreateWalletActions' import invalidIcon from '../../assets/images/createWallet/invalid_icon.png' import validIcon from '../../assets/images/createWallet/valid_icon.png' import { CryptoIcon } from '../../components/icons/CryptoIcon' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { HandleAvailableStatus } from '../../reducers/scenes/CreateWalletReducer' import { THEME } from '../../theme/variables/airbitz' import { connect } from '../../types/reactRedux' @@ -89,7 +89,7 @@ export class CreateWalletAccountSetup extends React.Component { return ( - {s.strings.string_next_capitalized} + {lstrings.string_next_capitalized} ) @@ -107,11 +107,11 @@ export class CreateWalletAccountSetup extends React.Component { let chooseHandleErrorMessage = '' if (handleAvailableStatus === 'INVALID') { - chooseHandleErrorMessage = s.strings.create_wallet_account_invalid_account_name + chooseHandleErrorMessage = lstrings.create_wallet_account_invalid_account_name } else if (handleAvailableStatus === 'UNAVAILABLE') { - chooseHandleErrorMessage = s.strings.create_wallet_account_account_name_unavailable + chooseHandleErrorMessage = lstrings.create_wallet_account_account_name_unavailable } else if (handleAvailableStatus === 'UNKNOWN_ERROR') { - chooseHandleErrorMessage = s.strings.create_wallet_account_unknown_error + chooseHandleErrorMessage = lstrings.create_wallet_account_unknown_error } const showButton = !!accountHandle && isHandleAvailable && !isCheckingHandleAvailability @@ -125,10 +125,10 @@ export class CreateWalletAccountSetup extends React.Component { - {sprintf(s.strings.create_wallet_account_review_instructions, currencyCode)} + {sprintf(lstrings.create_wallet_account_review_instructions, currencyCode)} - {s.strings.create_wallet_account_requirements_eos} + {lstrings.create_wallet_account_requirements_eos} @@ -143,7 +143,7 @@ export class CreateWalletAccountSetup extends React.Component { autoFocus autoCorrect={false} onChangeText={this.handleChangeHandle} - label={s.strings.create_wallet_account_handle} + label={lstrings.create_wallet_account_handle} value={this.state.accountHandle} returnKeyType="next" onSubmitEditing={this.onSetup} diff --git a/src/components/scenes/CreateWalletCompletionScene.tsx b/src/components/scenes/CreateWalletCompletionScene.tsx index f2d8ada5c91..cf51106f3c9 100644 --- a/src/components/scenes/CreateWalletCompletionScene.tsx +++ b/src/components/scenes/CreateWalletCompletionScene.tsx @@ -8,7 +8,7 @@ import IonIcon from 'react-native-vector-icons/Ionicons' import { createWallet, enableTokensAcrossWallets, PLACEHOLDER_WALLET_ID, splitCreateWalletItems } from '../../actions/CreateWalletActions' import { useAsyncEffect } from '../../hooks/useAsyncEffect' import { useHandler } from '../../hooks/useHandler' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { useDispatch, useSelector } from '../../types/reactRedux' import { NavigationProp, RouteProp } from '../../types/routerTypes' import { SceneWrapper } from '../common/SceneWrapper' @@ -120,7 +120,7 @@ const CreateWalletCompletionComponent = (props: Props) => { } - leftText={s.strings.create_wallet_tokens} + leftText={lstrings.create_wallet_tokens} leftSubtext={ {tokenNameString} @@ -137,7 +137,7 @@ const CreateWalletCompletionComponent = (props: Props) => { return ( navigation.navigate('walletsTab', { screen: 'walletList' })} @@ -153,7 +153,7 @@ const CreateWalletCompletionComponent = (props: Props) => { {gap => ( - + { await Airship.show<'edit' | undefined>(bridge => ( )) @@ -105,11 +105,11 @@ const CreateWalletImportComponent = (props: Props) => { const resolveValue = await Airship.show<'continue' | 'edit' | 'cancel' | undefined>(bridge => ( )) @@ -128,7 +128,7 @@ const CreateWalletImportComponent = (props: Props) => { return ( - + { - {s.strings.create_wallet_import_all_instructions} + {lstrings.create_wallet_import_all_instructions} { marginRem={[1, 0.75, 1.25]} ref={textInputRef} /> - + ) diff --git a/src/components/scenes/CreateWalletSelectCryptoScene.tsx b/src/components/scenes/CreateWalletSelectCryptoScene.tsx index ae144987875..24804f7e289 100644 --- a/src/components/scenes/CreateWalletSelectCryptoScene.tsx +++ b/src/components/scenes/CreateWalletSelectCryptoScene.tsx @@ -6,7 +6,7 @@ import { sprintf } from 'sprintf-js' import { enableTokensAcrossWallets, MainWalletCreateItem, PLACEHOLDER_WALLET_ID, splitCreateWalletItems } from '../../actions/CreateWalletActions' import { useHandler } from '../../hooks/useHandler' import { useWatch } from '../../hooks/useWatch' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { useDispatch, useSelector } from '../../types/reactRedux' import { NavigationProp, RouteProp } from '../../types/routerTypes' import { SceneWrapper } from '../common/SceneWrapper' @@ -91,7 +91,7 @@ const CreateWalletSelectCryptoComponent = (props: Props) => { const handleNext = useHandler(async () => { if (numSelected === 0) { - showError(s.strings.create_wallet_no_assets_selected) + showError(lstrings.create_wallet_no_assets_selected) return } @@ -139,7 +139,7 @@ const CreateWalletSelectCryptoComponent = (props: Props) => { onPress={() => { bridge.resolve(PLACEHOLDER_WALLET_ID) }} - rightSide={{s.strings.create_wallet_choice_new_button_fragment}} + rightSide={{lstrings.create_wallet_choice_new_button_fragment}} /> ) } @@ -155,8 +155,8 @@ const CreateWalletSelectCryptoComponent = (props: Props) => { return ( bridge={bridge} - title={s.strings.select_wallet} - message={sprintf(s.strings.create_wallet_select_wallet_for_assets, displayNames)} + title={lstrings.select_wallet} + message={sprintf(lstrings.create_wallet_select_wallet_for_assets, displayNames)} textInput={false} fullScreen={false} rowComponent={renderRow} @@ -226,7 +226,7 @@ const CreateWalletSelectCryptoComponent = (props: Props) => { () => ( 0} visible={numSelected > 0} duration={300}> - + ), @@ -237,13 +237,13 @@ const CreateWalletSelectCryptoComponent = (props: Props) => { {gap => ( - + { autoCorrect={false} bridge={bridge} initialValue={currentName} - inputLabel={s.strings.fragment_wallets_rename_wallet} + inputLabel={lstrings.fragment_wallets_rename_wallet} returnKeyType="go" - title={s.strings.fragment_wallets_rename_wallet} + title={lstrings.fragment_wallets_rename_wallet} /> )) if (newName != null) setWalletNames({ ...walletNames, [key]: newName }) @@ -109,10 +109,10 @@ const CreateWalletSelectFiatComponent = (props: Props) => { await Airship.show<'cancel' | undefined>(bridge => ( )) @@ -126,11 +126,11 @@ const CreateWalletSelectFiatComponent = (props: Props) => { const resolveValue = await Airship.show<'continue' | 'cancel' | undefined>(bridge => ( )) @@ -154,7 +154,7 @@ const CreateWalletSelectFiatComponent = (props: Props) => { const fiatCountry = FIAT_COUNTRY[fiat.value] const key = `currency_label_${fiat.value}` - const subTitle = s.strings[key as keyof typeof s.strings] ?? s.strings.currency_label_ + const subTitle = lstrings[key as keyof typeof lstrings] ?? lstrings.currency_label_ return ( { return ( - + {renderSelectedFiatRow()} - {s.strings.fragment_create_wallet_instructions} + {lstrings.fragment_create_wallet_instructions} { keyExtractor={keyExtractor} renderItem={renderCurrencyRow} /> - - + + ) diff --git a/src/components/scenes/CryptoExchangeQuoteProcessingScene.tsx b/src/components/scenes/CryptoExchangeQuoteProcessingScene.tsx index 96dfa49b624..1ccfcf99042 100644 --- a/src/components/scenes/CryptoExchangeQuoteProcessingScene.tsx +++ b/src/components/scenes/CryptoExchangeQuoteProcessingScene.tsx @@ -1,7 +1,7 @@ import * as React from 'react' import { ActivityIndicator, View } from 'react-native' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { SceneWrapper } from '../common/SceneWrapper' import { cacheStyles, Theme, ThemeProps, withTheme } from '../services/ThemeContext' import { EdgeText } from '../themed/EdgeText' @@ -11,9 +11,9 @@ function CryptoExchangeQuoteProcessingScreenComponent(props: ThemeProps) { return ( - {s.strings.hang_tight} + {lstrings.hang_tight} - {s.strings.trying_to_find} + {lstrings.trying_to_find} diff --git a/src/components/scenes/CryptoExchangeQuoteScene.tsx b/src/components/scenes/CryptoExchangeQuoteScene.tsx index 445943854f9..a12f26c9ded 100644 --- a/src/components/scenes/CryptoExchangeQuoteScene.tsx +++ b/src/components/scenes/CryptoExchangeQuoteScene.tsx @@ -6,7 +6,7 @@ import FastImage from 'react-native-fast-image' import IonIcon from 'react-native-vector-icons/Ionicons' import { exchangeTimerExpired, shiftCryptoCurrency } from '../../actions/CryptoExchangeActions' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { connect } from '../../types/reactRedux' import { NavigationBase, NavigationProp, RouteProp } from '../../types/routerTypes' import { GuiSwapInfo } from '../../types/types' @@ -90,9 +90,9 @@ export class CryptoExchangeQuoteScreenComponent extends React.Component(bridge => ( )) } @@ -114,10 +114,10 @@ export class CryptoExchangeQuoteScreenComponent extends React.Component - + - - {showFeeWarning && } + + {showFeeWarning && } - + - {s.strings.plugin_powered_by_space + ' '} + {lstrings.plugin_powered_by_space + ' '} {' ' + exchangeName} {quote.isEstimate && ( { } if (this.props.toCurrencyCode === '') { - showWarning(`${s.strings.loan_select_receiving_wallet}`) + showWarning(`${lstrings.loan_select_receiving_wallet}`) Keyboard.dismiss() return } @@ -166,7 +166,7 @@ export class CryptoExchangeComponent extends React.Component { } if (zeroString(data.primaryNativeAmount)) { - showError(`${s.strings.no_exchange_amount}. ${s.strings.select_exchange_amount}.`) + showError(`${lstrings.no_exchange_amount}. ${lstrings.select_exchange_amount}.`) return } @@ -180,13 +180,13 @@ export class CryptoExchangeComponent extends React.Component { if (exchangeInfo != null) { const disableSrc = this.checkDisableAsset(exchangeInfo.swap.disableAssets.source, this.props.fromWalletId, this.props.fromWalletPrimaryInfo) if (disableSrc) { - showError(sprintf(s.strings.exchange_asset_unsupported, this.props.fromWalletPrimaryInfo.exchangeCurrencyCode)) + showError(sprintf(lstrings.exchange_asset_unsupported, this.props.fromWalletPrimaryInfo.exchangeCurrencyCode)) return } const disableDest = this.checkDisableAsset(exchangeInfo.swap.disableAssets.destination, this.props.toWalletId, this.props.toWalletPrimaryInfo) if (disableDest) { - showError(sprintf(s.strings.exchange_asset_unsupported, this.props.toWalletPrimaryInfo.exchangeCurrencyCode)) + showError(sprintf(lstrings.exchange_asset_unsupported, this.props.toWalletPrimaryInfo.exchangeCurrencyCode)) return } } @@ -244,7 +244,7 @@ export class CryptoExchangeComponent extends React.Component { const showNext = this.props.fromCurrencyCode !== '' && this.props.toCurrencyCode !== '' && !!parseFloat(primaryNativeAmount) if (!showNext) return null if (this.checkExceedsAmount()) return null - return + return } renderAlert = () => { @@ -254,12 +254,12 @@ export class CryptoExchangeComponent extends React.Component { const primaryNativeBalance = fromWalletBalances[fromCurrencyCode] ?? '0' if (minimumPopupModals != null && primaryNativeBalance < minimumPopupModals.minimumNativeBalance) { - return + return } if (insufficient || genericError != null) { - const title = genericError != null ? s.strings.exchange_generic_error_title : insufficient ? s.strings.exchange_insufficient_funds_title : '' - const message = genericError != null ? genericError : insufficient ? s.strings.exchange_insufficient_funds_message : '' + const title = genericError != null ? lstrings.exchange_generic_error_title : insufficient ? lstrings.exchange_insufficient_funds_title : '' + const message = genericError != null ? genericError : insufficient ? lstrings.exchange_insufficient_funds_message : '' return } @@ -267,8 +267,8 @@ export class CryptoExchangeComponent extends React.Component { return ( ) @@ -282,7 +282,7 @@ export class CryptoExchangeComponent extends React.Component { { } const isFromFocused = this.state.whichWalletFocus === 'from' const isToFocused = this.state.whichWalletFocus === 'to' - const fromHeaderText = sprintf(s.strings.exchange_from_wallet, fromWalletName) - const toHeaderText = sprintf(s.strings.exchange_to_wallet, toWalletName) + const fromHeaderText = sprintf(lstrings.exchange_from_wallet, fromWalletName) + const toHeaderText = sprintf(lstrings.exchange_to_wallet, toWalletName) return ( - + - + { focusMe={this.focusFromWallet} onNext={this.handleNext} > - {this.props.hasMaxSpend ? ( - - ) : null} + {this.props.hasMaxSpend ? : null} - + - {s.strings.exchange_congratulations} + {lstrings.exchange_congratulations} - {s.strings.exchange_congratulations_msg} + {lstrings.exchange_congratulations_msg} - {s.strings.exchange_congratulations_msg_info} + {lstrings.exchange_congratulations_msg_info} - + {this.renderConfetti()} diff --git a/src/components/scenes/CurrencyNotificationScene.tsx b/src/components/scenes/CurrencyNotificationScene.tsx index deadd6d5e86..aca9a2a605b 100644 --- a/src/components/scenes/CurrencyNotificationScene.tsx +++ b/src/components/scenes/CurrencyNotificationScene.tsx @@ -5,7 +5,7 @@ import { sprintf } from 'sprintf-js' import { newPriceChangeEvent, serverSettingsToNotificationSettings, setDeviceSettings } from '../../actions/NotificationActions' import { NewPushEvent } from '../../controllers/action-queue/types/pushApiTypes' import { useHandler } from '../../hooks/useHandler' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { RootState } from '../../reducers/RootReducer' import { useDispatch, useSelector } from '../../types/reactRedux' import { RouteProp } from '../../types/routerTypes' @@ -57,13 +57,13 @@ export const CurrencyNotificationScene = (props: Props) => { () => [ , diff --git a/src/components/scenes/CurrencySettingsScene.tsx b/src/components/scenes/CurrencySettingsScene.tsx index 483c20f0b1d..a2ce1f1016f 100644 --- a/src/components/scenes/CurrencySettingsScene.tsx +++ b/src/components/scenes/CurrencySettingsScene.tsx @@ -2,7 +2,7 @@ import * as React from 'react' import { ScrollView, Text } from 'react-native' import { setDenominationKeyRequest } from '../../actions/SettingsActions' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { getDisplayDenomination } from '../../selectors/DenominationSelectors' import { useDispatch, useSelector } from '../../types/reactRedux' import { RouteProp } from '../../types/routerTypes' @@ -31,7 +31,7 @@ export function CurrencySettingsScene(props: Props) { return ( - + {denominations.map(denomination => { const key = denomination.multiplier const isSelected = key === selectedDenominationMultiplier diff --git a/src/components/scenes/DefaultFiatSettingScene.tsx b/src/components/scenes/DefaultFiatSettingScene.tsx index 76399173117..4c8c6aee087 100644 --- a/src/components/scenes/DefaultFiatSettingScene.tsx +++ b/src/components/scenes/DefaultFiatSettingScene.tsx @@ -6,7 +6,7 @@ import { cacheStyles } from 'react-native-patina' import { setDefaultFiatRequest } from '../../actions/SettingsActions' import { FIAT_COUNTRY } from '../../constants/CountryConstants' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { getDefaultFiat } from '../../selectors/SettingsSelectors' import { connect } from '../../types/reactRedux' import { NavigationProp } from '../../types/routerTypes' @@ -65,7 +65,7 @@ export class DefaultFiatSettingComponent extends React.Component { icon={fiatCountry.logoUrl ? : } paddingRem={[0, 1]} // @ts-expect-error - subTitle={s.strings[`currency_label_${data.item.value}`]} + subTitle={lstrings[`currency_label_${data.item.value}`]} title={data.item.value} onPress={() => this.onSelectFiat(data.item)} /> @@ -83,13 +83,13 @@ export class DefaultFiatSettingComponent extends React.Component { {gap => ( - + { onSelectFiat = ({ value: selectedFiat }: { value: string }) => { const { navigation } = this.props if (!this.isValidFiat(selectedFiat)) { - Alert.alert(s.strings.fragment_create_wallet_select_valid) + Alert.alert(lstrings.fragment_create_wallet_select_valid) } else { this.setState({ selectedFiat }) Keyboard.dismiss() diff --git a/src/components/scenes/EdgeLoginScene.tsx b/src/components/scenes/EdgeLoginScene.tsx index c62233f67ef..3a468205a5f 100644 --- a/src/components/scenes/EdgeLoginScene.tsx +++ b/src/components/scenes/EdgeLoginScene.tsx @@ -5,7 +5,7 @@ import { sprintf } from 'sprintf-js' import { useAsyncEffect } from '../../hooks/useAsyncEffect' import { useHandler } from '../../hooks/useHandler' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { config } from '../../theme/appConfig' import { useSelector } from '../../types/reactRedux' import { NavigationBase, RouteProp } from '../../types/routerTypes' @@ -35,15 +35,15 @@ export const EdgeLoginScene = (props: Props) => { const warningMessage = lobby?.loginRequest?.appId === '' - ? sprintf(s.strings.edge_description_warning, lobby?.loginRequest?.displayName) - : sprintf(s.strings.access_wallet_description, config.appName) + ? sprintf(lstrings.edge_description_warning, lobby?.loginRequest?.displayName) + : sprintf(lstrings.access_wallet_description, config.appName) useAsyncEffect(async () => { try { setLobby(await account.fetchLobby(lobbyId)) } catch (error: any) { if (error.message.includes('Account does not')) { - showOkModal(s.strings.edge_login_failed, s.strings.edge_login_fail_stale_qr) + showOkModal(lstrings.edge_login_failed, lstrings.edge_login_fail_stale_qr) } else { showError(error) } @@ -57,11 +57,11 @@ export const EdgeLoginScene = (props: Props) => { try { await loginRequest.approve() navigation.pop() - showOkModal(s.strings.send_scan_edge_login_success_title, s.strings.send_scan_edge_login_success_message) + showOkModal(lstrings.send_scan_edge_login_success_title, lstrings.send_scan_edge_login_success_message) } catch (error: any) { navigation.pop() if (error.message.includes('Could not reach')) { - showOkModal(s.strings.edge_login_failed, s.strings.edge_login_fail_message) + showOkModal(lstrings.edge_login_failed, lstrings.edge_login_fail_message) } else { showError(error) } @@ -84,19 +84,19 @@ export const EdgeLoginScene = (props: Props) => { - + - + - + ) } const showOkModal = async (title: string, message: string) => { return await Airship.show<'ok' | undefined>(bridge => ( - + )) } diff --git a/src/components/scenes/EditTokenScene.tsx b/src/components/scenes/EditTokenScene.tsx index 17bb1ffdf04..9eb2941a02f 100644 --- a/src/components/scenes/EditTokenScene.tsx +++ b/src/components/scenes/EditTokenScene.tsx @@ -4,7 +4,7 @@ import * as React from 'react' import { ScrollView } from 'react-native' import { useHandler } from '../../hooks/useHandler' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { useSelector } from '../../types/reactRedux' import { NavigationProp, RouteProp } from '../../types/routerTypes' import { getWalletName } from '../../util/CurrencyWalletHelpers' @@ -52,11 +52,11 @@ function EditTokenSceneComponent(props: Props) { )) @@ -75,10 +75,10 @@ function EditTokenSceneComponent(props: Props) { // Validate input: const decimals = parseInt(decimalPlaces) if (currencyCode === '' || displayName === '' || contractAddress === '') { - return await showMessage(s.strings.addtoken_invalid_information) + return await showMessage(lstrings.addtoken_invalid_information) } if (isNaN(decimals)) { - return await showMessage(s.strings.edittoken_invalid_decimal_places) + return await showMessage(lstrings.edittoken_invalid_decimal_places) } // TODO: // We need to check for conflicts with the other tokens in the account, @@ -111,13 +111,13 @@ function EditTokenSceneComponent(props: Props) { return ( - + - + {tokenId == null ? null : ( { bridge={bridge} message={message} buttons={{ - ok: { label: s.strings.string_ok_cap } + ok: { label: lstrings.string_ok_cap } }} /> )) diff --git a/src/components/scenes/Fio/FioAddressDetailsScene.tsx b/src/components/scenes/Fio/FioAddressDetailsScene.tsx index 167fca2304b..22fc148c473 100644 --- a/src/components/scenes/Fio/FioAddressDetailsScene.tsx +++ b/src/components/scenes/Fio/FioAddressDetailsScene.tsx @@ -3,7 +3,7 @@ import * as React from 'react' import { Alert } from 'react-native' import IonIcon from 'react-native-vector-icons/Ionicons' -import s from '../../../locales/strings' +import { lstrings } from '../../../locales/strings' import { ConnectWalletsConnector as ConnectWallets } from '../../../modules/FioAddress/components/ConnectWallets' import { BUNDLED_TXS_AMOUNT_ALERT, findWalletByFioAddress } from '../../../modules/FioAddress/util' import { connect } from '../../../types/reactRedux' @@ -41,8 +41,8 @@ export class FioAddressDetails extends React.Component { const { route } = this.props const { fioAddressName } = route.params if (!fioAddressName) { - Alert.alert(s.strings.fio_address_details_screen_alert_title, s.strings.fio_address_details_screen_alert_message, [ - { text: s.strings.fio_address_details_screen_alert_button } + Alert.alert(lstrings.fio_address_details_screen_alert_title, lstrings.fio_address_details_screen_alert_message, [ + { text: lstrings.fio_address_details_screen_alert_button } ]) } this.findFioWallet() @@ -69,7 +69,7 @@ export class FioAddressDetails extends React.Component { refreshAfterAddBundledTxs: true }) } else { - showError(s.strings.fio_wallet_missing_for_fio_address) + showError(lstrings.fio_wallet_missing_for_fio_address) } } @@ -87,14 +87,14 @@ export class FioAddressDetails extends React.Component { - {!bundledTxs ? s.strings.fio_address_details_no_bundled_txs : s.strings.fio_address_details_bundled_txs_out_soon} + {!bundledTxs ? lstrings.fio_address_details_no_bundled_txs : lstrings.fio_address_details_bundled_txs_out_soon} ) } return ( - + ) @@ -104,7 +104,7 @@ export class FioAddressDetails extends React.Component { const { navigation, theme, route } = this.props const { fioAddressName, bundledTxs } = route.params const styles = getStyles(theme) - const bundledTxsLabel = `${s.strings.fio_address_details_screen_bundled_txs}: ${bundledTxs}` + const bundledTxsLabel = `${lstrings.fio_address_details_screen_bundled_txs}: ${bundledTxs}` return ( @@ -112,7 +112,7 @@ export class FioAddressDetails extends React.Component { {this.renderAccountSettings()} } - label={s.strings.fio_address_details_connect_to_wallets} + label={lstrings.fio_address_details_connect_to_wallets} /> diff --git a/src/components/scenes/Fio/FioAddressListScene.tsx b/src/components/scenes/Fio/FioAddressListScene.tsx index 2dbb3246259..0d37421f932 100644 --- a/src/components/scenes/Fio/FioAddressListScene.tsx +++ b/src/components/scenes/Fio/FioAddressListScene.tsx @@ -6,7 +6,7 @@ import IonIcon from 'react-native-vector-icons/Ionicons' import { refreshAllFioAddresses } from '../../../actions/FioAddressActions' import fioAddressLogo from '../../../assets/images/fio/fio_logo.png' import { Fontello } from '../../../assets/vector' -import s from '../../../locales/strings' +import { lstrings } from '../../../locales/strings' import { FioNameRow } from '../../../modules/FioAddress/components/FioName' import { connect } from '../../../types/reactRedux' import { NavigationProp } from '../../../types/routerTypes' @@ -72,7 +72,7 @@ export class FioAddressList extends React.Component { fetchData() { const { refreshAllFioAddresses, isConnected } = this.props if (!isConnected) { - showError(s.strings.fio_network_alert_text) + showError(lstrings.fio_network_alert_text) } refreshAllFioAddresses() } @@ -114,13 +114,13 @@ export class FioAddressList extends React.Component { const { initLoading } = this.state const styles = getStyles(theme) - const noFioDomainsText = `${s.strings.no} ${s.strings.title_fio_domains}` - const noFioAddressesText = `${s.strings.no} ${s.strings.title_fio_address}` + const noFioDomainsText = `${lstrings.no} ${lstrings.title_fio_domains}` + const noFioAddressesText = `${lstrings.no} ${lstrings.title_fio_address}` return ( <> - + {!fioAddresses.length && {noFioAddressesText}} {fioAddresses.map((address: FioAddress) => ( @@ -135,7 +135,7 @@ export class FioAddressList extends React.Component { /> ))} - + {!fioDomains.length && {noFioDomainsText}} {fioDomains.map((domain: FioDomain) => ( @@ -159,13 +159,13 @@ export class FioAddressList extends React.Component { navigation.navigate('fioAddressRegister', {})}> - {s.strings.fio_address_list_screen_button_register} + {lstrings.fio_address_list_screen_button_register} navigation.navigate('fioDomainRegister', {})}> - {s.strings.fio_address_list_domain_register} + {lstrings.fio_address_list_domain_register} diff --git a/src/components/scenes/Fio/FioAddressRegisterScene.tsx b/src/components/scenes/Fio/FioAddressRegisterScene.tsx index e325f281984..c451e0c5cf8 100644 --- a/src/components/scenes/Fio/FioAddressRegisterScene.tsx +++ b/src/components/scenes/Fio/FioAddressRegisterScene.tsx @@ -6,7 +6,7 @@ import { sprintf } from 'sprintf-js' import { createFioWallet } from '../../../actions/FioAddressActions' import { Fontello } from '../../../assets/vector' import { FIO_ADDRESS_DELIMITER, FIO_DOMAIN_DEFAULT, FIO_STR } from '../../../constants/WalletAndCurrencyConstants' -import s from '../../../locales/strings' +import { lstrings } from '../../../locales/strings' import { DomainListModal } from '../../../modules/FioAddress/components/DomainListModal' import { checkIsDomainPublic } from '../../../modules/FioAddress/util' import { connect } from '../../../types/reactRedux' @@ -129,7 +129,7 @@ export class FioAddressRegister extends React.Component { createFioWallet = async (): Promise => { const { createFioWallet } = this.props - showToast(s.strings.preparing_fio_wallet) + showToast(lstrings.preparing_fio_wallet) this.setState({ walletLoading: true }) try { const wallet = await createFioWallet() @@ -139,7 +139,7 @@ export class FioAddressRegister extends React.Component { }) } catch (e: any) { this.setState({ walletLoading: false }) - showError(s.strings.create_wallet_failed_message) + showError(lstrings.create_wallet_failed_message) } } @@ -154,7 +154,7 @@ export class FioAddressRegister extends React.Component { try { openLink(url) } catch (e: any) { - showError(sprintf(s.strings.open_url_err, url)) + showError(sprintf(lstrings.open_url_err, url)) } } @@ -163,7 +163,7 @@ export class FioAddressRegister extends React.Component { const { fioAddress, selectedWallet, selectedDomain, isValid, isAvailable, loading, walletLoading } = this.state if (isValid && isAvailable && !loading && !walletLoading) { if (isConnected) { - if (!selectedWallet) return showError(s.strings.create_wallet_failed_message) + if (!selectedWallet) return showError(lstrings.create_wallet_failed_message) const fullAddress = `${fioAddress}${FIO_ADDRESS_DELIMITER}${selectedDomain.name}` if (selectedDomain.isFree) { navigation.navigate('fioNameConfirm', { @@ -180,7 +180,7 @@ export class FioAddressRegister extends React.Component { }) } } else { - showError(s.strings.fio_network_alert_text) + showError(lstrings.fio_network_alert_text) } } } @@ -215,7 +215,7 @@ export class FioAddressRegister extends React.Component { this.setState({ loading: false, isValid: false, - errorMessage: s.strings.warning_alphanumeric + errorMessage: lstrings.warning_alphanumeric }) return } @@ -276,8 +276,8 @@ export class FioAddressRegister extends React.Component { )).then((response: string | undefined) => { if (response) { @@ -296,13 +296,13 @@ export class FioAddressRegister extends React.Component { selectFioWallet = () => { const allowedCurrencyCodes: string[] = [FIO_STR] Airship.show(bridge => ( - + )).then(({ walletId, currencyCode }: WalletListResult) => { if (walletId && currencyCode) { if (currencyCode === FIO_STR) { this.handleFioWalletChange(walletId) } else { - showError(`${s.strings.create_wallet_select_valid_crypto}: ${FIO_STR}`) + showError(`${lstrings.create_wallet_select_valid_crypto}: ${FIO_STR}`) } } }) @@ -331,7 +331,7 @@ export class FioAddressRegister extends React.Component { { const { loading } = this.state const styles = getStyles(theme) - const label = `(${s.strings.validating})` + const label = `(${lstrings.validating})` return loading ? {label} : null } @@ -357,8 +357,8 @@ export class FioAddressRegister extends React.Component { const { selectedWallet } = this.state if (fioWallets && fioWallets.length > 1) { - const title = `${selectedWallet == null ? s.strings.fio_address_register_no_wallet_name : getWalletName(selectedWallet)}` - return + const title = `${selectedWallet == null ? lstrings.fio_address_register_no_wallet_name : getWalletName(selectedWallet)}` + return } } @@ -370,14 +370,14 @@ export class FioAddressRegister extends React.Component { if (loading) return null if (fioAddress && !this.props.isConnected) { - chooseHandleErrorMessage = s.strings.fio_address_register_screen_cant_check + chooseHandleErrorMessage = lstrings.fio_address_register_screen_cant_check } if (fioAddress && !isAvailable) { - chooseHandleErrorMessage = s.strings.fio_address_register_screen_not_available + chooseHandleErrorMessage = lstrings.fio_address_register_screen_not_available } if (fioAddress && !isValid) { - chooseHandleErrorMessage = s.strings.fio_error_invalid_address + chooseHandleErrorMessage = lstrings.fio_error_invalid_address } if (fioAddress && !isValid && errorMessage) { @@ -398,7 +398,7 @@ export class FioAddressRegister extends React.Component { return ( - + {/* eslint-disable-next-line react/no-string-refs */} @@ -406,36 +406,36 @@ export class FioAddressRegister extends React.Component { - {s.strings.fio_address_first_screen_title} + {lstrings.fio_address_first_screen_title} - {s.strings.fio_address_features} + {lstrings.fio_address_features} - {s.strings.fio_address_first_screen_end} + {lstrings.fio_address_first_screen_end} - + {fioAddress ? ( {fioAddress} ) : ( - {s.strings.fio_address_register_placeholder} + {lstrings.fio_address_register_placeholder} )} {this.renderLoader()} {this.renderFioWallets()} @@ -444,7 +444,7 @@ export class FioAddressRegister extends React.Component { } - label={s.strings.fio_address_reg_free} + label={lstrings.fio_address_reg_free} /> ) : null} {this.renderErrorMessage()} diff --git a/src/components/scenes/Fio/FioAddressRegisterSelectWalletScene.tsx b/src/components/scenes/Fio/FioAddressRegisterSelectWalletScene.tsx index 2af1558d6b9..2b91130520b 100644 --- a/src/components/scenes/Fio/FioAddressRegisterSelectWalletScene.tsx +++ b/src/components/scenes/Fio/FioAddressRegisterSelectWalletScene.tsx @@ -5,7 +5,7 @@ import { ActivityIndicator, Alert, Image, ScrollView, View } from 'react-native' import { sprintf } from 'sprintf-js' import { FIO_STR } from '../../../constants/WalletAndCurrencyConstants' -import s from '../../../locales/strings' +import { lstrings } from '../../../locales/strings' import { getRegInfo } from '../../../modules/FioAddress/util' import { getDisplayDenomination, getExchangeDenomination } from '../../../selectors/DenominationSelectors' import { config } from '../../../theme/appConfig' @@ -124,7 +124,7 @@ export class FioAddressRegisterSelectWallet extends React.Component(bridge => ( - + )) if (walletId && currencyCode) { this.setState({ paymentWallet: { id: walletId, currencyCode } }) @@ -160,21 +160,21 @@ export class FioAddressRegisterSelectWallet extends React.Component { if (error) { setTimeout(() => { - showError(s.strings.create_wallet_account_error_sending_transaction) + showError(lstrings.create_wallet_account_error_sending_transaction) }, 750) } else if (edgeTransaction) { Alert.alert( - `${s.strings.fio_address_register_form_field_label} ${s.strings.fragment_wallet_unconfirmed}`, - sprintf(s.strings.fio_address_register_pending, s.strings.fio_address_register_form_field_label), - [{ text: s.strings.string_ok_cap }] + `${lstrings.fio_address_register_form_field_label} ${lstrings.fragment_wallet_unconfirmed}`, + sprintf(lstrings.fio_address_register_pending, lstrings.fio_address_register_form_field_label), + [{ text: lstrings.string_ok_cap }] ) navigation.navigate('walletsTab', { screen: 'walletList' }) } @@ -188,7 +188,7 @@ export class FioAddressRegisterSelectWallet extends React.Component - + {!selectedDomain.walletId && ( - + )} - + {!loading && ((paymentWallet && paymentWallet.id) || selectedDomain.walletId !== '') && ( - + )} {loading && } @@ -220,7 +220,7 @@ export class FioAddressRegisterSelectWallet extends React.Component diff --git a/src/components/scenes/Fio/FioAddressRegisteredScene.tsx b/src/components/scenes/Fio/FioAddressRegisteredScene.tsx index 55bfd450e3f..db698508a66 100644 --- a/src/components/scenes/Fio/FioAddressRegisteredScene.tsx +++ b/src/components/scenes/Fio/FioAddressRegisteredScene.tsx @@ -2,7 +2,7 @@ import * as React from 'react' import { Image, View } from 'react-native' import { formatDate } from '../../../locales/intl' -import s from '../../../locales/strings' +import { lstrings } from '../../../locales/strings' import { NavigationProp, RouteProp } from '../../../types/routerTypes' import { SceneWrapper } from '../../common/SceneWrapper' import { FormattedText } from '../../legacy/FormattedText/FormattedText.ui' @@ -25,7 +25,7 @@ export class FioAddressRegistered extends React.Component { return ( - {`${s.strings.fio_address_details_screen_expires} `} + {`${lstrings.fio_address_details_screen_expires} `} {formatDate(new Date(expiration))} ) @@ -46,11 +46,11 @@ export class FioAddressRegistered extends React.Component { - {s.strings.fio_address_details_screen_registered} + {lstrings.fio_address_details_screen_registered} {fioName} {this.renderExpDate()} - navigation.navigate('fioAddressList', {})} label={s.strings.title_fio_names} /> + navigation.navigate('fioAddressList', {})} label={lstrings.title_fio_names} /> ) diff --git a/src/components/scenes/Fio/FioAddressSettingsScene.tsx b/src/components/scenes/Fio/FioAddressSettingsScene.tsx index c46a9f09610..b43ec569844 100644 --- a/src/components/scenes/Fio/FioAddressSettingsScene.tsx +++ b/src/components/scenes/Fio/FioAddressSettingsScene.tsx @@ -2,7 +2,7 @@ import { EdgeCurrencyWallet } from 'edge-core-js' import * as React from 'react' import { refreshAllFioAddresses } from '../../../actions/FioAddressActions' -import s from '../../../locales/strings' +import { lstrings } from '../../../locales/strings' import { FioActionSubmit } from '../../../modules/FioAddress/components/FioActionSubmit' import { addBundledTxs, getAddBundledTxsFee, getTransferFee } from '../../../modules/FioAddress/util' import { connect } from '../../../types/reactRedux' @@ -56,7 +56,7 @@ export class FioAddressSettingsComponent extends React.Component(bridge => ( - + {transferredMessage} )) @@ -93,7 +93,7 @@ export class FioAddressSettingsComponent extends React.Component - - {bundledTxs != null ? : null} + + {bundledTxs != null ? : null} {showAddBundledTxs && ( - - + + )} diff --git a/src/components/scenes/Fio/FioConnectWalletConfirmScene.tsx b/src/components/scenes/Fio/FioConnectWalletConfirmScene.tsx index 1a3300bb18d..85235c39a7f 100644 --- a/src/components/scenes/Fio/FioConnectWalletConfirmScene.tsx +++ b/src/components/scenes/Fio/FioConnectWalletConfirmScene.tsx @@ -1,7 +1,7 @@ import * as React from 'react' import { ScrollView } from 'react-native' -import s from '../../../locales/strings' +import { lstrings } from '../../../locales/strings' import { FIO_NO_BUNDLED_ERR_CODE, updatePubAddressesForFioAddress } from '../../../modules/FioAddress/util' import { CcWalletMap } from '../../../reducers/FioReducer' import { connect } from '../../../types/reactRedux' @@ -124,9 +124,9 @@ export class FioConnectWalletConfirm extends React.Component { throw eitherError } if (walletsToConnect.length) { - showToast(s.strings.fio_connect_wallets_success) + showToast(lstrings.fio_connect_wallets_success) } else { - if (walletsToDisconnect.length) showToast(s.strings.fio_disconnect_wallets_success) + if (walletsToDisconnect.length) showToast(lstrings.fio_disconnect_wallets_success) } navigation.goBack() } catch (e: any) { @@ -135,10 +135,10 @@ export class FioConnectWalletConfirm extends React.Component { const answer = await Airship.show<'ok' | undefined>(bridge => ( @@ -157,7 +157,7 @@ export class FioConnectWalletConfirm extends React.Component { } this.setState({ connectWalletsLoading: false }) } else { - showError(s.strings.fio_network_alert_text) + showError(lstrings.fio_network_alert_text) } } @@ -190,22 +190,22 @@ export class FioConnectWalletConfirm extends React.Component { return ( - + {walletsToConnect.length ? ( - + {walletsToConnect.map(this.renderWalletLine)} ) : null} {walletsToDisconnect.length ? ( - + {walletsToDisconnect.map(this.renderWalletLine)} ) : null} - {s.strings.fio_connect_checkbox_text} + {lstrings.fio_connect_checkbox_text} {showSlider && ( @@ -213,7 +213,7 @@ export class FioConnectWalletConfirm extends React.Component { parentStyle={styles.slider} onSlidingComplete={this.confirm} disabled={!acknowledge || connectWalletsLoading} - disabledText={s.strings.send_confirmation_slide_to_confirm} + disabledText={lstrings.send_confirmation_slide_to_confirm} showSpinner={connectWalletsLoading} /> )} diff --git a/src/components/scenes/Fio/FioCreateHandleScene.tsx b/src/components/scenes/Fio/FioCreateHandleScene.tsx index 639098914b1..182dd06229a 100644 --- a/src/components/scenes/Fio/FioCreateHandleScene.tsx +++ b/src/components/scenes/Fio/FioCreateHandleScene.tsx @@ -10,7 +10,7 @@ import { createFioWallet, refreshAllFioAddresses } from '../../../actions/FioAdd import { FIO_ADDRESS_DELIMITER } from '../../../constants/WalletAndCurrencyConstants' import { useAsyncEffect } from '../../../hooks/useAsyncEffect' import { useHandler } from '../../../hooks/useHandler' -import s from '../../../locales/strings' +import { lstrings } from '../../../locales/strings' import { useDispatch, useSelector } from '../../../types/reactRedux' import { NavigationProp, RouteProp } from '../../../types/routerTypes' import { getFioCustomizeHandleImage } from '../../../util/CdnUris' @@ -56,7 +56,7 @@ export const FioCreateHandleScene = ({ navigation, route }: Props) => { const accountUserName = useSelector(state => state.core.account.username) const fioPlugin = useSelector(state => state.core.account.currencyConfig.fio) if (fioPlugin.otherMethods == null) { - showError(s.strings.fio_register_handle_error) + showError(lstrings.fio_register_handle_error) navigation.pop() } @@ -92,7 +92,7 @@ export const FioCreateHandleScene = ({ navigation, route }: Props) => { const fioAccountName = `${fioHandle}${domainStr}` if (!(await fioPlugin.otherMethods.validateAccount(fioAccountName))) { if (!mounted.current) return - setErrorText(sprintf(s.strings.fio_register_handle_taken_error_s, fioAccountName)) + setErrorText(sprintf(lstrings.fio_register_handle_taken_error_s, fioAccountName)) } // Register handle @@ -130,7 +130,7 @@ export const FioCreateHandleScene = ({ navigation, route }: Props) => { // Registration fetch failed console.error(JSON.stringify(e, null, 2)) if (!mounted.current) return - setErrorText(s.strings.fio_register_handle_error) + setErrorText(lstrings.fio_register_handle_error) } } @@ -178,7 +178,7 @@ export const FioCreateHandleScene = ({ navigation, route }: Props) => { try { setDomainStr(`${FIO_ADDRESS_DELIMITER}${asFreeFioDomain(domains[0]).domain}`) } catch (e) { - setErrorText(s.strings.fio_register_handle_error) + setErrorText(lstrings.fio_register_handle_error) } } // eslint-disable-next-line react-hooks/exhaustive-deps @@ -200,7 +200,7 @@ export const FioCreateHandleScene = ({ navigation, route }: Props) => { - {s.strings.personalize_wallet_title} + {lstrings.personalize_wallet_title} { - + diff --git a/src/components/scenes/Fio/FioDomainRegisterScene.tsx b/src/components/scenes/Fio/FioDomainRegisterScene.tsx index c894ac7df90..ec07f1e9659 100644 --- a/src/components/scenes/Fio/FioDomainRegisterScene.tsx +++ b/src/components/scenes/Fio/FioDomainRegisterScene.tsx @@ -5,7 +5,7 @@ import IonIcon from 'react-native-vector-icons/Ionicons' import { createFioWallet } from '../../../actions/FioAddressActions' import { FIO_STR } from '../../../constants/WalletAndCurrencyConstants' -import s from '../../../locales/strings' +import { lstrings } from '../../../locales/strings' import { connect } from '../../../types/reactRedux' import { NavigationProp } from '../../../types/routerTypes' import { getWalletName } from '../../../util/CurrencyWalletHelpers' @@ -73,7 +73,7 @@ export class FioDomainRegister extends React.PureComponent { createFioWallet = async (): Promise => { const { createFioWallet } = this.props - showToast(s.strings.preparing_fio_wallet) + showToast(lstrings.preparing_fio_wallet) this.setState({ walletLoading: true }) try { const wallet = await createFioWallet() @@ -83,7 +83,7 @@ export class FioDomainRegister extends React.PureComponent { }) } catch (e: any) { this.setState({ walletLoading: false }) - showError(s.strings.create_wallet_failed_message) + showError(lstrings.create_wallet_failed_message) } } @@ -92,14 +92,14 @@ export class FioDomainRegister extends React.PureComponent { const { fioDomain, selectedWallet, isValid, isAvailable, loading, walletLoading } = this.state if (isValid && isAvailable && !loading && !walletLoading) { if (isConnected) { - if (!selectedWallet) return showError(s.strings.create_wallet_failed_message) + if (!selectedWallet) return showError(lstrings.create_wallet_failed_message) navigation.navigate('fioDomainRegisterSelectWallet', { fioDomain, selectedWallet }) } } else { - showError(s.strings.fio_network_alert_text) + showError(lstrings.fio_network_alert_text) } } @@ -127,7 +127,7 @@ export class FioDomainRegister extends React.PureComponent { this.setState({ loading: false, isValid: false, - errorMessage: s.strings.warning_alphanumeric + errorMessage: lstrings.warning_alphanumeric }) return } @@ -186,13 +186,13 @@ export class FioDomainRegister extends React.PureComponent { selectFioWallet = async () => { const allowedCurrencyCodes: string[] = [FIO_STR] const { walletId, currencyCode } = await Airship.show(bridge => ( - + )) if (walletId && currencyCode) { if (currencyCode === FIO_STR) { this.handleFioWalletChange(walletId) } else { - showError(`${s.strings.create_wallet_select_valid_crypto}: ${FIO_STR}`) + showError(`${lstrings.create_wallet_select_valid_crypto}: ${FIO_STR}`) } } } @@ -201,7 +201,7 @@ export class FioDomainRegister extends React.PureComponent { this.handleFioDomainFocus() const fioDomain = await Airship.show(bridge => ( - + )) if (fioDomain) this.handleFioDomainChange(fioDomain) } @@ -213,7 +213,7 @@ export class FioDomainRegister extends React.PureComponent { return ( { return ( ) } @@ -246,10 +246,10 @@ export class FioDomainRegister extends React.PureComponent { const styles = getStyles(theme) let chooseHandleErrorMessage = '' if (fioDomain && !this.props.isConnected) { - chooseHandleErrorMessage = s.strings.fio_address_register_screen_cant_check + chooseHandleErrorMessage = lstrings.fio_address_register_screen_cant_check } if (fioDomain && !isAvailable) { - chooseHandleErrorMessage = s.strings.fio_address_register_screen_not_available + chooseHandleErrorMessage = lstrings.fio_address_register_screen_not_available } if (fioDomain && !isValid && errorMessage) { @@ -258,23 +258,23 @@ export class FioDomainRegister extends React.PureComponent { return ( - + {/* eslint-disable-next-line react/no-string-refs */} - {s.strings.fio_domain_reg_text} + {lstrings.fio_domain_reg_text} - {s.strings.fio_domain_reg_descr} + {lstrings.fio_domain_reg_descr} - + {fioDomain} - {loading ? `(${s.strings.loading})` : ''} + {loading ? `(${lstrings.loading})` : ''} diff --git a/src/components/scenes/Fio/FioDomainRegisterSelectWalletScene.tsx b/src/components/scenes/Fio/FioDomainRegisterSelectWalletScene.tsx index c02e96eaf03..f38a7bb6969 100644 --- a/src/components/scenes/Fio/FioDomainRegisterSelectWalletScene.tsx +++ b/src/components/scenes/Fio/FioDomainRegisterSelectWalletScene.tsx @@ -6,7 +6,7 @@ import IonIcon from 'react-native-vector-icons/Ionicons' import { sprintf } from 'sprintf-js' import { FIO_STR } from '../../../constants/WalletAndCurrencyConstants' -import s from '../../../locales/strings' +import { lstrings } from '../../../locales/strings' import { getDomainRegInfo } from '../../../modules/FioAddress/util' import { getDisplayDenomination, getExchangeDenomination } from '../../../selectors/DenominationSelectors' import { config } from '../../../theme/appConfig' @@ -109,7 +109,7 @@ class FioDomainRegisterSelectWallet extends React.PureComponent(bridge => ( - + )) if (walletId && currencyCode) { this.setState({ paymentWallet: { id: walletId, currencyCode } }) @@ -148,23 +148,23 @@ class FioDomainRegisterSelectWallet extends React.PureComponent { if (error) { setTimeout(() => { - showError(s.strings.create_wallet_account_error_sending_transaction) + showError(lstrings.create_wallet_account_error_sending_transaction) }, 750) } else if (edgeTransaction) { Airship.show<'ok' | undefined>(bridge => ( )) navigation.navigate('walletsTab', { screen: 'walletList' }) @@ -179,7 +179,7 @@ class FioDomainRegisterSelectWallet extends React.PureComponent {detailsText} - - + + {!loading && paymentWallet && paymentWallet.id && ( - + )} {errorMessage && ( diff --git a/src/components/scenes/Fio/FioDomainSettingsScene.tsx b/src/components/scenes/Fio/FioDomainSettingsScene.tsx index 15fc7587ea2..44a157d706d 100644 --- a/src/components/scenes/Fio/FioDomainSettingsScene.tsx +++ b/src/components/scenes/Fio/FioDomainSettingsScene.tsx @@ -4,7 +4,7 @@ import * as React from 'react' import { refreshAllFioAddresses } from '../../../actions/FioAddressActions' import { FIO_ADDRESS_DELIMITER } from '../../../constants/WalletAndCurrencyConstants' import { formatDate } from '../../../locales/intl' -import s from '../../../locales/strings' +import { lstrings } from '../../../locales/strings' import { FioActionSubmit } from '../../../modules/FioAddress/components/FioActionSubmit' import { getDomainSetVisibilityFee, getRenewalFee, getTransferFee, renewFioDomain, setDomainVisibility } from '../../../modules/FioAddress/util' import { connect } from '../../../types/reactRedux' @@ -63,9 +63,9 @@ export class FioDomainSettingsComponent extends React.Component { const { fioDomainName } = route.params const styles = getStyles(theme) const domainName = `@${fioDomainName || ''}` - const transferredMessage = ` ${s.strings.fio_domain_transferred.toLowerCase()}` + const transferredMessage = ` ${lstrings.fio_domain_transferred.toLowerCase()}` await Airship.show<'ok' | undefined>(bridge => ( - + {domainName} {transferredMessage} @@ -100,7 +100,7 @@ export class FioDomainSettingsComponent extends React.Component { const { fioDomainName, isPublic } = route.params if (!isConnected) { - showError(s.strings.fio_network_alert_text) + showError(lstrings.fio_network_alert_text) return } await setDomainVisibility(fioWallet, fioDomainName, !isPublic, fee) @@ -111,7 +111,7 @@ export class FioDomainSettingsComponent extends React.Component { const { fioDomainName } = route.params if (!isConnected) { - throw new Error(s.strings.fio_network_alert_text) + throw new Error(lstrings.fio_network_alert_text) } await renewFioDomain(fioWallet, fioDomainName, renewalFee) @@ -120,7 +120,7 @@ export class FioDomainSettingsComponent extends React.Component { goToTransfer = (params: { fee: number }) => { const { navigation } = this.props const { fee: transferFee } = params - if (!transferFee) return showError(s.strings.fio_get_fee_err_msg) + if (!transferFee) return showError(lstrings.fio_get_fee_err_msg) this.cancelOperation() const { route } = this.props const { fioDomainName, fioWallet } = route.params @@ -153,7 +153,7 @@ export class FioDomainSettingsComponent extends React.Component { amount: true, fioAddressSelect: true }, - infoTiles: [{ label: s.strings.fio_domain_to_transfer, value: `@${fioDomainName}` }] + infoTiles: [{ label: lstrings.fio_domain_to_transfer, value: `@${fioDomainName}` }] }) } @@ -165,16 +165,16 @@ export class FioDomainSettingsComponent extends React.Component { return ( - - + + {showVisibility && ( { onSuccess={this.afterSuccess} cancelOperation={this.cancelOperation} getOperationFee={this.getRenewalFee} - successMessage={s.strings.fio_request_renew_domain_ok_text} + successMessage={lstrings.fio_request_renew_domain_ok_text} fioWallet={fioWallet} showPaymentWalletPicker navigation={this.props.navigation} @@ -197,12 +197,12 @@ export class FioDomainSettingsComponent extends React.Component { )} {!showRenew && !showVisibility && !showTransfer && ( <> - - + + )} diff --git a/src/components/scenes/Fio/FioNameConfirmScene.tsx b/src/components/scenes/Fio/FioNameConfirmScene.tsx index fc01fa70667..865abb07200 100644 --- a/src/components/scenes/Fio/FioNameConfirmScene.tsx +++ b/src/components/scenes/Fio/FioNameConfirmScene.tsx @@ -3,7 +3,7 @@ import * as React from 'react' import { View } from 'react-native' import { FIO_ADDRESS_DELIMITER } from '../../../constants/WalletAndCurrencyConstants' -import s from '../../../locales/strings' +import { lstrings } from '../../../locales/strings' import { FioActionSubmit } from '../../../modules/FioAddress/components/FioActionSubmit' import { fioMakeSpend, fioSignAndBroadcast } from '../../../modules/FioAddress/util' import { connect } from '../../../types/reactRedux' @@ -46,13 +46,13 @@ class FioNameConfirm extends React.PureComponent { const { isConnected, fioPlugin } = this.props if (!isConnected) { - throw new Error(s.strings.fio_network_alert_text) + throw new Error(lstrings.fio_network_alert_text) } if (!fee) { if (this.isFioAddress()) { if (!fioPlugin) { - throw new Error(s.strings.fio_register_address_err_msg) + throw new Error(lstrings.fio_register_address_err_msg) } const response = await fioPlugin.otherMethods.buyAddressRequest( { @@ -71,9 +71,9 @@ class FioNameConfirm extends React.PureComponent { await Airship.show<'ok' | undefined>(bridge => ( )) return navigation.navigate('fioAddressRegisterSelectWallet', { @@ -96,15 +96,15 @@ class FioNameConfirm extends React.PureComponent { await Airship.show<'ok' | undefined>(bridge => ( )) navigation.navigate('walletsTab', { screen: 'walletList' }) } else { // no free domains - showError(s.strings.fio_get_fee_err_msg) + showError(lstrings.fio_get_fee_err_msg) } } else { try { @@ -132,7 +132,7 @@ class FioNameConfirm extends React.PureComponent { ) } } catch (e: any) { - showError(s.strings.fio_register_address_err_msg) + showError(lstrings.fio_register_address_err_msg) } } } @@ -144,11 +144,11 @@ class FioNameConfirm extends React.PureComponent { return ( - + diff --git a/src/components/scenes/Fio/FioRequestConfirmationScene.tsx b/src/components/scenes/Fio/FioRequestConfirmationScene.tsx index e2d52021023..911415f2778 100644 --- a/src/components/scenes/Fio/FioRequestConfirmationScene.tsx +++ b/src/components/scenes/Fio/FioRequestConfirmationScene.tsx @@ -4,7 +4,7 @@ import * as React from 'react' import { View } from 'react-native' import { formatNumber } from '../../../locales/intl' -import s from '../../../locales/strings' +import { lstrings } from '../../../locales/strings' import { addToFioAddressCache, checkPubAddress, @@ -126,7 +126,7 @@ export class FioRequestConfirmationConnected extends React.Component(bridge => ( @@ -171,7 +171,7 @@ export class FioRequestConfirmationConnected extends React.Component(bridge => ( - + )) if (fioAddressFrom == null) return if (fioPlugin && !(await fioPlugin.otherMethods.doesAccountExist(fioAddressFrom))) - return showError(`${s.strings.send_fio_request_error_addr_not_exist}${fioAddressFrom ? '\n' + fioAddressFrom : ''}`) - if (!walletAddresses.find(({ fioAddress }) => fioAddress === fioAddressFrom)) return showError(s.strings.fio_wallet_missing_for_fio_address) // Check if valid owned fio address - if (fioAddressFrom === this.state.fioAddressTo) return showError(s.strings.fio_confirm_request_error_from_same) + return showError(`${lstrings.send_fio_request_error_addr_not_exist}${fioAddressFrom ? '\n' + fioAddressFrom : ''}`) + if (!walletAddresses.find(({ fioAddress }) => fioAddress === fioAddressFrom)) return showError(lstrings.fio_wallet_missing_for_fio_address) // Check if valid owned fio address + if (fioAddressFrom === this.state.fioAddressTo) return showError(lstrings.fio_confirm_request_error_from_same) this.setState({ fioAddressFrom }) } @@ -250,14 +250,14 @@ export class FioRequestConfirmationConnected extends React.Component(bridge => ( - + )) if (fioAddressTo == null) { this.showError() } else if (fioPlugin && !(await fioPlugin.otherMethods.doesAccountExist(fioAddressTo))) { - this.showError(`${s.strings.send_fio_request_error_addr_not_exist}${fioAddressTo ? '\n' + fioAddressTo : ''}`) + this.showError(`${lstrings.send_fio_request_error_addr_not_exist}${fioAddressTo ? '\n' + fioAddressTo : ''}`) } else if (this.state.fioAddressFrom === fioAddressTo) { - this.showError(s.strings.fio_confirm_request_error_to_same) + this.showError(lstrings.fio_confirm_request_error_to_same) } else { this.setState({ fioAddressTo, settingFioAddressTo: false }) } @@ -268,16 +268,16 @@ export class FioRequestConfirmationConnected extends React.Component )) if (memo == null) return - if (memo.length > 64) return showError(s.strings.send_fio_request_error_memo_inline) - if (memo && !/^[\x20-\x7E\x85\n]*$/.test(memo)) return showError(s.strings.send_fio_request_error_memo_invalid_character) + if (memo.length > 64) return showError(lstrings.send_fio_request_error_memo_inline) + if (memo && !/^[\x20-\x7E\x85\n]*$/.test(memo)) return showError(lstrings.send_fio_request_error_memo_invalid_character) this.setState({ memo }) } @@ -304,18 +304,18 @@ export class FioRequestConfirmationConnected extends React.Component - + - - + + {fioAddressFrom.length > 0 && fioAddressTo.length > 0 && showSlider ? ( - + ) : null} diff --git a/src/components/scenes/Fio/FioRequestListScene.tsx b/src/components/scenes/Fio/FioRequestListScene.tsx index 11375567457..3e995659755 100644 --- a/src/components/scenes/Fio/FioRequestListScene.tsx +++ b/src/components/scenes/Fio/FioRequestListScene.tsx @@ -7,7 +7,7 @@ import { sprintf } from 'sprintf-js' import { refreshAllFioAddresses } from '../../../actions/FioAddressActions' import { SPECIAL_CURRENCY_INFO } from '../../../constants/WalletAndCurrencyConstants' import { formatDate, SHORT_DATE_FMT } from '../../../locales/intl' -import s from '../../../locales/strings' +import { lstrings } from '../../../locales/strings' import { addToFioAddressCache, cancelFioRequest, @@ -179,7 +179,7 @@ class FioRequestList extends React.Component { paging[fioPublicKey]++ } } catch (e: any) { - throw new Error(s.strings.fio_get_requests_error) + throw new Error(lstrings.fio_get_requests_error) } } return nextFioRequests @@ -190,10 +190,10 @@ class FioRequestList extends React.Component { const answer = await Airship.show<'ok' | undefined>(bridge => ( @@ -220,7 +220,7 @@ class FioRequestList extends React.Component { rejectFioRequest = async (request: FioRequest) => { const payerFioAddress = request.payer_fio_address if (!this.props.isConnected) { - showError(s.strings.fio_network_alert_text) + showError(lstrings.fio_network_alert_text) return } this.setState({ fullScreenLoader: true }) @@ -237,13 +237,13 @@ class FioRequestList extends React.Component { edgeTx = await fioSignAndBroadcast(fioWallet, edgeTx) await fioWallet.saveTx(edgeTx) this.removeFioPendingRequest(request.fio_request_id) - showToast(s.strings.fio_reject_status) + showToast(lstrings.fio_reject_status) } } catch (e: any) { - showError(s.strings.fio_reject_request_error) + showError(lstrings.fio_reject_request_error) } } else { - showError(s.strings.err_no_address_title) + showError(lstrings.err_no_address_title) } this.setState({ fullScreenLoader: false }) } @@ -251,7 +251,7 @@ class FioRequestList extends React.Component { cancelFioRequest = async (request: FioRequest) => { const payeeFioAddress = request.payee_fio_address if (!this.props.isConnected) { - showError(s.strings.fio_network_alert_text) + showError(lstrings.fio_network_alert_text) return } this.setState({ fullScreenLoader: true }) @@ -262,7 +262,7 @@ class FioRequestList extends React.Component { try { await cancelFioRequest(fioWallet, request.fio_request_id, payeeFioAddress) this.removeFioSentRequest(request.fio_request_id) - showToast(s.strings.fio_cancel_status) + showToast(lstrings.fio_cancel_status) } catch (e: any) { this.setState({ fullScreenLoader: false }) if (e.code === FIO_NO_BUNDLED_ERR_CODE) { @@ -272,7 +272,7 @@ class FioRequestList extends React.Component { } } } else { - showError(s.strings.fio_wallet_missing_for_fio_request) + showError(lstrings.fio_wallet_missing_for_fio_request) } this.setState({ fullScreenLoader: false }) } @@ -281,11 +281,11 @@ class FioRequestList extends React.Component { const answer = await Airship.show<'yes' | 'cancel' | undefined>(bridge => ( )) @@ -298,11 +298,11 @@ class FioRequestList extends React.Component { const answer = await Airship.show<'yes' | 'no' | undefined>(bridge => ( )) @@ -318,7 +318,7 @@ class FioRequestList extends React.Component { selectPendingRequest = (fioRequest: FioRequest) => { if (!this.props.isConnected) { - showError(s.strings.fio_network_alert_text) + showError(lstrings.fio_network_alert_text) return } const { account, onSelectWallet } = this.props @@ -355,9 +355,9 @@ class FioRequestList extends React.Component { Airship.show<'ok' | undefined>(bridge => ( )) } @@ -369,7 +369,7 @@ class FioRequestList extends React.Component { pluginId => (SPECIAL_CURRENCY_INFO[pluginId].fioChainCode ?? SPECIAL_CURRENCY_INFO[pluginId].chainCode) === content.chain_code.toUpperCase() ) if (pluginId == null) { - showError(sprintf(s.strings.fio_request_unknown_chain_code, content.chain_code.toUpperCase())) + showError(sprintf(lstrings.fio_request_unknown_chain_code, content.chain_code.toUpperCase())) return } @@ -378,7 +378,7 @@ class FioRequestList extends React.Component { const allowedAssets = [{ pluginId, tokenId }] const { walletId, currencyCode } = await Airship.show(bridge => ( - + )) if (walletId && currencyCode) { onSelectWallet(walletId, currencyCode) @@ -389,7 +389,7 @@ class FioRequestList extends React.Component { sendCrypto = async (pendingRequest: FioRequest, walletId: string, selectedCurrencyCode: string) => { const { fioWallets = [], currencyWallets, navigation, getExchangeDenomination } = this.props const fioWalletByAddress = fioWallets.find(wallet => wallet.id === pendingRequest.fioWalletId) || null - if (!fioWalletByAddress) return showError(s.strings.fio_wallet_missing_for_fio_address) + if (!fioWalletByAddress) return showError(lstrings.fio_wallet_missing_for_fio_address) const currencyWallet = currencyWallets[walletId] const exchangeDenomination = getExchangeDenomination(currencyWallet.currencyInfo.pluginId, pendingRequest.content.token_code.toUpperCase()) let nativeAmount = mul(pendingRequest.content.amount, exchangeDenomination.multiplier) @@ -423,11 +423,11 @@ class FioRequestList extends React.Component { payerFioAddress: pendingRequest.payer_fio_address }) if (edgeTx.networkFee !== '0') { - showError(s.strings.fio_no_bundled_err_msg) - throw new Error(s.strings.fio_no_bundled_err_msg) + showError(lstrings.fio_no_bundled_err_msg) + throw new Error(lstrings.fio_no_bundled_err_msg) } } catch (e: any) { - showError(s.strings.fio_get_fee_err_msg) + showError(lstrings.fio_get_fee_err_msg) throw e } }, @@ -450,7 +450,7 @@ class FioRequestList extends React.Component { selectSentRequest = (fioRequest: FioRequest) => { const { navigation } = this.props if (!this.props.isConnected) { - showError(s.strings.fio_network_alert_text) + showError(lstrings.fio_network_alert_text) return } navigation.navigate('fioSentRequestDetails', { @@ -530,9 +530,9 @@ class FioRequestList extends React.Component { {fullScreenLoader && } - + - {!loadingPending && !fioRequestsPending.length ? {s.strings.fio_no_requests_label} : null} + {!loadingPending && !fioRequestsPending.length ? {lstrings.fio_no_requests_label} : null} {loadingPending && !fioRequestsPending.length && } { - + - {!loadingSent && !fioRequestsSent.length ? {s.strings.fio_no_requests_label} : null} + {!loadingSent && !fioRequestsSent.length ? {lstrings.fio_no_requests_label} : null} {loadingSent && !fioRequestsSent.length && } { const { amount } = content const tokenCode = content.token_code.toUpperCase() const text = `${amount} ${tokenCode} (${fiatSymbol} ${this.fiatAmount(tokenCode, amount)})` - return + return } statusField = (status: string) => { const styles = getStyles(this.props.theme) - let statusLabel = {s.strings.fragment_wallet_unconfirmed} + let statusLabel = {lstrings.fragment_wallet_unconfirmed} if (isSentFioRequest(status)) { - statusLabel = {s.strings.fragment_transaction_list_receive_prefix} + statusLabel = {lstrings.fragment_transaction_list_receive_prefix} } if (isRejectedFioRequest(status)) { - statusLabel = {s.strings.fio_reject_status} + statusLabel = {lstrings.fio_reject_status} } return ( - + {statusLabel} ) @@ -71,14 +71,14 @@ class FioSentRequestDetailsComponent extends React.PureComponent { return ( - + {this.amountField()} - - + + {this.statusField(selectedFioSentRequest.status)} - - + + ) } diff --git a/src/components/scenes/Fio/FioStakingChangeScene.tsx b/src/components/scenes/Fio/FioStakingChangeScene.tsx index 1c661c07f3e..3501a271bac 100644 --- a/src/components/scenes/Fio/FioStakingChangeScene.tsx +++ b/src/components/scenes/Fio/FioStakingChangeScene.tsx @@ -9,7 +9,7 @@ import { refreshAllFioAddresses } from '../../../actions/FioAddressActions' import fioLogo from '../../../assets/images/fio/fio_logo.png' import { SPECIAL_CURRENCY_INFO, STAKING_BALANCES } from '../../../constants/WalletAndCurrencyConstants' import { formatNumber, formatTimeDate, SHORT_DATE_FMT } from '../../../locales/intl' -import s from '../../../locales/strings' +import { lstrings } from '../../../locales/strings' import { getDisplayDenomination, getExchangeDenomination } from '../../../selectors/DenominationSelectors' import { convertCurrency } from '../../../selectors/WalletSelectors' import { connect } from '../../../types/reactRedux' @@ -111,14 +111,14 @@ export const FioStakingChangeSceneComponent = (props: Props) => { } const handleSubmit = async () => { - if (tx == null) return setError(s.strings.create_wallet_account_error_sending_transaction) + if (tx == null) return setError(lstrings.create_wallet_account_error_sending_transaction) setLoading(true) try { const signedTx = await currencyWallet.signTx(tx) await currencyWallet.broadcastTx(signedTx) const messages = { - add: s.strings.staking_success, - remove: s.strings.staking_unstake_success + add: lstrings.staking_success, + remove: lstrings.staking_unstake_success } showToast(messages[change]) navigation.goBack() @@ -148,10 +148,10 @@ export const FioStakingChangeSceneComponent = (props: Props) => { return ( }> - {s.strings.staking_change_unlock_explainer_title} + {lstrings.staking_change_unlock_explainer_title} - {s.strings.staking_change_unlock_explainer1} - {s.strings.staking_change_unlock_explainer2} + {lstrings.staking_change_unlock_explainer1} + {lstrings.staking_change_unlock_explainer2} ) @@ -184,7 +184,7 @@ export const FioStakingChangeSceneComponent = (props: Props) => { // If no address is found, we do not define the selectedFioAddress if (fioAddress == null) return // Addresses must have at least 1 bundled transaction; we rely on bundle txs and don't yet support fee-based tx for staking - if (fioAddress.bundledTxs < 1) return setError(new Error(sprintf(s.strings.staking_no_bundled_txs_error, fioAddress.name))) + if (fioAddress.bundledTxs < 1) return setError(new Error(sprintf(lstrings.staking_no_bundled_txs_error, fioAddress.name))) setSelectedFioAddress(fioAddress.name) } @@ -199,7 +199,7 @@ export const FioStakingChangeSceneComponent = (props: Props) => { // If the selectedFioAddress is not defined, then we will not be able to complete the transaction. if (selectedFioAddress == null) { - setError(new Error(s.strings.staking_no_fio_address_error)) + setError(new Error(lstrings.staking_no_fio_address_error)) return } @@ -237,17 +237,17 @@ export const FioStakingChangeSceneComponent = (props: Props) => { }, [nativeAmount]) const renderAdd = () => { - const apyValue = sprintf(apy === maxApy ? s.strings.staking_estimated_return_up_to : s.strings.staking_estimated_return, `${apy}%`) + const apyValue = sprintf(apy === maxApy ? lstrings.staking_estimated_return_up_to : lstrings.staking_estimated_return, `${apy}%`) return ( <> - + - {s.strings.staking_change_explaner1} - {s.strings.staking_change_explaner2} + {lstrings.staking_change_explaner1} + {lstrings.staking_change_explaner2} - + {exchangeAmount} {apy != null && apy !== 0 && ( @@ -268,18 +268,18 @@ export const FioStakingChangeSceneComponent = (props: Props) => { } return ( <> - + - + {exchangeAmount} {estReward !== '0' && ( - + {estReward} )} - + {unlockDateFormat} @@ -290,7 +290,7 @@ export const FioStakingChangeSceneComponent = (props: Props) => { if (error == null) return null return ( - + {String(error)} diff --git a/src/components/scenes/Fio/FioStakingOverviewScene.tsx b/src/components/scenes/Fio/FioStakingOverviewScene.tsx index 73d1573b765..4c5ac55c446 100644 --- a/src/components/scenes/Fio/FioStakingOverviewScene.tsx +++ b/src/components/scenes/Fio/FioStakingOverviewScene.tsx @@ -9,7 +9,7 @@ import fioLogo from '../../../assets/images/fio/fio_logo.png' import { getSymbolFromCurrency, STAKING_BALANCES } from '../../../constants/WalletAndCurrencyConstants' import { useWatch } from '../../../hooks/useWatch' import { formatNumber, formatTimeDate } from '../../../locales/intl' -import s from '../../../locales/strings' +import { lstrings } from '../../../locales/strings' import { getDisplayDenomination, getExchangeDenomination } from '../../../selectors/DenominationSelectors' import { convertCurrency } from '../../../selectors/WalletSelectors' import { connect } from '../../../types/reactRedux' @@ -76,7 +76,7 @@ export const FioStakingOverviewSceneComponent = (props: Props) => { // @ts-expect-error Flow does not understand that unlockDate here can't be undefined id: new Date(unlockDate).toDateString(), // @ts-expect-error Flow does not understand that unlockDate here can't be undefined - title: sprintf(s.strings.staking_locked_title, formatTimeDate(new Date(unlockDate), true)), + title: sprintf(lstrings.staking_locked_title, formatTimeDate(new Date(unlockDate), true)), amount: formatNumber(add(convertNativeToDenomination(currencyDenomination.multiplier)(nativeAmount), '0')) })) ) @@ -104,11 +104,11 @@ export const FioStakingOverviewSceneComponent = (props: Props) => { return ( - + - {s.strings.staking_overview_explainer} + {lstrings.staking_overview_explainer} {staked} @@ -118,8 +118,8 @@ export const FioStakingOverviewSceneComponent = (props: Props) => { {renderItems()} - - + + ) diff --git a/src/components/scenes/FormScene.tsx b/src/components/scenes/FormScene.tsx index 3e7f7bcd7ae..03e4aeb0725 100644 --- a/src/components/scenes/FormScene.tsx +++ b/src/components/scenes/FormScene.tsx @@ -2,7 +2,7 @@ import * as React from 'react' import { View } from 'react-native' import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { SceneWrapper } from '../common/SceneWrapper' import { cacheStyles, Theme, useTheme } from '../services/ThemeContext' import { SafeSlider } from '../themed/SafeSlider' @@ -29,7 +29,7 @@ export const FormScene = (props: Props) => { {children} - + diff --git a/src/components/scenes/GettingStartedScene.tsx b/src/components/scenes/GettingStartedScene.tsx index 6423ee28b87..a34a8545ad6 100644 --- a/src/components/scenes/GettingStartedScene.tsx +++ b/src/components/scenes/GettingStartedScene.tsx @@ -11,7 +11,7 @@ import slide2HeroImage from '../../assets/images/gettingStarted/slide2HeroImage. import slide3HeroImage from '../../assets/images/gettingStarted/slide3HeroImage.png' import slide4HeroImage from '../../assets/images/gettingStarted/slide4HeroImage.png' import { useHandler } from '../../hooks/useHandler' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { useSelector } from '../../types/reactRedux' import { NavigationProp } from '../../types/routerTypes' import { parseMarkedText } from '../../util/parseMarkedText' @@ -37,27 +37,27 @@ const sections: SectionData[] = [ { image: slide1HeroImage, key: 'slide1', - message: s.strings.getting_started_slide_1_message, - title: s.strings.getting_started_slide_1_title, - footnote: s.strings.getting_started_slide_1_footnote + message: lstrings.getting_started_slide_1_message, + title: lstrings.getting_started_slide_1_title, + footnote: lstrings.getting_started_slide_1_footnote }, { image: slide2HeroImage, key: 'slide2', - message: s.strings.getting_started_slide_2_message, - title: s.strings.getting_started_slide_2_title + message: lstrings.getting_started_slide_2_message, + title: lstrings.getting_started_slide_2_title }, { image: slide3HeroImage, key: 'slide3', - message: s.strings.getting_started_slide_3_message, - title: s.strings.getting_started_slide_3_title + message: lstrings.getting_started_slide_3_message, + title: lstrings.getting_started_slide_3_title }, { image: slide4HeroImage, key: 'slide4', - message: s.strings.getting_started_slide_4_message, - title: s.strings.getting_started_slide_4_title + message: lstrings.getting_started_slide_4_message, + title: lstrings.getting_started_slide_4_title } ] @@ -92,7 +92,7 @@ export const GettingStartedScene = (props: Props) => { - {s.strings.skip} + {lstrings.skip} @@ -101,9 +101,9 @@ export const GettingStartedScene = (props: Props) => { - {parseMarkedText(s.strings.getting_started_welcome_title)} - {s.strings.getting_started_welcome_message} - {s.strings.getting_started_welcome_prompt} + {parseMarkedText(lstrings.getting_started_welcome_title)} + {lstrings.getting_started_welcome_message} + {lstrings.getting_started_welcome_prompt} {sections.map((section, index) => { return ( @@ -130,15 +130,15 @@ export const GettingStartedScene = (props: Props) => { {parseMarkedText(section.title)} {section.message} - {section.footnote == null ? null : {s.strings.getting_started_slide_1_footnote}} + {section.footnote == null ? null : {lstrings.getting_started_slide_1_footnote}} ) })} - - + + diff --git a/src/components/scenes/GuiPluginListScene.tsx b/src/components/scenes/GuiPluginListScene.tsx index 1c3c6b6afb0..17de3c91913 100644 --- a/src/components/scenes/GuiPluginListScene.tsx +++ b/src/components/scenes/GuiPluginListScene.tsx @@ -16,7 +16,7 @@ import { COUNTRY_CODES } from '../../constants/CountryConstants' import buyPluginJsonRaw from '../../constants/plugins/buyPluginList.json' import { customPluginRow, guiPlugins } from '../../constants/plugins/GuiPlugins' import sellPluginJsonRaw from '../../constants/plugins/sellPluginList.json' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { getSyncedSettings, setSyncedSettings } from '../../modules/Core/Account/settings' import { checkWyreHasLinkedBank, executePlugin } from '../../plugins/gui/fiatPlugin' import { FiatPaymentType } from '../../plugins/gui/fiatPluginTypes' @@ -204,7 +204,7 @@ class GuiPluginList extends React.PureComponent { */ async checkDisclaimer() { const { account } = this.props - const message = sprintf(s.strings.plugin_service_provider_disclaimer, config.appName) + const message = sprintf(lstrings.plugin_service_provider_disclaimer, config.appName) try { const text = await account.disklet.getText(MODAL_DATA_FILE) const json = JSON.parse(text) @@ -212,9 +212,7 @@ class GuiPluginList extends React.PureComponent { if (timesPluginWarningModalViewed < 3) { const newNumber = timesPluginWarningModalViewed + 1 if (newNumber === 3) { - await Airship.show<'ok' | undefined>(bridge => ( - - )) + await Airship.show<'ok' | undefined>(bridge => ) } const newText = JSON.stringify({ viewed: newNumber @@ -227,7 +225,7 @@ class GuiPluginList extends React.PureComponent { } const text = JSON.stringify(json) await account.disklet.setText(MODAL_DATA_FILE, text) - await Airship.show<'ok' | undefined>(bridge => ) + await Airship.show<'ok' | undefined>(bridge => ) } } @@ -285,10 +283,10 @@ class GuiPluginList extends React.PureComponent { autoCapitalize="none" bridge={bridge} initialValue={developerUri} - inputLabel={s.strings.plugin_url} + inputLabel={lstrings.plugin_url} returnKeyType="go" - submitLabel={s.strings.load_plugin} - title={s.strings.load_plugin} + submitLabel={lstrings.load_plugin} + title={lstrings.load_plugin} /> )) if (deepPath == null) return @@ -376,7 +374,7 @@ class GuiPluginList extends React.PureComponent { {poweredBy != null && item.partnerIconPath != null ? ( - {s.strings.plugin_powered_by_space} + {lstrings.plugin_powered_by_space} {' ' + poweredBy} @@ -411,7 +409,7 @@ class GuiPluginList extends React.PureComponent { return ( - + {countryData && ( { style={styles.selectedCountryFlag} /> )} - {countryData ? countryData.name : s.strings.buy_sell_crypto_select_country_button} + {countryData ? countryData.name : lstrings.buy_sell_crypto_select_country_button} {plugins.length === 0 ? ( - {s.strings.buy_sell_crypto_no_plugin_region} + {lstrings.buy_sell_crypto_no_plugin_region} ) : ( diff --git a/src/components/scenes/Loans/LoanCloseScene.tsx b/src/components/scenes/Loans/LoanCloseScene.tsx index dca56a12290..5fb28044c35 100644 --- a/src/components/scenes/Loans/LoanCloseScene.tsx +++ b/src/components/scenes/Loans/LoanCloseScene.tsx @@ -15,7 +15,7 @@ import { useExecutionContext } from '../../../hooks/useExecutionContext' import { useHandler } from '../../../hooks/useHandler' import { useUrlHandler } from '../../../hooks/useUrlHandler' import { useWatch } from '../../../hooks/useWatch' -import s from '../../../locales/strings' +import { lstrings } from '../../../locales/strings' import { useDispatch, useSelector } from '../../../types/reactRedux' import { NavigationProp, RouteProp } from '../../../types/routerTypes' import { makeAaveCloseAction } from '../../../util/ActionProgramUtils' @@ -130,22 +130,22 @@ export const LoanCloseSceneComponent = (props: Props) => { } - title={s.strings.loan_close_loan_title} + title={lstrings.loan_close_loan_title} underline withTopMargin /> - + {debts.length > 0 ? ( - + {debts.map(debt => ( ))} ) : null} {collaterals.length > 0 ? ( - + {collaterals.map(collateral => ( ))} @@ -153,18 +153,18 @@ export const LoanCloseSceneComponent = (props: Props) => { ) : null} {aggregateErrorMessage.length > 0 ? ( ) : actionProgram !== null ? ( - + ) : ( { )} - + diff --git a/src/components/scenes/Loans/LoanCreateConfirmationScene.tsx b/src/components/scenes/Loans/LoanCreateConfirmationScene.tsx index b64989d7f36..6c64f5ff47c 100644 --- a/src/components/scenes/Loans/LoanCreateConfirmationScene.tsx +++ b/src/components/scenes/Loans/LoanCreateConfirmationScene.tsx @@ -11,7 +11,7 @@ import { useAsyncValue } from '../../../hooks/useAsyncValue' import { useExecutionContext } from '../../../hooks/useExecutionContext' import { useTokenDisplayData } from '../../../hooks/useTokenDisplayData' import { useWalletBalance } from '../../../hooks/useWalletBalance' -import s from '../../../locales/strings' +import { lstrings } from '../../../locales/strings' import { convertCurrency } from '../../../selectors/WalletSelectors' import { useDispatch, useSelector } from '../../../types/reactRedux' import { NavigationProp, RouteProp } from '../../../types/routerTypes' @@ -217,7 +217,7 @@ export const LoanCreateConfirmationScene = (props: Props) => { ? gt(add(swapFiatAmount, feeFiatAmount), srcBalanceFiatAmount) : gt(networkFeeAmount, borrowWalletNativeBalance) - if (loanAccountError != null) return + if (loanAccountError != null) return return loanAccount == null ? ( @@ -225,24 +225,24 @@ export const LoanCreateConfirmationScene = (props: Props) => { ) : ( - + - + - + - + {paymentMethod != null ? ( ) : ( @@ -251,7 +251,7 @@ export const LoanCreateConfirmationScene = (props: Props) => { {actionProgramError != null ? : null} - {isFeesExceedCollateral ? : null} + {isFeesExceedCollateral ? : null} ) } diff --git a/src/components/scenes/Loans/LoanCreateScene.tsx b/src/components/scenes/Loans/LoanCreateScene.tsx index 203ef83d5f3..a095bcae8f9 100644 --- a/src/components/scenes/Loans/LoanCreateScene.tsx +++ b/src/components/scenes/Loans/LoanCreateScene.tsx @@ -19,7 +19,7 @@ import { useWalletBalance } from '../../../hooks/useWalletBalance' import { useWalletName } from '../../../hooks/useWalletName' import { useWatch } from '../../../hooks/useWatch' import { toPercentString } from '../../../locales/intl' -import s from '../../../locales/strings' +import { lstrings } from '../../../locales/strings' import { convertCurrency } from '../../../selectors/WalletSelectors' import { config } from '../../../theme/appConfig' import { useSelector } from '../../../types/reactRedux' @@ -244,7 +244,7 @@ export const LoanCreateScene = (props: Props) => { { // ----------------------------------------------------------------------------- const collateralWarningMsg = React.useMemo( - () => sprintf(s.strings.loan_insufficient_funds_warning, srcAssetName, srcWalletName, srcCurrencyCode, config.appName), + () => sprintf(lstrings.loan_insufficient_funds_warning, srcAssetName, srcWalletName, srcCurrencyCode, config.appName), [srcAssetName, srcCurrencyCode, srcWalletName] ) const renderWarning = useHandler(() => { @@ -315,7 +315,7 @@ export const LoanCreateScene = (props: Props) => { @@ -333,7 +333,7 @@ export const LoanCreateScene = (props: Props) => { } - title={s.strings.loan_create_title} + title={lstrings.loan_create_title} underline withTopMargin /> @@ -343,8 +343,8 @@ export const LoanCreateScene = (props: Props) => { @@ -359,31 +359,31 @@ export const LoanCreateScene = (props: Props) => { )} {/* Source of Collateral / Source Wallet */} - {s.strings.loan_collateral_source} + {lstrings.loan_collateral_source} {/* Fund Destination */} - {s.strings.loan_debt_destination} + {lstrings.loan_debt_destination} {/* Collateral Amount Required / Collateral Amount */} - {s.strings.loan_collateral_required} + {lstrings.loan_collateral_required} {srcWallet == null || destWallet == null ? ( - {srcWallet == null ? s.strings.loan_select_source_collateral : s.strings.loan_select_receiving_wallet} + {srcWallet == null ? lstrings.loan_select_source_collateral : lstrings.loan_select_receiving_wallet} ) : ( @@ -396,7 +396,7 @@ export const LoanCreateScene = (props: Props) => { {destWallet == null ? null : ( { diff --git a/src/components/scenes/Loans/LoanDashboardScene.tsx b/src/components/scenes/Loans/LoanDashboardScene.tsx index a32fe42aa55..407777660c1 100644 --- a/src/components/scenes/Loans/LoanDashboardScene.tsx +++ b/src/components/scenes/Loans/LoanDashboardScene.tsx @@ -14,7 +14,7 @@ import { useAsyncEffect } from '../../../hooks/useAsyncEffect' import { useHandler } from '../../../hooks/useHandler' import { useUrlHandler } from '../../../hooks/useUrlHandler' import { useWatch } from '../../../hooks/useWatch' -import s from '../../../locales/strings' +import { lstrings } from '../../../locales/strings' import { borrowPlugins } from '../../../plugins/helpers/borrowPluginHelpers' import { useDispatch, useSelector } from '../../../types/reactRedux' import { NavigationProp } from '../../../types/routerTypes' @@ -105,7 +105,7 @@ export const LoanDashboardScene = (props: Props) => { @@ -173,7 +173,7 @@ export const LoanDashboardScene = (props: Props) => { ) : ( - {s.strings.loan_new_loan} + {lstrings.loan_new_loan} )} @@ -183,7 +183,7 @@ export const LoanDashboardScene = (props: Props) => { if (!isWalletsLoaded) { return ( - + ) @@ -197,22 +197,22 @@ export const LoanDashboardScene = (props: Props) => { } - title={s.strings.loan_dashboard_title} + title={lstrings.loan_dashboard_title} underline withTopMargin /> - {s.strings.loan_active_loans_title} + {lstrings.loan_active_loans_title} {Object.keys(loanAccountsMap).length === 0 ? ( <> {isLoansLoading ? ( - {s.strings.loan_loading_loans} + {lstrings.loan_loading_loans} ) : ( <> - {s.strings.loan_no_active_loans} + {lstrings.loan_no_active_loans} diff --git a/src/components/scenes/Loans/LoanDetailsScene.tsx b/src/components/scenes/Loans/LoanDetailsScene.tsx index 6dfe7f9d520..cf68032beaa 100644 --- a/src/components/scenes/Loans/LoanDetailsScene.tsx +++ b/src/components/scenes/Loans/LoanDetailsScene.tsx @@ -19,7 +19,7 @@ import { formatFiatString } from '../../../hooks/useFiatText' import { useUrlHandler } from '../../../hooks/useUrlHandler' import { useWatch } from '../../../hooks/useWatch' import { toPercentString } from '../../../locales/intl' -import s from '../../../locales/strings' +import { lstrings } from '../../../locales/strings' import { useSelector } from '../../../types/reactRedux' import { NavigationProp } from '../../../types/routerTypes' import { GuiExchangeRates } from '../../../types/types' @@ -91,9 +91,9 @@ export const LoanDetailsSceneComponent = (props: Props) => { }, [account, runningActionQueueItem]) const summaryDetails = [ - { label: s.strings.loan_collateral_value, value: displayFiatTotal(wallet, collateralTotal) }, + { label: lstrings.loan_collateral_value, value: displayFiatTotal(wallet, collateralTotal) }, { - label: s.strings.loan_available_equity, + label: lstrings.loan_available_equity, value: displayFiatTotal(wallet, availableEquity), icon: } @@ -137,7 +137,7 @@ export const LoanDetailsSceneComponent = (props: Props) => { isDisabled: boolean }> = [ { - title: s.strings.loan_action_add_collateral, + title: lstrings.loan_action_add_collateral, iconName: 'add-collateral', handlePress: () => { navigation.navigate('loanManage', { loanManageType: 'loan-manage-deposit', loanAccountId }) @@ -145,7 +145,7 @@ export const LoanDetailsSceneComponent = (props: Props) => { isDisabled: isActionProgramRunning }, { - title: s.strings.loan_action_withdraw_collateral, + title: lstrings.loan_action_withdraw_collateral, iconName: 'withdraw-collateral', handlePress: () => { navigation.navigate('loanManage', { loanManageType: 'loan-manage-withdraw', loanAccountId }) @@ -153,7 +153,7 @@ export const LoanDetailsSceneComponent = (props: Props) => { isDisabled: isActionProgramRunning || !isOpenCollaterals }, { - title: s.strings.loan_borrow_more, + title: lstrings.loan_borrow_more, iconName: 'borrow-more', handlePress: () => { navigation.navigate('loanManage', { loanManageType: 'loan-manage-borrow', loanAccountId }) @@ -161,7 +161,7 @@ export const LoanDetailsSceneComponent = (props: Props) => { isDisabled: isActionProgramRunning || !isOpenCollaterals }, { - title: s.strings.loan_make_payment, + title: lstrings.loan_make_payment, iconName: 'make-payment', handlePress: () => { navigation.navigate('loanManage', { loanManageType: 'loan-manage-repay', loanAccountId }) @@ -169,7 +169,7 @@ export const LoanDetailsSceneComponent = (props: Props) => { isDisabled: isActionProgramRunning || !isOpenDebts }, { - title: s.strings.loan_action_close_loan, + title: lstrings.loan_action_close_loan, iconName: 'close-loan', handlePress: () => { navigation.navigate('loanClose', { loanAccountId }) @@ -217,7 +217,7 @@ export const LoanDetailsSceneComponent = (props: Props) => { } - title={`${s.strings.loan_details_title}${isDevMode ? ` (${wallet.name})` : ''}`} + title={`${lstrings.loan_details_title}${isDevMode ? ` (${wallet.name})` : ''}`} underline withTopMargin /> @@ -234,11 +234,11 @@ export const LoanDetailsSceneComponent = (props: Props) => { - {s.strings.loan_loan_breakdown_title} + {lstrings.loan_loan_breakdown_title} {debts.map(debt => { if (zeroString(debt.nativeAmount)) return null - const aprText = sprintf(s.strings.loan_apr_s, toPercentString(debt.apr)) + const aprText = sprintf(lstrings.loan_apr_s, toPercentString(debt.apr)) return ( @@ -260,9 +260,9 @@ export const LoanDetailsSceneComponent = (props: Props) => { {/* Tappable Action Cards */} - {s.strings.loan_actions_title} + {lstrings.loan_actions_title} {isActionProgramRunning ? ( - + ) : null} {actionCards} diff --git a/src/components/scenes/Loans/LoanManageScene.tsx b/src/components/scenes/Loans/LoanManageScene.tsx index e3d19cd90fc..1e5036865fc 100644 --- a/src/components/scenes/Loans/LoanManageScene.tsx +++ b/src/components/scenes/Loans/LoanManageScene.tsx @@ -23,7 +23,7 @@ import { useHandler } from '../../../hooks/useHandler' import { useUrlHandler } from '../../../hooks/useUrlHandler' import { useWatch } from '../../../hooks/useWatch' import { toPercentString } from '../../../locales/intl' -import s from '../../../locales/strings' +import { lstrings } from '../../../locales/strings' import { BorrowCollateral, BorrowDebt } from '../../../plugins/borrow-plugins/types' import { useDispatch, useSelector } from '../../../types/reactRedux' import { NavigationProp, RouteProp } from '../../../types/routerTypes' @@ -67,38 +67,38 @@ const MANAGE_ACTION_DATA_MAP: { } = { 'loan-manage-borrow': { actionSide: 'debts', - amountCard: s.strings.loan_fragment_loan, - headerText: s.strings.loan_borrow_more, + amountCard: lstrings.loan_fragment_loan, + headerText: lstrings.loan_borrow_more, isFundDestWallet: true, programType: 'loan-borrow', - srcDestCard: s.strings.loan_fund_destination, + srcDestCard: lstrings.loan_fund_destination, supportUrl: sprintf(AAVE_SUPPORT_ARTICLE_URL_1S, 'borrow-more') }, 'loan-manage-deposit': { actionSide: 'collaterals', - amountCard: s.strings.loan_fragment_deposit, - headerText: s.strings.loan_add_collateral, + amountCard: lstrings.loan_fragment_deposit, + headerText: lstrings.loan_add_collateral, isFundDestWallet: false, programType: 'loan-deposit', - srcDestCard: s.strings.loan_fund_source, + srcDestCard: lstrings.loan_fund_source, supportUrl: sprintf(AAVE_SUPPORT_ARTICLE_URL_1S, 'add-collateral') }, 'loan-manage-repay': { actionSide: 'debts', - amountCard: s.strings.loan_fragment_repay, - headerText: s.strings.loan_make_payment, + amountCard: lstrings.loan_fragment_repay, + headerText: lstrings.loan_make_payment, isFundDestWallet: false, programType: 'loan-repay', - srcDestCard: s.strings.loan_fund_source, + srcDestCard: lstrings.loan_fund_source, supportUrl: sprintf(AAVE_SUPPORT_ARTICLE_URL_1S, 'make-payment') }, 'loan-manage-withdraw': { actionSide: 'collaterals', - amountCard: s.strings.loan_fragment_withdraw, - headerText: s.strings.loan_withdraw_collateral, + amountCard: lstrings.loan_fragment_withdraw, + headerText: lstrings.loan_withdraw_collateral, isFundDestWallet: true, programType: 'loan-withdraw', - srcDestCard: s.strings.loan_fund_destination, + srcDestCard: lstrings.loan_fund_destination, supportUrl: sprintf(AAVE_SUPPORT_ARTICLE_URL_1S, 'withdraw-collateral') } } @@ -346,7 +346,7 @@ export const LoanManageSceneComponent = (props: Props) => { { wallet: borrowEngineWallet, nativeBalance: collaterals.find(collateral => collateral.tokenId === hardCollateralTokenId)?.nativeAmount ?? '0', referenceTokenId: hardCollateralTokenId ?? '', - displayName: sprintf(s.strings.loan_deposited_collateral_s, 'WBTC'), + displayName: sprintf(lstrings.loan_deposited_collateral_s, 'WBTC'), currencyCode: 'WBTC' } ] @@ -412,8 +412,8 @@ export const LoanManageSceneComponent = (props: Props) => { @@ -422,25 +422,25 @@ export const LoanManageSceneComponent = (props: Props) => { - + { )} diff --git a/src/components/scenes/Loans/LoanStatusScene.tsx b/src/components/scenes/Loans/LoanStatusScene.tsx index 2872f13e9d4..b6346e0f97b 100644 --- a/src/components/scenes/Loans/LoanStatusScene.tsx +++ b/src/components/scenes/Loans/LoanStatusScene.tsx @@ -14,7 +14,7 @@ import { LoanAccount } from '../../../controllers/loan-manager/types' import { useAsyncValue } from '../../../hooks/useAsyncValue' import { useHandler } from '../../../hooks/useHandler' import { useUrlHandler } from '../../../hooks/useUrlHandler' -import s from '../../../locales/strings' +import { lstrings } from '../../../locales/strings' import { config } from '../../../theme/appConfig' import { useDispatch, useSelector } from '../../../types/reactRedux' import { NavigationProp, RouteProp } from '../../../types/routerTypes' @@ -69,8 +69,8 @@ export const LoanStatusSceneComponent = (props: Props) => { const approve = await Airship.show(bridge => ( )) @@ -102,7 +102,7 @@ export const LoanStatusSceneComponent = (props: Props) => { } - title={s.strings.loan_status_title} + title={lstrings.loan_status_title} underline withTopMargin /> @@ -122,9 +122,9 @@ export const LoanStatusSceneComponent = (props: Props) => { ) : null} {isProgramDone ? ( - + ) : ( - + )} {isProgramDone ? : null} diff --git a/src/components/scenes/LoginScene.tsx b/src/components/scenes/LoginScene.tsx index 18d19d18594..73998b80dbf 100644 --- a/src/components/scenes/LoginScene.tsx +++ b/src/components/scenes/LoginScene.tsx @@ -12,7 +12,7 @@ import { initializeAccount, logoutRequest } from '../../actions/LoginActions' import { serverSettingsToNotificationSettings, setDeviceSettings } from '../../actions/NotificationActions' import { cacheStyles, Theme, ThemeProps, useTheme } from '../../components/services/ThemeContext' import { ENV } from '../../env' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { config } from '../../theme/appConfig' import { DeepLink } from '../../types/DeepLinkTypes' import { useDispatch, useSelector } from '../../types/reactRedux' @@ -192,7 +192,7 @@ class LoginSceneComponent extends React.PureComponent { backgroundImage={backgroundImage} primaryLogo={theme.primaryLogo} primaryLogoCallback={handleSendLogs} - parentButton={{ text: s.strings.string_help, callback: this.onClickHelp }} + parentButton={{ text: lstrings.string_help, callback: this.onClickHelp }} skipSecurityAlerts /> diff --git a/src/components/scenes/ManageTokensScene.tsx b/src/components/scenes/ManageTokensScene.tsx index d6889a7030b..3e89b34debd 100644 --- a/src/components/scenes/ManageTokensScene.tsx +++ b/src/components/scenes/ManageTokensScene.tsx @@ -8,7 +8,7 @@ import { PREFERRED_TOKENS, SPECIAL_CURRENCY_INFO } from '../../constants/WalletA import { useHandler } from '../../hooks/useHandler' import { useWalletName } from '../../hooks/useWalletName' import { useWatch } from '../../hooks/useWatch' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { useSelector } from '../../types/reactRedux' import { NavigationProp } from '../../types/routerTypes' import { EdgeTokenId, FlatListItem } from '../../types/types' @@ -92,7 +92,7 @@ function ManageTokensSceneComponent(props: Props) { .map(pluginId => ({ pluginId })) const { walletId, currencyCode } = await Airship.show(bridge => ( - + )) if (walletId != null && currencyCode != null) { @@ -136,9 +136,9 @@ function ManageTokensSceneComponent(props: Props) { text={walletName} /> - {s.strings.managetokens_top_instructions} + {lstrings.managetokens_top_instructions} - + )} diff --git a/src/components/scenes/MigrateWalletCalculateFeeScene.tsx b/src/components/scenes/MigrateWalletCalculateFeeScene.tsx index dfc34f693c2..ee65123c439 100644 --- a/src/components/scenes/MigrateWalletCalculateFeeScene.tsx +++ b/src/components/scenes/MigrateWalletCalculateFeeScene.tsx @@ -8,7 +8,7 @@ import { SPECIAL_CURRENCY_INFO } from '../../constants/WalletAndCurrencyConstant import { useAsyncEffect } from '../../hooks/useAsyncEffect' import { useHandler } from '../../hooks/useHandler' import { useWatch } from '../../hooks/useWatch' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { useSelector } from '../../types/reactRedux' import { NavigationProp, RouteProp } from '../../types/routerTypes' import { getWalletName } from '../../util/CurrencyWalletHelpers' @@ -180,7 +180,7 @@ const MigrateWalletCalculateFeeComponent = (props: Props) => { if (e instanceof InsufficientFundsError) { bundlesFeeTotals.set(key, e) } else { - bundlesFeeTotals.set(key, Error(s.strings.migrate_unknown_error_fragment)) + bundlesFeeTotals.set(key, Error(lstrings.migrate_unknown_error_fragment)) } } } @@ -217,9 +217,9 @@ const MigrateWalletCalculateFeeComponent = (props: Props) => { return ( - + - {s.strings.migrate_wallet_instructions_fragment} + {lstrings.migrate_wallet_instructions_fragment} { let createdNewWallet = false if (newWallet == null) { newWallet = await account.createCurrencyWallet(walletType, { - name: `${oldWalletName}${s.strings.migrate_wallet_new_fragment}`, + name: `${oldWalletName}${lstrings.migrate_wallet_new_fragment}`, fiatCurrencyCode, migratedFromWalletId: oldWalletId }) @@ -125,7 +125,7 @@ const MigrateWalletCompletionComponent = (props: Props) => { } // Change old wallet name - if (createdNewWallet) await oldWallet.renameWallet(`${oldWalletName}${s.strings.migrate_wallet_old_fragment}`) + if (createdNewWallet) await oldWallet.renameWallet(`${oldWalletName}${lstrings.migrate_wallet_old_fragment}`) const addressInfo = await newWallet.getReceiveAddress() const newPublicAddress = addressInfo.segwitAddress ?? addressInfo.publicAddress @@ -226,7 +226,7 @@ const MigrateWalletCompletionComponent = (props: Props) => { return ( navigation.navigate('walletList', {})} @@ -242,7 +242,7 @@ const MigrateWalletCompletionComponent = (props: Props) => { {gap => ( - + { const handleNext = useHandler(async () => { if (numSelected === 0) { - showError(s.strings.create_wallet_no_assets_selected) + showError(lstrings.create_wallet_no_assets_selected) return } @@ -143,7 +143,7 @@ const MigrateWalletSelectCryptoComponent = (props: Props) => { () => ( 0} visible={numSelected > 0} duration={300}> - + ), @@ -156,7 +156,7 @@ const MigrateWalletSelectCryptoComponent = (props: Props) => { {gap => ( - + { await handlePressToggleSetting('ignoreMarketing')} /> await handlePressToggleSetting('ignorePriceChanges')} /> diff --git a/src/components/scenes/OtpSettingsScene.tsx b/src/components/scenes/OtpSettingsScene.tsx index 47a14ae2662..2896a79d7ac 100644 --- a/src/components/scenes/OtpSettingsScene.tsx +++ b/src/components/scenes/OtpSettingsScene.tsx @@ -6,7 +6,7 @@ import { cacheStyles } from 'react-native-patina' import AntDesignIcon from 'react-native-vector-icons/AntDesign' import { sprintf } from 'sprintf-js' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { B } from '../../styles/common/textStyles' import { config } from '../../theme/appConfig' import { connect } from '../../types/reactRedux' @@ -55,18 +55,18 @@ class OtpSettingsSceneComponent extends React.Component { )).catch(showError) @@ -85,33 +85,33 @@ class OtpSettingsSceneComponent extends React.Component { handleCopyKey = () => { const { otpKey = '' } = this.state Clipboard.setString(otpKey) - showToast(s.strings.otp_copied_msg) + showToast(lstrings.otp_copied_msg) } render() { const { theme } = this.props const { otpKey } = this.state const styles = getStyles(theme) - const otpDescriptionTwo = sprintf(s.strings.otp_description_two, config.appName) + const otpDescriptionTwo = sprintf(lstrings.otp_description_two, config.appName) return ( - {otpKey != null ? s.strings.title_otp_enabled : s.strings.title_otp_disabled} + {otpKey != null ? lstrings.title_otp_enabled : lstrings.title_otp_disabled} - {s.strings.otp_description} + {lstrings.otp_description} {otpDescriptionTwo} {otpKey != null ? ( - {s.strings.otp_enabled_message} + {lstrings.otp_enabled_message} ) : null} {otpKey != null ? this.renderKey(otpKey) : null} {otpKey != null ? ( - + ) : ( - + )} ) @@ -125,7 +125,7 @@ class OtpSettingsSceneComponent extends React.Component { return ( - {showKey ? s.strings.otp_hide_code : s.strings.otp_show_code} + {showKey ? lstrings.otp_hide_code : lstrings.otp_show_code} {showKey ? ( diff --git a/src/components/scenes/PromotionSettingsScene.tsx b/src/components/scenes/PromotionSettingsScene.tsx index b6decf167d7..87ca24f3a22 100644 --- a/src/components/scenes/PromotionSettingsScene.tsx +++ b/src/components/scenes/PromotionSettingsScene.tsx @@ -3,7 +3,7 @@ import { Text, View } from 'react-native' import { sprintf } from 'sprintf-js' import { activatePromotion, removePromotion } from '../../actions/AccountReferralActions' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { connect } from '../../types/reactRedux' import { AccountReferral, DeviceReferral } from '../../types/ReferralTypes' import { SceneWrapper } from '../common/SceneWrapper' @@ -30,23 +30,23 @@ export class PromotionSettingsComponent extends React.Component { return ( - + {deviceReferral.installerId == null - ? s.strings.settings_promotion_device_normal - : sprintf(s.strings.settings_promotion_device_installer, deviceReferral.installerId)} + ? lstrings.settings_promotion_device_normal + : sprintf(lstrings.settings_promotion_device_installer, deviceReferral.installerId)} {deviceReferral.currencyCodes != null ? ( - {sprintf(s.strings.settings_promotion_device_currencies, deviceReferral.currencyCodes.join(', '))} + {sprintf(lstrings.settings_promotion_device_currencies, deviceReferral.currencyCodes.join(', '))} ) : null} {accountReferral.installerId == null - ? s.strings.settings_promotion_account_normal - : sprintf(s.strings.settings_promotion_account_installer, accountReferral.installerId)} + ? lstrings.settings_promotion_account_normal + : sprintf(lstrings.settings_promotion_account_installer, accountReferral.installerId)} - + {accountReferral.promotions.map(promotion => ( { onPress={async () => await removePromotion(promotion.installerId)} /> ))} - + ) } @@ -67,7 +67,7 @@ export class PromotionSettingsComponent extends React.Component { autoCorrect={false} bridge={bridge} returnKeyType="go" - title={s.strings.settings_promotion_add} + title={lstrings.settings_promotion_add} onSubmit={async installerId => { await this.props.activatePromotion(installerId) return true diff --git a/src/components/scenes/RequestScene.tsx b/src/components/scenes/RequestScene.tsx index 28d4740214a..607e53c5a9b 100644 --- a/src/components/scenes/RequestScene.tsx +++ b/src/components/scenes/RequestScene.tsx @@ -11,7 +11,7 @@ import { refreshAllFioAddresses } from '../../actions/FioAddressActions' import { selectWalletToken } from '../../actions/WalletActions' import { Fontello } from '../../assets/vector' import { getSpecialCurrencyInfo, SPECIAL_CURRENCY_INFO } from '../../constants/WalletAndCurrencyConstants' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { getDisplayDenomination, getExchangeDenomination } from '../../selectors/DenominationSelectors' import { getExchangeRate } from '../../selectors/WalletSelectors' import { config } from '../../theme/appConfig' @@ -130,19 +130,19 @@ export class RequestSceneComponent extends React.Component { if (receiveAddress.segwitAddress != null) { addresses.push({ addressString: receiveAddress.segwitAddress, - label: s.strings.request_qr_your_segwit_address + label: lstrings.request_qr_your_segwit_address }) } // Handle publicAddress addresses.push({ addressString: receiveAddress.publicAddress, - label: receiveAddress.segwitAddress != null ? s.strings.request_qr_your_wrapped_segwit_address : s.strings.request_qr_your_wallet_address + label: receiveAddress.segwitAddress != null ? lstrings.request_qr_your_wrapped_segwit_address : lstrings.request_qr_your_wallet_address }) // Handle legacyAddress if (receiveAddress.legacyAddress != null) { addresses.push({ addressString: receiveAddress.legacyAddress, - label: s.strings.request_qr_your_legacy_address + label: lstrings.request_qr_your_legacy_address }) } @@ -196,9 +196,9 @@ export class RequestSceneComponent extends React.Component { await Airship.show<'ok' | undefined>(bridge => ( )) @@ -233,11 +233,11 @@ export class RequestSceneComponent extends React.Component { Airship.show<'confirm' | 'cancel' | undefined>(bridge => ( )) @@ -249,7 +249,7 @@ export class RequestSceneComponent extends React.Component { handleOpenWalletListModal = () => { const { account } = this.props - Airship.show(bridge => ).then( + Airship.show(bridge => ).then( ({ walletId, currencyCode }: WalletListResult) => { if (walletId && currencyCode) { const wallet = account.currencyWallets[walletId] @@ -262,14 +262,14 @@ export class RequestSceneComponent extends React.Component { onError = (errorMessage?: string) => this.setState({ errorMessage }) - handleKeysOnlyModePress = () => showWebViewModal(config.supportSite, s.strings.help_support) + handleKeysOnlyModePress = () => showWebViewModal(config.supportSite, lstrings.help_support) renderKeysOnlyMode = () => { const styles = getStyles(this.props.theme) return ( - - {sprintf(s.strings.request_deprecated_currency_code, this.props.primaryCurrencyInfo?.displayCurrencyCode)} - + + {sprintf(lstrings.request_deprecated_currency_code, this.props.primaryCurrencyInfo?.displayCurrencyCode)} + @@ -293,15 +293,15 @@ export class RequestSceneComponent extends React.Component { } const selectedAddress = this.state.selectedAddress - const requestAddress = selectedAddress?.addressString ?? s.strings.loading - const flipInputHeaderText = sprintf(s.strings.send_to_wallet, getWalletName(wallet)) + const requestAddress = selectedAddress?.addressString ?? lstrings.loading + const flipInputHeaderText = sprintf(lstrings.send_to_wallet, getWalletName(wallet)) const { keysOnlyMode = false } = getSpecialCurrencyInfo(wallet.currencyInfo.pluginId) const addressExplorerDisabled = wallet.currencyInfo.addressExplorer === '' // Balance const nativeBalance = getAvailableBalance(wallet, primaryCurrencyInfo.displayCurrencyCode) const displayBalanceAmount = convertNativeToDenomination(primaryCurrencyInfo.displayDenomination.multiplier)(nativeBalance) - const displayBalanceString = sprintf(s.strings.request_balance, `${truncateDecimals(displayBalanceAmount)} ${primaryCurrencyInfo.displayDenomination.name}`) + const displayBalanceString = sprintf(lstrings.request_balance, `${truncateDecimals(displayBalanceAmount)} ${primaryCurrencyInfo.displayDenomination.name}`) // Selected denomination const denomString = `1 ${primaryCurrencyInfo.displayDenomination.name}` @@ -312,7 +312,7 @@ export class RequestSceneComponent extends React.Component { - {s.strings.fragment_request_subtitle} + {lstrings.fragment_request_subtitle} {denomString} @@ -353,10 +353,10 @@ export class RequestSceneComponent extends React.Component { - {this.state.isFioMode ? s.strings.string_cancel_cap : ''} + {this.state.isFioMode ? lstrings.string_cancel_cap : ''} - {this.state.isFioMode ? s.strings.string_next_capitalized : 'Done'} + {this.state.isFioMode ? lstrings.string_next_capitalized : 'Done'} @@ -377,7 +377,7 @@ export class RequestSceneComponent extends React.Component { /> - {selectedAddress?.label ?? s.strings.request_qr_your_wallet_address} + {selectedAddress?.label ?? lstrings.request_qr_your_wallet_address} {addressExplorerDisabled ? null : } {requestAddress} @@ -398,7 +398,7 @@ export class RequestSceneComponent extends React.Component { const encodedUri = uri ?? (await this.getEncodedUri()) if (encodedUri != null) { Clipboard.setString(encodedUri) - showToast(s.strings.fragment_request_address_uri_copied) + showToast(lstrings.fragment_request_address_uri_copied) } } catch (error) { showError(error) @@ -446,10 +446,10 @@ export class RequestSceneComponent extends React.Component { sharedAddress = newUri.substring(0, newUri.indexOf('?')) } edgePayUri = edgePayUri + `pay/${sharedAddress.replace(':', '/')}` - addOnMessage = `\n\n${sprintf(s.strings.request_qr_email_title, config.appName)}\n\n` + addOnMessage = `\n\n${sprintf(lstrings.request_qr_email_title, config.appName)}\n\n` } - const subject = wallet != null ? sprintf(s.strings.request_email_subject, config.appName, wallet.currencyInfo.displayName) : '' + const subject = wallet != null ? sprintf(lstrings.request_email_subject, config.appName, wallet.currencyInfo.displayName) : '' const message = `${sharedAddress}${addOnMessage}` const shareOptions = { @@ -469,16 +469,16 @@ export class RequestSceneComponent extends React.Component { fioAddressModal = () => { const { navigation } = this.props if (!this.props.isConnected) { - showError(s.strings.fio_network_alert_text) + showError(lstrings.fio_network_alert_text) return } if (!this.props.fioAddressesExist) { - showError(`${s.strings.title_register_fio_address}. ${s.strings.fio_request_by_fio_address_error_no_address}`) + showError(`${lstrings.title_register_fio_address}. ${lstrings.fio_request_by_fio_address_error_no_address}`) return } if (this.state.amounts == null || lte(this.state.amounts.nativeAmount, '0')) { if (Platform.OS === 'android') { - showError(`${s.strings.fio_request_by_fio_address_error_invalid_amount_header}. ${s.strings.fio_request_by_fio_address_error_invalid_amount}`) + showError(`${lstrings.fio_request_by_fio_address_error_invalid_amount_header}. ${lstrings.fio_request_by_fio_address_error_invalid_amount}`) return } else { this.fioMode() @@ -507,7 +507,7 @@ export class RequestSceneComponent extends React.Component { nextFioMode = () => { if (this.state.isFioMode && (!this.state.amounts || lte(this.state.amounts.nativeAmount, '0'))) { - showError(`${s.strings.fio_request_by_fio_address_error_invalid_amount_header}. ${s.strings.fio_request_by_fio_address_error_invalid_amount}`) + showError(`${lstrings.fio_request_by_fio_address_error_invalid_amount_header}. ${lstrings.fio_request_by_fio_address_error_invalid_amount}`) } else { if (this.flipInput) { this.flipInput.textInputBottomBlur() diff --git a/src/components/scenes/SendScene.tsx b/src/components/scenes/SendScene.tsx index 6c22c51e9f2..f1b83b76f47 100644 --- a/src/components/scenes/SendScene.tsx +++ b/src/components/scenes/SendScene.tsx @@ -19,7 +19,7 @@ import { checkAndShowGetCryptoModal } from '../../actions/ScanActions' import { FioSenderInfo, sendConfirmationUpdateTx, signBroadcastAndSave } from '../../actions/SendConfirmationActions' import { selectWalletToken } from '../../actions/WalletActions' import { FIO_STR, getSpecialCurrencyInfo } from '../../constants/WalletAndCurrencyConstants' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { checkRecordSendFee, FIO_NO_BUNDLED_ERR_CODE } from '../../modules/FioAddress/util' import { getDisplayDenominationFromState, getExchangeDenominationFromState } from '../../selectors/DenominationSelectors' import { connect } from '../../types/reactRedux' @@ -197,12 +197,7 @@ class SendComponent extends React.PureComponent { const prevCurrencyCode = this.state.selectedCurrencyCode Airship.show(bridge => ( - + )) .then(({ walletId, currencyCode }: WalletListResult) => { if (walletId == null || currencyCode == null) return @@ -344,11 +339,11 @@ class SendComponent extends React.PureComponent { const answer = await Airship.show<'ok' | 'cancel' | undefined>(bridge => ( )) @@ -389,7 +384,7 @@ class SendComponent extends React.PureComponent { return ( @@ -408,7 +403,7 @@ class SendComponent extends React.PureComponent { if (coreWallet && !hiddenTilesMap.address) { return ( { if (recipientAddress === '') { return ( ) @@ -463,7 +458,7 @@ class SendComponent extends React.PureComponent { return ( { const feeSyntaxStyle = transactionFee.fiatStyle return ( - + { if (transactionMetadata && transactionMetadata.notes) { return ( - + {transactionMetadata.notes} ) @@ -575,8 +570,8 @@ class SendComponent extends React.PureComponent { bridge={bridge} inputLabel={identifierName} keyboardType={keyboardType} - message={sprintf(s.strings.unique_identifier_modal_description, identifierName)} - submitLabel={s.strings.unique_identifier_modal_confirm} + message={sprintf(lstrings.unique_identifier_modal_description, identifierName)} + submitLabel={lstrings.unique_identifier_modal_confirm} title={identifierName} maxLength={this.state.coreWallet?.currencyInfo?.memoMaxLength} /> @@ -610,7 +605,7 @@ class SendComponent extends React.PureComponent { if (authRequired === 'pin') { return ( - + diff --git a/src/components/scenes/SendScene2.tsx b/src/components/scenes/SendScene2.tsx index b88f60f01f2..adaa54b7df3 100644 --- a/src/components/scenes/SendScene2.tsx +++ b/src/components/scenes/SendScene2.tsx @@ -25,7 +25,7 @@ import { useHandler } from '../../hooks/useHandler' import { useMount } from '../../hooks/useMount' import { useUnmount } from '../../hooks/useUnmount' import { useWatch } from '../../hooks/useWatch' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { addToFioAddressCache, checkRecordSendFee, FIO_NO_BUNDLED_ERR_CODE, recordSend } from '../../modules/FioAddress/util' import { useState } from '../../types/reactHooks' import { useDispatch, useSelector } from '../../types/reactRedux' @@ -250,7 +250,7 @@ const SendComponent = (props: Props) => { // TODO: Change API of AddressTile to access undefined recipientAddress const { publicAddress = '', otherParams = {} } = spendTarget const { fioAddress } = otherParams - const title = s.strings.send_scene_send_to_address + (spendInfo.spendTargets.length > 1 ? ` ${(index + 1).toString()}` : '') + const title = lstrings.send_scene_send_to_address + (spendInfo.spendTargets.length > 1 ? ` ${(index + 1).toString()}` : '') return ( { const renderAmount = (index: number, spendTarget: EdgeSpendTarget) => { const { publicAddress, nativeAmount } = spendTarget if (publicAddress != null && !hiddenTilesMap.amount) { - const title = s.strings.fio_request_amount + (spendInfo.spendTargets.length > 1 ? ` ${(index + 1).toString()}` : '') + const title = lstrings.fio_request_amount + (spendInfo.spendTargets.length > 1 ? ` ${(index + 1).toString()}` : '') return ( { } const handleWalletPress = useHandler(() => { - Airship.show(bridge => ) + Airship.show(bridge => ) .then((result: WalletListResult) => { if (result.walletId == null || result.currencyCode == null) { return @@ -392,7 +392,7 @@ const SendComponent = (props: Props) => { return ( @@ -414,14 +414,14 @@ const SendComponent = (props: Props) => { const lastTargetHasAddress = spendInfo.spendTargets[numTargets - 1].publicAddress != null const lastTargetHasAmount = spendInfo.spendTargets[numTargets - 1].nativeAmount != null if (lastTargetHasAddress && lastTargetHasAmount && ALLOW_MULTIPLE_TARGETS) { - return + return } else { return null } } const handleTimeoutDone = useHandler(() => { - setError(new Error(s.strings.send_address_expired_error_message)) + setError(new Error(lstrings.send_address_expired_error_message)) }) const renderTimeout = () => { @@ -429,7 +429,7 @@ const SendComponent = (props: Props) => { return ( { const feeSyntaxStyle = transactionFee.fiatStyle return ( - + {processingAmountChanged ? ( { color: feeSyntaxStyle ? theme[feeSyntaxStyle] : theme.primaryText }} > - {s.strings.send_confirmation_calculating_fee} + {lstrings.send_confirmation_calculating_fee} @@ -499,7 +499,7 @@ const SendComponent = (props: Props) => { const notes = edgeTransaction?.metadata?.notes if (notes != null) { return ( - + {notes} ) @@ -558,8 +558,8 @@ const SendComponent = (props: Props) => { inputLabel={identifierName} initialValue={uniqueIdentifier} keyboardType={keyboardType} - message={sprintf(s.strings.unique_identifier_modal_description, identifierName)} - submitLabel={s.strings.unique_identifier_modal_confirm} + message={sprintf(lstrings.unique_identifier_modal_description, identifierName)} + submitLabel={lstrings.unique_identifier_modal_confirm} title={identifierName} maxLength={coreWallet?.currencyInfo?.memoMaxLength} /> @@ -603,7 +603,7 @@ const SendComponent = (props: Props) => { const pinLength = pinValue?.length ?? 0 return ( - + @@ -613,7 +613,7 @@ const SendComponent = (props: Props) => { onChangeText={handleChangePin} keyboardType="numeric" returnKeyType="done" - placeholder={s.strings.spending_limits_enter_pin} + placeholder={lstrings.spending_limits_enter_pin} placeholderTextColor={theme.textLink} style={styles.pinInput} value={pinValue} @@ -629,13 +629,13 @@ const SendComponent = (props: Props) => { if (publicAddress === '' || publicAddress == null) { return ( ) @@ -665,7 +665,7 @@ const SendComponent = (props: Props) => { // }) // } catch (e: any) { // const message = e?.message ?? '' - // message.includes(FIO_FEE_EXCEEDS_SUPPLIED_MAXIMUM) ? showError(s.strings.fio_fee_exceeds_supplied_maximum_record_obt_data) : showError(e) + // message.includes(FIO_FEE_EXCEEDS_SUPPLIED_MAXIMUM) ? showError(lstrings.fio_fee_exceeds_supplied_maximum_record_obt_data) : showError(e) // } // } else if ((guiMakeSpendInfo.publicAddress != null || publicAddress != null) && (!skipRecord || edgeSignedTransaction.currencyCode === FIO_STR)) { if (!skipRecord) { @@ -702,7 +702,7 @@ const SendComponent = (props: Props) => { if (!isAuthorized) { resetSlider() setPinValue('') - showError(new Error(s.strings.incorrect_pin)) + showError(new Error(lstrings.incorrect_pin)) return } } @@ -754,8 +754,8 @@ const SendComponent = (props: Props) => { } if (payeeName != null && fioSender != null) { - let fioNotes = `${s.strings.fragment_transaction_list_sent_prefix}${s.strings.fragment_send_from_label.toLowerCase()} ${fioSender.fioAddress}\n` - fioNotes += fioSender.memo ? `\n${s.strings.fio_sender_memo_label}: ${fioSender.memo}\n` : '' + let fioNotes = `${lstrings.fragment_transaction_list_sent_prefix}${lstrings.fragment_send_from_label.toLowerCase()} ${fioSender.fioAddress}\n` + fioNotes += fioSender.memo ? `\n${lstrings.fio_sender_memo_label}: ${fioSender.memo}\n` : '' if (notes.length > 1) { fioNotes += notes.join('\n') } @@ -808,33 +808,33 @@ const SendComponent = (props: Props) => { walletId }) } - Alert.alert(s.strings.transaction_success, s.strings.transaction_success_message, [ + Alert.alert(lstrings.transaction_success, lstrings.transaction_success_message, [ { onPress() {}, style: 'default', - text: s.strings.string_ok + text: lstrings.string_ok } ]) } catch (e: any) { resetSlider() console.log(e) - let message = sprintf(s.strings.transaction_failure_message, e.message) + let message = sprintf(lstrings.transaction_failure_message, e.message) e.message = 'broadcastError' if (e.name === 'ErrorEosInsufficientCpu') { - message = s.strings.send_confirmation_eos_error_cpu + message = lstrings.send_confirmation_eos_error_cpu } else if (e.name === 'ErrorEosInsufficientNet') { - message = s.strings.send_confirmation_eos_error_net + message = lstrings.send_confirmation_eos_error_net } else if (e.name === 'ErrorEosInsufficientRam') { - message = s.strings.send_confirmation_eos_error_ram + message = lstrings.send_confirmation_eos_error_ram } else if (e.code && e.code === FIO_NO_BUNDLED_ERR_CODE && currencyCode !== FIO_STR) { const answer = await Airship.show<'ok' | 'cancel' | undefined>(bridge => ( )) @@ -846,11 +846,11 @@ const SendComponent = (props: Props) => { } } - Alert.alert(s.strings.transaction_failure, message, [ + Alert.alert(lstrings.transaction_failure, message, [ { onPress() {}, style: 'default', - text: s.strings.string_ok + text: lstrings.string_ok } ]) } @@ -928,7 +928,7 @@ const SendComponent = (props: Props) => { disableSlider = true } else if (pinSpendingLimitsEnabled && spendingLimitExceeded && (pinValue?.length ?? 0) < PIN_MAX_LENGTH) { disableSlider = true - disabledText = s.strings.spending_limits_enter_pin + disabledText = lstrings.spending_limits_enter_pin } return ( diff --git a/src/components/scenes/SettingsScene.tsx b/src/components/scenes/SettingsScene.tsx index 391aa4d6e52..3cb70526488 100644 --- a/src/components/scenes/SettingsScene.tsx +++ b/src/components/scenes/SettingsScene.tsx @@ -18,7 +18,7 @@ import { updateTouchIdEnabled } from '../../actions/SettingsActions' import { CURRENCY_SETTINGS_KEYS } from '../../constants/WalletAndCurrencyConstants' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { getDefaultFiat } from '../../selectors/SettingsSelectors' import { config } from '../../theme/appConfig' import { connect } from '../../types/reactRedux' @@ -83,7 +83,7 @@ export class SettingsSceneComponent extends React.Component { const { logSettings } = this.props.context this.state = { - touchIdText: s.strings.settings_button_use_touchID, + touchIdText: lstrings.settings_button_use_touchID, darkTheme: this.props.theme === config.darkTheme, defaultLogLevel: logSettings.defaultLogLevel } @@ -109,17 +109,17 @@ export class SettingsSceneComponent extends React.Component { const biometryType = await getSupportedBiometryType() switch (biometryType) { case 'FaceID': - this.setState({ touchIdText: s.strings.settings_button_use_faceID }) + this.setState({ touchIdText: lstrings.settings_button_use_faceID }) break case 'TouchID': - this.setState({ touchIdText: s.strings.settings_button_use_touchID }) + this.setState({ touchIdText: lstrings.settings_button_use_touchID }) break case false: break } } else { - this.setState({ touchIdText: s.strings.settings_button_use_biometric }) + this.setState({ touchIdText: lstrings.settings_button_use_biometric }) } } @@ -157,8 +157,8 @@ export class SettingsSceneComponent extends React.Component { const approveDelete = await Airship.show(bridge => ( @@ -170,16 +170,16 @@ export class SettingsSceneComponent extends React.Component { await Airship.show(bridge => ( { - if (text !== username) return s.strings.delete_account_verification_error + if (text !== username) return lstrings.delete_account_verification_error await this.props.account.deleteRemoteAccount() await this.props.logoutRequest(this.props.navigation) await this.props.context.deleteLocalAccount(username) - Airship.show(bridge => ) + Airship.show(bridge => ) return true }} /> @@ -265,49 +265,49 @@ export class SettingsSceneComponent extends React.Component { const autoLogout = secondsToDisplay(this.props.autoLogoutTimeInSeconds) const timeStrings = { - seconds: s.strings.settings_seconds, - minutes: s.strings.settings_minutes, - hours: s.strings.settings_hours, - days: s.strings.settings_days + seconds: lstrings.settings_seconds, + minutes: lstrings.settings_minutes, + hours: lstrings.settings_hours, + days: lstrings.settings_days } - const autoLogoutRightText = autoLogout.value === 0 ? s.strings.string_disable : `${autoLogout.value} ${timeStrings[autoLogout.measurement]}` + const autoLogoutRightText = autoLogout.value === 0 ? lstrings.string_disable : `${autoLogout.value} ${timeStrings[autoLogout.measurement]}` return ( } - label={`${s.strings.settings_account_title_cap}: ${account.username}`} + label={`${lstrings.settings_account_title_cap}: ${account.username}`} /> - - - - - - - } label={s.strings.settings_options_title_cap} /> - - - - - - + + + + + + + } label={lstrings.settings_options_title_cap} /> + + + + + + {this.props.supportsTouchId && ( )} - + {CURRENCY_SETTINGS_KEYS.map(pluginId => { if (account.currencyConfig[pluginId] == null) return null const { currencyInfo } = account.currencyConfig[pluginId] @@ -324,28 +324,28 @@ export class SettingsSceneComponent extends React.Component { ) })} - + {this.props.developerModeOn && ( - + )} - this.props.showRestoreWalletsModal(navigation)} /> - navigation.push('migrateWalletSelectCrypto', {})} /> - + this.props.showRestoreWalletsModal(navigation)} /> + navigation.push('migrateWalletSelectCrypto', {})} /> + - - + + diff --git a/src/components/scenes/SpendingLimitsScene.tsx b/src/components/scenes/SpendingLimitsScene.tsx index 7671dacdbe7..693d9b3aaba 100644 --- a/src/components/scenes/SpendingLimitsScene.tsx +++ b/src/components/scenes/SpendingLimitsScene.tsx @@ -5,7 +5,7 @@ import { TextField } from 'react-native-material-textfield' import { setSpendingLimits } from '../../actions/SpendingLimitsActions' import { getSymbolFromCurrency } from '../../constants/WalletAndCurrencyConstants' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { THEME } from '../../theme/variables/airbitz' import { connect } from '../../types/reactRedux' import { NavigationBase } from '../../types/routerTypes' @@ -56,14 +56,14 @@ class SpendingLimitsComponent extends React.Component { baseColor={THEME.COLORS.GRAY_2} tintColor={THEME.COLORS.GRAY_2} secureTextEntry - label={s.strings.enter_your_password} + label={lstrings.enter_your_password} onChangeText={this.onPasswordChanged} /> - {s.strings.spending_limits_tx_title} - {s.strings.spending_limits_tx_description} + {lstrings.spending_limits_tx_title} + {lstrings.spending_limits_tx_description} @@ -75,7 +75,7 @@ class SpendingLimitsComponent extends React.Component { value={transactionAmount.toString()} onChangeText={this.onTransactionAmountChanged} containerStyle={[{ flex: 1 }]} - label={s.strings.spending_limits_tx_title} + label={lstrings.spending_limits_tx_title} suffix={currencySymbol} autoCorrect={false} keyboardType="numeric" @@ -84,7 +84,7 @@ class SpendingLimitsComponent extends React.Component { - {s.strings.save} + {lstrings.save} diff --git a/src/components/scenes/Staking/StakeModifyScene.tsx b/src/components/scenes/Staking/StakeModifyScene.tsx index d5f959c9ee7..161f0c039dc 100644 --- a/src/components/scenes/Staking/StakeModifyScene.tsx +++ b/src/components/scenes/Staking/StakeModifyScene.tsx @@ -5,7 +5,7 @@ import { Image, View } from 'react-native' import { ScrollView } from 'react-native-gesture-handler' import { sprintf } from 'sprintf-js' -import s from '../../../locales/strings' +import { lstrings } from '../../../locales/strings' import { ChangeQuote, ChangeQuoteRequest, QuoteAllocation, StakeBelowLimitError, StakePoolFullError } from '../../../plugins/stake-plugins/types' import { getDenominationFromCurrencyInfo, getDisplayDenomination } from '../../../selectors/DenominationSelectors' import { useSelector } from '../../../types/reactRedux' @@ -108,7 +108,7 @@ const StakeModifySceneComponent = (props: Props) => { // Display error msg tile if (err instanceof StakeBelowLimitError) { const { currencyCode, nativeMin } = err - let errMessage = changeQuoteRequest.action === 'stake' ? s.strings.stake_error_stake_below_minimum : s.strings.stake_error_unstake_below_minimum + let errMessage = changeQuoteRequest.action === 'stake' ? lstrings.stake_error_stake_below_minimum : lstrings.stake_error_unstake_below_minimum if (nativeMin != null) { wallet.nativeToDenomination(nativeMin, currencyCode).then(minExchangeAmount => { errMessage += `: ${minExchangeAmount} ${currencyCode}` @@ -119,7 +119,7 @@ const StakeModifySceneComponent = (props: Props) => { } } else if (err instanceof StakePoolFullError) { const { currencyCode } = err - const errMessage = sprintf(s.strings.state_error_pool_full_s, currencyCode) + const errMessage = sprintf(lstrings.state_error_pool_full_s, currencyCode) setErrorMessage(errMessage) } else { setErrorMessage(err.message) @@ -155,9 +155,9 @@ const StakeModifySceneComponent = (props: Props) => { const handleSlideComplete = (reset: () => void) => { const message = { - stake: s.strings.stake_change_stake_success, - unstake: s.strings.stake_change_unstake_success, - claim: s.strings.stake_change_claim_success, + stake: lstrings.stake_change_stake_success, + unstake: lstrings.stake_change_unstake_success, + claim: lstrings.stake_change_claim_success, unstakeExact: '' } @@ -180,7 +180,7 @@ const StakeModifySceneComponent = (props: Props) => { } const handleShowFlipInputModal = (currencyCode: string) => () => { - const header = modification === 'stake' ? s.strings.stake_modal_modify_stake_title : s.strings.stake_modal_modify_unstake_title + const header = modification === 'stake' ? lstrings.stake_modal_modify_stake_title : lstrings.stake_modal_modify_unstake_title // TODO: Max button needs to be enabled after max calculation for // multi-asset staking is fully implemented and working in plugin @@ -210,11 +210,11 @@ const StakeModifySceneComponent = (props: Props) => { let title: string let message: string if (modification === 'stake') { - title = s.strings.stake_estimated_staking_fee - message = s.strings.stake_staking_fee_message + title = lstrings.stake_estimated_staking_fee + message = lstrings.stake_staking_fee_message } else { - title = s.strings.stake_estimated_unstaking_fee - message = s.strings.stake_unstaking_fee_message + title = lstrings.stake_estimated_unstaking_fee + message = lstrings.stake_unstaking_fee_message } Airship.show<'ok' | undefined>(bridge => ( @@ -223,7 +223,7 @@ const StakeModifySceneComponent = (props: Props) => { title={title} message={message} buttons={{ - ok: { label: s.strings.string_ok } + ok: { label: lstrings.string_ok } }} /> )) @@ -233,10 +233,10 @@ const StakeModifySceneComponent = (props: Props) => { Airship.show<'ok' | undefined>(bridge => ( )) @@ -246,10 +246,10 @@ const StakeModifySceneComponent = (props: Props) => { Airship.show<'ok' | undefined>(bridge => ( )) @@ -275,10 +275,10 @@ const StakeModifySceneComponent = (props: Props) => { const title = allocationType === 'stake' - ? sprintf(s.strings.stake_amount_s_stake, quoteCurrencyCode) + ? sprintf(lstrings.stake_amount_s_stake, quoteCurrencyCode) : allocationType === 'unstake' - ? sprintf(s.strings.stake_amount_s_unstake, quoteCurrencyCode) - : sprintf(s.strings.stake_amount_claim, quoteCurrencyCode) + ? sprintf(lstrings.stake_amount_s_unstake, quoteCurrencyCode) + : sprintf(lstrings.stake_amount_claim, quoteCurrencyCode) const nativeAmount = zeroString(quoteAllocation?.nativeAmount) ? '' : quoteAllocation?.nativeAmount ?? '' const earnedAmount = existingAllocations.earned[0]?.nativeAmount ?? '0' @@ -312,7 +312,7 @@ const StakeModifySceneComponent = (props: Props) => { if (quoteAllocation == null) return null const quoteDenom = getDenominationFromCurrencyInfo(wallet.currencyInfo, currencyCode) - const title = modification === 'stake' ? s.strings.stake_estimated_staking_fee : s.strings.stake_estimated_unstaking_fee + const title = modification === 'stake' ? lstrings.stake_estimated_staking_fee : lstrings.stake_estimated_unstaking_fee return ( { return ( { let message: string if (breakEvenDays > 60) { - message = sprintf(s.strings.stake_break_even_days_months_s, days, months) + message = sprintf(lstrings.stake_break_even_days_months_s, days, months) } else { - message = sprintf(s.strings.stake_break_even_days_s, days) + message = sprintf(lstrings.stake_break_even_days_s, days) } return ( - + {message} ) @@ -381,19 +381,19 @@ const StakeModifySceneComponent = (props: Props) => { if (modification === 'stake') { if (stakeWarning === null) return null - warningMessage = stakeWarning ?? s.strings.stake_warning_stake + warningMessage = stakeWarning ?? lstrings.stake_warning_stake } if (modification === 'claim') { if (claimWarning === null) return null - warningMessage = claimWarning ?? s.strings.stake_warning_claim + warningMessage = claimWarning ?? lstrings.stake_warning_claim } if (modification === 'unstake') { if (unstakeWarning === null) return null - warningMessage = unstakeWarning ?? isRemainingStakedAmount ? s.strings.stake_warning_unstake : null + warningMessage = unstakeWarning ?? isRemainingStakedAmount ? lstrings.stake_warning_unstake : null } } return warningMessage == null ? null : ( - + ) } @@ -402,7 +402,7 @@ const StakeModifySceneComponent = (props: Props) => { return ( - + {getWalletName(wallet)} { @@ -424,7 +424,7 @@ const StakeModifySceneComponent = (props: Props) => { { // Render network fee tile { return { stake: getPolicyTitleName(stakePolicy), - claim: s.strings.stake_claim_rewards, + claim: lstrings.stake_claim_rewards, unstake: unstakeText, unstakeExact: '' // Only for internal use } @@ -480,7 +480,7 @@ const StakeModifySceneComponent = (props: Props) => { onSlidingComplete={handleSlideComplete} disabled={isSliderDisabled} showSpinner={sliderLocked} - disabledText={s.strings.stake_disabled_slider} + disabledText={lstrings.stake_disabled_slider} /> diff --git a/src/components/scenes/Staking/StakeOptionsScene.tsx b/src/components/scenes/Staking/StakeOptionsScene.tsx index 175189dc20d..f571036ca4b 100644 --- a/src/components/scenes/Staking/StakeOptionsScene.tsx +++ b/src/components/scenes/Staking/StakeOptionsScene.tsx @@ -5,7 +5,7 @@ import { View } from 'react-native' import { TouchableOpacity } from 'react-native-gesture-handler' import { sprintf } from 'sprintf-js' -import s from '../../../locales/strings' +import { lstrings } from '../../../locales/strings' import { StakePolicy } from '../../../plugins/stake-plugins/types' import { useSelector } from '../../../types/reactRedux' import { NavigationProp, RouteProp } from '../../../types/routerTypes' @@ -69,11 +69,11 @@ const StakeOptionsSceneComponent = (props: Props) => { return ( - + - {s.strings.stake_select_options} + {lstrings.stake_select_options} stakePolicy.stakePolicyId} /> diff --git a/src/components/scenes/Staking/StakeOverviewScene.tsx b/src/components/scenes/Staking/StakeOverviewScene.tsx index ae9585a910e..696d8c5841f 100644 --- a/src/components/scenes/Staking/StakeOverviewScene.tsx +++ b/src/components/scenes/Staking/StakeOverviewScene.tsx @@ -4,7 +4,7 @@ import * as React from 'react' import { View } from 'react-native' import { sprintf } from 'sprintf-js' -import s from '../../../locales/strings' +import { lstrings } from '../../../locales/strings' import { ChangeQuoteRequest, PositionAllocation, StakePosition } from '../../../plugins/stake-plugins/types' import { getDisplayDenominationFromState } from '../../../selectors/DenominationSelectors' import { useDispatch, useSelector } from '../../../types/reactRedux' @@ -99,7 +99,7 @@ const StakeOverviewSceneComponent = (props: Props) => { // Renderers const renderCFAT = ({ item }: { item: PositionAllocation }) => { const { allocationType, currencyCode, nativeAmount } = item - const titleBase = allocationType === 'staked' ? s.strings.stake_s_staked : s.strings.stake_s_earned + const titleBase = allocationType === 'staked' ? lstrings.stake_s_staked : lstrings.stake_s_earned const title = `${sprintf(titleBase, currencyCode)} ${getAllocationLocktimeMessage(item)}` const denomination = displayDenomMap[currencyCode] @@ -135,7 +135,7 @@ const StakeOverviewSceneComponent = (props: Props) => { keyExtractor={(allocation: PositionAllocation) => allocation.currencyCode + allocation.allocationType} /> { /> {stakePolicy.rewardsNotClaimable ? null : ( { let selected: string if (settingsPreferredSwapType === 'DEX') { - selected = s.strings.swap_preferred_dex + selected = lstrings.swap_preferred_dex } else if (settingsPreferredSwapType === 'CEX') { - selected = s.strings.swap_preferred_cex + selected = lstrings.swap_preferred_cex } else { - selected = exchanges[selectedPluginId] != null ? exchanges[selectedPluginId].swapInfo.displayName : s.strings.swap_preferred_cheapest + selected = exchanges[selectedPluginId] != null ? exchanges[selectedPluginId].swapInfo.displayName : lstrings.swap_preferred_cheapest } // Process Items @@ -120,17 +120,17 @@ export class SwapSettings extends React.Component { })) const preferCheapest = { - name: s.strings.swap_preferred_cheapest, + name: lstrings.swap_preferred_cheapest, icon: } const preferDex = { - name: s.strings.swap_preferred_dex, + name: lstrings.swap_preferred_dex, icon: } const preferCex = { - name: s.strings.swap_preferred_cex, + name: lstrings.swap_preferred_cex, icon: } @@ -138,7 +138,7 @@ export class SwapSettings extends React.Component { Airship.show(bridge => ( @@ -161,13 +161,13 @@ export class SwapSettings extends React.Component { - {s.strings.settings_exchange_instruction} + {lstrings.settings_exchange_instruction} - + {this.sortedDexIds.map(pluginId => this.renderPlugin(pluginId))} - + {this.sortedCexIds.map(pluginId => this.renderPlugin(pluginId))} - + {this.renderPreferredArea()} @@ -218,16 +218,16 @@ export class SwapSettings extends React.Component { icon: this.renderPluginIcon(pluginId) } : { - label: s.strings.swap_preferred_cheapest, + label: lstrings.swap_preferred_cheapest, icon: } if (settingsPreferredSwapType != null) { if (settingsPreferredSwapType === 'DEX') { - label = s.strings.swap_preferred_dex + label = lstrings.swap_preferred_dex icon = } else if (settingsPreferredSwapType === 'CEX') { - label = s.strings.swap_preferred_cex + label = lstrings.swap_preferred_cex icon = } } @@ -237,7 +237,7 @@ export class SwapSettings extends React.Component { return ( <> - {s.strings.swap_preferred_promo_instructions} + {lstrings.swap_preferred_promo_instructions} await this.props.removePromotion(swapSource.installerId)}> {icon} @@ -249,7 +249,7 @@ export class SwapSettings extends React.Component { return ( <> - {s.strings.swap_preferred_instructions} + {lstrings.swap_preferred_instructions} {icon} diff --git a/src/components/scenes/TransactionDetailsScene.tsx b/src/components/scenes/TransactionDetailsScene.tsx index 854b9d5ad87..939c7092982 100644 --- a/src/components/scenes/TransactionDetailsScene.tsx +++ b/src/components/scenes/TransactionDetailsScene.tsx @@ -8,7 +8,7 @@ import { sprintf } from 'sprintf-js' import { playSendSound } from '../../actions/SoundActions' import { refreshTransactionsRequest } from '../../actions/TransactionListActions' import { useContactThumbnail } from '../../hooks/redux/useContactThumbnail' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { useDispatch } from '../../types/reactRedux' import { NavigationProp, RouteProp } from '../../types/routerTypes' import { formatCategory, joinCategory, splitCategory } from '../../util/categories' @@ -97,7 +97,7 @@ class TransactionDetailsComponent extends React.Component { } openPersonInput = () => { - const personLabel = this.state.direction === 'receive' ? s.strings.transaction_details_payer : s.strings.transaction_details_payee + const personLabel = this.state.direction === 'receive' ? lstrings.transaction_details_payer : lstrings.transaction_details_payee Airship.show(bridge => ).then( person => { if (person != null) this.onSaveTxDetails({ name: person.contactName }) @@ -118,11 +118,11 @@ class TransactionDetailsComponent extends React.Component { )).then(notes => (notes != null ? this.onSaveTxDetails({ notes }) : null)) } @@ -143,7 +143,7 @@ class TransactionDetailsComponent extends React.Component { if (signedTx != null) { playSendSound().catch(error => console.log(error)) - showToast(s.strings.transaction_details_accelerate_transaction_sent) + showToast(lstrings.transaction_details_accelerate_transaction_sent) navigation.pop() navigation.push('transactionDetails', { @@ -155,7 +155,7 @@ class TransactionDetailsComponent extends React.Component { if (err?.message === 'transaction underpriced') { const newAcceleratedTx = await this.makeAcceleratedTx(acceleratedTx) this.setState({ acceleratedTx: newAcceleratedTx }) - showError(s.strings.transaction_details_accelerate_transaction_fee_too_low) + showError(lstrings.transaction_details_accelerate_transaction_fee_too_low) return } showError(err) @@ -199,9 +199,9 @@ class TransactionDetailsComponent extends React.Component { const { direction, acceleratedTx, name, notes, category } = this.state const styles = getStyles(theme) - const personLabel = direction === 'receive' ? s.strings.transaction_details_sender : s.strings.transaction_details_recipient + const personLabel = direction === 'receive' ? lstrings.transaction_details_sender : lstrings.transaction_details_recipient const personName = name !== '' ? name : personLabel - const personHeader = sprintf(s.strings.transaction_details_person_name, personLabel) + const personHeader = sprintf(lstrings.transaction_details_person_name, personLabel) // spendTargets recipient addresses format let recipientsAddresses = '' @@ -231,19 +231,19 @@ class TransactionDetailsComponent extends React.Component { - + {categoriesText} - {edgeTransaction.spendTargets && } + {edgeTransaction.spendTargets && } {edgeTransaction.swapData == null ? null : } {acceleratedTx == null ? null : ( - + )} - + - {s.strings.transaction_details_view_advanced_data} + {lstrings.transaction_details_view_advanced_data} - + diff --git a/src/components/scenes/TransactionListScene.tsx b/src/components/scenes/TransactionListScene.tsx index 294db36be43..4fc83008fe5 100644 --- a/src/components/scenes/TransactionListScene.tsx +++ b/src/components/scenes/TransactionListScene.tsx @@ -7,7 +7,7 @@ import { useDispatch } from 'react-redux' import { fetchMoreTransactions } from '../../actions/TransactionListActions' import { SPECIAL_CURRENCY_INFO } from '../../constants/WalletAndCurrencyConstants' import { useHandler } from '../../hooks/useHandler' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { getExchangeDenomination } from '../../selectors/DenominationSelectors' import { useSelector } from '../../types/reactRedux' import { NavigationProp, RouteProp } from '../../types/routerTypes' @@ -152,7 +152,7 @@ class TransactionListComponent extends React.PureComponent { return sections } - emptySection = () => [{ title: s.strings.transaction_list_search_no_result, data: [] }] + emptySection = () => [{ title: lstrings.transaction_list_search_no_result, data: [] }] renderEmptyComponent = () => { const { navigation, tokenId, numTransactions, wallet } = this.props diff --git a/src/components/scenes/TransactionsExportScene.tsx b/src/components/scenes/TransactionsExportScene.tsx index 4adbbec54f3..a8bd35a4fe5 100644 --- a/src/components/scenes/TransactionsExportScene.tsx +++ b/src/components/scenes/TransactionsExportScene.tsx @@ -7,7 +7,7 @@ import EntypoIcon from 'react-native-vector-icons/Entypo' import { exportTransactionsToCSV, exportTransactionsToQBO, updateTxsFiat } from '../../actions/TransactionExportActions' import { formatDate } from '../../locales/intl' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { getDisplayDenomination } from '../../selectors/DenominationSelectors' import { connect } from '../../types/reactRedux' import { RouteProp } from '../../types/routerTypes' @@ -96,14 +96,14 @@ class TransactionsExportSceneComponent extends React.PureComponent undefined} /> - } label={s.strings.export_transaction_date_range} /> - - - - - } label={s.strings.export_transaction_export_type} /> + } label={lstrings.export_transaction_date_range} /> + + + + + } label={lstrings.export_transaction_export_type} /> {Platform.OS === 'android' ? this.renderAndroidSwitches() : this.renderIosSwitches()} - {disabledExport ? null : } + {disabledExport ? null : } ) @@ -113,8 +113,8 @@ class TransactionsExportSceneComponent extends React.PureComponent const { isExportCsv, isExportQbo } = this.state return ( <> - - + + ) } @@ -123,8 +123,8 @@ class TransactionsExportSceneComponent extends React.PureComponent const { isExportCsv, isExportQbo } = this.state return ( <> - - + + ) } @@ -163,7 +163,7 @@ class TransactionsExportSceneComponent extends React.PureComponent const { sourceWallet, currencyCode } = route.params const { isExportQbo, isExportCsv, startDate, endDate } = this.state if (startDate.getTime() > endDate.getTime()) { - showError(s.strings.export_transaction_error) + showError(lstrings.export_transaction_error) return } @@ -205,7 +205,7 @@ class TransactionsExportSceneComponent extends React.PureComponent // which we are relying on to determine if the date range is empty: const csvFile = await exportTransactionsToCSV(sourceWallet, txs, transactionOptions) if (typeof csvFile !== 'string' || csvFile === '' || csvFile == null) { - showError(s.strings.export_transaction_export_error) + showError(lstrings.export_transaction_export_error) return } diff --git a/src/components/scenes/WalletListScene.tsx b/src/components/scenes/WalletListScene.tsx index f8389cd4e04..6dd5f00ec66 100644 --- a/src/components/scenes/WalletListScene.tsx +++ b/src/components/scenes/WalletListScene.tsx @@ -4,7 +4,7 @@ import { TouchableOpacity, View } from 'react-native' import { updateWalletsSort } from '../../actions/WalletListActions' import { useAsyncEffect } from '../../hooks/useAsyncEffect' import { useHandler } from '../../hooks/useHandler' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { useDispatch, useSelector } from '../../types/reactRedux' import { NavigationProp } from '../../types/routerTypes' import { CrossFade } from '../common/CrossFade' @@ -95,9 +95,9 @@ export function WalletListScene(props: Props) { {sorting && ( - {s.strings.title_wallets} + {lstrings.title_wallets} - {s.strings.string_done_cap} + {lstrings.string_done_cap} )} diff --git a/src/components/scenes/WcConnectScene.tsx b/src/components/scenes/WcConnectScene.tsx index 9cdd745d3c2..b7f1214e919 100644 --- a/src/components/scenes/WcConnectScene.tsx +++ b/src/components/scenes/WcConnectScene.tsx @@ -9,7 +9,7 @@ import { selectWalletToken } from '../../actions/WalletActions' import { MAX_ADDRESS_CHARACTERS } from '../../constants/WalletAndCurrencyConstants' import { useWalletName } from '../../hooks/useWalletName' import { useWatch } from '../../hooks/useWatch' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { useDispatch, useSelector } from '../../types/reactRedux' import { NavigationProp, RouteProp } from '../../types/routerTypes' import { getTokenId } from '../../util/CurrencyInfoHelpers' @@ -57,7 +57,7 @@ export const WcConnectScene = (props: Props) => { try { await wallet.otherMethods.wcConnect(uri, walletAddress, wallet.id) connected.current = true - Airship.show(bridge => {}} />) + Airship.show(bridge => {}} />) navigation.navigate('wcConnections', {}) } catch (error: any) { console.error(`WalletConnect connection error: ${error.message}`) @@ -70,8 +70,8 @@ export const WcConnectScene = (props: Props) => { const dApp = await currencyWallets[walletId].otherMethods.wcInit({ uri }) const dAppName = String(dApp.peerMeta.name).split(' ')[0] setDappDetails({ - subTitleText: sprintf(s.strings.wc_confirm_subtitle, dAppName), - bodyTitleText: sprintf(s.strings.wc_confirm_body_title, dAppName), + subTitleText: sprintf(lstrings.wc_confirm_subtitle, dAppName), + bodyTitleText: sprintf(lstrings.wc_confirm_body_title, dAppName), // @ts-expect-error dAppImage: }) @@ -86,7 +86,7 @@ export const WcConnectScene = (props: Props) => { const allowedAssets = allowedCurrencyWallets.map(walletID => ({ pluginId: currencyWallets[walletID].currencyInfo.pluginId })) Airship.show(bridge => ( - + )).then(({ walletId, currencyCode }: WalletListResult) => { if (walletId && currencyCode) { const wallet = account.currencyWallets[walletId] @@ -116,7 +116,7 @@ export const WcConnectScene = (props: Props) => { const renderWalletSelect = () => { if (selectedWallet.walletId === '' && selectedWallet.currencyCode === '') { - return + return } else { const walletNameStr = truncateString(walletName || '', MAX_ADDRESS_CHARACTERS) const walletImage = ( @@ -133,7 +133,7 @@ export const WcConnectScene = (props: Props) => { return ( - + {dAppImage !== '' && dAppImage} @@ -143,12 +143,12 @@ export const WcConnectScene = (props: Props) => { {bodyTitleText} - {s.strings.wc_confirm_body} + {lstrings.wc_confirm_body} {renderWalletSelect()} {subTitleText !== '' && ( - + )} diff --git a/src/components/scenes/WcConnectionsScene.tsx b/src/components/scenes/WcConnectionsScene.tsx index 846f56e4c8a..cf185ec3e1f 100644 --- a/src/components/scenes/WcConnectionsScene.tsx +++ b/src/components/scenes/WcConnectionsScene.tsx @@ -4,7 +4,7 @@ import FastImage from 'react-native-fast-image' import AntDesignIcon from 'react-native-vector-icons/AntDesign' import { useWatch } from '../../hooks/useWatch' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { useSelector } from '../../types/reactRedux' import { NavigationProp } from '../../types/routerTypes' import { WcConnectionInfo, wcGetConnection } from '../../types/types' @@ -100,9 +100,9 @@ export const WcConnectionsScene = (props: Props) => { Airship.show(bridge => ( )) .then((result: string | undefined) => { @@ -120,17 +120,17 @@ export const WcConnectionsScene = (props: Props) => { return ( - + - {s.strings.wc_walletconnect_subtitle} + {lstrings.wc_walletconnect_subtitle} handleNewConnectionPress()} alignSelf="center" /> - {s.strings.wc_walletconnect_active_connections} + {lstrings.wc_walletconnect_active_connections} {connections.map((dAppConnection: WcConnectionInfo, index) => ( handleActiveConnectionPress(dAppConnection)}> diff --git a/src/components/scenes/WcDisconnectScene.tsx b/src/components/scenes/WcDisconnectScene.tsx index 8c32e6c5da7..e54fc69f3b1 100644 --- a/src/components/scenes/WcDisconnectScene.tsx +++ b/src/components/scenes/WcDisconnectScene.tsx @@ -5,7 +5,7 @@ import { View } from 'react-native' import FastImage from 'react-native-fast-image' import { useWatch } from '../../hooks/useWatch' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { useSelector } from '../../types/reactRedux' import { NavigationProp, RouteProp } from '../../types/routerTypes' import { Card } from '../cards/Card' @@ -45,7 +45,7 @@ export const WcDisconnectScene = (props: Props) => { return ( - + @@ -57,9 +57,9 @@ export const WcDisconnectScene = (props: Props) => { - - - + + + ) } diff --git a/src/components/services/LoanManagerService.ts b/src/components/services/LoanManagerService.ts index 94141119d63..f62bbf57f64 100644 --- a/src/components/services/LoanManagerService.ts +++ b/src/components/services/LoanManagerService.ts @@ -10,7 +10,7 @@ import { checkLoanHasFunds } from '../../controllers/loan-manager/util/checkLoan import { waitForBorrowEngineSync } from '../../controllers/loan-manager/util/waitForLoanAccountSync' import { useAllTokens } from '../../hooks/useAllTokens' import { useAsyncEffect } from '../../hooks/useAsyncEffect' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { BorrowEngine } from '../../plugins/borrow-plugins/types' import { useState } from '../../types/reactHooks' import { useDispatch, useSelector } from '../../types/reactRedux' @@ -150,8 +150,8 @@ export const LoanManagerService = (props: Props) => { belowRate: thresholdRate } const pushMessage: PushMessage = { - title: s.strings.loan_notification_ltv_threshold_alert_title, - body: s.strings.loan_notification_ltv_threshold_alert_message + title: lstrings.loan_notification_ltv_threshold_alert_title, + body: lstrings.loan_notification_ltv_threshold_alert_message } const newPushEvent: NewPushEvent = { eventId, trigger, pushMessage } const loginUpdatePayload: LoginUpdatePayload = { diff --git a/src/components/services/NetworkActivity.ts b/src/components/services/NetworkActivity.ts index 4bb3990abe8..3e28045e4f9 100644 --- a/src/components/services/NetworkActivity.ts +++ b/src/components/services/NetworkActivity.ts @@ -1,7 +1,7 @@ import NetInfo, { NetInfoState } from '@react-native-community/netinfo' import * as React from 'react' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { connect } from '../../types/reactRedux' import { showError } from './AirshipInstance' @@ -17,7 +17,7 @@ class NetworkActivityComponent extends React.Component { console.log('NetworkActivity - isConnected changed: ', info.isConnected) this.props.changeConnectivity(info.isConnected ?? false) if (!info.isConnected) { - showError(`${s.strings.network_alert_title}`) + showError(`${lstrings.network_alert_title}`) } } diff --git a/src/components/themed/BuyCrypto.tsx b/src/components/themed/BuyCrypto.tsx index cbf6c0a8546..48e02bcb31c 100644 --- a/src/components/themed/BuyCrypto.tsx +++ b/src/components/themed/BuyCrypto.tsx @@ -6,7 +6,7 @@ import { sprintf } from 'sprintf-js' import { IONIA_SUPPORTED_FIATS } from '../../constants/plugins/GuiPlugins' import { SPECIAL_CURRENCY_INFO } from '../../constants/WalletAndCurrencyConstants' import { useHandler } from '../../hooks/useHandler' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { getDefaultFiat } from '../../selectors/SettingsSelectors' import { config } from '../../theme/appConfig' import { useSelector } from '../../types/reactRedux' @@ -41,9 +41,9 @@ export const BuyCrypto = (props: Props) => { const { displayName, pluginId } = wallet.currencyInfo - let message = s.strings.transaction_list_buy_crypto_message + let message = lstrings.transaction_list_buy_crypto_message if (!hideIoniaRewards && ioniaPluginIds.includes(pluginId) && IONIA_SUPPORTED_FIATS.includes(defaultFiat)) { - message = s.strings.transaction_list_buy_and_earn_crypto_message + message = lstrings.transaction_list_buy_and_earn_crypto_message } return ( @@ -60,7 +60,7 @@ export const BuyCrypto = (props: Props) => { )} - {s.strings.transaction_list_no_tx_yet} + {lstrings.transaction_list_no_tx_yet} ) diff --git a/src/components/themed/ControlPanel.tsx b/src/components/themed/ControlPanel.tsx index 9925d66863d..5b76bfeaf90 100644 --- a/src/components/themed/ControlPanel.tsx +++ b/src/components/themed/ControlPanel.tsx @@ -25,7 +25,7 @@ import { guiPlugins, IONIA_SUPPORTED_FIATS } from '../../constants/plugins/GuiPl import { ENV } from '../../env' import { useSelectedWallet } from '../../hooks/useSelectedWallet' import { useWatch } from '../../hooks/useWatch' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { getDisplayDenomination } from '../../selectors/DenominationSelectors' import { getDefaultFiat } from '../../selectors/SettingsSelectors' import { config } from '../../theme/appConfig' @@ -95,18 +95,18 @@ export function ControlPanel(props: DrawerContentComponentProps) { Airship.show<'ok' | 'cancel' | undefined>(bridge => ( { await dispatch(deleteLocalAccount(username)) return true }, type: 'primary' }, - cancel: { label: s.strings.string_cancel_cap, type: 'secondary' } + cancel: { label: lstrings.string_cancel_cap, type: 'secondary' } }} /> )) @@ -126,15 +126,15 @@ export function ControlPanel(props: DrawerContentComponentProps) { Airship.show(bridge => ( - {s.strings.enter_any_title} - {s.strings.enter_any_body} + {lstrings.enter_any_title} + {lstrings.enter_any_body} } - textModalHint={s.strings.enter_any_input_hint} + textModalHint={lstrings.enter_any_input_hint} /> )) .then((result: string | undefined) => { @@ -147,7 +147,7 @@ export function ControlPanel(props: DrawerContentComponentProps) { } const handleShareApp = () => { - const message = `${sprintf(s.strings.share_subject, config.appName)}\n\n${s.strings.share_message}\n\n` + const message = `${sprintf(lstrings.share_subject, config.appName)}\n\n${lstrings.share_message}\n\n` const shareOptions = { message: Platform.OS === 'ios' ? message : message + EDGE_URL, @@ -214,7 +214,7 @@ export function ControlPanel(props: DrawerContentComponentProps) { navigation.dispatch(DrawerActions.closeDrawer()) }, iconName: 'control-panel-fio-names', - title: s.strings.drawer_fio_names + title: lstrings.drawer_fio_names }, { pressHandler: () => { @@ -222,7 +222,7 @@ export function ControlPanel(props: DrawerContentComponentProps) { navigation.dispatch(DrawerActions.closeDrawer()) }, iconName: 'control-panel-fio', - title: s.strings.drawer_fio_requests + title: lstrings.drawer_fio_requests }, { pressHandler: () => { @@ -230,35 +230,35 @@ export function ControlPanel(props: DrawerContentComponentProps) { navigation.dispatch(DrawerActions.closeDrawer()) }, iconName: 'control-panel-wallet-connect', - title: s.strings.wc_walletconnect_title + title: lstrings.wc_walletconnect_title }, { pressHandler: () => handleScanQr(), iconName: 'control-panel-scan-qr', - title: s.strings.drawer_scan_qr_send + title: lstrings.drawer_scan_qr_send }, - ...(ENV.BETA_FEATURES ? [{ pressHandler: handleBorrow, iconName: 'control-panel-borrow', title: s.strings.drawer_borrow_dollars }] : []), + ...(ENV.BETA_FEATURES ? [{ pressHandler: handleBorrow, iconName: 'control-panel-borrow', title: lstrings.drawer_borrow_dollars }] : []), { pressHandler: () => { navigation.navigate('termsOfService', {}) navigation.dispatch(DrawerActions.closeDrawer()) }, iconName: 'control-panel-tos', - title: s.strings.title_terms_of_service + title: lstrings.title_terms_of_service }, - { pressHandler: handleShareApp, iconName: 'control-panel-share', title: s.strings.string_share + ' ' + config.appName }, + { pressHandler: handleShareApp, iconName: 'control-panel-share', title: lstrings.string_share + ' ' + config.appName }, { pressHandler: () => { navigation.navigate('settingsOverview', {}) navigation.dispatch(DrawerActions.closeDrawer()) }, iconName: 'control-panel-settings', - title: s.strings.settings_title + title: lstrings.settings_title }, { pressHandler: async () => await dispatch(logoutRequest(navigation)), iconName: 'control-panel-logout', - title: s.strings.settings_button_logout + title: lstrings.settings_button_logout }, // Dummy row that goes under the transparent close button { @@ -274,7 +274,7 @@ export function ControlPanel(props: DrawerContentComponentProps) { navigation.dispatch(DrawerActions.closeDrawer()) }, iconNameFontAwesome: 'hand-holding-usd', - title: sprintf(s.strings.side_menu_rewards_button_1s, defaultFiat) + title: sprintf(lstrings.side_menu_rewards_button_1s, defaultFiat) }) } @@ -293,7 +293,7 @@ export function ControlPanel(props: DrawerContentComponentProps) { {/* ==== Rate Display Start ==== */} {selectedWallet == null || selectedDenomination == null ? ( - {s.strings.exchange_rate_loading_singular} + {lstrings.exchange_rate_loading_singular} ) : ( <> diff --git a/src/components/themed/CryptoExchangeFlipInputWrapperComponent.tsx b/src/components/themed/CryptoExchangeFlipInputWrapperComponent.tsx index 624d18c90e2..c0d5e9bbff3 100644 --- a/src/components/themed/CryptoExchangeFlipInputWrapperComponent.tsx +++ b/src/components/themed/CryptoExchangeFlipInputWrapperComponent.tsx @@ -3,7 +3,7 @@ import * as React from 'react' import { ActivityIndicator, View } from 'react-native' import { formatNumber } from '../../locales/intl' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { connect } from '../../types/reactRedux' import { GuiCurrencyInfo } from '../../types/types' import { getTokenId } from '../../util/CurrencyInfoHelpers' @@ -71,7 +71,7 @@ export class CryptoExchangeFlipInputWrapperComponent extends React.Component - {s.strings.string_wallet_balance + ': ' + cryptoAmount + ' ' + primaryCurrencyInfo.displayDenomination.name} + {lstrings.string_wallet_balance + ': ' + cryptoAmount + ' ' + primaryCurrencyInfo.displayDenomination.name} ) } diff --git a/src/components/themed/ExchangeQuoteComponent.tsx b/src/components/themed/ExchangeQuoteComponent.tsx index 245156fdd8b..ff3d238959c 100644 --- a/src/components/themed/ExchangeQuoteComponent.tsx +++ b/src/components/themed/ExchangeQuoteComponent.tsx @@ -1,7 +1,7 @@ import * as React from 'react' import { View } from 'react-native' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { fixSides, mapSides, sidesToMargin } from '../../util/sides' import { Card } from '../cards/Card' import { CryptoIcon } from '../icons/CryptoIcon' @@ -43,11 +43,11 @@ export class ExchangeQuoteComponent extends React.PureComponent - {this.renderRow({s.strings.mining_fee}, {miningFee || '0'}, { + {this.renderRow({lstrings.mining_fee}, {miningFee || '0'}, { ...sidesToMargin(mapSides(fixSides([0.75, 0, 0], 0), theme.rem)) })} {this.renderRow( - {s.strings.string_total_amount}, + {lstrings.string_total_amount}, {totalText} )} diff --git a/src/components/themed/ExplorerCard.tsx b/src/components/themed/ExplorerCard.tsx index c7f3133cae1..16a1a981493 100644 --- a/src/components/themed/ExplorerCard.tsx +++ b/src/components/themed/ExplorerCard.tsx @@ -5,7 +5,7 @@ import { sprintf } from 'sprintf-js' import { SPECIAL_CURRENCY_INFO } from '../../constants/WalletAndCurrencyConstants' import { useHandler } from '../../hooks/useHandler' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { CryptoIcon } from '../icons/CryptoIcon' import { cacheStyles, Theme, useTheme } from '../services/ThemeContext' import { EdgeText } from './EdgeText' @@ -50,11 +50,11 @@ export const ExplorerCard = (props: Props) => { - {s.strings.transaction_details_advance_details_show_explorer} + {lstrings.transaction_details_advance_details_show_explorer} - {s.strings.transaction_list_no_tx_support_yet} + {lstrings.transaction_list_no_tx_support_yet} ) diff --git a/src/components/themed/FioRequestRow.tsx b/src/components/themed/FioRequestRow.tsx index fb11d8cfa82..1751a2bef21 100644 --- a/src/components/themed/FioRequestRow.tsx +++ b/src/components/themed/FioRequestRow.tsx @@ -7,7 +7,7 @@ import FontAwesome from 'react-native-vector-icons/FontAwesome' import { getSymbolFromCurrency } from '../../constants/WalletAndCurrencyConstants' import { formatNumber, formatTime } from '../../locales/intl' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { convertEdgeToFIOCodes, convertFIOToEdgeCodes } from '../../modules/FioAddress/util' import { isRejectedFioRequest, isSentFioRequest } from '../../modules/FioRequest/util' import { getDisplayDenomination } from '../../selectors/DenominationSelectors' @@ -59,7 +59,7 @@ class FioRequestRowComponent extends React.PureComponent { const { displayDenomination, fioRequest, theme } = this.props const styles = getStyles(theme) const name = displayDenomination.name || fioRequest.content.token_code.toUpperCase() - const value = `${s.strings.title_fio_requested} ${name}` + const value = `${lstrings.title_fio_requested} ${name}` return {value} } @@ -69,14 +69,14 @@ class FioRequestRowComponent extends React.PureComponent { const styles = getStyles(theme) let statusStyle = styles.requestPartialConfirmation - let label = s.strings.fragment_wallet_unconfirmed + let label = lstrings.fragment_wallet_unconfirmed if (isSentFioRequest(status)) { statusStyle = styles.requestDetailsReceivedTx - label = s.strings.fragment_transaction_list_receive_prefix + label = lstrings.fragment_transaction_list_receive_prefix } if (isRejectedFioRequest(status)) { statusStyle = styles.requestPending - label = s.strings.fio_reject_status + label = lstrings.fio_reject_status } return {label} } @@ -100,7 +100,7 @@ class FioRequestRowComponent extends React.PureComponent { : (isActive: SharedValue) => ( - {isSent ? s.strings.string_cancel_cap : s.strings.swap_terms_reject_button} + {isSent ? lstrings.string_cancel_cap : lstrings.swap_terms_reject_button} ) diff --git a/src/components/themed/FlipInput.tsx b/src/components/themed/FlipInput.tsx index 9366b863cfb..46180288603 100644 --- a/src/components/themed/FlipInput.tsx +++ b/src/components/themed/FlipInput.tsx @@ -7,7 +7,7 @@ import Reamimated, { useAnimatedStyle, withDelay, withRepeat, withSequence, with import { Fontello } from '../../assets/vector' import { formatNumberInput, prettifyNumber, truncateDecimals, truncateDecimalsPeriod } from '../../locales/intl' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { DECIMAL_PRECISION, truncateDecimals as truncateDecimalsUtils, zeroString } from '../../util/utils' import { CryptoIcon } from '../icons/CryptoIcon' import { showError } from '../services/AirshipInstance' @@ -392,7 +392,7 @@ export class FlipInputComponent extends React.PureComponent { if (keyPressed === 'Backspace') { this.setStateAmounts(truncateDecimals(decimalAmount.slice(0, -1), maxEntryDecimals), setAmounts) } else if (!checkKeyPress(keyPressed, decimalAmount)) { - this.handleOnError(s.strings.invalid_character_error) + this.handleOnError(lstrings.invalid_character_error) } else { this.clearError() this.setStateAmounts(truncateDecimals(decimalAmount + keyPressed, maxEntryDecimals), setAmounts) @@ -468,7 +468,7 @@ export class FlipInputComponent extends React.PureComponent { const onBlur = isFront ? this.textInputFrontFocusFalse : this.textInputBackFocusFalse const ref = isFront ? this.getTextInputFrontRef : this.getTextInputBackRef const displayAmountCheck = (decimalAmount.match(/^0*$/) && !showCursor) || displayAmount === '' - const displayAmountString = displayAmountCheck ? s.strings.string_amount : displayAmount + const displayAmountString = displayAmountCheck ? lstrings.string_amount : displayAmount const displayAmountStyle = displayAmountCheck ? styles.bottomAmountMuted : styles.bottomAmount const currencyNameStyle = displayAmountCheck ? styles.bottomCurrencyMuted : styles.bottomCurrency @@ -537,7 +537,7 @@ export class FlipInputComponent extends React.PureComponent { - {s.strings.string_paste} + {lstrings.string_paste} diff --git a/src/components/themed/FlipInput2.tsx b/src/components/themed/FlipInput2.tsx index ee2c893c21d..e8986d06d13 100644 --- a/src/components/themed/FlipInput2.tsx +++ b/src/components/themed/FlipInput2.tsx @@ -6,7 +6,7 @@ import Animated, { AnimationCallback, Easing, interpolate, runOnJS, useAnimatedS import { Fontello } from '../../assets/vector' import { useHandler } from '../../hooks/useHandler' import { formatNumberInput, isValidInput } from '../../locales/intl' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { useState } from '../../types/reactHooks' import { NumericInput } from '../modals/NumericInput' import { showError } from '../services/AirshipInstance' @@ -131,7 +131,7 @@ export const FlipInput2 = React.forwardRef((props: Props, r style={styles.bottomAmount} value={primaryAmount} maxDecimals={fieldInfos[fieldNum].maxEntryDecimals} - placeholder={amountBlank ? s.strings.string_amount : ''} + placeholder={amountBlank ? lstrings.string_amount : ''} placeholderTextColor={theme.deactivatedText} onChangeText={onNumericInputChange} autoCorrect={false} diff --git a/src/components/themed/MaybeCustomServersSetting.tsx b/src/components/themed/MaybeCustomServersSetting.tsx index ddcd01f7a98..099509ff45d 100644 --- a/src/components/themed/MaybeCustomServersSetting.tsx +++ b/src/components/themed/MaybeCustomServersSetting.tsx @@ -3,7 +3,7 @@ import * as React from 'react' import { Text, TouchableOpacity } from 'react-native' import { sprintf } from 'sprintf-js' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { logActivity } from '../../util/logger' import { CurrencySettingProps, maybeCurrencySetting } from '../hoc/MaybeCurrencySetting' import { TextInputModal } from '../modals/TextInputModal' @@ -26,7 +26,7 @@ function CustomServersSettingComponent(props: Props) { const theme = useTheme() const styles = getStyles(theme) - const titleText = extraInfo == null ? s.strings.settings_custom_nodes_title : sprintf(s.strings.settings_custom_servers_title, extraInfo) + const titleText = extraInfo == null ? lstrings.settings_custom_nodes_title : sprintf(lstrings.settings_custom_servers_title, extraInfo) const customServerSet = new Set(customServers) async function handleToggleEnabled(): Promise { @@ -62,8 +62,8 @@ function CustomServersSettingComponent(props: Props) { autoCorrect={false} bridge={bridge} initialValue={server ?? ''} - inputLabel={s.strings.settings_custom_node_url} - title={s.strings.settings_edit_custom_node} + inputLabel={lstrings.settings_custom_node_url} + title={lstrings.settings_edit_custom_node} onSubmit={handleSubmit} /> )) @@ -72,7 +72,7 @@ function CustomServersSettingComponent(props: Props) { return ( <> - + {!enableCustomServers ? null : ( <> {Array.from(customServerSet).map(server => ( @@ -82,7 +82,7 @@ function CustomServersSettingComponent(props: Props) { ))} - + )} @@ -168,8 +168,8 @@ const asElectrumServersSetting: Cleaner = asCodec( // Individual settings sections: // -export const MaybeBlockbookSetting = maybeCurrencySetting(CustomServersSettingComponent, asBlockbookServersSetting, s.strings.settings_blockbook) +export const MaybeBlockbookSetting = maybeCurrencySetting(CustomServersSettingComponent, asBlockbookServersSetting, lstrings.settings_blockbook) export const MaybeCustomServersSetting = maybeCurrencySetting(CustomServersSettingComponent, asCustomServersSetting, undefined) -export const MaybeElectrumSetting = maybeCurrencySetting(CustomServersSettingComponent, asElectrumServersSetting, s.strings.settings_electrum) +export const MaybeElectrumSetting = maybeCurrencySetting(CustomServersSettingComponent, asElectrumServersSetting, lstrings.settings_electrum) diff --git a/src/components/themed/MenuTabs.tsx b/src/components/themed/MenuTabs.tsx index 2aeebe2adca..3868c6dbaf2 100644 --- a/src/components/themed/MenuTabs.tsx +++ b/src/components/themed/MenuTabs.tsx @@ -9,7 +9,7 @@ import Ionicon from 'react-native-vector-icons/Ionicons' import { Fontello } from '../../assets/vector/index' import { useHandler } from '../../hooks/useHandler' import { LocaleStringKey } from '../../locales/en_US' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { config } from '../../theme/appConfig' import { cacheStyles, Theme, useTheme } from '../services/ThemeContext' import { DividerLine } from './DividerLine' @@ -19,12 +19,12 @@ import { VectorIcon } from './VectorIcon' const extraTabString: LocaleStringKey = config.extraTab?.tabTitleKey ?? 'title_map' const title: { readonly [key: string]: string } = { - marketsTab: s.strings.title_markets, - walletsTab: s.strings.title_wallets, - buyTab: s.strings.title_buy, - sellTab: s.strings.title_sell, - exchangeTab: s.strings.title_exchange, - extraTab: s.strings[extraTabString] + marketsTab: lstrings.title_markets, + walletsTab: lstrings.title_wallets, + buyTab: lstrings.title_buy, + sellTab: lstrings.title_sell, + exchangeTab: lstrings.title_exchange, + extraTab: lstrings[extraTabString] } export const MenuTabs = (props: BottomTabBarProps) => { diff --git a/src/components/themed/SafeSlider.tsx b/src/components/themed/SafeSlider.tsx index cade727f27f..d76333d9c1e 100644 --- a/src/components/themed/SafeSlider.tsx +++ b/src/components/themed/SafeSlider.tsx @@ -5,7 +5,7 @@ import Animated, { Easing, runOnJS, useAnimatedGestureHandler, useAnimatedStyle, import Entypo from 'react-native-vector-icons/Entypo' import { useHandler } from '../../hooks/useHandler' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { triggerHaptic } from '../../util/haptic' import { cacheStyles, Theme, useTheme } from '../services/ThemeContext' import { EdgeText } from './EdgeText' @@ -34,7 +34,7 @@ export const SafeSlider = (props: Props) => { const upperBound = width - theme.confirmationSliderThumbWidth const widthStyle = { width } const sliderDisabled = disabled || completed - const sliderText = !sliderDisabled ? s.strings.send_confirmation_slide_to_confirm : disabledText || s.strings.select_exchange_amount_short + const sliderText = !sliderDisabled ? lstrings.send_confirmation_slide_to_confirm : disabledText || lstrings.select_exchange_amount_short const translateX = useSharedValue(upperBound) const isSliding = useSharedValue(false) diff --git a/src/components/themed/SelectFioAddress.tsx b/src/components/themed/SelectFioAddress.tsx index 0003954ea19..7dc800aa8a7 100644 --- a/src/components/themed/SelectFioAddress.tsx +++ b/src/components/themed/SelectFioAddress.tsx @@ -4,7 +4,7 @@ import { View } from 'react-native' import { refreshAllFioAddresses } from '../../actions/FioAddressActions' import { FIO_STR } from '../../constants/WalletAndCurrencyConstants' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { checkRecordSendFee, findWalletByFioAddress, FIO_NO_BUNDLED_ERR_CODE } from '../../modules/FioAddress/util' import { getSelectedCurrencyWallet } from '../../selectors/WalletSelectors' import { connect } from '../../types/reactRedux' @@ -117,7 +117,7 @@ export class SelectFioAddressComponent extends React.PureComponent { const { currencyCode, selectedWalletId } = this.props Airship.show(bridge => ( - + )).then(response => { if (response) { this.setFioAddress(response) @@ -130,11 +130,11 @@ export class SelectFioAddressComponent extends React.PureComponent )).then(memo => { if (memo != null) this.handleMemoChange(memo) @@ -157,7 +157,7 @@ export class SelectFioAddressComponent extends React.PureComponent(bridge => ( )) @@ -199,10 +199,10 @@ export class SelectFioAddressComponent extends React.PureComponent { let memoError = '' if (memo && memo.length > 64) { - memoError = s.strings.send_fio_request_error_memo_inline + memoError = lstrings.send_fio_request_error_memo_inline } if (memo && !/^[\x20-\x7E]*$/.test(memo)) { - memoError = s.strings.send_fio_request_error_memo_invalid_character + memoError = lstrings.send_fio_request_error_memo_invalid_character } this.props.onMemoChange(memo, memoError) } @@ -214,7 +214,7 @@ export class SelectFioAddressComponent extends React.PureComponent @@ -231,7 +231,7 @@ export class SelectFioAddressComponent extends React.PureComponent + {memoError} ) @@ -240,8 +240,8 @@ export class SelectFioAddressComponent extends React.PureComponent ) diff --git a/src/components/themed/SelectFioAddress2.tsx b/src/components/themed/SelectFioAddress2.tsx index aeff5e8690b..c380b1e9c1f 100644 --- a/src/components/themed/SelectFioAddress2.tsx +++ b/src/components/themed/SelectFioAddress2.tsx @@ -4,7 +4,7 @@ import { View } from 'react-native' import { refreshAllFioAddresses } from '../../actions/FioAddressActions' import { FIO_STR } from '../../constants/WalletAndCurrencyConstants' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { checkRecordSendFee, findWalletByFioAddress, FIO_NO_BUNDLED_ERR_CODE } from '../../modules/FioAddress/util' import { connect } from '../../types/reactRedux' import { NavigationBase } from '../../types/routerTypes' @@ -116,7 +116,7 @@ export class SelectFioAddressComponent extends React.PureComponent { const { currencyCode, coreWallet } = this.props Airship.show(bridge => ( - + )).then(response => { if (response) { this.setFioAddress(response) @@ -129,11 +129,11 @@ export class SelectFioAddressComponent extends React.PureComponent )).then(memo => { if (memo != null) this.handleMemoChange(memo) @@ -156,7 +156,7 @@ export class SelectFioAddressComponent extends React.PureComponent(bridge => ( )) @@ -198,10 +198,10 @@ export class SelectFioAddressComponent extends React.PureComponent { let memoError = '' if (memo && memo.length > 64) { - memoError = s.strings.send_fio_request_error_memo_inline + memoError = lstrings.send_fio_request_error_memo_inline } if (memo && !/^[\x20-\x7E]*$/.test(memo)) { - memoError = s.strings.send_fio_request_error_memo_invalid_character + memoError = lstrings.send_fio_request_error_memo_invalid_character } this.props.onMemoChange(memo, memoError) } @@ -213,7 +213,7 @@ export class SelectFioAddressComponent extends React.PureComponent @@ -230,7 +230,7 @@ export class SelectFioAddressComponent extends React.PureComponent + {memoError} ) @@ -239,8 +239,8 @@ export class SelectFioAddressComponent extends React.PureComponent ) diff --git a/src/components/themed/ShareButtons.tsx b/src/components/themed/ShareButtons.tsx index 81da01bfda2..8ef7f6fc26c 100644 --- a/src/components/themed/ShareButtons.tsx +++ b/src/components/themed/ShareButtons.tsx @@ -3,7 +3,7 @@ import { TouchableOpacity, View } from 'react-native' import { Fontello } from '../../assets/vector/index' import { useHandler } from '../../hooks/useHandler' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { cacheStyles, Theme, useTheme } from '../services/ThemeContext' import { EdgeText } from '../themed/EdgeText' @@ -20,9 +20,9 @@ export function ShareButtons(props: Props) { return ( - - - + + + ) } diff --git a/src/components/themed/Slider.tsx b/src/components/themed/Slider.tsx index 614af5e22c7..e5fd4ac6ada 100644 --- a/src/components/themed/Slider.tsx +++ b/src/components/themed/Slider.tsx @@ -5,7 +5,7 @@ import Animated, { Easing, runOnJS, useAnimatedGestureHandler, useAnimatedStyle, import Entypo from 'react-native-vector-icons/Entypo' import { useHandler } from '../../hooks/useHandler' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { triggerHaptic } from '../../util/haptic' import { cacheStyles, Theme, ThemeProps, withTheme } from '../services/ThemeContext' import { EdgeText } from './EdgeText' @@ -47,7 +47,7 @@ export const SliderComponent = (props: Props) => { const upperBound = width - theme.confirmationSliderThumbWidth const widthStyle = { width } const sliderDisabled = disabled || showSpinner - const sliderText = !sliderDisabled ? s.strings.send_confirmation_slide_to_confirm : disabledText || s.strings.select_exchange_amount_short + const sliderText = !sliderDisabled ? lstrings.send_confirmation_slide_to_confirm : disabledText || lstrings.select_exchange_amount_short const translateX = useSharedValue(upperBound) const isSliding = useSharedValue(false) diff --git a/src/components/themed/TransactionListRow.tsx b/src/components/themed/TransactionListRow.tsx index 2c77347b831..9350effd0b4 100644 --- a/src/components/themed/TransactionListRow.tsx +++ b/src/components/themed/TransactionListRow.tsx @@ -11,7 +11,7 @@ import { useHandler } from '../../hooks/useHandler' import { useHistoricalRate } from '../../hooks/useHistoricalRate' import { useWatch } from '../../hooks/useWatch' import { formatNumber } from '../../locales/intl' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { getDisplayDenomination, getExchangeDenomination } from '../../selectors/DenominationSelectors' import { useSelector } from '../../types/reactRedux' import { NavigationBase } from '../../types/routerTypes' @@ -82,7 +82,7 @@ export function TransactionListRow(props: Props) { const handlePress = useHandler(() => { if (transaction == null) { - return showError(s.strings.transaction_details_error_invalid) + return showError(lstrings.transaction_details_error_invalid) } navigation.push('transactionDetails', { edgeTransaction: transaction, diff --git a/src/components/themed/TransactionListTop.tsx b/src/components/themed/TransactionListTop.tsx index ebe0bfe37b8..e254582aa68 100644 --- a/src/components/themed/TransactionListTop.tsx +++ b/src/components/themed/TransactionListTop.tsx @@ -14,7 +14,7 @@ import { useHandler } from '../../hooks/useHandler' import { useWalletName } from '../../hooks/useWalletName' import { useWatch } from '../../hooks/useWatch' import { formatNumber } from '../../locales/intl' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { getStakePlugins } from '../../plugins/stake-plugins/stakePlugins' import { PositionAllocation, StakePlugin, StakePolicy } from '../../plugins/stake-plugins/types' import { getDisplayDenomination, getExchangeDenomination } from '../../selectors/DenominationSelectors' @@ -146,7 +146,7 @@ export class TransactionListTopComponent extends React.PureComponent { console.error(err) - showWarning(s.strings.stake_unable_to_query_locked) + showWarning(lstrings.stake_unable_to_query_locked) }) if (amount == null) return @@ -158,7 +158,7 @@ export class TransactionListTopComponent extends React.PureComponent { triggerHaptic('impactLight') const { navigation } = this.props - Airship.show(bridge => ).then( + Airship.show(bridge => ).then( ({ walletId, currencyCode }: WalletListResult) => { if (walletId != null && currencyCode != null) { navigation.setParams({ currencyCode, walletId }) @@ -213,7 +213,7 @@ export class TransactionListTopComponent extends React.PureComponent{fiatSymbol + fiatBalanceFormat + ' ' + fiatCurrencyCode} ) : ( - {s.strings.string_show_balance} + {lstrings.string_show_balance} )} @@ -251,7 +251,7 @@ export class TransactionListTopComponent extends React.PureComponent {sprintf( - s.strings.staking_status, + lstrings.staking_status, stakingCryptoAmountFormat + ' ' + displayDenomination.name, fiatSymbol + stakingFiatBalanceFormat + ' ' + fiatCurrencyCode )} @@ -370,7 +370,7 @@ export class TransactionListTopComponent extends React.PureComponent {searching && ( - {s.strings.string_done_cap} + {lstrings.string_done_cap} )} @@ -395,11 +395,11 @@ export class TransactionListTopComponent extends React.PureComponent - {s.strings.fragment_request_subtitle} + {lstrings.fragment_request_subtitle} - {s.strings.fragment_send_subtitle} + {lstrings.fragment_send_subtitle} {!isStakePoliciesLoaded ? ( @@ -407,7 +407,7 @@ export class TransactionListTopComponent extends React.PureComponent - {s.strings.stake_earn_button_label} + {lstrings.stake_earn_button_label} {bestApy != null ? {bestApy} : null} ) @@ -419,7 +419,7 @@ export class TransactionListTopComponent extends React.PureComponent {!isEmpty && !searching && ( - {s.strings.fragment_transaction_list_transaction} + {lstrings.fragment_transaction_list_transaction} )} diff --git a/src/components/themed/TransactionRow.tsx b/src/components/themed/TransactionRow.tsx index 29cdfcc8f82..e9409471a0d 100644 --- a/src/components/themed/TransactionRow.tsx +++ b/src/components/themed/TransactionRow.tsx @@ -6,7 +6,7 @@ import Ionicons from 'react-native-vector-icons/Ionicons' import { sprintf } from 'sprintf-js' import { useHandler } from '../../hooks/useHandler' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { TransactionListTx } from '../../types/types' import { formatCategory, splitCategory } from '../../util/categories' import { triggerHaptic } from '../../util/haptic' @@ -57,12 +57,12 @@ const TransactionRowComponent = (props: Props) => { let transactionText, transactionIcon, transactionStyle if (isSentTransaction) { transactionText = - transaction.metadata && transaction.metadata.name ? transaction.metadata.name : s.strings.fragment_transaction_list_sent_prefix + selectedCurrencyName + transaction.metadata && transaction.metadata.name ? transaction.metadata.name : lstrings.fragment_transaction_list_sent_prefix + selectedCurrencyName transactionIcon = transactionStyle = styles.iconSent } else { transactionText = - transaction.metadata && transaction.metadata.name ? transaction.metadata.name : s.strings.fragment_transaction_list_receive_prefix + selectedCurrencyName + transaction.metadata && transaction.metadata.name ? transaction.metadata.name : lstrings.fragment_transaction_list_receive_prefix + selectedCurrencyName transactionIcon = transactionStyle = styles.iconRequest } @@ -73,14 +73,14 @@ const TransactionRowComponent = (props: Props) => { currentConfirmations === 'confirmed' ? transaction.time : !isSentTransaction && canReplaceByFee && currentConfirmations === 'unconfirmed' - ? s.strings.fragment_transaction_list_unconfirmed_rbf + ? lstrings.fragment_transaction_list_unconfirmed_rbf : currentConfirmations === 'unconfirmed' - ? s.strings.fragment_wallet_unconfirmed + ? lstrings.fragment_wallet_unconfirmed : currentConfirmations === 'dropped' - ? s.strings.fragment_transaction_list_tx_dropped + ? lstrings.fragment_transaction_list_tx_dropped : typeof currentConfirmations === 'number' - ? sprintf(s.strings.fragment_transaction_list_confirmation_progress, currentConfirmations, requiredConfirmations) - : s.strings.fragment_transaction_list_tx_synchronizing + ? sprintf(lstrings.fragment_transaction_list_confirmation_progress, currentConfirmations, requiredConfirmations) + : lstrings.fragment_transaction_list_tx_synchronizing const pendingStyle = currentConfirmations === 'confirmed' ? styles.completedTime : styles.partialTime diff --git a/src/components/themed/WalletList.tsx b/src/components/themed/WalletList.tsx index f2563811aca..dedc4d4b190 100644 --- a/src/components/themed/WalletList.tsx +++ b/src/components/themed/WalletList.tsx @@ -6,7 +6,7 @@ import { SectionList } from 'react-native' import { selectWalletToken } from '../../actions/WalletActions' import { useHandler } from '../../hooks/useHandler' import { useRowLayout } from '../../hooks/useRowLayout' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { useDispatch, useSelector } from '../../types/reactRedux' import { NavigationBase } from '../../types/routerTypes' import { EdgeTokenId, FlatListItem, WalletListItem } from '../../types/types' @@ -176,11 +176,11 @@ export function WalletList(props: Props) { return { sectionList: [ { - title: s.strings.wallet_list_modal_header_mru, + title: lstrings.wallet_list_modal_header_mru, data: [...recentWalletList] }, { - title: s.strings.wallet_list_modal_header_all, + title: lstrings.wallet_list_modal_header_all, data: walletList } ], diff --git a/src/components/themed/WalletListCreateRow.tsx b/src/components/themed/WalletListCreateRow.tsx index ac89c549e33..aec788cff73 100644 --- a/src/components/themed/WalletListCreateRow.tsx +++ b/src/components/themed/WalletListCreateRow.tsx @@ -10,7 +10,7 @@ import { Airship, showError } from '../../components/services/AirshipInstance' import { getPluginId } from '../../constants/WalletAndCurrencyConstants' import { useHandler } from '../../hooks/useHandler' import { useWatch } from '../../hooks/useWatch' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { useDispatch, useSelector } from '../../types/reactRedux' import { ThunkAction } from '../../types/reduxTypes' import { getCreateWalletType, guessFromCurrencyCode } from '../../util/CurrencyInfoHelpers' @@ -94,7 +94,7 @@ export const WalletListCreateRowComponent = (props: WalletListCreateRowProps) => return ( bridge={bridge} - title={s.strings.select_wallet} + title={lstrings.select_wallet} textInput={false} fullScreen={false} rowComponent={renderRow} @@ -116,7 +116,7 @@ export const WalletListCreateRowComponent = (props: WalletListCreateRowProps) => {currencyName} - {walletType != null ? s.strings.fragment_create_wallet_create_wallet : s.strings.wallet_list_add_token} + {walletType != null ? lstrings.fragment_create_wallet_create_wallet : lstrings.wallet_list_add_token} ) @@ -154,10 +154,10 @@ function createAndSelectToken({ ? currencyWallets[parentWalletId] : // If no parent chain wallet exists, create it await showFullScreenSpinner( - s.strings.wallet_list_modal_enabling_token, + lstrings.wallet_list_modal_enabling_token, (async (): Promise => { const { walletType } = getCreateWalletType(account, parentCurrencyCode) ?? {} - if (walletType == null) throw new Error(s.strings.create_wallet_failed_message) + if (walletType == null) throw new Error(lstrings.create_wallet_failed_message) return await createWallet(account, { walletType, walletName: getUniqueWalletName(account, pluginId), @@ -183,7 +183,7 @@ function createAndSelectWallet({ walletType, fiatCurrencyCode }: CreateWalletOpt const walletName = getUniqueWalletName(account, getPluginId(walletType)) try { const wallet = await showFullScreenSpinner( - s.strings.wallet_list_modal_creating_wallet, + lstrings.wallet_list_modal_creating_wallet, createWallet(account, { walletName, walletType, fiatCurrencyCode }) ) return wallet.id diff --git a/src/components/themed/WalletListFooter.tsx b/src/components/themed/WalletListFooter.tsx index 08d85afc9a2..6d53c727440 100644 --- a/src/components/themed/WalletListFooter.tsx +++ b/src/components/themed/WalletListFooter.tsx @@ -4,7 +4,7 @@ import Ionicon from 'react-native-vector-icons/Ionicons' import { SPECIAL_CURRENCY_INFO } from '../../constants/WalletAndCurrencyConstants' import { useHandler } from '../../hooks/useHandler' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { useSelector } from '../../types/reactRedux' import { NavigationProp } from '../../types/routerTypes' import { EdgeTokenId } from '../../types/types' @@ -33,7 +33,7 @@ export const WalletListFooter = (props: Props) => { .map(pluginId => ({ pluginId })) Airship.show(bridge => ( - + )) .then(({ walletId, currencyCode }) => { if (walletId != null && currencyCode != null) { @@ -47,11 +47,11 @@ export const WalletListFooter = (props: Props) => { - {s.strings.wallet_list_add_wallet} + {lstrings.wallet_list_add_wallet} - {s.strings.wallet_list_add_token} + {lstrings.wallet_list_add_token} ) diff --git a/src/components/themed/WalletListHeader.tsx b/src/components/themed/WalletListHeader.tsx index c1190bdb780..bc6d48e5fdd 100644 --- a/src/components/themed/WalletListHeader.tsx +++ b/src/components/themed/WalletListHeader.tsx @@ -3,7 +3,7 @@ import { TouchableOpacity, View } from 'react-native' import Ionicon from 'react-native-vector-icons/Ionicons' import { Fontello } from '../../assets/vector/index' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { NavigationBase } from '../../types/routerTypes' import { PromoCard } from '../cards/PromoCard' import { cacheStyles, Theme, ThemeProps, withTheme } from '../services/ThemeContext' @@ -55,7 +55,7 @@ export class WalletListHeaderComponent extends React.PureComponent { { {searching && ( - {s.strings.string_done_cap} + {lstrings.string_done_cap} )} {!searching && } {!sorting && !searching && ( - {s.strings.title_wallets} + {lstrings.title_wallets} navigation.push('createWalletSelectCrypto', {})}> diff --git a/src/components/themed/WiredBalanceBox.tsx b/src/components/themed/WiredBalanceBox.tsx index fed849c9fd1..57fd90c050a 100644 --- a/src/components/themed/WiredBalanceBox.tsx +++ b/src/components/themed/WiredBalanceBox.tsx @@ -4,7 +4,7 @@ import { TouchableOpacity } from 'react-native' import { toggleAccountBalanceVisibility } from '../../actions/WalletListActions' import { getSymbolFromCurrency } from '../../constants/WalletAndCurrencyConstants' import { formatNumber } from '../../locales/intl' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { connect } from '../../types/reactRedux' import { GuiExchangeRates } from '../../types/types' import { triggerHaptic } from '../../util/haptic' @@ -53,13 +53,13 @@ export class BalanceBox extends React.PureComponent { {showBalance && !noExchangeRates ? ( <> - {s.strings.fragment_wallets_balance_text} + {lstrings.fragment_wallets_balance_text} {fiatSymbol.length !== 1 ? `${formattedFiat} ${fiatCurrencyCode}` : `${fiatSymbol} ${formattedFiat} ${fiatCurrencyCode}`} ) : ( - {noExchangeRates ? s.strings.exchange_rates_loading : s.strings.string_show_balance} + {noExchangeRates ? lstrings.exchange_rates_loading : lstrings.string_show_balance} )} diff --git a/src/components/tiles/AddressTile.tsx b/src/components/tiles/AddressTile.tsx index 29a15767363..adc116d5f32 100644 --- a/src/components/tiles/AddressTile.tsx +++ b/src/components/tiles/AddressTile.tsx @@ -10,7 +10,7 @@ import { sprintf } from 'sprintf-js' import { launchPaymentProto } from '../../actions/PaymentProtoActions' import { addressWarnings } from '../../actions/ScanActions' import { ENS_DOMAINS } from '../../constants/WalletAndCurrencyConstants' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { checkPubAddress } from '../../modules/FioAddress/util' import { PaymentProtoError } from '../../types/PaymentProtoError' import { connect } from '../../types/reactRedux' @@ -140,7 +140,7 @@ export class AddressTileComponent extends React.PureComponent { } if (!parsedUri.publicAddress) { - return showError(s.strings.scan_invalid_address_error_title) + return showError(lstrings.scan_invalid_address_error_title) } // set address @@ -156,7 +156,7 @@ export class AddressTileComponent extends React.PureComponent { await launchPaymentProto(navigation, this.props.account, parsedLink.uri, { currencyCode, navigateReplace: true, wallet: coreWallet }).catch(showError) } } else { - showError(`${s.strings.scan_invalid_address_error_title} ${s.strings.scan_invalid_address_error_description}`) + showError(`${lstrings.scan_invalid_address_error_title} ${lstrings.scan_invalid_address_error_description}`) } this.setState({ loading: false }) @@ -191,13 +191,13 @@ export class AddressTileComponent extends React.PureComponent { handleScan = () => { const { currencyCode } = this.props - const title = sprintf(s.strings.send_scan_modal_text_modal_title_s, currencyCode) - const message = sprintf(s.strings.send_scan_modal_text_modal_message_s, currencyCode) + const title = sprintf(lstrings.send_scan_modal_text_modal_title_s, currencyCode) + const message = sprintf(lstrings.send_scan_modal_text_modal_message_s, currencyCode) Airship.show(bridge => ( @@ -215,7 +215,7 @@ export class AddressTileComponent extends React.PureComponent { handleChangeAddress = async () => { const { coreWallet, currencyCode } = this.props Airship.show(bridge => ( - + )) .then(result => { if (result) { @@ -239,7 +239,7 @@ export class AddressTileComponent extends React.PureComponent { const { fioToAddress, recipientAddress, lockInputs, theme, title } = this.props const { loading } = this.state const styles = getStyles(theme) - const copyMessage = this.state.clipboard ? `${s.strings.string_paste}: ${this.state.clipboard}` : null + const copyMessage = this.state.clipboard ? `${lstrings.string_paste}: ${this.state.clipboard}` : null const tileType = loading ? 'loading' : !!recipientAddress && !lockInputs ? 'touchable' : 'static' return ( @@ -248,16 +248,16 @@ export class AddressTileComponent extends React.PureComponent { - {s.strings.enter_as_in_enter_address_with_keyboard} + {lstrings.enter_as_in_enter_address_with_keyboard} - {s.strings.scan_as_in_scan_barcode} + {lstrings.scan_as_in_scan_barcode} {copyMessage && ( - {s.strings.string_paste} + {lstrings.string_paste} )} diff --git a/src/components/tiles/AddressTile2.tsx b/src/components/tiles/AddressTile2.tsx index 7eaf069197c..5fc02e2f4f7 100644 --- a/src/components/tiles/AddressTile2.tsx +++ b/src/components/tiles/AddressTile2.tsx @@ -10,7 +10,7 @@ import { sprintf } from 'sprintf-js' import { launchPaymentProto } from '../../actions/PaymentProtoActions' import { addressWarnings } from '../../actions/ScanActions' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { checkPubAddress } from '../../modules/FioAddress/util' import { PaymentProtoError } from '../../types/PaymentProtoError' import { connect } from '../../types/reactRedux' @@ -142,7 +142,7 @@ export class AddressTileComponent extends React.PureComponent { } if (!parsedUri.publicAddress) { - return showError(s.strings.scan_invalid_address_error_title) + return showError(lstrings.scan_invalid_address_error_title) } // set address @@ -158,7 +158,7 @@ export class AddressTileComponent extends React.PureComponent { await launchPaymentProto(navigation, this.props.account, parsedLink.uri, { currencyCode, navigateReplace: true, wallet: coreWallet }).catch(showError) } } else { - showError(`${s.strings.scan_invalid_address_error_title} ${s.strings.scan_invalid_address_error_description}`) + showError(`${lstrings.scan_invalid_address_error_title} ${lstrings.scan_invalid_address_error_description}`) } this.setState({ loading: false }) @@ -191,13 +191,13 @@ export class AddressTileComponent extends React.PureComponent { handleScan = () => { const { currencyCode } = this.props - const title = sprintf(s.strings.send_scan_modal_text_modal_title_s, currencyCode) - const message = sprintf(s.strings.send_scan_modal_text_modal_message_s, currencyCode) + const title = sprintf(lstrings.send_scan_modal_text_modal_title_s, currencyCode) + const message = sprintf(lstrings.send_scan_modal_text_modal_message_s, currencyCode) Airship.show(bridge => ( @@ -215,7 +215,7 @@ export class AddressTileComponent extends React.PureComponent { handleChangeAddress = async () => { const { coreWallet, currencyCode } = this.props Airship.show(bridge => ( - + )) .then(result => { if (result) { @@ -234,7 +234,7 @@ export class AddressTileComponent extends React.PureComponent { await Airship.show(bridge => ( { const { currencyWallets } = account const { loading } = this.state const styles = getStyles(theme) - const copyMessage = this.state.clipboard ? `${s.strings.string_paste}: ${this.state.clipboard}` : null + const copyMessage = this.state.clipboard ? `${lstrings.string_paste}: ${this.state.clipboard}` : null const tileType = loading ? 'loading' : !!recipientAddress && !lockInputs ? 'delete' : 'static' const tokenId: string | undefined = getTokenId(this.props.account, pluginId, currencyCode) const canSelfTransfer: boolean = Object.keys(currencyWallets).some(walletId => { @@ -279,22 +279,22 @@ export class AddressTileComponent extends React.PureComponent { - {s.strings.enter_as_in_enter_address_with_keyboard} + {lstrings.enter_as_in_enter_address_with_keyboard} {canSelfTransfer ? ( - {s.strings.fragment_send_myself} + {lstrings.fragment_send_myself} ) : null} - {s.strings.scan_as_in_scan_barcode} + {lstrings.scan_as_in_scan_barcode} {copyMessage ? ( - {s.strings.string_paste} + {lstrings.string_paste} ) : null} diff --git a/src/components/tiles/AprCard.tsx b/src/components/tiles/AprCard.tsx index 651c52b1581..d9be0943c34 100644 --- a/src/components/tiles/AprCard.tsx +++ b/src/components/tiles/AprCard.tsx @@ -3,7 +3,7 @@ import { View } from 'react-native' import { sprintf } from 'sprintf-js' import { toPercentString } from '../../locales/intl' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { Card } from '../cards/Card' import { cacheStyles, Theme, useTheme } from '../services/ThemeContext' import { EdgeText } from '../themed/EdgeText' @@ -18,7 +18,7 @@ const AprCardComponent = (props: Props) => { const styles = getStyles(theme) const aprValue = apr == null || apr === 0 ? '-- ' : toPercentString(apr) - const displayApr = React.useMemo(() => sprintf(s.strings.loan_s_apr, aprValue), [aprValue]) + const displayApr = React.useMemo(() => sprintf(lstrings.loan_s_apr, aprValue), [aprValue]) return ( diff --git a/src/components/tiles/EditableAmountTile.tsx b/src/components/tiles/EditableAmountTile.tsx index e2ed698a395..4fd4605b275 100644 --- a/src/components/tiles/EditableAmountTile.tsx +++ b/src/components/tiles/EditableAmountTile.tsx @@ -2,7 +2,7 @@ import { div, round, toFixed } from 'biggystring' import { EdgeCurrencyWallet, EdgeDenomination } from 'edge-core-js' import * as React from 'react' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { convertCurrencyFromExchangeRates } from '../../selectors/WalletSelectors' import { GuiExchangeRates } from '../../types/types' import { getWalletFiat } from '../../util/CurrencyWalletHelpers' @@ -35,7 +35,7 @@ export const EditableAmountTile = (props: Props) => { const theme = useTheme() const styles = getStyles(theme) if (nativeAmount === '' && !lockInputs) { - cryptoAmountSyntax = s.strings.string_tap_to_edit + cryptoAmountSyntax = lstrings.string_tap_to_edit cryptoAmountStyle = styles.amountTextMuted } else if (!zeroString(nativeAmount)) { const displayAmount = div(nativeAmount, displayDenomination.multiplier, DECIMAL_PRECISION) diff --git a/src/components/tiles/ErrorTile.tsx b/src/components/tiles/ErrorTile.tsx index e3f1c8b3631..f49a04885ac 100644 --- a/src/components/tiles/ErrorTile.tsx +++ b/src/components/tiles/ErrorTile.tsx @@ -1,6 +1,6 @@ import * as React from 'react' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { cacheStyles, Theme, useTheme } from '../services/ThemeContext' import { EdgeText } from '../themed/EdgeText' import { Tile } from './Tile' @@ -16,7 +16,7 @@ export const ErrorTile = (props: Props) => { const styles = getStyles(theme) return ( - + {message} diff --git a/src/components/tiles/InterestRateChangeTile.tsx b/src/components/tiles/InterestRateChangeTile.tsx index 9dba3c062fb..49d6fbd6d47 100644 --- a/src/components/tiles/InterestRateChangeTile.tsx +++ b/src/components/tiles/InterestRateChangeTile.tsx @@ -3,7 +3,7 @@ import * as React from 'react' import { useHandler } from '../../hooks/useHandler' import { useWatch } from '../../hooks/useWatch' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { BorrowDebt, BorrowEngine } from '../../plugins/borrow-plugins/types' import { useSelector } from '../../types/reactRedux' import { GuiExchangeRates } from '../../types/types' @@ -80,7 +80,7 @@ const InterestRateChangeTileComponent = (props: Props) => { [currentAprs, apr, currentFiatAmounts, incomingDebtFiatAmount] ) - return + return } export const InterestRateChangeTile = React.memo(InterestRateChangeTileComponent) diff --git a/src/components/tiles/LtvRatioTile.tsx b/src/components/tiles/LtvRatioTile.tsx index 67ae0928a48..e468c797a2a 100644 --- a/src/components/tiles/LtvRatioTile.tsx +++ b/src/components/tiles/LtvRatioTile.tsx @@ -1,6 +1,6 @@ import * as React from 'react' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { BorrowEngine } from '../../plugins/borrow-plugins/types' import { Theme, useTheme } from '../services/ThemeContext' import { PercentageChangeArrowTile } from './PercentageChangeArrowTile' @@ -16,7 +16,7 @@ export const LtvRatioTile = (props: { borrowEngine: BorrowEngine; futureValue: s return ( diff --git a/src/components/tiles/SwapDetailsTiles.tsx b/src/components/tiles/SwapDetailsTiles.tsx index 203efad346e..2bf67321c3f 100644 --- a/src/components/tiles/SwapDetailsTiles.tsx +++ b/src/components/tiles/SwapDetailsTiles.tsx @@ -7,7 +7,7 @@ import { sprintf } from 'sprintf-js' import { useHandler } from '../../hooks/useHandler' import { useWalletName } from '../../hooks/useWalletName' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { getDisplayDenomination, getExchangeDenomination } from '../../selectors/DenominationSelectors' import { useSelector } from '../../types/reactRedux' import { getWalletName } from '../../util/CurrencyWalletHelpers' @@ -42,7 +42,7 @@ export function SwapDetailsTiles(props: Props) { const payoutCurrencyCode = swapData.payoutCurrencyCode.toUpperCase() const handleExchangeDetails = useHandler(() => { - Airship.show(bridge => ) + Airship.show(bridge => ) }) const handleEmail = useHandler(() => { @@ -51,7 +51,7 @@ export function SwapDetailsTiles(props: Props) { Mailer.mail( { - subject: sprintf(s.strings.transaction_details_exchange_support_request, plugin.displayName), + subject: sprintf(lstrings.transaction_details_exchange_support_request, plugin.displayName), // @ts-expect-error recipients: [email], body, @@ -100,33 +100,33 @@ export function SwapDetailsTiles(props: Props) { const uniqueIdentifier = spendTargets[0].uniqueIdentifier ?? '' const exchangeAddresses = spendTargets.map((target, index) => `${target.publicAddress}${index + 1 !== spendTargets.length ? newline : ''}`).toString() - return `${s.strings.transaction_details_exchange_service}: ${plugin.displayName}${newline}${s.strings.transaction_details_exchange_order_id}: ${ + return `${lstrings.transaction_details_exchange_service}: ${plugin.displayName}${newline}${lstrings.transaction_details_exchange_order_id}: ${ orderId || '' - }${newline}${s.strings.transaction_details_exchange_source_wallet}: ${walletName}${newline}${ - s.strings.fragment_send_from_label - }: ${sourceAmount} ${symbolString}${newline}${s.strings.string_to_capitalize}: ${destinationAmount} ${destinationCurrencyCode}${newline}${ - s.strings.transaction_details_exchange_destination_wallet - }: ${destinationWalletName}${newline}${isEstimate ? s.strings.estimated_quote : s.strings.fixed_quote}${newline}${newline}${ - s.strings.transaction_details_exchange_exchange_address - }:${newline} ${exchangeAddresses}${newline}${s.strings.transaction_details_exchange_exchange_unique_id}:${newline} ${uniqueIdentifier}${newline}${ - s.strings.transaction_details_exchange_payout_address - }:${newline} ${payoutAddress}${newline}${s.strings.transaction_details_exchange_refund_address}:${newline} ${refundAddress || ''}${newline}` + }${newline}${lstrings.transaction_details_exchange_source_wallet}: ${walletName}${newline}${ + lstrings.fragment_send_from_label + }: ${sourceAmount} ${symbolString}${newline}${lstrings.string_to_capitalize}: ${destinationAmount} ${destinationCurrencyCode}${newline}${ + lstrings.transaction_details_exchange_destination_wallet + }: ${destinationWalletName}${newline}${isEstimate ? lstrings.estimated_quote : lstrings.fixed_quote}${newline}${newline}${ + lstrings.transaction_details_exchange_exchange_address + }:${newline} ${exchangeAddresses}${newline}${lstrings.transaction_details_exchange_exchange_unique_id}:${newline} ${uniqueIdentifier}${newline}${ + lstrings.transaction_details_exchange_payout_address + }:${newline} ${payoutAddress}${newline}${lstrings.transaction_details_exchange_refund_address}:${newline} ${refundAddress || ''}${newline}` } return ( <> - + - {s.strings.title_exchange + ' ' + sourceAmount + ' ' + symbolString} - {s.strings.string_to_capitalize + ' ' + destinationAmount + ' ' + destinationCurrencyCode} - {swapData.isEstimate ? s.strings.estimated_quote : s.strings.fixed_quote} + {lstrings.title_exchange + ' ' + sourceAmount + ' ' + symbolString} + {lstrings.string_to_capitalize + ' ' + destinationAmount + ' ' + destinationCurrencyCode} + {swapData.isEstimate ? lstrings.estimated_quote : lstrings.fixed_quote} {orderUri == null ? null : ( - + )} {plugin.supportEmail == null ? null : ( - + )} ) diff --git a/src/components/tiles/Tile.tsx b/src/components/tiles/Tile.tsx index 6232245e42f..ff7a4c6db57 100644 --- a/src/components/tiles/Tile.tsx +++ b/src/components/tiles/Tile.tsx @@ -4,7 +4,7 @@ import { ActivityIndicator, TouchableWithoutFeedback, View } from 'react-native' import FontAwesomeIcon from 'react-native-vector-icons/FontAwesome' import SimpleLineIcons from 'react-native-vector-icons/SimpleLineIcons' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { triggerHaptic } from '../../util/haptic' import { showToast } from '../services/AirshipInstance' import { cacheStyles, Theme, ThemeProps, withTheme } from '../services/ThemeContext' @@ -34,7 +34,7 @@ export class TileComponent extends React.PureComponent { copy = () => { if (!this.props.body) return Clipboard.setString(this.props.body) - showToast(s.strings.fragment_copied) + showToast(lstrings.fragment_copied) } handlePress = () => { diff --git a/src/components/tiles/TransactionCryptoAmountTile.tsx b/src/components/tiles/TransactionCryptoAmountTile.tsx index 5c175e945a2..1468928cd2e 100644 --- a/src/components/tiles/TransactionCryptoAmountTile.tsx +++ b/src/components/tiles/TransactionCryptoAmountTile.tsx @@ -3,7 +3,7 @@ import { EdgeCurrencyWallet, EdgeDenomination, EdgeTransaction } from 'edge-core import * as React from 'react' import { sprintf } from 'sprintf-js' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { getDisplayDenomination, getExchangeDenomination } from '../../selectors/DenominationSelectors' import { useSelector } from '../../types/reactRedux' import { convertNativeToDisplay, truncateDecimals } from '../../util/utils' @@ -59,8 +59,8 @@ export function TransactionCryptoAmountTile(props: Props) { const convertedFee = abs(truncateDecimals(convertNativeToDisplay(walletDefaultDenom.multiplier)(networkFee))) const feeString = symbolString - ? sprintf(s.strings.fragment_tx_detail_mining_fee_with_symbol, convertedFee) - : sprintf(s.strings.fragment_tx_detail_mining_fee_with_denom, convertedFee, walletDefaultDenom.name) + ? sprintf(lstrings.fragment_tx_detail_mining_fee_with_symbol, convertedFee) + : sprintf(lstrings.fragment_tx_detail_mining_fee_with_denom, convertedFee, walletDefaultDenom.name) return `${symbolString} ${convertedAmount} (${feeString})` } @@ -70,5 +70,5 @@ export function TransactionCryptoAmountTile(props: Props) { return `${symbolString} ${absoluteAmount}` }, [currencyCode, currencyInfo, nativeAmount, networkFee, swapData, walletDefaultDenom]) - return + return } diff --git a/src/components/tiles/TransactionFiatTiles.tsx b/src/components/tiles/TransactionFiatTiles.tsx index 5f877a5f3c9..7c0da17f1d8 100644 --- a/src/components/tiles/TransactionFiatTiles.tsx +++ b/src/components/tiles/TransactionFiatTiles.tsx @@ -9,7 +9,7 @@ import { displayFiatAmount } from '../../hooks/useFiatText' import { useHandler } from '../../hooks/useHandler' import { useHistoricalRate } from '../../hooks/useHistoricalRate' import { useWatch } from '../../hooks/useWatch' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { getExchangeDenomination } from '../../selectors/DenominationSelectors' import { convertCurrencyFromExchangeRates } from '../../selectors/WalletSelectors' import { useSelector } from '../../types/reactRedux' @@ -75,8 +75,8 @@ export function TransactionFiatTiles(props: Props) { inputLabel={fiatCurrencyCode} returnKeyType="done" keyboardType="numeric" - submitLabel={s.strings.string_save} - title={sprintf(s.strings.transaction_details_amount_in_fiat, fiatCurrencyCode)} + submitLabel={lstrings.string_save} + title={sprintf(lstrings.transaction_details_amount_in_fiat, fiatCurrencyCode)} /> )) .then(async inputText => { @@ -92,13 +92,13 @@ export function TransactionFiatTiles(props: Props) { return ( <> - + {fiatSymbol + ' '} {displayFiatText} - + {fiatSymbol + ' '} {currentFiatText} diff --git a/src/constants/WalletAndCurrencyConstants.ts b/src/constants/WalletAndCurrencyConstants.ts index fbb40a18256..a92c169cf2e 100644 --- a/src/constants/WalletAndCurrencyConstants.ts +++ b/src/constants/WalletAndCurrencyConstants.ts @@ -1,4 +1,4 @@ -import s from '../locales/strings' +import { lstrings } from '../locales/strings' import { StringMap } from '../types/types' export const MAX_TOKEN_CODE_CHARACTERS = 7 @@ -13,9 +13,9 @@ const UTXO_MAX_SPEND_TARGETS = 32 // Translations for custom fee keys: export const FEE_STRINGS = { - gasLimit: s.strings.gasLimit, - gasPrice: s.strings.gasPrice, - satPerByte: s.strings.satPerByte + gasLimit: lstrings.gasLimit, + gasPrice: lstrings.gasPrice, + satPerByte: lstrings.satPerByte } /** @@ -155,7 +155,7 @@ export const getSpecialCurrencyInfo = (walletType: string = ''): SpecialCurrency return SPECIAL_CURRENCY_INFO[pluginId] } else { return { - initWalletName: s.strings.string_no_name, + initWalletName: lstrings.string_no_name, chainCode: '', displayBuyCrypto: false } @@ -168,13 +168,13 @@ export const SPECIAL_CURRENCY_INFO: { bitcoin: { maxSpendTargets: UTXO_MAX_SPEND_TARGETS, hasSegwit: true, - initWalletName: s.strings.string_first_bitcoin_wallet_name, + initWalletName: lstrings.string_first_bitcoin_wallet_name, chainCode: 'BTC', displayBuyCrypto: true, displayIoniaRewards: true, isImportKeySupported: { - privateKeyLabel: s.strings.create_wallet_import_input_key_or_seed_prompt, - privateKeyInstructions: s.strings.create_wallet_import_input_key_or_seed_instructions + privateKeyLabel: lstrings.create_wallet_import_input_key_or_seed_prompt, + privateKeyInstructions: lstrings.create_wallet_import_input_key_or_seed_instructions }, isStakingSupported: true, isPrivateKeySweepable: true, @@ -183,25 +183,25 @@ export const SPECIAL_CURRENCY_INFO: { bitcointestnet: { hasSegwit: true, maxSpendTargets: UTXO_MAX_SPEND_TARGETS, - initWalletName: s.strings.string_first_bitcoin_testnet_wallet_name, + initWalletName: lstrings.string_first_bitcoin_testnet_wallet_name, chainCode: 'TESTBTC', displayBuyCrypto: true, isImportKeySupported: { - privateKeyLabel: s.strings.create_wallet_import_input_key_or_seed_prompt, - privateKeyInstructions: s.strings.create_wallet_import_input_key_or_seed_instructions + privateKeyLabel: lstrings.create_wallet_import_input_key_or_seed_prompt, + privateKeyInstructions: lstrings.create_wallet_import_input_key_or_seed_instructions }, isPrivateKeySweepable: true, isPaymentProtocolSupported: true }, bitcoincash: { maxSpendTargets: UTXO_MAX_SPEND_TARGETS, - initWalletName: s.strings.string_first_bitcoincash_wallet_name, + initWalletName: lstrings.string_first_bitcoincash_wallet_name, chainCode: 'BCH', displayBuyCrypto: true, displayIoniaRewards: true, isImportKeySupported: { - privateKeyLabel: s.strings.create_wallet_import_input_key_or_seed_prompt, - privateKeyInstructions: s.strings.create_wallet_import_input_key_or_seed_instructions + privateKeyLabel: lstrings.create_wallet_import_input_key_or_seed_prompt, + privateKeyInstructions: lstrings.create_wallet_import_input_key_or_seed_instructions }, isStakingSupported: true, isPrivateKeySweepable: true, @@ -209,23 +209,23 @@ export const SPECIAL_CURRENCY_INFO: { }, bitcoinsv: { maxSpendTargets: UTXO_MAX_SPEND_TARGETS, - initWalletName: s.strings.string_first_bitcoin_sv_wallet_name, + initWalletName: lstrings.string_first_bitcoin_sv_wallet_name, chainCode: 'BSV', isImportKeySupported: { - privateKeyLabel: s.strings.create_wallet_import_input_key_or_seed_prompt, - privateKeyInstructions: s.strings.create_wallet_import_input_key_or_seed_instructions + privateKeyLabel: lstrings.create_wallet_import_input_key_or_seed_prompt, + privateKeyInstructions: lstrings.create_wallet_import_input_key_or_seed_instructions }, isPrivateKeySweepable: true, isPaymentProtocolSupported: true }, digibyte: { maxSpendTargets: UTXO_MAX_SPEND_TARGETS, - initWalletName: s.strings.string_first_digibyte_wallet_name, + initWalletName: lstrings.string_first_digibyte_wallet_name, chainCode: 'DGB', displayBuyCrypto: true, isImportKeySupported: { - privateKeyLabel: s.strings.create_wallet_import_input_key_or_seed_prompt, - privateKeyInstructions: s.strings.create_wallet_import_input_key_or_seed_instructions + privateKeyLabel: lstrings.create_wallet_import_input_key_or_seed_prompt, + privateKeyInstructions: lstrings.create_wallet_import_input_key_or_seed_instructions }, isPrivateKeySweepable: true, isPaymentProtocolSupported: true @@ -233,158 +233,158 @@ export const SPECIAL_CURRENCY_INFO: { litecoin: { hasSegwit: true, maxSpendTargets: UTXO_MAX_SPEND_TARGETS, - initWalletName: s.strings.string_first_litecoin_wallet_name, + initWalletName: lstrings.string_first_litecoin_wallet_name, chainCode: 'LTC', displayBuyCrypto: true, displayIoniaRewards: true, isImportKeySupported: { - privateKeyLabel: s.strings.create_wallet_import_input_key_or_seed_prompt, - privateKeyInstructions: s.strings.create_wallet_import_input_key_or_seed_instructions + privateKeyLabel: lstrings.create_wallet_import_input_key_or_seed_prompt, + privateKeyInstructions: lstrings.create_wallet_import_input_key_or_seed_instructions }, isStakingSupported: true, isPrivateKeySweepable: true, isPaymentProtocolSupported: true }, rsk: { - initWalletName: s.strings.string_first_rsk_wallet_name, + initWalletName: lstrings.string_first_rsk_wallet_name, chainCode: 'RBTC', dummyPublicAddress: '0x74f9452e22fe58e27575f176fc884729d88267ba', // rj116 allowZeroTx: true, isImportKeySupported: { - privateKeyLabel: s.strings.create_wallet_import_input_key_or_seed_prompt, - privateKeyInstructions: s.strings.create_wallet_import_input_key_or_seed_instructions + privateKeyLabel: lstrings.create_wallet_import_input_key_or_seed_prompt, + privateKeyInstructions: lstrings.create_wallet_import_input_key_or_seed_instructions }, isCustomTokensSupported: true }, stellar: { - initWalletName: s.strings.string_first_stellar_wallet_name, + initWalletName: lstrings.string_first_stellar_wallet_name, chainCode: 'XLM', dummyPublicAddress: 'GBEVGJYAUKJ2TVPMC3GEPI2GGZQLMWZDRWJCVNBXCJ3ELYTDPHVQQM74', uniqueIdentifierInfo: { - addButtonText: s.strings.unique_identifier_dropdown_option_memo_id, - identifierName: s.strings.unique_identifier_memo_id, + addButtonText: lstrings.unique_identifier_dropdown_option_memo_id, + identifierName: lstrings.unique_identifier_memo_id, keyboardType: 'default' }, minimumPopupModals: { minimumNativeBalance: '10000000', - modalMessage: s.strings.request_xlm_minimum_notification_body, - alertMessage: s.strings.request_xlm_minimum_notification_alert_body + modalMessage: lstrings.request_xlm_minimum_notification_body, + alertMessage: lstrings.request_xlm_minimum_notification_alert_body }, displayBuyCrypto: false, isImportKeySupported: { - privateKeyLabel: s.strings.create_wallet_import_input_key_prompt, - privateKeyInstructions: s.strings.create_wallet_import_key_instructions + privateKeyLabel: lstrings.create_wallet_import_input_key_prompt, + privateKeyInstructions: lstrings.create_wallet_import_key_instructions } }, ripple: { - initWalletName: s.strings.string_first_ripple_wallet_name, + initWalletName: lstrings.string_first_ripple_wallet_name, showTokenNames: true, chainCode: 'XRP', dummyPublicAddress: 'rfuESo7eHUnvebxgaFjfYxfwXhM2uBPAj3', uniqueIdentifierInfo: { - addButtonText: s.strings.unique_identifier_dropdown_option_destination_tag, - identifierName: s.strings.unique_identifier_destination_tag, + addButtonText: lstrings.unique_identifier_dropdown_option_destination_tag, + identifierName: lstrings.unique_identifier_destination_tag, keyboardType: 'numeric' }, minimumPopupModals: { minimumNativeBalance: '10000000', - modalMessage: s.strings.request_xrp_minimum_notification_body, - alertMessage: s.strings.request_xrp_minimum_notification_alert_body + modalMessage: lstrings.request_xrp_minimum_notification_body, + alertMessage: lstrings.request_xrp_minimum_notification_alert_body }, displayBuyCrypto: false, isImportKeySupported: { - privateKeyLabel: s.strings.create_wallet_import_input_key_prompt, - privateKeyInstructions: s.strings.create_wallet_import_key_instructions + privateKeyLabel: lstrings.create_wallet_import_input_key_prompt, + privateKeyInstructions: lstrings.create_wallet_import_key_instructions } }, monero: { - initWalletName: s.strings.string_first_monero_wallet_name, + initWalletName: lstrings.string_first_monero_wallet_name, chainCode: 'XMR', dummyPublicAddress: '46qxvuS78CNBoiiKmDjvjd5pMAZrTBbDNNHDoP52jKj9j5mk6m4R5nU6BDrWQURiWV9a2n5Sy8Qo4aJskKa92FX1GpZFiYA', isImportKeySupported: false }, eos: { - initWalletName: s.strings.string_first_eos_wallet_name, + initWalletName: lstrings.string_first_eos_wallet_name, chainCode: 'EOS', isAccountActivationRequired: true, dummyPublicAddress: 'edgecreator2', needsAccountNameSetup: true, noChangeMiningFee: true, uniqueIdentifierInfo: { - addButtonText: s.strings.unique_identifier_dropdown_option_memo, - identifierName: s.strings.unique_identifier_memo, + addButtonText: lstrings.unique_identifier_dropdown_option_memo, + identifierName: lstrings.unique_identifier_memo, keyboardType: 'default' }, isImportKeySupported: { - privateKeyLabel: s.strings.create_wallet_import_active_key_input_prompt, - privateKeyInstructions: s.strings.create_wallet_import_active_key_instructions + privateKeyLabel: lstrings.create_wallet_import_active_key_input_prompt, + privateKeyInstructions: lstrings.create_wallet_import_active_key_instructions }, isCustomTokensSupported: true }, telos: { - initWalletName: s.strings.string_first_telos_wallet_name, + initWalletName: lstrings.string_first_telos_wallet_name, chainCode: 'TLOS', isAccountActivationRequired: true, dummyPublicAddress: 'edgecreator2', needsAccountNameSetup: true, noChangeMiningFee: true, uniqueIdentifierInfo: { - addButtonText: s.strings.unique_identifier_dropdown_option_memo, - identifierName: s.strings.unique_identifier_memo, + addButtonText: lstrings.unique_identifier_dropdown_option_memo, + identifierName: lstrings.unique_identifier_memo, keyboardType: 'default' }, isImportKeySupported: { - privateKeyLabel: s.strings.create_wallet_import_active_key_input_prompt, - privateKeyInstructions: s.strings.create_wallet_import_active_key_instructions + privateKeyLabel: lstrings.create_wallet_import_active_key_input_prompt, + privateKeyInstructions: lstrings.create_wallet_import_active_key_instructions }, isCustomTokensSupported: true }, wax: { - initWalletName: s.strings.string_first_wax_wallet_name, + initWalletName: lstrings.string_first_wax_wallet_name, chainCode: 'WAX', isAccountActivationRequired: false, dummyPublicAddress: 'edgecreator2', needsAccountNameSetup: false, noChangeMiningFee: true, uniqueIdentifierInfo: { - addButtonText: s.strings.unique_identifier_dropdown_option_memo, - identifierName: s.strings.unique_identifier_memo, + addButtonText: lstrings.unique_identifier_dropdown_option_memo, + identifierName: lstrings.unique_identifier_memo, keyboardType: 'default' }, isImportKeySupported: { - privateKeyLabel: s.strings.create_wallet_import_active_key_input_prompt, - privateKeyInstructions: s.strings.create_wallet_import_active_key_instructions + privateKeyLabel: lstrings.create_wallet_import_active_key_input_prompt, + privateKeyInstructions: lstrings.create_wallet_import_active_key_instructions }, isCustomTokensSupported: true, keysOnlyMode: true }, ethereum: { - initWalletName: s.strings.string_first_ethereum_wallet_name, + initWalletName: lstrings.string_first_ethereum_wallet_name, chainCode: 'ETH', dummyPublicAddress: '0x0d73358506663d484945ba85d0cd435ad610b0a0', allowZeroTx: true, displayBuyCrypto: true, isImportKeySupported: { - privateKeyLabel: s.strings.create_wallet_import_input_key_or_seed_prompt, - privateKeyInstructions: s.strings.create_wallet_import_input_key_or_seed_instructions + privateKeyLabel: lstrings.create_wallet_import_input_key_or_seed_prompt, + privateKeyInstructions: lstrings.create_wallet_import_input_key_or_seed_instructions }, isStakingSupported: true, isCustomTokensSupported: true, isPaymentProtocolSupported: false }, tron: { - initWalletName: s.strings.string_first_tron_wallet_name, + initWalletName: lstrings.string_first_tron_wallet_name, chainCode: 'TRX', dummyPublicAddress: 'TG8dEvp1JHJRRWEBzmURjbUwb4sbGbHgKs', allowZeroTx: true, noChangeMiningFee: true, isImportKeySupported: { - privateKeyLabel: s.strings.create_wallet_import_input_key_or_seed_prompt, - privateKeyInstructions: s.strings.create_wallet_import_input_key_or_seed_instructions + privateKeyLabel: lstrings.create_wallet_import_input_key_or_seed_prompt, + privateKeyInstructions: lstrings.create_wallet_import_input_key_or_seed_instructions }, uniqueIdentifierInfo: { - addButtonText: s.strings.unique_identifier_dropdown_option_note, - identifierName: s.strings.unique_identifier_note, + addButtonText: lstrings.unique_identifier_dropdown_option_note, + identifierName: lstrings.unique_identifier_note, keyboardType: 'default' }, isCustomTokensSupported: true, @@ -392,124 +392,124 @@ export const SPECIAL_CURRENCY_INFO: { isStakingSupported: true }, kovan: { - initWalletName: s.strings.string_first_ethereum_wallet_name, + initWalletName: lstrings.string_first_ethereum_wallet_name, chainCode: 'ETH', dummyPublicAddress: '0x0d73358506663d484945ba85d0cd435ad610b0a0', allowZeroTx: true, displayBuyCrypto: true, isImportKeySupported: { - privateKeyLabel: s.strings.create_wallet_import_input_key_or_seed_prompt, - privateKeyInstructions: s.strings.create_wallet_import_input_key_or_seed_instructions + privateKeyLabel: lstrings.create_wallet_import_input_key_or_seed_prompt, + privateKeyInstructions: lstrings.create_wallet_import_input_key_or_seed_instructions }, isCustomTokensSupported: true, isPaymentProtocolSupported: false }, ethereumclassic: { - initWalletName: s.strings.string_first_ethereum_classic_wallet_name, + initWalletName: lstrings.string_first_ethereum_classic_wallet_name, chainCode: 'ETC', dummyPublicAddress: '0x0d73358506663d484945ba85d0cd435ad610b0a0', isImportKeySupported: { - privateKeyLabel: s.strings.create_wallet_import_input_key_or_seed_prompt, - privateKeyInstructions: s.strings.create_wallet_import_input_key_or_seed_instructions + privateKeyLabel: lstrings.create_wallet_import_input_key_or_seed_prompt, + privateKeyInstructions: lstrings.create_wallet_import_input_key_or_seed_instructions } }, ethereumpow: { - initWalletName: s.strings.string_first_ethereum_pow_wallet_name, + initWalletName: lstrings.string_first_ethereum_pow_wallet_name, chainCode: 'ETHW', dummyPublicAddress: '0x0d73358506663d484945ba85d0cd435ad610b0a0', allowZeroTx: true, isImportKeySupported: { - privateKeyLabel: s.strings.create_wallet_import_input_key_or_seed_prompt, - privateKeyInstructions: s.strings.create_wallet_import_input_key_or_seed_instructions + privateKeyLabel: lstrings.create_wallet_import_input_key_or_seed_prompt, + privateKeyInstructions: lstrings.create_wallet_import_input_key_or_seed_instructions }, isCustomTokensSupported: true, isPaymentProtocolSupported: false, isTransactionListUnsupported: true }, optimism: { - initWalletName: s.strings.string_first_optimism_wallet_name, + initWalletName: lstrings.string_first_optimism_wallet_name, chainCode: 'OP', dummyPublicAddress: '0x0d73358506663d484945ba85d0cd435ad610b0a0', allowZeroTx: true, isImportKeySupported: { - privateKeyLabel: s.strings.create_wallet_import_input_key_or_seed_prompt, - privateKeyInstructions: s.strings.create_wallet_import_input_key_or_seed_instructions + privateKeyLabel: lstrings.create_wallet_import_input_key_or_seed_prompt, + privateKeyInstructions: lstrings.create_wallet_import_input_key_or_seed_instructions }, isCustomTokensSupported: true, isPaymentProtocolSupported: false }, tezos: { - initWalletName: s.strings.string_first_tezos_wallet_name, + initWalletName: lstrings.string_first_tezos_wallet_name, chainCode: 'XTZ', noChangeMiningFee: true, // will share / copy public address instead of URI on Request scene isUriEncodedStructure: true, dummyPublicAddress: 'tz1cVgSd4oY25pDkH7vdvVp5DfPkZwT2hXwX', isImportKeySupported: { - privateKeyLabel: s.strings.create_wallet_import_input_key_or_seed_prompt, - privateKeyInstructions: s.strings.create_wallet_import_input_key_or_seed_instructions + privateKeyLabel: lstrings.create_wallet_import_input_key_or_seed_prompt, + privateKeyInstructions: lstrings.create_wallet_import_input_key_or_seed_instructions } }, binance: { - initWalletName: s.strings.string_first_bnb_wallet_name, + initWalletName: lstrings.string_first_bnb_wallet_name, chainCode: 'BNB', uniqueIdentifierInfo: { - addButtonText: s.strings.unique_identifier_dropdown_option_memo, - identifierName: s.strings.unique_identifier_memo, + addButtonText: lstrings.unique_identifier_dropdown_option_memo, + identifierName: lstrings.unique_identifier_memo, keyboardType: 'default' }, isImportKeySupported: { - privateKeyLabel: s.strings.create_wallet_import_input_key_or_seed_prompt, - privateKeyInstructions: s.strings.create_wallet_import_input_key_or_seed_instructions + privateKeyLabel: lstrings.create_wallet_import_input_key_or_seed_prompt, + privateKeyInstructions: lstrings.create_wallet_import_input_key_or_seed_instructions }, dummyPublicAddress: 'bnb1rt449yu7us6hmk4pmyr8talc60ydkwp4qkvcl7' }, binancesmartchain: { - initWalletName: s.strings.string_first_binance_smart_chain_wallet_name, + initWalletName: lstrings.string_first_binance_smart_chain_wallet_name, chainCode: 'BNB', fioChainCode: 'BSC', allowZeroTx: true, isImportKeySupported: { - privateKeyLabel: s.strings.create_wallet_import_input_key_or_seed_prompt, - privateKeyInstructions: s.strings.create_wallet_import_input_key_or_seed_instructions + privateKeyLabel: lstrings.create_wallet_import_input_key_or_seed_prompt, + privateKeyInstructions: lstrings.create_wallet_import_input_key_or_seed_instructions }, dummyPublicAddress: '0x0d73358506663d484945ba85d0cd435ad610b0a0', isCustomTokensSupported: true }, solana: { - initWalletName: s.strings.string_first_solana_wallet_name, + initWalletName: lstrings.string_first_solana_wallet_name, chainCode: 'SOL', isImportKeySupported: { - privateKeyLabel: s.strings.create_wallet_import_input_prompt, - privateKeyInstructions: s.strings.create_wallet_import_instructions + privateKeyLabel: lstrings.create_wallet_import_input_prompt, + privateKeyInstructions: lstrings.create_wallet_import_instructions }, dummyPublicAddress: 'DEd1rkRyr5bRkJHgaAKMSYjYC1KMz3Hc5bSs4Jiwt29x', uniqueIdentifierInfo: { - addButtonText: s.strings.unique_identifier_dropdown_option_memo, - identifierName: s.strings.unique_identifier_memo, + addButtonText: lstrings.unique_identifier_dropdown_option_memo, + identifierName: lstrings.unique_identifier_memo, keyboardType: 'default' }, noChangeMiningFee: true }, celo: { - initWalletName: s.strings.string_first_celo_wallet_name, + initWalletName: lstrings.string_first_celo_wallet_name, chainCode: 'CELO', dummyPublicAddress: '0x0d73358506663d484945ba85d0cd435ad610b0a0', allowZeroTx: true, isImportKeySupported: { - privateKeyLabel: s.strings.create_wallet_import_input_key_or_seed_prompt, - privateKeyInstructions: s.strings.create_wallet_import_input_key_or_seed_instructions + privateKeyLabel: lstrings.create_wallet_import_input_key_or_seed_prompt, + privateKeyInstructions: lstrings.create_wallet_import_input_key_or_seed_instructions }, isCustomTokensSupported: true }, fio: { - initWalletName: s.strings.string_first_fio_wallet_name, + initWalletName: lstrings.string_first_fio_wallet_name, chainCode: 'FIO', dummyPublicAddress: 'FIO4uX8tSuBZyHJmpPfc5Q6WrZ9eXd33wdgfWvfJ2fjGsg9yH4Dkd', noChangeMiningFee: true, isImportKeySupported: { - privateKeyLabel: s.strings.create_wallet_import_input_key_or_seed_prompt, - privateKeyInstructions: s.strings.create_wallet_import_input_key_or_seed_instructions + privateKeyLabel: lstrings.create_wallet_import_input_key_or_seed_prompt, + privateKeyInstructions: lstrings.create_wallet_import_input_key_or_seed_instructions }, isStakingSupported: true, stakeActions: { @@ -521,35 +521,35 @@ export const SPECIAL_CURRENCY_INFO: { }, dash: { maxSpendTargets: UTXO_MAX_SPEND_TARGETS, - initWalletName: s.strings.string_first_dash_wallet_name, + initWalletName: lstrings.string_first_dash_wallet_name, chainCode: 'DASH', displayIoniaRewards: true, isImportKeySupported: { - privateKeyLabel: s.strings.create_wallet_import_input_key_or_seed_prompt, - privateKeyInstructions: s.strings.create_wallet_import_input_key_or_seed_instructions + privateKeyLabel: lstrings.create_wallet_import_input_key_or_seed_prompt, + privateKeyInstructions: lstrings.create_wallet_import_input_key_or_seed_instructions }, isPrivateKeySweepable: true, isPaymentProtocolSupported: true }, ravencoin: { maxSpendTargets: UTXO_MAX_SPEND_TARGETS, - initWalletName: s.strings.string_first_ravencoin_wallet_name, + initWalletName: lstrings.string_first_ravencoin_wallet_name, chainCode: 'RVN', isImportKeySupported: { - privateKeyLabel: s.strings.create_wallet_import_input_key_or_seed_prompt, - privateKeyInstructions: s.strings.create_wallet_import_input_key_or_seed_instructions + privateKeyLabel: lstrings.create_wallet_import_input_key_or_seed_prompt, + privateKeyInstructions: lstrings.create_wallet_import_input_key_or_seed_instructions }, isPrivateKeySweepable: true, isPaymentProtocolSupported: true }, dogecoin: { maxSpendTargets: UTXO_MAX_SPEND_TARGETS, - initWalletName: s.strings.string_first_doge_wallet_name, + initWalletName: lstrings.string_first_doge_wallet_name, chainCode: 'DOGE', displayIoniaRewards: true, isImportKeySupported: { - privateKeyLabel: s.strings.create_wallet_import_input_key_or_seed_prompt, - privateKeyInstructions: s.strings.create_wallet_import_input_key_or_seed_instructions + privateKeyLabel: lstrings.create_wallet_import_input_key_or_seed_prompt, + privateKeyInstructions: lstrings.create_wallet_import_input_key_or_seed_instructions }, isStakingSupported: true, isPrivateKeySweepable: true, @@ -557,22 +557,22 @@ export const SPECIAL_CURRENCY_INFO: { }, zcoin: { maxSpendTargets: UTXO_MAX_SPEND_TARGETS, - initWalletName: s.strings.string_first_zcoin_wallet_name, + initWalletName: lstrings.string_first_zcoin_wallet_name, chainCode: 'FIRO', isImportKeySupported: { - privateKeyLabel: s.strings.create_wallet_import_input_key_or_seed_prompt, - privateKeyInstructions: s.strings.create_wallet_import_input_key_or_seed_instructions + privateKeyLabel: lstrings.create_wallet_import_input_key_or_seed_prompt, + privateKeyInstructions: lstrings.create_wallet_import_input_key_or_seed_instructions }, isPrivateKeySweepable: true, isPaymentProtocolSupported: true }, smartcash: { maxSpendTargets: UTXO_MAX_SPEND_TARGETS, - initWalletName: s.strings.string_first_smartcash_wallet_name, + initWalletName: lstrings.string_first_smartcash_wallet_name, chainCode: 'SMART', isImportKeySupported: { - privateKeyLabel: s.strings.create_wallet_import_input_key_or_seed_prompt, - privateKeyInstructions: s.strings.create_wallet_import_input_key_or_seed_instructions + privateKeyLabel: lstrings.create_wallet_import_input_key_or_seed_prompt, + privateKeyInstructions: lstrings.create_wallet_import_input_key_or_seed_instructions }, isPrivateKeySweepable: true, isPaymentProtocolSupported: true, @@ -580,22 +580,22 @@ export const SPECIAL_CURRENCY_INFO: { }, vertcoin: { maxSpendTargets: UTXO_MAX_SPEND_TARGETS, - initWalletName: s.strings.string_first_vertcoin_wallet_name, + initWalletName: lstrings.string_first_vertcoin_wallet_name, chainCode: 'VTC', isImportKeySupported: { - privateKeyLabel: s.strings.create_wallet_import_input_key_or_seed_prompt, - privateKeyInstructions: s.strings.create_wallet_import_input_key_or_seed_instructions + privateKeyLabel: lstrings.create_wallet_import_input_key_or_seed_prompt, + privateKeyInstructions: lstrings.create_wallet_import_input_key_or_seed_instructions }, isPrivateKeySweepable: true, isPaymentProtocolSupported: true }, bitcoingold: { maxSpendTargets: UTXO_MAX_SPEND_TARGETS, - initWalletName: s.strings.string_first_bitcoin_gold_wallet_name, + initWalletName: lstrings.string_first_bitcoin_gold_wallet_name, chainCode: 'BTG', isImportKeySupported: { - privateKeyLabel: s.strings.create_wallet_import_input_key_or_seed_prompt, - privateKeyInstructions: s.strings.create_wallet_import_input_key_or_seed_instructions + privateKeyLabel: lstrings.create_wallet_import_input_key_or_seed_prompt, + privateKeyInstructions: lstrings.create_wallet_import_input_key_or_seed_instructions }, isPrivateKeySweepable: true, isSplittingDisabled: true, @@ -603,144 +603,144 @@ export const SPECIAL_CURRENCY_INFO: { }, feathercoin: { maxSpendTargets: UTXO_MAX_SPEND_TARGETS, - initWalletName: s.strings.string_first_feather_coin_wallet_name, + initWalletName: lstrings.string_first_feather_coin_wallet_name, chainCode: 'FTC', isImportKeySupported: { - privateKeyLabel: s.strings.create_wallet_import_input_key_or_seed_prompt, - privateKeyInstructions: s.strings.create_wallet_import_input_key_or_seed_instructions + privateKeyLabel: lstrings.create_wallet_import_input_key_or_seed_prompt, + privateKeyInstructions: lstrings.create_wallet_import_input_key_or_seed_instructions }, isPrivateKeySweepable: true, isPaymentProtocolSupported: true }, groestlcoin: { maxSpendTargets: UTXO_MAX_SPEND_TARGETS, - initWalletName: s.strings.string_first_groestlcoin_wallet_name, + initWalletName: lstrings.string_first_groestlcoin_wallet_name, chainCode: 'GRS', isImportKeySupported: { - privateKeyLabel: s.strings.create_wallet_import_input_key_or_seed_prompt, - privateKeyInstructions: s.strings.create_wallet_import_input_key_or_seed_instructions + privateKeyLabel: lstrings.create_wallet_import_input_key_or_seed_prompt, + privateKeyInstructions: lstrings.create_wallet_import_input_key_or_seed_instructions }, isPrivateKeySweepable: true, isPaymentProtocolSupported: true }, qtum: { maxSpendTargets: UTXO_MAX_SPEND_TARGETS, - initWalletName: s.strings.string_first_qtum_wallet_name, + initWalletName: lstrings.string_first_qtum_wallet_name, chainCode: 'QTUM', isImportKeySupported: { - privateKeyLabel: s.strings.create_wallet_import_input_key_or_seed_prompt, - privateKeyInstructions: s.strings.create_wallet_import_input_key_or_seed_instructions + privateKeyLabel: lstrings.create_wallet_import_input_key_or_seed_prompt, + privateKeyInstructions: lstrings.create_wallet_import_input_key_or_seed_instructions }, isPrivateKeySweepable: true, isPaymentProtocolSupported: true }, eboost: { maxSpendTargets: UTXO_MAX_SPEND_TARGETS, - initWalletName: s.strings.string_first_eboost_wallet_name, + initWalletName: lstrings.string_first_eboost_wallet_name, chainCode: 'EBST', isImportKeySupported: { - privateKeyLabel: s.strings.create_wallet_import_input_key_or_seed_prompt, - privateKeyInstructions: s.strings.create_wallet_import_input_key_or_seed_instructions + privateKeyLabel: lstrings.create_wallet_import_input_key_or_seed_prompt, + privateKeyInstructions: lstrings.create_wallet_import_input_key_or_seed_instructions }, isPrivateKeySweepable: true, keysOnlyMode: true }, ufo: { maxSpendTargets: UTXO_MAX_SPEND_TARGETS, - initWalletName: s.strings.string_first_ufo_wallet_name, + initWalletName: lstrings.string_first_ufo_wallet_name, chainCode: 'ufo', isImportKeySupported: { - privateKeyLabel: s.strings.create_wallet_import_input_key_or_seed_prompt, - privateKeyInstructions: s.strings.create_wallet_import_input_key_or_seed_instructions + privateKeyLabel: lstrings.create_wallet_import_input_key_or_seed_prompt, + privateKeyInstructions: lstrings.create_wallet_import_input_key_or_seed_instructions }, isPrivateKeySweepable: true }, fantom: { - initWalletName: s.strings.string_first_fantom_wallet_name, + initWalletName: lstrings.string_first_fantom_wallet_name, chainCode: 'FTM', dummyPublicAddress: '0x0d73358506663d484945ba85d0cd435ad610b0a0', isImportKeySupported: { - privateKeyLabel: s.strings.create_wallet_import_input_prompt, - privateKeyInstructions: s.strings.create_wallet_import_instructions + privateKeyLabel: lstrings.create_wallet_import_input_prompt, + privateKeyInstructions: lstrings.create_wallet_import_instructions }, isStakingSupported: true, isCustomTokensSupported: true }, hedera: { - initWalletName: s.strings.string_first_hedera_wallet_name, + initWalletName: lstrings.string_first_hedera_wallet_name, chainCode: 'HBAR', dummyPublicAddress: '0.0.14625', isImportKeySupported: { - privateKeyLabel: s.strings.create_wallet_import_input_key_or_seed_prompt, - privateKeyInstructions: s.strings.create_wallet_import_input_key_or_seed_instructions + privateKeyLabel: lstrings.create_wallet_import_input_key_or_seed_prompt, + privateKeyInstructions: lstrings.create_wallet_import_input_key_or_seed_instructions }, isAccountActivationRequired: true, skipAccountNameValidation: true, noMaxSpend: true, noChangeMiningFee: true, uniqueIdentifierInfo: { - addButtonText: s.strings.unique_identifier_dropdown_option_memo, - identifierName: s.strings.unique_identifier_memo, + addButtonText: lstrings.unique_identifier_dropdown_option_memo, + identifierName: lstrings.unique_identifier_memo, keyboardType: 'default' } }, polkadot: { - initWalletName: s.strings.string_first_polkadot_wallet_name, + initWalletName: lstrings.string_first_polkadot_wallet_name, chainCode: 'DOT', dummyPublicAddress: '16gmDVJdCaij79PwzCisu7GRudJKABFB8fB5RWpjKX8H4Eh8', noChangeMiningFee: true, minimumPopupModals: { minimumNativeBalance: '10000000000', - modalMessage: s.strings.request_dot_minimum_notification_body, - alertMessage: s.strings.request_dot_minimum_notification_alert_body + modalMessage: lstrings.request_dot_minimum_notification_body, + alertMessage: lstrings.request_dot_minimum_notification_alert_body }, isImportKeySupported: { - privateKeyLabel: s.strings.create_wallet_import_input_key_or_seed_prompt, - privateKeyInstructions: s.strings.create_wallet_import_polkadot_input_key_or_seed_instructions + privateKeyLabel: lstrings.create_wallet_import_input_key_or_seed_prompt, + privateKeyInstructions: lstrings.create_wallet_import_polkadot_input_key_or_seed_instructions } }, zcash: { - initWalletName: s.strings.string_first_zcash_wallet_name, + initWalletName: lstrings.string_first_zcash_wallet_name, chainCode: 'ZEC', dummyPublicAddress: 'zs10xwzhkwm0ayzqn99q04l6hhyy76cu6mf6m8cu4xv4pdles7a3puh2cnv7w32qhzktrrsqpwy3n5', noChangeMiningFee: true, uniqueIdentifierInfo: { - addButtonText: s.strings.unique_identifier_dropdown_option_memo, - identifierName: s.strings.unique_identifier_memo, + addButtonText: lstrings.unique_identifier_dropdown_option_memo, + identifierName: lstrings.unique_identifier_memo, keyboardType: 'default' } }, piratechain: { - initWalletName: s.strings.string_first_piratechain_wallet_name, + initWalletName: lstrings.string_first_piratechain_wallet_name, chainCode: 'ARRR', dummyPublicAddress: 'zs1ps48sm9yusglfd2y28e7uhfkxfljy38papy00lzdmcdmctczx2hmvchcfjvp3n68zr2tu732y8k', noChangeMiningFee: true, uniqueIdentifierInfo: { - addButtonText: s.strings.unique_identifier_dropdown_option_memo, - identifierName: s.strings.unique_identifier_memo, + addButtonText: lstrings.unique_identifier_dropdown_option_memo, + identifierName: lstrings.unique_identifier_memo, keyboardType: 'default' } }, polygon: { - initWalletName: s.strings.string_first_polygon_wallet_name, + initWalletName: lstrings.string_first_polygon_wallet_name, chainCode: 'MATIC', dummyPublicAddress: '0x0d73358506663d484945ba85d0cd435ad610b0a0', allowZeroTx: true, displayBuyCrypto: true, isImportKeySupported: { - privateKeyLabel: s.strings.create_wallet_import_input_key_or_seed_prompt, - privateKeyInstructions: s.strings.create_wallet_import_input_key_or_seed_instructions + privateKeyLabel: lstrings.create_wallet_import_input_key_or_seed_prompt, + privateKeyInstructions: lstrings.create_wallet_import_input_key_or_seed_instructions }, isCustomTokensSupported: true }, avalanche: { - initWalletName: s.strings.string_first_avalanche_wallet_name, + initWalletName: lstrings.string_first_avalanche_wallet_name, chainCode: 'AVAX', dummyPublicAddress: '0x0d73358506663d484945ba85d0cd435ad610b0a0', allowZeroTx: true, isImportKeySupported: { - privateKeyLabel: s.strings.create_wallet_import_input_key_or_seed_prompt, - privateKeyInstructions: s.strings.create_wallet_import_input_key_or_seed_instructions + privateKeyLabel: lstrings.create_wallet_import_input_key_or_seed_prompt, + privateKeyInstructions: lstrings.create_wallet_import_input_key_or_seed_instructions }, isStakingSupported: true, isCustomTokensSupported: true diff --git a/src/controllers/action-queue/ActionProgram.ts b/src/controllers/action-queue/ActionProgram.ts index cac427d6769..5cd2a50875e 100644 --- a/src/controllers/action-queue/ActionProgram.ts +++ b/src/controllers/action-queue/ActionProgram.ts @@ -1,5 +1,5 @@ import { ENV } from '../../env' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { ActionOp, ActionProgram, ActionProgramCompleteMessage } from './types' // TODO: Move handling from ActionProgramUtil methods here, use this instead of @@ -11,8 +11,8 @@ export async function makeActionProgram(actionOp: ActionOp, completeMessage?: Ac programId, actionOp, completeMessage: completeMessage ?? { - title: s.strings.action_display_title_complete_default, - message: s.strings.action_display_message_complete_default + title: lstrings.action_display_title_complete_default, + message: lstrings.action_display_message_complete_default }, mockMode: ENV.ACTION_QUEUE.mockMode } diff --git a/src/controllers/action-queue/display.ts b/src/controllers/action-queue/display.ts index 5f0b474cdad..25abc6e1544 100644 --- a/src/controllers/action-queue/display.ts +++ b/src/controllers/action-queue/display.ts @@ -13,7 +13,7 @@ import { SwapActionOp } from '../../controllers/action-queue/types' import { LocaleStringKey } from '../../locales/en_US' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { queryBorrowPlugins } from '../../plugins/helpers/borrowPluginHelpers' import { config } from '../../theme/appConfig' import { getCurrencyCode } from '../../util/CurrencyInfoHelpers' @@ -48,8 +48,8 @@ async function getActionOpDisplayInfo(account: EdgeAccount, actionOp: ActionOp, switch (actionOp.type) { case 'seq': { return { - title: s.strings.action_queue_display_seq_title, - message: s.strings.action_queue_display_seq_message, + title: lstrings.action_queue_display_seq_title, + message: lstrings.action_queue_display_seq_message, ...baseDisplayInfo, steps: await Promise.all( actionOp.actions.map(async (op, index) => { @@ -83,8 +83,8 @@ async function getActionOpDisplayInfo(account: EdgeAccount, actionOp: ActionOp, const { title, message } = await getActionOpDisplayKeyMessage(account, actionOp) return { - title: title ?? s.strings.action_queue_display_par_title, - message: message ?? s.strings.action_queue_display_par_message, + title: title ?? lstrings.action_queue_display_par_title, + message: message ?? lstrings.action_queue_display_par_message, ...baseDisplayInfo, steps: await Promise.all( actionOp.actions.map(async (op, index) => { @@ -124,13 +124,13 @@ async function getActionOpDisplayInfo(account: EdgeAccount, actionOp: ActionOp, return { ...baseDisplayInfo, - title: s.strings.action_display_title_swap, + title: lstrings.action_display_title_swap, message: sprintf( - s.strings.action_queue_display_swap_message, + lstrings.action_queue_display_swap_message, fromCurrencyCode, config.appName, toCurrencyCode, - s.strings.loan_aave_fragment, + lstrings.loan_aave_fragment, toWallet.currencyInfo.currencyCode ) } @@ -142,8 +142,8 @@ async function getActionOpDisplayInfo(account: EdgeAccount, actionOp: ActionOp, return { ...baseDisplayInfo, - title: sprintf(s.strings.action_queue_display_fiat_buy_title, currencyCode), - message: sprintf(s.strings.action_queue_display_fiat_buy_message, currencyCode, 'Wyre') + title: sprintf(lstrings.action_queue_display_fiat_buy_title, currencyCode), + message: sprintf(lstrings.action_queue_display_fiat_buy_message, currencyCode, 'Wyre') } } case 'wyre-sell': { @@ -153,8 +153,8 @@ async function getActionOpDisplayInfo(account: EdgeAccount, actionOp: ActionOp, return { ...baseDisplayInfo, - title: s.strings.action_queue_display_fiat_sell_title, - message: sprintf(s.strings.action_queue_display_fiat_sell_message, currencyCode, 'Wyre') + title: lstrings.action_queue_display_fiat_sell_title, + message: sprintf(lstrings.action_queue_display_fiat_sell_message, currencyCode, 'Wyre') } } case 'loan-borrow': { @@ -164,8 +164,8 @@ async function getActionOpDisplayInfo(account: EdgeAccount, actionOp: ActionOp, return { ...baseDisplayInfo, - title: s.strings.action_queue_display_loan_borrow_title, - message: sprintf(s.strings.action_queue_display_loan_borrow_message_1s, currencyCode) + title: lstrings.action_queue_display_loan_borrow_title, + message: sprintf(lstrings.action_queue_display_loan_borrow_message_1s, currencyCode) } } case 'loan-deposit': { @@ -177,22 +177,22 @@ async function getActionOpDisplayInfo(account: EdgeAccount, actionOp: ActionOp, return { ...baseDisplayInfo, - title: sprintf(s.strings.action_queue_display_loan_deposit_title, currencyCode), - message: sprintf(s.strings.action_queue_display_loan_deposit_message, currencyCode, borrowPluginDisplayName) + title: sprintf(lstrings.action_queue_display_loan_deposit_title, currencyCode), + message: sprintf(lstrings.action_queue_display_loan_deposit_message, currencyCode, borrowPluginDisplayName) } } case 'loan-repay': { if (actionOp.fromTokenId != null) { return { ...baseDisplayInfo, - title: s.strings.action_queue_display_loan_repay_with_collateral_title, - message: s.strings.action_queue_display_loan_repay_with_collateral_message + title: lstrings.action_queue_display_loan_repay_with_collateral_title, + message: lstrings.action_queue_display_loan_repay_with_collateral_message } } else { return { ...baseDisplayInfo, - title: s.strings.action_queue_display_loan_repay_title, - message: s.strings.action_queue_display_loan_repay_message + title: lstrings.action_queue_display_loan_repay_title, + message: lstrings.action_queue_display_loan_repay_message } } } @@ -203,14 +203,14 @@ async function getActionOpDisplayInfo(account: EdgeAccount, actionOp: ActionOp, return { ...baseDisplayInfo, - title: s.strings.action_queue_display_loan_withdraw_title, - message: sprintf(s.strings.action_queue_display_loan_withdraw_message, currencyCode) + title: lstrings.action_queue_display_loan_withdraw_title, + message: sprintf(lstrings.action_queue_display_loan_withdraw_message, currencyCode) } } case 'broadcast-tx': { return { - title: sprintf(s.strings.action_queue_display_unknown_title), - message: sprintf(s.strings.action_queue_display_unknown_message), + title: sprintf(lstrings.action_queue_display_unknown_title), + message: sprintf(lstrings.action_queue_display_unknown_message), ...baseDisplayInfo } } @@ -254,7 +254,7 @@ async function getActionOpDisplayKeyMessage(account: EdgeAccount, actionOp: ParA titleData = { stringKey: `action_display_title_swap` } messageData = { stringKey: `action_display_message_swap_4s`, - wildcards: [config.appName, fromCurrencyCode, toCurrencyCode, s.strings.loan_aave_fragment] + wildcards: [config.appName, fromCurrencyCode, toCurrencyCode, lstrings.loan_aave_fragment] } } break @@ -276,7 +276,7 @@ async function getActionOpDisplayKeyMessage(account: EdgeAccount, actionOp: ParA titleData = { stringKey: `action_display_title_swap` } messageData = { stringKey: `action_display_message_swap_fees_5s`, - wildcards: [config.appName, fromCurrencyCode, toCurrencyCode, feeCurrencyCode, s.strings.loan_aave_fragment] + wildcards: [config.appName, fromCurrencyCode, toCurrencyCode, feeCurrencyCode, lstrings.loan_aave_fragment] } } break @@ -303,8 +303,8 @@ async function getActionOpDisplayKeyMessage(account: EdgeAccount, actionOp: ParA // Retrieve the strings. Populate wildcards, if applicable return { - title: titleData.wildcards == null ? s.strings[titleData.stringKey] : sprintf(s.strings[titleData.stringKey], ...titleData.wildcards), - message: messageData.wildcards == null ? s.strings[messageData.stringKey] : sprintf(s.strings[messageData.stringKey], ...messageData.wildcards) + title: titleData.wildcards == null ? lstrings[titleData.stringKey] : sprintf(lstrings[titleData.stringKey], ...titleData.wildcards), + message: messageData.wildcards == null ? lstrings[messageData.stringKey] : sprintf(lstrings[messageData.stringKey], ...messageData.wildcards) } } diff --git a/src/controllers/action-queue/push.ts b/src/controllers/action-queue/push.ts index 0f930c3ff5e..a89e986e6ff 100644 --- a/src/controllers/action-queue/push.ts +++ b/src/controllers/action-queue/push.ts @@ -1,4 +1,4 @@ -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { asHex } from '../../util/cleaners/asHex' import { makePushClient } from '../../util/PushClient/PushClient' import { filterNull } from '../../util/safeFilters' @@ -39,8 +39,8 @@ export async function prepareNewPushEvents( // Final push message to send to the device once server has finished all events const pushMessage: PushMessage = { - title: s.strings.action_queue_push_notification_title, - body: s.strings.action_queue_push_notification_body + title: lstrings.action_queue_push_notification_title, + body: lstrings.action_queue_push_notification_body } const pushEventInfos: PushEventInfo[] = await Promise.all( diff --git a/src/controllers/edgeProvider/EdgeProviderServer.tsx b/src/controllers/edgeProvider/EdgeProviderServer.tsx index bbf5a55f13e..58002dd3df6 100644 --- a/src/controllers/edgeProvider/EdgeProviderServer.tsx +++ b/src/controllers/edgeProvider/EdgeProviderServer.tsx @@ -13,7 +13,7 @@ import { trackConversion } from '../../actions/TrackingActions' import { ButtonsModal } from '../../components/modals/ButtonsModal' import { WalletListModal, WalletListResult } from '../../components/modals/WalletListModal' import { Airship, showError, showToast } from '../../components/services/AirshipInstance' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { GuiPlugin } from '../../types/GuiPluginTypes' import { Dispatch } from '../../types/reduxTypes' import { NavigationBase } from '../../types/routerTypes' @@ -102,13 +102,7 @@ export class EdgeProviderServer implements EdgeProviderMethods { } const selectedWallet = await Airship.show(bridge => ( - + )) const { walletId, currencyCode } = selectedWallet @@ -145,7 +139,7 @@ export class EdgeProviderServer implements EdgeProviderMethods { return returnCurrencyCode } - throw new Error(s.strings.user_closed_modal_no_wallet) + throw new Error(lstrings.user_closed_modal_no_wallet) } // Get an address from the user's wallet @@ -255,11 +249,11 @@ export class EdgeProviderServer implements EdgeProviderMethods { const confirmTxShare = await Airship.show<'ok' | 'cancel' | undefined>(bridge => ( )) diff --git a/src/hooks/useWalletName.ts b/src/hooks/useWalletName.ts index 4cb2a2fcfb9..d1b87c7e25c 100644 --- a/src/hooks/useWalletName.ts +++ b/src/hooks/useWalletName.ts @@ -1,7 +1,7 @@ import { EdgeCurrencyWallet } from 'edge-core-js' import { sprintf } from 'sprintf-js' -import s from '../locales/strings' +import { lstrings } from '../locales/strings' import { useWatch } from './useWatch' /** @@ -12,5 +12,5 @@ export function useWalletName(wallet: EdgeCurrencyWallet): string { const name = useWatch(wallet, 'name') if (name != null) return name - return sprintf(s.strings.my_crypto_wallet_name, wallet.currencyInfo.displayName) + return sprintf(lstrings.my_crypto_wallet_name, wallet.currencyInfo.displayName) } diff --git a/src/locales/strings.ts b/src/locales/strings.ts index df7e23dd724..78f562c2985 100644 --- a/src/locales/strings.ts +++ b/src/locales/strings.ts @@ -14,49 +14,40 @@ import zh from './strings/zh.json' const allLocales = { en, de, ru, es, it, pt, ja, fr, ko, vi, zh } -const strings = { ...en } -const out = { strings } +export const lstrings = { ...en } // Set the language at boot: -const [firstLocale = { languageTag: 'en_US' }] = getLocales() -selectLocale(firstLocale.languageTag) +const [firstLocale] = getLocales() +const { languageTag = 'en-US' } = firstLocale ?? {} +if (languageTag !== 'en-US') selectLocale(languageTag) function mergeStrings(primary: { [key: string]: string }, secondary: { [key: string]: string }) { for (const str of Object.keys(secondary)) { - if (secondary[str]) { + if (secondary[str] !== '') { primary[str] = secondary[str] } } } // Locale formats can be in the form 'en', 'en-US', 'en_US', or 'enUS' -export function selectLocale(locale: string = 'en'): boolean { +export function selectLocale(locale: string): boolean { // Break up local into language and region const normalizedLocale = locale.replace('-', '').replace('-', '').replace('_', '') - - let found = false const lang = normalizedLocale.slice(0, 2) - if (locale === 'en') return true - // Find pure language match first (ie. find 'es' when 'esMX' is chosen) - // @ts-expect-error - if (allLocales[lang] !== undefined) { - found = true - // @ts-expect-error - mergeStrings(out.strings, allLocales[lang]) + const shortMatch = allLocales[lang as keyof typeof allLocales] + if (shortMatch != null) { + mergeStrings(lstrings, shortMatch) + return true } // Find an exact match - // @ts-expect-error - if (allLocales[normalizedLocale] !== undefined) { - found = true - // @ts-expect-error - mergeStrings(out.strings, allLocales[normalizedLocale]) + const exactMatch = allLocales[normalizedLocale as keyof typeof allLocales] + if (exactMatch != null) { + mergeStrings(lstrings, exactMatch) + return true } - return found + return false } - -// eslint-disable-next-line import/no-default-export -export default out diff --git a/src/modules/FioAddress/components/ConnectWallets.tsx b/src/modules/FioAddress/components/ConnectWallets.tsx index f35f9f38581..5356f777ade 100644 --- a/src/modules/FioAddress/components/ConnectWallets.tsx +++ b/src/modules/FioAddress/components/ConnectWallets.tsx @@ -8,7 +8,7 @@ import { showError } from '../../../components/services/AirshipInstance' import { cacheStyles, Theme, ThemeProps, withTheme } from '../../../components/services/ThemeContext' import { EdgeText } from '../../../components/themed/EdgeText' import { MainButton } from '../../../components/themed/MainButton' -import s from '../../../locales/strings' +import { lstrings } from '../../../locales/strings' import { connect } from '../../../types/reactRedux' import { NavigationBase } from '../../../types/routerTypes' import { FioConnectionWalletItem } from '../../../types/types' @@ -101,7 +101,7 @@ class ConnectWallets extends React.Component { walletsToDisconnect }) } else { - showError(s.strings.fio_wallet_missing_for_fio_address) + showError(lstrings.fio_wallet_missing_for_fio_address) } } @@ -188,7 +188,7 @@ class ConnectWallets extends React.Component { renderNoWallets() { const { loading, theme } = this.props const styles = getStyles(theme) - return {loading ? s.strings.loading : s.strings.fio_connect_no_wallets} + return {loading ? lstrings.loading : lstrings.fio_connect_no_wallets} } render() { @@ -216,7 +216,7 @@ class ConnectWallets extends React.Component { - + ) diff --git a/src/modules/FioAddress/components/DomainListModal.tsx b/src/modules/FioAddress/components/DomainListModal.tsx index 50293ed07ff..a613a4f34f9 100644 --- a/src/modules/FioAddress/components/DomainListModal.tsx +++ b/src/modules/FioAddress/components/DomainListModal.tsx @@ -12,7 +12,7 @@ import { ModalFooter, ModalTitle } from '../../../components/themed/ModalParts' import { OutlinedTextInput } from '../../../components/themed/OutlinedTextInput' import { ThemedModal } from '../../../components/themed/ThemedModal' import { FIO_ADDRESS_DELIMITER, FIO_DOMAIN_DEFAULT } from '../../../constants/WalletAndCurrencyConstants' -import s from '../../../locales/strings' +import { lstrings } from '../../../locales/strings' import { connect } from '../../../types/reactRedux' import { NavigationBase } from '../../../types/routerTypes' import { FioDomain, FlatListItem } from '../../../types/types' @@ -46,8 +46,8 @@ type Props = OwnProps & ThemeProps & StateProps const newDomainItem = { createNew: true, - value: { ...FIO_DOMAIN_DEFAULT, name: s.strings.fio_address_list_register_domain }, - label: s.strings.fio_address_list_register_domain + value: { ...FIO_DOMAIN_DEFAULT, name: lstrings.fio_address_list_register_domain }, + label: lstrings.fio_address_list_register_domain } class DomainListModalComponent extends React.Component { @@ -127,7 +127,7 @@ class DomainListModalComponent extends React.Component { } - label={s.strings.fio_address_list_domain_register} + label={lstrings.fio_address_list_domain_register} onPress={this.registerNewDomain} paddingRem={0} /> @@ -139,7 +139,7 @@ class DomainListModalComponent extends React.Component { this.selectItem(value)}> {label} - {value.isFree ? s.strings.fio_domain_free : ''} + {value.isFree ? lstrings.fio_domain_free : ''} ) @@ -156,14 +156,14 @@ class DomainListModalComponent extends React.Component { return ( bridge.resolve(undefined)} paddingRem={[1, 0]}> - {s.strings.fio_address_choose_domain_label} + {lstrings.fio_address_choose_domain_label} { const { onSubmit, onSuccess, successMessage, addressTitles } = this.props const { paymentWallet, fee } = this.state if (!paymentWallet) { - const msg = addressTitles ? s.strings.fio_wallet_missing_for_fio_address : s.strings.fio_wallet_missing_for_fio_domain + const msg = addressTitles ? lstrings.fio_wallet_missing_for_fio_address : lstrings.fio_wallet_missing_for_fio_domain showError(msg) this.setState({ error: msg }) return } if (fee == null) { - showError(s.strings.fio_get_fee_err_msg) - this.setState({ error: s.strings.fio_get_fee_err_msg }) + showError(lstrings.fio_get_fee_err_msg) + this.setState({ error: lstrings.fio_get_fee_err_msg }) return } @@ -119,7 +119,7 @@ class FioActionSubmitComponent extends React.Component { const { fioWallet } = this.props const allowedCurrencyCodes: string[] = [fioWallet.currencyInfo.currencyCode] Airship.show(bridge => ( - + )) .then(({ walletId, currencyCode }: WalletListResult) => { if (walletId && currencyCode) { @@ -166,7 +166,7 @@ class FioActionSubmitComponent extends React.Component { const availbleBalance = getAvailableBalance(paymentWallet) this.setState({ balance: this.formatFio(availbleBalance) }) } else { - showError(addressTitles ? s.strings.fio_wallet_missing_for_fio_address : s.strings.fio_wallet_missing_for_fio_domain) + showError(addressTitles ? lstrings.fio_wallet_missing_for_fio_address : lstrings.fio_wallet_missing_for_fio_domain) } } @@ -185,16 +185,16 @@ class FioActionSubmitComponent extends React.Component { if (feeLoading || !showSlider) return null - const balanceText = `${balance ? balance.toFixed(2) : '0'} ${balance ? s.strings.fio_address_confirm_screen_fio_label : ''}` + const balanceText = `${balance ? balance.toFixed(2) : '0'} ${balance ? lstrings.fio_address_confirm_screen_fio_label : ''}` return ( <> {displayFee ? ( - + balance ? styles.balanceTitleDisabled : styles.balanceTitle}>{balanceText} ) : null} @@ -212,7 +212,7 @@ class FioActionSubmitComponent extends React.Component { {feeLoading && } {title ? {title} : null} {showPaymentWalletPicker && fioWallets.length > 1 ? ( - + ) : null} {this.renderFeeAndBalance()} @@ -222,14 +222,14 @@ class FioActionSubmitComponent extends React.Component { onSlidingComplete={this.onConfirm} disabled={displayFee > balance || loading} showSpinner={loading} - disabledText={s.strings.fio_address_confirm_screen_disabled_slider_label} + disabledText={lstrings.fio_address_confirm_screen_disabled_slider_label} /> )} {!feeLoading && ( - + )} diff --git a/src/modules/FioAddress/components/FioName.tsx b/src/modules/FioAddress/components/FioName.tsx index 08108b775b8..eba4d06554b 100644 --- a/src/modules/FioAddress/components/FioName.tsx +++ b/src/modules/FioAddress/components/FioName.tsx @@ -6,7 +6,7 @@ import { cacheStyles, Theme, ThemeProps, withTheme } from '../../../components/s import { ClickableRow } from '../../../components/themed/ClickableRow' import { EdgeText } from '../../../components/themed/EdgeText' import { formatDate } from '../../../locales/intl' -import s from '../../../locales/strings' +import { lstrings } from '../../../locales/strings' interface FioNameProps { name: string @@ -22,12 +22,12 @@ const FioName = (props: FioNameProps & ThemeProps) => { const renderSubTitle = () => { if (expiration != null) { - const subTitle = `${s.strings.fio_address_details_screen_expires} ${formatDate(new Date(expiration))}` + const subTitle = `${lstrings.fio_address_details_screen_expires} ${formatDate(new Date(expiration))}` return {subTitle} } if (bundledTxs != null) { - const subTitle = `${s.strings.fio_address_details_screen_bundled_txs}: ${bundledTxs}` + const subTitle = `${lstrings.fio_address_details_screen_bundled_txs}: ${bundledTxs}` return {subTitle} } diff --git a/src/modules/FioAddress/util.ts b/src/modules/FioAddress/util.ts index f61407d345f..b62886c345e 100644 --- a/src/modules/FioAddress/util.ts +++ b/src/modules/FioAddress/util.ts @@ -4,7 +4,7 @@ import { EdgeAccount, EdgeCurrencyConfig, EdgeCurrencyWallet, EdgeDenomination, import { sprintf } from 'sprintf-js' import { FIO_STR, getSpecialCurrencyInfo, SPECIAL_CURRENCY_INFO } from '../../constants/WalletAndCurrencyConstants' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { CcWalletMap } from '../../reducers/FioReducer' import { BooleanMap, FioAddress, FioConnectionWalletItem, FioDomain, FioObtRecord, StringMap } from '../../types/types' import { getWalletName } from '../../util/CurrencyWalletHelpers' @@ -270,7 +270,7 @@ export const updatePubAddressesForFioAddress = async ( publicAddresses: Array<{ walletId: string; chainCode: string; tokenCode: string; publicAddress: string }>, isConnection: boolean = true ): Promise<{ updatedCcWallets: Array<{ fullCurrencyCode: string; walletId: string }>; error?: Error | FioError | null }> => { - if (!fioWallet) throw new Error(s.strings.fio_connect_wallets_err) + if (!fioWallet) throw new Error(lstrings.fio_connect_wallets_err) const connectedWalletsFromDisklet = await getConnectedWalletsForFioAddress(fioWallet, fioAddress) let updatedCcWallets: WalletArray = [] const iteration: IterationObj = { @@ -351,13 +351,13 @@ export const addPublicAddresses = async ( edgeTx = await fioMakeSpend(fioWallet, 'addPublicAddresses', { fioAddress, publicAddresses }) fee = edgeTx.networkFee } catch (e: any) { - throw new Error(s.strings.fio_get_fee_err_msg) + throw new Error(lstrings.fio_get_fee_err_msg) } - if (fee !== '0') throw new FioError(s.strings.fio_no_bundled_err_msg, FIO_NO_BUNDLED_ERR_CODE) + if (fee !== '0') throw new FioError(lstrings.fio_no_bundled_err_msg, FIO_NO_BUNDLED_ERR_CODE) try { await fioSignAndBroadcast(fioWallet, edgeTx) } catch (e: any) { - throw new Error(s.strings.fio_connect_wallets_err) + throw new Error(lstrings.fio_connect_wallets_err) } } @@ -380,13 +380,13 @@ export const removePublicAddresses = async ( edgeTx = await fioMakeSpend(fioWallet, 'removePublicAddresses', { fioAddress, publicAddresses }) fee = edgeTx.networkFee } catch (e: any) { - throw new Error(s.strings.fio_get_fee_err_msg) + throw new Error(lstrings.fio_get_fee_err_msg) } - if (fee !== '0') throw new FioError(s.strings.fio_no_bundled_err_msg, FIO_NO_BUNDLED_ERR_CODE) + if (fee !== '0') throw new FioError(lstrings.fio_no_bundled_err_msg, FIO_NO_BUNDLED_ERR_CODE) try { await fioSignAndBroadcast(fioWallet, edgeTx) } catch (e: any) { - throw new Error(s.strings.fio_connect_wallets_err) + throw new Error(lstrings.fio_connect_wallets_err) } } @@ -472,18 +472,15 @@ export const checkPubAddress = async (fioPlugin: EdgeCurrencyConfig, fioAddress: return publicAddress } catch (e: any) { if (e.labelCode && e.labelCode === fioPlugin.currencyInfo.defaultSettings.errorCodes.INVALID_FIO_ADDRESS) { - throw new FioError(s.strings.fio_error_invalid_address, fioPlugin.currencyInfo.defaultSettings.errorCodes.INVALID_FIO_ADDRESS) + throw new FioError(lstrings.fio_error_invalid_address, fioPlugin.currencyInfo.defaultSettings.errorCodes.INVALID_FIO_ADDRESS) } if (e.labelCode && e.labelCode === fioPlugin.currencyInfo.defaultSettings.errorCodes.FIO_ADDRESS_IS_NOT_EXIST) { - throw new FioError(s.strings.send_fio_request_error_addr_not_exist, fioPlugin.currencyInfo.defaultSettings.errorCodes.FIO_ADDRESS_IS_NOT_EXIST) + throw new FioError(lstrings.send_fio_request_error_addr_not_exist, fioPlugin.currencyInfo.defaultSettings.errorCodes.FIO_ADDRESS_IS_NOT_EXIST) } if (e.labelCode && e.labelCode === fioPlugin.currencyInfo.defaultSettings.errorCodes.FIO_ADDRESS_IS_NOT_LINKED) { - throw new FioError( - sprintf(s.strings.err_address_not_linked_title, tokenCode), - fioPlugin.currencyInfo.defaultSettings.errorCodes.FIO_ADDRESS_IS_NOT_LINKED - ) + throw new FioError(sprintf(lstrings.err_address_not_linked_title, tokenCode), fioPlugin.currencyInfo.defaultSettings.errorCodes.FIO_ADDRESS_IS_NOT_LINKED) } - throw new Error(s.strings.fio_connect_wallets_err) + throw new Error(lstrings.fio_connect_wallets_err) } } @@ -514,7 +511,7 @@ export const getFioAddressCache = async (account: EdgeAccount): Promise { - if (!fioWallet) throw new Error(s.strings.fio_wallet_missing_for_fio_address) + if (!fioWallet) throw new Error(lstrings.fio_wallet_missing_for_fio_address) let getFeeResult: string try { const edgeTx = await fioMakeSpend(fioWallet, 'recordObtData', { @@ -523,12 +520,12 @@ export const checkRecordSendFee = async (fioWallet: EdgeCurrencyWallet | null, f }) getFeeResult = edgeTx.networkFee } catch (e: any) { - throw new Error(s.strings.fio_get_fee_err_msg) + throw new Error(lstrings.fio_get_fee_err_msg) } const bundles = await getRemainingBundles(fioWallet, fioAddress) // record_obt_data requires 2 bundled transactions if (getFeeResult !== '0' || bundles < 2) { - throw new FioError(`${s.strings.fio_no_bundled_err_msg} ${s.strings.fio_no_bundled_add_err_msg}`, FIO_NO_BUNDLED_ERR_CODE) + throw new FioError(`${lstrings.fio_no_bundled_err_msg} ${lstrings.fio_no_bundled_add_err_msg}`, FIO_NO_BUNDLED_ERR_CODE) } } @@ -615,7 +612,7 @@ export const getFioDomains = async (fioPlugin: EdgeCurrencyConfig, fioAddress: s } } } catch (e: any) { - throw new Error(s.strings.err_no_address_title) + throw new Error(lstrings.err_no_address_title) } return '' @@ -627,14 +624,14 @@ export const checkIsDomainPublic = async (fioPlugin: EdgeCurrencyConfig, domain: isDomainPublic = fioPlugin.otherMethods ? await fioPlugin.otherMethods.isDomainPublic(domain) : false } catch (e: any) { if (e.labelCode && e.labelCode === fioPlugin.currencyInfo.defaultSettings.errorCodes.FIO_DOMAIN_IS_NOT_EXIST) { - throw new Error(s.strings.fio_get_reg_info_domain_err_msg) + throw new Error(lstrings.fio_get_reg_info_domain_err_msg) } - throw new Error(s.strings.fio_connect_wallets_err) + throw new Error(lstrings.fio_connect_wallets_err) } if (!isDomainPublic) { - throw new Error(s.strings.fio_address_register_domain_is_not_public) + throw new Error(lstrings.fio_address_register_domain_is_not_public) } } @@ -669,7 +666,7 @@ export const getRegInfo = async ( feeValue = parseInt(edgeTx.networkFee) activationCost = parseFloat(truncateDecimals(div(`${feeValue}`, displayDenomination.multiplier, DECIMAL_PRECISION))) } catch (e: any) { - throw new Error(s.strings.fio_get_fee_err_msg) + throw new Error(lstrings.fio_get_fee_err_msg) } if (selectedDomain.walletId) { @@ -722,7 +719,7 @@ export const getDomainRegInfo = async ( feeValue = parseInt(edgeTx.networkFee) activationCost = parseFloat(truncateDecimals(div(`${feeValue}`, displayDenomination.multiplier, DECIMAL_PRECISION))) } catch (e: any) { - throw new Error(s.strings.fio_get_fee_err_msg) + throw new Error(lstrings.fio_get_fee_err_msg) } const reqResult = await buyAddressRequest(fioPlugin, fioDomain, fioPlugin.currencyInfo.defaultSettings.defaultRef, selectedWallet, activationCost) @@ -782,18 +779,18 @@ const buyAddressRequest = async ( } } catch (e: any) { const errorMessages = { - [fioPlugin.currencyInfo.defaultSettings.errorCodes.INVALID_FIO_ADDRESS]: s.strings.fio_error_invalid_address, - [fioPlugin.currencyInfo.defaultSettings.errorCodes.FIO_DOMAIN_IS_NOT_EXIST]: s.strings.fio_get_reg_info_domain_err_msg, - [fioPlugin.currencyInfo.defaultSettings.errorCodes.FIO_DOMAIN_IS_NOT_PUBLIC]: s.strings.fio_address_register_domain_is_not_public, - [fioPlugin.currencyInfo.defaultSettings.errorCodes.SERVER_ERROR]: s.strings.fio_get_reg_info_err_msg, - [fioPlugin.currencyInfo.defaultSettings.errorCodes.ALREADY_SENT_REGISTRATION_REQ_FOR_DOMAIN]: s.strings.fio_get_reg_info_already_sent_err_msg, - [fioPlugin.currencyInfo.defaultSettings.errorCodes.ALREADY_REGISTERED]: s.strings.fio_address_register_screen_not_available + [fioPlugin.currencyInfo.defaultSettings.errorCodes.INVALID_FIO_ADDRESS]: lstrings.fio_error_invalid_address, + [fioPlugin.currencyInfo.defaultSettings.errorCodes.FIO_DOMAIN_IS_NOT_EXIST]: lstrings.fio_get_reg_info_domain_err_msg, + [fioPlugin.currencyInfo.defaultSettings.errorCodes.FIO_DOMAIN_IS_NOT_PUBLIC]: lstrings.fio_address_register_domain_is_not_public, + [fioPlugin.currencyInfo.defaultSettings.errorCodes.SERVER_ERROR]: lstrings.fio_get_reg_info_err_msg, + [fioPlugin.currencyInfo.defaultSettings.errorCodes.ALREADY_SENT_REGISTRATION_REQ_FOR_DOMAIN]: lstrings.fio_get_reg_info_already_sent_err_msg, + [fioPlugin.currencyInfo.defaultSettings.errorCodes.ALREADY_REGISTERED]: lstrings.fio_address_register_screen_not_available } if (e.labelCode && errorMessages[e.labelCode]) { throw new Error(errorMessages[e.labelCode]) } } - throw new Error(s.strings.fio_get_reg_info_err_msg) + throw new Error(lstrings.fio_get_reg_info_err_msg) } export const getRemainingBundles = async (fioWallet: EdgeCurrencyWallet, fioName: string): Promise => { @@ -815,10 +812,10 @@ export const getAddBundledTxsFee = async (fioWallet: EdgeCurrencyWallet | null): const edgeTx = await fioMakeSpend(fioWallet, 'addBundledTransactions', { fioAddress: '', bundleSets: DEFAULT_BUNDLE_SET_VALUE }) return parseInt(edgeTx.networkFee) } catch (e: any) { - throw new Error(s.strings.fio_get_fee_err_msg) + throw new Error(lstrings.fio_get_fee_err_msg) } } - throw new Error(s.strings.fio_get_fee_err_msg) + throw new Error(lstrings.fio_get_fee_err_msg) } export const addBundledTxs = async (fioWallet: EdgeCurrencyWallet | null, fioAddress: string, fee: number): Promise => { @@ -831,10 +828,10 @@ export const addBundledTxs = async (fioWallet: EdgeCurrencyWallet | null, fioAdd const expiration = edgeTx.otherParams?.broadcastResult?.expiration return expiration } catch (e: any) { - throw new Error(s.strings.fio_add_bundled_txs_err_msg) + throw new Error(lstrings.fio_add_bundled_txs_err_msg) } } - throw new Error(s.strings.fio_add_bundled_txs_err_msg) + throw new Error(lstrings.fio_add_bundled_txs_err_msg) } export const getRenewalFee = async (fioWallet: EdgeCurrencyWallet | null): Promise => { @@ -843,14 +840,14 @@ export const getRenewalFee = async (fioWallet: EdgeCurrencyWallet | null): Promi const edgeTx = await fioMakeSpend(fioWallet, 'renewFioDomain', { fioDomain: '' }) return parseInt(edgeTx.networkFee) } catch (e: any) { - throw new Error(s.strings.fio_get_fee_err_msg) + throw new Error(lstrings.fio_get_fee_err_msg) } } - throw new Error(s.strings.fio_get_fee_err_msg) + throw new Error(lstrings.fio_get_fee_err_msg) } export const renewFioDomain = async (fioWallet: EdgeCurrencyWallet | null, fioDomain: string, fee: number): Promise<{ expiration: string }> => { - const errorStr = sprintf(s.strings.fio_renew_err_msg, s.strings.fio_domain_label) + const errorStr = sprintf(lstrings.fio_renew_err_msg, lstrings.fio_domain_label) if (fioWallet) { try { let edgeTx = await fioMakeSpend(fioWallet, 'renewFioDomain', { fioDomain }) @@ -870,10 +867,10 @@ export const getDomainSetVisibilityFee = async (fioWallet: EdgeCurrencyWallet | const edgeTx = await fioMakeSpend(fioWallet, 'setFioDomainVisibility', { fioDomain: '', isPublic: true }) return parseInt(edgeTx.networkFee) } catch (e: any) { - throw new Error(s.strings.fio_get_fee_err_msg) + throw new Error(lstrings.fio_get_fee_err_msg) } } - throw new Error(s.strings.fio_get_fee_err_msg) + throw new Error(lstrings.fio_get_fee_err_msg) } export const setDomainVisibility = async ( @@ -889,10 +886,10 @@ export const setDomainVisibility = async ( const expiration = edgeTx.otherParams?.broadcastResult?.expiration return { expiration } } catch (e: any) { - throw new Error(s.strings.fio_domain_set_visibility_err) + throw new Error(lstrings.fio_domain_set_visibility_err) } } - throw new Error(s.strings.fio_domain_set_visibility_err) + throw new Error(lstrings.fio_domain_set_visibility_err) } export const getTransferFee = async (fioWallet: EdgeCurrencyWallet | null, forDomain: boolean = false): Promise => { @@ -906,30 +903,30 @@ export const getTransferFee = async (fioWallet: EdgeCurrencyWallet | null, forDo return parseInt(edgeTx.networkFee) } } catch (e: any) { - throw new Error(s.strings.fio_get_fee_err_msg) + throw new Error(lstrings.fio_get_fee_err_msg) } } - throw new Error(s.strings.fio_get_fee_err_msg) + throw new Error(lstrings.fio_get_fee_err_msg) } export const cancelFioRequest = async (fioWallet: EdgeCurrencyWallet | null, fioRequestId: number, fioAddress: string) => { - if (!fioWallet) throw new Error(s.strings.fio_wallet_missing_for_fio_address) + if (!fioWallet) throw new Error(lstrings.fio_wallet_missing_for_fio_address) let getFeeResult: string let edgeTx: EdgeTransaction try { edgeTx = await fioMakeSpend(fioWallet, 'cancelFundsRequest', { fioAddress, fioRequestId }) getFeeResult = edgeTx.networkFee } catch (e: any) { - throw new Error(s.strings.fio_get_fee_err_msg) + throw new Error(lstrings.fio_get_fee_err_msg) } if (getFeeResult !== '0') { - throw new FioError(`${s.strings.fio_no_bundled_err_msg} ${s.strings.fio_no_bundled_add_err_msg}`, FIO_NO_BUNDLED_ERR_CODE) + throw new FioError(`${lstrings.fio_no_bundled_err_msg} ${lstrings.fio_no_bundled_add_err_msg}`, FIO_NO_BUNDLED_ERR_CODE) } try { edgeTx = await fioSignAndBroadcast(fioWallet, edgeTx) await fioWallet.saveTx(edgeTx) } catch (e: any) { - throw new Error(s.strings.fio_cancel_request_error) + throw new Error(lstrings.fio_cancel_request_error) } } diff --git a/src/plugins/gui/creditCardPlugin.ts b/src/plugins/gui/creditCardPlugin.ts index cea6b7f5ff9..90ddf87f4e9 100644 --- a/src/plugins/gui/creditCardPlugin.ts +++ b/src/plugins/gui/creditCardPlugin.ts @@ -4,7 +4,7 @@ import { sprintf } from 'sprintf-js' import { ENV } from '../../env' import { formatNumber, isValidInput } from '../../locales/intl' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { config } from '../../theme/appConfig' import { EdgeTokenId } from '../../types/types' import { getPartnerIconUri } from '../../util/CdnUris' @@ -70,7 +70,7 @@ export const creditCardPlugin: FiatPluginFactory = async (params: FiatPluginFact startPlugin: async (params: FiatPluginStartParams) => { const { isBuy, regionCode, paymentTypes, providerId } = params const ps = fuzzyTimeout(assetPromises, 5000).catch(e => []) - const assetArray = await showUi.showToastSpinner(s.strings.fiat_plugin_fetching_assets, ps) + const assetArray = await showUi.showToastSpinner(lstrings.fiat_plugin_fetching_assets, ps) const allowedAssets: EdgeTokenId[] = [] const allowedFiats: { [fiatCurrencyCode: string]: boolean } = {} @@ -96,7 +96,7 @@ export const creditCardPlugin: FiatPluginFactory = async (params: FiatPluginFact // Pop up modal to pick wallet/asset const walletListResult: { walletId: string | undefined; currencyCode: string | undefined } = await showUi.walletPicker({ - headerTitle: s.strings.fiat_plugin_select_asset_to_purchase, + headerTitle: lstrings.fiat_plugin_select_asset_to_purchase, allowedAssets, showCreateWallet: true }) @@ -118,11 +118,11 @@ export const creditCardPlugin: FiatPluginFactory = async (params: FiatPluginFact let enterAmountMethods: FiatPluginGetMethodsResponse // Navigate to scene to have user enter amount await showUi.enterAmount({ - headerTitle: sprintf(s.strings.fiat_plugin_buy_currencycode, currencyCode), + headerTitle: sprintf(lstrings.fiat_plugin_buy_currencycode, currencyCode), isBuy, - label1: sprintf(s.strings.fiat_plugin_amount_currencycode, displayFiatCurrencyCode), - label2: sprintf(s.strings.fiat_plugin_amount_currencycode, currencyCode), + label1: sprintf(lstrings.fiat_plugin_amount_currencycode, displayFiatCurrencyCode), + label2: sprintf(lstrings.fiat_plugin_amount_currencycode, currencyCode), initialAmount1: '500', getMethods: (methods: FiatPluginGetMethodsResponse) => { enterAmountMethods = methods @@ -130,7 +130,7 @@ export const creditCardPlugin: FiatPluginFactory = async (params: FiatPluginFact convertValue: async (sourceFieldNum: number, value: string): Promise => { if (!isValidInput(value)) { if (enterAmountMethods != null) - enterAmountMethods.setStatusText({ statusText: s.strings.create_wallet_invalid_input, options: { textType: 'error' } }) + enterAmountMethods.setStatusText({ statusText: lstrings.create_wallet_invalid_input, options: { textType: 'error' } }) return } bestQuote = undefined @@ -185,7 +185,7 @@ export const creditCardPlugin: FiatPluginFactory = async (params: FiatPluginFact if (goodQuotes.length === 0) { // Find the best error to surface - const bestErrorText = getBestError(errors as any, sourceFieldCurrencyCode) ?? s.strings.fiat_plugin_buy_no_quote + const bestErrorText = getBestError(errors as any, sourceFieldCurrencyCode) ?? lstrings.fiat_plugin_buy_no_quote if (enterAmountMethods != null) enterAmountMethods.setStatusText({ statusText: bestErrorText, options: { textType: 'error' } }) return } @@ -193,7 +193,7 @@ export const creditCardPlugin: FiatPluginFactory = async (params: FiatPluginFact // Find best quote factoring in pluginPriorities bestQuote = getBestQuote(goodQuotes, priorityArray) if (bestQuote == null) { - if (enterAmountMethods != null) enterAmountMethods.setStatusText({ statusText: s.strings.fiat_plugin_buy_no_quote, options: { textType: 'error' } }) + if (enterAmountMethods != null) enterAmountMethods.setStatusText({ statusText: lstrings.fiat_plugin_buy_no_quote, options: { textType: 'error' } }) return } diff --git a/src/plugins/gui/pluginUtils.ts b/src/plugins/gui/pluginUtils.ts index 92968066a6a..0717f0760a1 100644 --- a/src/plugins/gui/pluginUtils.ts +++ b/src/plugins/gui/pluginUtils.ts @@ -3,7 +3,7 @@ import { EdgeDataStore } from 'edge-core-js' import { sprintf } from 'sprintf-js' import { formatNumber } from '../../locales/intl' -import s from '../../locales/strings' +import { lstrings } from '../../locales/strings' import { FiatProviderError, FiatProviderQuote, FiatProviderQuoteError, FiatProviderQuoteErrorTypes, FiatProviderStore } from './fiatProviderTypes' export const createStore = (storeId: string, store: EdgeDataStore): FiatProviderStore => { @@ -25,11 +25,11 @@ const ERROR_PRIORITIES: { [errorType: FiatProviderQuoteErrorTypes]: number } = { } const ERROR_TEXT = { - underLimit: s.strings.fiat_plugin_buy_amount_under_limit, - overLimit: s.strings.fiat_plugin_buy_amount_over_limit, - paymentUnsupported: s.strings.fiat_plugin_payment_unsupported, - regionRestricted: s.strings.fiat_plugin_buy_region_restricted, - assetUnsupported: s.strings.fiat_plugin_asset_unsupported + underLimit: lstrings.fiat_plugin_buy_amount_under_limit, + overLimit: lstrings.fiat_plugin_buy_amount_over_limit, + paymentUnsupported: lstrings.fiat_plugin_payment_unsupported, + regionRestricted: lstrings.fiat_plugin_buy_region_restricted, + assetUnsupported: lstrings.fiat_plugin_asset_unsupported } export const getRateFromQuote = (quote: FiatProviderQuote, fiatCode: string): string => { diff --git a/src/plugins/gui/scenes/EnterAmountScene.tsx b/src/plugins/gui/scenes/EnterAmountScene.tsx index 0029e348bc7..1aff6968ba1 100644 --- a/src/plugins/gui/scenes/EnterAmountScene.tsx +++ b/src/plugins/gui/scenes/EnterAmountScene.tsx @@ -10,7 +10,7 @@ import { MainButton } from '../../../components/themed/MainButton' import { OutlinedTextInput } from '../../../components/themed/OutlinedTextInput' import { SceneHeader } from '../../../components/themed/SceneHeader' import { useHandler } from '../../../hooks/useHandler' -import s from '../../../locales/strings' +import { lstrings } from '../../../locales/strings' import { RouteProp } from '../../../types/routerTypes' import { getPartnerIconUri } from '../../../util/CdnUris' @@ -152,11 +152,11 @@ export const FiatPluginEnterAmountScene = React.memo((props: Props) => { - {s.strings.plugin_powered_by_space} + {lstrings.plugin_powered_by_space} {poweredBy.poweredByText} - {s.strings.tap_to_change_provider} + {lstrings.tap_to_change_provider} @@ -166,7 +166,7 @@ export const FiatPluginEnterAmountScene = React.memo((props: Props) => { ) : null} - + ) diff --git a/src/plugins/stake-plugins/currency/tronStakePlugin.ts b/src/plugins/stake-plugins/currency/tronStakePlugin.ts index 23c1811444e..a5d34beec56 100644 --- a/src/plugins/stake-plugins/currency/tronStakePlugin.ts +++ b/src/plugins/stake-plugins/currency/tronStakePlugin.ts @@ -1,11 +1,11 @@ import { gt } from 'biggystring' import { EdgeSpendInfo } from 'edge-core-js' -import s from '../../../locales/strings' +import { lstrings } from '../../../locales/strings' import { ChangeQuote, ChangeQuoteRequest, QuoteAllocation, StakePlugin, StakePolicy, StakePosition, StakePositionRequest, StakeProviderInfo } from '../types' const stakeProviderInfo: StakeProviderInfo = { - displayName: s.strings.stake_resource_display_name, + displayName: lstrings.stake_resource_display_name, pluginId: 'tronResources', stakeProviderId: 'tronResources' } @@ -28,7 +28,7 @@ const policies: StakePolicy[] = [ { pluginId: 'tron', currencyCode: 'BANDWIDTH', - displayName: s.strings.stake_resource_bandwidth, + displayName: lstrings.stake_resource_bandwidth, cdnName: 'bandwidth' } ], @@ -46,7 +46,7 @@ const policies: StakePolicy[] = [ { pluginId: 'tron', currencyCode: 'ENERGY', - displayName: s.strings.stake_resource_energy, + displayName: lstrings.stake_resource_energy, cdnName: 'energy' } ], diff --git a/src/plugins/stake-plugins/uniswapV2/policies/cemeteryPolicy.ts b/src/plugins/stake-plugins/uniswapV2/policies/cemeteryPolicy.ts index 483f4e5b760..2470a157d70 100644 --- a/src/plugins/stake-plugins/uniswapV2/policies/cemeteryPolicy.ts +++ b/src/plugins/stake-plugins/uniswapV2/policies/cemeteryPolicy.ts @@ -4,7 +4,7 @@ import { add, div, gt, gte, lte, mul, sub } from 'biggystring' import { BigNumber, ethers } from 'ethers' import { sprintf } from 'sprintf-js' -import s from '../../../../locales/strings' +import { lstrings } from '../../../../locales/strings' import { cacheTxMetadata } from '../../metadataCache' import { AssetId, ChangeQuote, ChangeQuoteRequest, PositionAllocation, QuoteAllocation, StakePosition, StakePositionRequest } from '../../types' import { makeBigAccumulator } from '../../util/accumulator' @@ -212,7 +212,7 @@ export const makeCemeteryPolicy = (options: CemeteryPolicyOptions): StakePluginP const totalBalance = add(balanceAmount, fromLpToken) const isBalanceEnough = lte(allocation.nativeAmount, totalBalance) if (!isBalanceEnough) { - throw new Error(sprintf(s.strings.stake_error_insufficient_s, allocation.currencyCode)) + throw new Error(sprintf(lstrings.stake_error_insufficient_s, allocation.currencyCode)) } }) ) @@ -429,7 +429,7 @@ export const makeCemeteryPolicy = (options: CemeteryPolicyOptions): StakePluginP const totalLpTokenBalance = add(lpTokenBalance, stakedLpTokenBalance) const isBalanceEnough = gte(totalLpTokenBalance, expectedLiquidityAmount) if (!isBalanceEnough) { - throw new Error(sprintf(s.strings.stake_error_insufficient_s, tokenACurrencyCode)) + throw new Error(sprintf(lstrings.stake_error_insufficient_s, tokenACurrencyCode)) } // 3. Withdraw LP-token from Pool Contract diff --git a/src/plugins/stake-plugins/uniswapV2/policies/masonryPolicy.ts b/src/plugins/stake-plugins/uniswapV2/policies/masonryPolicy.ts index cd9e889a075..0fb17ff131e 100644 --- a/src/plugins/stake-plugins/uniswapV2/policies/masonryPolicy.ts +++ b/src/plugins/stake-plugins/uniswapV2/policies/masonryPolicy.ts @@ -2,7 +2,7 @@ import { gt, lte } from 'biggystring' import { BigNumber } from 'ethers' import { sprintf } from 'sprintf-js' -import s from '../../../../locales/strings' +import { lstrings } from '../../../../locales/strings' import { cacheTxMetadata } from '../../metadataCache' import { ChangeQuote, ChangeQuoteRequest, PositionAllocation, QuoteAllocation, StakePosition, StakePositionRequest } from '../../types' import { makeBigAccumulator } from '../../util/accumulator' @@ -187,7 +187,7 @@ export const makeMasonryPolicy = (options?: MasonryPolicyOptions): StakePluginPo const balanceAmount = fromHex(balanceResponse._hex) const isBalanceEnough = lte(allocation.nativeAmount, balanceAmount) if (!isBalanceEnough) { - throw new Error(sprintf(s.strings.stake_error_insufficient_s, request.currencyCode)) + throw new Error(sprintf(lstrings.stake_error_insufficient_s, request.currencyCode)) } }) ) diff --git a/src/types/PaymentProtoError.ts b/src/types/PaymentProtoError.ts index 6acf4555015..8f2bc7e89cf 100644 --- a/src/types/PaymentProtoError.ts +++ b/src/types/PaymentProtoError.ts @@ -1,6 +1,6 @@ import { sprintf } from 'sprintf-js' -import s from '../locales/strings' +import { lstrings } from '../locales/strings' export type PaymentProtoErrorCode = | 'CurrencyNotSupported' @@ -65,23 +65,23 @@ export class PaymentProtoError extends Error { export function translatePaymentProtoError(error: PaymentProtoError): string { switch (error.code) { case 'CurrencyNotSupported': - return sprintf(s.strings.error_paymentprotocol_currency_not_supported, error.text) + return sprintf(lstrings.error_paymentprotocol_currency_not_supported, error.text) case 'EmptyOutputInvoice': - return s.strings.error_paymentprotocol_empty_output_invoice + return lstrings.error_paymentprotocol_empty_output_invoice case 'EmptyVerificationHexReq': - return s.strings.error_paymentprotocol_empty_verification_hex_req + return lstrings.error_paymentprotocol_empty_verification_hex_req case 'FetchFailed': - return sprintf(s.strings.error_paymentprotocol_fetch, error.header, error.statusCode, error.text) + return sprintf(lstrings.error_paymentprotocol_fetch, error.header, error.statusCode, error.text) case 'InvalidPaymentOption': - return sprintf(s.strings.error_paymentprotocol_invalid_payment_option, error.text) + return sprintf(lstrings.error_paymentprotocol_invalid_payment_option, error.text) case 'MultiOutputInvoice': - return s.strings.error_paymentprotocol_multi_output_invoice + return lstrings.error_paymentprotocol_multi_output_invoice case 'MultiInstructionInvoice': - return s.strings.error_paymentprotocol_multi_tx_invoice + return lstrings.error_paymentprotocol_multi_tx_invoice case 'NoPaymentOption': - return sprintf(s.strings.error_paymentprotocol_no_payment_option, error.text) + return sprintf(lstrings.error_paymentprotocol_no_payment_option, error.text) case 'TxVerificationMismatch': - return sprintf(s.strings.error_paymentprotocol_tx_verification_failed) + return sprintf(lstrings.error_paymentprotocol_tx_verification_failed) default: return error.message } diff --git a/src/util/ActionProgramUtils.ts b/src/util/ActionProgramUtils.ts index fc152cbb750..9b37dc64a8b 100644 --- a/src/util/ActionProgramUtils.ts +++ b/src/util/ActionProgramUtils.ts @@ -5,7 +5,7 @@ import { sprintf } from 'sprintf-js' import { MAX_AMOUNT } from '../constants/valueConstants' import { makeActionProgram } from '../controllers/action-queue/ActionProgram' import { ActionOp, ActionProgram, ParActionOp, SeqActionOp } from '../controllers/action-queue/types' -import s from '../locales/strings' +import { lstrings } from '../locales/strings' import { BorrowCollateral, BorrowDebt, BorrowEngine } from '../plugins/borrow-plugins/types' import { convertCurrencyFromExchangeRates } from '../selectors/WalletSelectors' import { config } from '../theme/appConfig' @@ -107,11 +107,11 @@ export const makeAaveCreateActionProgram = async (params: AaveCreateActionParams // Special complete message for withdraw to bank return await makeActionProgram(actionOp, { - title: s.strings.action_display_title_complete_default, + title: lstrings.action_display_title_complete_default, message: destination.paymentMethodId != null - ? s.strings.action_display_message_complete_bank - : sprintf(s.strings.action_display_message_complete_wallet_2s, getToken(borrowEngineWallet, destination.tokenId)?.currencyCode ?? 'NA', config.appName) + ? lstrings.action_display_message_complete_bank + : sprintf(lstrings.action_display_message_complete_wallet_2s, getToken(borrowEngineWallet, destination.tokenId)?.currencyCode ?? 'NA', config.appName) }) } @@ -245,7 +245,7 @@ export const makeAaveCloseAction = async ({ // Closing loans with more than 1 debt/collateral is not supported because // we cannot make a judgement to determine which collateral asset to use to // repay debts. - if (collaterals.length > 1 || debts.length > 1) throw new Error(s.strings.loan_close_multiple_asset_error) + if (collaterals.length > 1 || debts.length > 1) throw new Error(lstrings.loan_close_multiple_asset_error) const collateral: BorrowCollateral | undefined = collaterals[0] const debt: BorrowDebt | undefined = debts[0] @@ -325,7 +325,7 @@ export const makeAaveCloseAction = async ({ throw new Error( sprintf( - s.strings.loan_close_insufficient_funds_4s, + lstrings.loan_close_insufficient_funds_4s, toFixed(debtBalanceDeficitFiat, 0, 2), debtCurrencyCode, toFixed(collateralDeficitAmount, 0, collateralMaxPrecision), diff --git a/src/util/CurrencyWalletHelpers.ts b/src/util/CurrencyWalletHelpers.ts index 9345b39bce8..7f9b8c5a4df 100644 --- a/src/util/CurrencyWalletHelpers.ts +++ b/src/util/CurrencyWalletHelpers.ts @@ -4,7 +4,7 @@ import { sprintf } from 'sprintf-js' import { showFullScreenSpinner } from '../components/modals/AirshipFullScreenSpinner' import { SPECIAL_CURRENCY_INFO, STAKING_BALANCES } from '../constants/WalletAndCurrencyConstants' -import s from '../locales/strings' +import { lstrings } from '../locales/strings' /** * Safely get a wallet name, returning a fallback when the name is null. @@ -14,7 +14,7 @@ export function getWalletName(wallet: EdgeCurrencyWallet): string { const { name } = wallet if (name != null) return name - return sprintf(s.strings.my_crypto_wallet_name, wallet.currencyInfo.displayName) + return sprintf(lstrings.my_crypto_wallet_name, wallet.currencyInfo.displayName) } export function getWalletFiat(wallet: EdgeCurrencyWallet): { fiatCurrencyCode: string; isoFiatCurrencyCode: string } { @@ -41,5 +41,5 @@ export const enableToken = async (currencyCode: string, wallet: EdgeCurrencyWall const enabledTokenIds = wallet.enabledTokenIds if (enabledTokenIds.find(enabledTokenId => enabledTokenId === newTokenId) == null) - await showFullScreenSpinner(s.strings.wallet_list_modal_enabling_token, wallet.changeEnabledTokenIds([...enabledTokenIds, newTokenId])) + await showFullScreenSpinner(lstrings.wallet_list_modal_enabling_token, wallet.changeEnabledTokenIds([...enabledTokenIds, newTokenId])) } diff --git a/src/util/categories.ts b/src/util/categories.ts index e8710ff8acb..353d4de7941 100644 --- a/src/util/categories.ts +++ b/src/util/categories.ts @@ -1,4 +1,4 @@ -import s from '../locales/strings' +import { lstrings } from '../locales/strings' export type Category = 'transfer' | 'exchange' | 'expense' | 'income' @@ -169,10 +169,10 @@ export const defaultCategories = [ * Use these strings to show categories in a user's language. */ export const displayCategories = { - transfer: s.strings.fragment_transaction_transfer, - exchange: s.strings.fragment_transaction_exchange, - expense: s.strings.fragment_transaction_expense, - income: s.strings.fragment_transaction_income + transfer: lstrings.fragment_transaction_transfer, + exchange: lstrings.fragment_transaction_exchange, + expense: lstrings.fragment_transaction_expense, + income: lstrings.fragment_transaction_income } /** diff --git a/src/util/stakeUtils.ts b/src/util/stakeUtils.ts index 7dea2020843..e4da3f7a067 100644 --- a/src/util/stakeUtils.ts +++ b/src/util/stakeUtils.ts @@ -2,7 +2,7 @@ import { EdgeCurrencyInfo } from 'edge-core-js' import { sprintf } from 'sprintf-js' import { formatTimeDate } from '../locales/intl' -import s from '../locales/strings' +import { lstrings } from '../locales/strings' import { PositionAllocation, StakePlugin, StakePolicy, StakePosition } from '../plugins/stake-plugins/types' import { getCurrencyIconUris } from './CdnUris' @@ -46,14 +46,14 @@ export const getPolicyTitleName = (stakePolicy: StakePolicy) => { const stakeName = stakeCurrencyCodes.length > 1 ? `${stakeCurrencyCodes.join(' + ')}` : stakeCurrencyCodes[0] const rewardName = rewardCurrencyCodes.length > 1 ? `${rewardCurrencyCodes.join(' + ')}` : rewardCurrencyCodes[0] - return sprintf(s.strings.stake_x_to_earn_y, stakeName, rewardName) + return sprintf(lstrings.stake_x_to_earn_y, stakeName, rewardName) } /** * Returns a formatted locked until timestamp, if it exists. */ export const getAllocationLocktimeMessage = (allocation: PositionAllocation) => { - return allocation.locktime != null ? ` (${sprintf(s.strings.stake_lock_message, formatTimeDate(allocation.locktime))})` : '' + return allocation.locktime != null ? ` (${sprintf(lstrings.stake_lock_message, formatTimeDate(allocation.locktime))})` : '' } /** @@ -84,5 +84,5 @@ export const getPluginFromPolicy = (stakePlugins: StakePlugin[], stakePolicy: St } export const getUnstakeText = (policy: StakePolicy): string => { - return policy.rewardsNotClaimable ? s.strings.stake_unstake : s.strings.stake_unstake_claim + return policy.rewardsNotClaimable ? lstrings.stake_unstake : lstrings.stake_unstake_claim } diff --git a/src/util/utils.ts b/src/util/utils.ts index d7f8cf408eb..a47d4c9af5e 100644 --- a/src/util/utils.ts +++ b/src/util/utils.ts @@ -23,7 +23,7 @@ import { SPECIAL_CURRENCY_INFO } from '../constants/WalletAndCurrencyConstants' import { toLocaleDate, toLocaleDateTime, toLocaleTime } from '../locales/intl' -import s from '../locales/strings' +import { lstrings } from '../locales/strings' import { convertCurrencyFromExchangeRates } from '../selectors/WalletSelectors' import { RootState } from '../types/reduxTypes' import { EdgeTokenId, GuiDenomination, GuiExchangeRates, GuiFiatType, TransactionListTx } from '../types/types' @@ -40,7 +40,7 @@ export const truncateString = (input: string | number, maxLength: number, isMidT const inputStr = typeof input !== 'string' ? String(input) : input const strLen = inputStr.length if (strLen >= maxLength) { - const delimStr = s.strings.util_truncate_delimeter + const delimStr = lstrings.util_truncate_delimeter if (isMidTrunc) { const segmentLen = Math.round(maxLength / 2) const seg1 = inputStr.slice(0, segmentLen) @@ -462,10 +462,10 @@ export function unixToLocaleDateTime(unixDate: number): { date: string; time: st export const toListString = (elements: string[]): string => { if (elements.length === 0) return '' if (elements.length === 1) return elements[0] - if (elements.length === 2) return sprintf(s.strings.util_s_and_s, elements[0], elements[1]) + if (elements.length === 2) return sprintf(lstrings.util_s_and_s, elements[0], elements[1]) const firstPart = elements.slice(0, elements.length - 2) - const lastPart = sprintf(s.strings.util_s_and_s, elements[elements.length - 2], elements[elements.length - 1]) + const lastPart = sprintf(lstrings.util_s_and_s, elements[elements.length - 2], elements[elements.length - 1]) return firstPart.join(', ') + `, ${lastPart}` }