FIX: missing i18n

This commit is contained in:
Ivan Vershigora 2020-12-21 21:27:49 +03:00
parent ed460c75e4
commit 1e89987e47
20 changed files with 72 additions and 51 deletions

View file

@ -2072,7 +2072,7 @@ export class BlueBitcoinAmount extends Component {
maxLength={this.maxLength()}
ref={textInput => (this.textInput = textInput)}
editable={!this.props.isLoading && !this.props.disabled}
value={parseFloat(amount) >= 0 || amount === BitcoinUnit.MAX ? amount : undefined}
value={amount === BitcoinUnit.MAX ? loc.units.MAX : parseFloat(amount) >= 0 ? amount : undefined}
placeholderTextColor={
this.props.disabled ? BlueCurrentTheme.colors.buttonDisabledTextColor : BlueCurrentTheme.colors.alternativeTextColor2
}
@ -2097,7 +2097,7 @@ export class BlueBitcoinAmount extends Component {
justifyContent: 'center',
}}
>
{' ' + this.state.unit}
{' ' + loc.units[this.state.unit]}
</Text>
)}
</View>
@ -2106,7 +2106,7 @@ export class BlueBitcoinAmount extends Component {
{this.state.unit === BitcoinUnit.LOCAL_CURRENCY && amount !== BitcoinUnit.MAX
? removeTrailingZeros(secondaryDisplayCurrency)
: secondaryDisplayCurrency}
{this.state.unit === BitcoinUnit.LOCAL_CURRENCY && amount !== BitcoinUnit.MAX ? ` ${BitcoinUnit.BTC}` : null}
{this.state.unit === BitcoinUnit.LOCAL_CURRENCY && amount !== BitcoinUnit.MAX ? ` ${loc.units[BitcoinUnit.BTC]}` : null}
</Text>
</View>
</View>

View file

@ -62,7 +62,7 @@ function Biometric() {
const isDeviceBiometricCapable = await Biometric.isDeviceBiometricCapable();
if (isDeviceBiometricCapable) {
return new Promise(resolve => {
FingerprintScanner.authenticate({ description: 'Please confirm your identity.', fallbackEnabled: true })
FingerprintScanner.authenticate({ description: loc.settings.biom_conf_identity, fallbackEnabled: true })
.then(() => resolve(true))
.catch(() => resolve(false))
.finally(() => FingerprintScanner.release());
@ -87,8 +87,8 @@ function Biometric() {
const isAuthenticated = await PasscodeAuth.authenticate();
if (isAuthenticated) {
Alert.alert(
'Storage',
`All your wallets will be removed and your storage will be decrypted. Are you sure you want to proceed?`,
loc.settings.encrypt_tstorage,
loc.settings.biom_remove_decrypt,
[
{ text: loc._.cancel, style: 'cancel' },
{
@ -104,15 +104,15 @@ function Biometric() {
isDevicePasscodeSupported = undefined;
}
if (isDevicePasscodeSupported === false) {
alert('Your device does not have a passcode. In order to proceed, please configure a passcode in the Settings app.');
alert(loc.settings.biom_no_passcode);
}
};
Biometric.showKeychainWipeAlert = () => {
if (Platform.OS === 'ios') {
Alert.alert(
'Storage',
`You have attempted to enter your password 10 times. Would you like to reset your storage? This will remove all wallets and decrypt your storage.`,
loc.settings.encrypt_tstorage,
loc.settings.biom_10times,
[
{
text: loc._.cancel,

View file

@ -19,6 +19,7 @@ export class PlaceholderWallet extends AbstractWallet {
}
getLabel() {
// no longer used in wallets carousel
return this.getIsFailure() ? 'Wallet Import' : 'Importing Wallet...';
}

View file

@ -173,7 +173,7 @@ const WalletCarouselItem = ({ item, index, onPress, handleLongPress, isSelectedW
<Image source={require('../img/btc-shape.png')} style={iStyles.image} />
<Text style={iStyles.br} />
<Text numberOfLines={1} style={[iStyles.label, { color: colors.inverseForegroundColor }]}>
{item.getLabel()}
{item.getIsFailure() ? loc.wallets.import_placeholder_fail : loc.wallets.import_placeholder_inprogress}
</Text>
{item.getIsFailure() ? (
<Text numberOfLines={0} style={[iStyles.importError, { color: colors.inverseForegroundColor }]}>

View file

@ -74,6 +74,8 @@
"item_nooffers": "No offers. Try to change \"Near me\" to Global offers.",
"item_rating": "{rating} trades",
"item_rating_no": "No rating",
"local_trader": "Local Trader",
"local_trader_new": "New",
"login": "Login",
"mycont": "My contracts",
"offer_accept": "Accept offer",
@ -228,6 +230,7 @@
"about_awesome": "Built with the awesome",
"about_backup": "Always backup your keys!",
"about_free": "BlueWallet is a free and open-source project. Crafted by Bitcoin users.",
"about_license": "MIT License",
"about_release_notes": "Release notes",
"about_review": "Leave us a review",
"about_selftest": "Run self-test",
@ -235,6 +238,11 @@
"about_sm_telegram": "Telegram chat",
"about_sm_twitter": "Follow us on Twitter",
"advanced_options": "Advanced Options",
"biom": "biometrics",
"biom_10times": "You have attempted to enter your password 10 times. Would you like to reset your storage? This will remove all wallets and decrypt your storage.",
"biom_conf_identity": "Please confirm your identity.",
"biom_no_passcode": "Your device does not have a passcode. In order to proceed, please configure a passcode in the Settings app.",
"biom_remove_decrypt": "All your wallets will be removed and your storage will be decrypted. Are you sure you want to proceed?",
"currency": "Currency",
"currency_source": "Prices are obtained from",
"default_desc": "When disabled, BlueWallet will immediately open the selected wallet at launch.",
@ -330,7 +338,8 @@
"rbf_title": "Bump Fee (RBF)",
"status_bump": "Bump Fee",
"status_cancel": "Cancel Transaction",
"transactions_count": "Transactions Count"
"transactions_count": "Transactions Count",
"txid": "Txid"
},
"wallets": {
"add_bitcoin": "Bitcoin",
@ -360,10 +369,15 @@
"details_del_wb_q": "This wallet has a balance. Before proceeding, please be aware that you will not be able to recover the funds without this wallet's seed phrase. In order to avoid accidental removal this wallet, please enter your wallet's balance of {balance} satoshis.",
"details_delete": "Delete",
"details_delete_wallet": "Delete Wallet",
"details_derivation_path": "derivation path",
"details_display": "Display in Wallets List",
"details_export_backup": "Export / Backup",
"details_marketplace": "Marketplace",
"details_master_fingerprint": "Master Fingerprint",
"details_ms_l": "{m} of {n} legacy (p2sh)",
"details_ms_ns": "{m} of {n} native segwit (p2wsh)",
"details_ms_ws": "{m} of {n} wrapped segwit (p2sh-p2wsh)",
"details_multisig_type": "multisig",
"details_no_cancel": "No, cancel",
"details_save": "Save",
"details_show_xpub": "Show Wallet XPUB",
@ -379,6 +393,8 @@
"import_explanation": "Write here your mnemonic, private key, WIF, or anything you've got. BlueWallet will do its best to guess the correct format and import your wallet.",
"import_file": "Import File",
"import_imported": "Imported",
"import_placeholder_fail": "Wallet Import",
"import_placeholder_inprogress": "Importing Wallet...",
"import_scan_qr": "Scan or import a file",
"import_success": "Your wallet has been successfully imported.",
"import_title": "Import",
@ -393,13 +409,15 @@
"list_import_error": "An error was encountered when attempting to import this wallet.",
"list_import_problem": "There was a problem importing this wallet",
"list_latest_transaction": "Latest Transaction",
"list_ln_browser": "LApp Browser",
"list_long_choose": "Choose Photo",
"list_long_clipboard": "Copy from Clipboard",
"list_long_scan": "Scan QR Code",
"list_marketplace": "marketplace",
"list_tap_here_to_buy": "Buy Bitcoin",
"no_ln_wallet_error": "Before paying a Lightning invoice, you must first add a Lightning wallet.",
"list_title": "Wallets",
"list_tryagain": "Try again",
"no_ln_wallet_error": "Before paying a Lightning invoice, you must first add a Lightning wallet.",
"looks_like_bip38": "This looks like a password-protected private key (BIP38)",
"reorder_title": "Reorder Wallets",
"select_no_bitcoin": "There are currently no Bitcoin wallets available.",
@ -500,5 +518,11 @@
"header": "Coin Control",
"use_coin": "Use Coin",
"tip": "Allows you to see, label, freeze or select coins for improved wallet management."
},
"units": {
"BTC": "BTC",
"MAX": "MAX",
"sat_byte": "sat/byte",
"sats": "sats"
}
}

View file

@ -221,17 +221,17 @@ export const removeTrailingZeros = value => {
*/
export function formatBalance(balance, toUnit, withFormatting = false) {
if (toUnit === undefined) {
return balance + ' ' + BitcoinUnit.BTC;
return balance + ' ' + strings.units[BitcoinUnit.BTC];
}
if (toUnit === BitcoinUnit.BTC) {
const value = new BigNumber(balance).dividedBy(100000000).toFixed(8);
return removeTrailingZeros(value) + ' ' + BitcoinUnit.BTC;
return removeTrailingZeros(value) + ' ' + strings.units[BitcoinUnit.BTC];
} else if (toUnit === BitcoinUnit.SATS) {
return (
(balance < 0 ? '-' : '') +
(withFormatting ? new Intl.NumberFormat().format(balance.toString()).replace(/[^0-9]/g, ' ') : balance) +
' ' +
BitcoinUnit.SATS
strings.units[BitcoinUnit.SATS]
);
} else if (toUnit === BitcoinUnit.LOCAL_CURRENCY) {
return currency.satoshiToLocalCurrency(balance);

View file

@ -16,6 +16,7 @@ import { BlueNavigationStyle, SafeBlueArea } from '../../BlueComponents';
import Ionicons from 'react-native-vector-icons/Ionicons';
import PropTypes from 'prop-types';
import Notifications from '../../blue_modules/notifications';
import loc from '../../loc';
let processedInvoices = {};
let lastTimeTriedToPay = 0;
@ -517,6 +518,6 @@ Browser.propTypes = {
Browser.navigationOptions = ({ navigation }) => ({
...BlueNavigationStyle(navigation, true),
title: 'Lapp Browser',
title: loc.wallets.list_ln_browser,
headerLeft: null,
});

View file

@ -135,7 +135,7 @@ export default class Confirm extends Component {
<Text testID="TransactionValue" style={styles.valueValue}>
{currency.satoshiToBTC(item.value)}
</Text>
<Text style={styles.valueUnit}>{' ' + BitcoinUnit.BTC}</Text>
<Text style={styles.valueUnit}>{' ' + loc.units[BitcoinUnit.BTC]}</Text>
</View>
<Text style={styles.transactionAmountFiat}>{currency.satoshiToLocalCurrency(item.value)}</Text>
<BlueCard>

View file

@ -42,7 +42,7 @@ import { HDSegwitBech32Wallet, LightningCustodianWallet, MultisigHDWallet, Watch
import { BitcoinTransaction } from '../../models/bitcoinTransactionInfo';
import DocumentPicker from 'react-native-document-picker';
import DeeplinkSchemaMatch from '../../class/deeplink-schema-match';
import loc, { formatBalanceWithoutSuffix } from '../../loc';
import loc, { formatBalance, formatBalanceWithoutSuffix } from '../../loc';
import { BlueCurrentTheme } from '../../components/themes';
import CoinsSelected from '../../components/CoinsSelected';
import BottomModal from '../../components/BottomModal';
@ -792,7 +792,9 @@ export default class SendDetails extends Component {
</View>
<View style={styles.feeModalRow}>
<Text style={styles.feeModalValue}>{fee && this.formatFee(fee)}</Text>
<Text style={styles.feeModalValue}>{rate} sat/byte</Text>
<Text style={styles.feeModalValue}>
{rate} {loc.units.sat_byte}
</Text>
</View>
</TouchableOpacity>
))}
@ -1341,14 +1343,7 @@ export default class SendDetails extends Component {
};
formatFee = fee => {
switch (this.state.feeUnit) {
case BitcoinUnit.SATS:
return fee + ' ' + BitcoinUnit.SATS;
case BitcoinUnit.BTC:
return currency.satoshiToBTC(fee) + ' ' + BitcoinUnit.BTC;
case BitcoinUnit.LOCAL_CURRENCY:
return currency.satoshiToLocalCurrency(fee);
}
return formatBalance(fee, this.state.feeUnit, true);
};
onLayout = e => {
@ -1414,7 +1409,9 @@ export default class SendDetails extends Component {
<Text style={styles.feeLabel}>{loc.send.create_fee}</Text>
<View style={styles.feeRow}>
<Text style={styles.feeValue}>
{this.state.feePrecalc.current ? this.formatFee(this.state.feePrecalc.current) : this.state.fee + ' sat/byte'}
{this.state.feePrecalc.current
? this.formatFee(this.state.feePrecalc.current)
: this.state.fee + ' ' + loc.units.sat_byte}
</Text>
</View>
</TouchableOpacity>

View file

@ -79,13 +79,13 @@ export const SuccessView = ({ amount, amountUnit, fee, invoiceDescription, shoul
{amount && (
<>
<Text style={[styles.amountValue, stylesHook.amountValue]}>{amount}</Text>
<Text style={[styles.amountUnit, stylesHook.amountUnit]}>{' ' + amountUnit}</Text>
<Text style={[styles.amountUnit, stylesHook.amountUnit]}>{' ' + loc.units[amountUnit]}</Text>
</>
)}
</View>
{fee > 0 && (
<Text style={styles.feeText}>
{loc.send.create_fee}: {fee} {BitcoinUnit.BTC}
{loc.send.create_fee}: {fee} {loc.units[BitcoinUnit.BTC]}
</Text>
)}
<Text numberOfLines={0} style={styles.feeText}>

View file

@ -163,7 +163,7 @@ const About = () => {
}}
chevron
onPress={handleOnLicensingPress}
title="MIT License"
title={loc.settings.about_license}
/>
<BlueListItem
leftIcon={{

View file

@ -156,7 +156,7 @@ const EncryptStorage = () => {
<ScrollView contentContainerStyle={styles.root}>
{biometrics.isDeviceBiometricCapable && (
<>
<BlueHeaderDefaultSubHooks leftText="biometrics" rightComponent={null} />
<BlueHeaderDefaultSubHooks leftText={loc.settings.biom} rightComponent={null} />
<BlueListItem
title={loc.formatString(loc.settings.encrypt_use, { type: biometrics.biometricsType })}
Component={TouchableWithoutFeedback}

View file

@ -190,7 +190,7 @@ const TransactionsDetails = () => {
{tx.hash && (
<>
<View style={styles.rowHeader}>
<BlueText style={[styles.txId, stylesHooks.txId]}>Txid</BlueText>
<BlueText style={[styles.txId, stylesHooks.txId]}>{loc.transactions.txid}</BlueText>
<BlueCopyToClipboardButton stringToCopy={tx.hash} />
</View>
<BlueText style={styles.txHash}>{tx.hash}</BlueText>

View file

@ -290,7 +290,7 @@ const TransactionsStatus = () => {
<Text style={[styles.value, stylesHook.value]}>
{formatBalanceWithoutSuffix(tx.value, wallet.current.preferredBalanceUnit, true)}{' '}
{wallet.current.preferredBalanceUnit !== BitcoinUnit.LOCAL_CURRENCY && (
<Text style={[styles.valueUnit, stylesHook.valueUnit]}>{wallet.current.preferredBalanceUnit}</Text>
<Text style={[styles.valueUnit, stylesHook.valueUnit]}>{loc.units[wallet.current.preferredBalanceUnit]}</Text>
)}
</Text>
</View>

View file

@ -285,13 +285,13 @@ const WalletsAdd = () => {
<BlueSpacing20 />
<Text style={[styles.advancedText, stylesHook.advancedText]}>{loc.settings.advanced_options}</Text>
<BlueSpacing20 />
<BlueText>Connect to your LNDHub</BlueText>
<BlueText>{loc.wallets.add_lndhub}</BlueText>
<View style={[styles.lndUri, stylesHook.lndUri]}>
<TextInput
value={walletBaseURI}
onChangeText={setWalletBaseURI}
onSubmitEditing={Keyboard.dismiss}
placeholder="your node address"
placeholder={loc.wallets.add_lndhub_placeholder}
clearButtonMode="while-editing"
autoCapitalize="none"
textContentType="URL"

View file

@ -494,7 +494,7 @@ const WalletsAddMultisigStep2 = () => {
component.push(
<View style={[styles.word, stylesHook.word]} key={`${secret}${index}`}>
<Text style={[styles.wordText, stylesHook.wordText]}>
{index + 1} . {secret}
{index + 1}. {secret}
</Text>
</View>,
);

View file

@ -426,14 +426,12 @@ const WalletDetails = () => {
{wallet.type === MultisigHDWallet.type && (
<>
<Text style={[styles.textLabel2, stylesHook.textLabel2]}>multisig</Text>
<Text style={[styles.textLabel2, stylesHook.textLabel2]}>{loc.wallets.details_multisig_type}</Text>
<BlueText>
{wallet.getM()} of {wallet.getN()}{' '}
{wallet.isNativeSegwit()
? 'native segwit (p2wsh)'
: wallet.isWrappedSegwit()
? 'wrapped segwit (p2sh-p2wsh)'
: 'legacy (p2sh)'}
{loc.formatString(loc.wallets[`details_ms_${wallet.isNativeSegwit() ? 'ns' : wallet.isWrappedSegwit() ? 'ws' : 'l'}`], {
m: wallet.getM(),
n: wallet.getN(),
})}
</BlueText>
</>
)}
@ -447,7 +445,7 @@ const WalletDetails = () => {
{wallet.type === MultisigHDWallet.type && !!wallet.getDerivationPath() && (
<>
<Text style={[styles.textLabel2, stylesHook.textLabel2]}>derivation path</Text>
<Text style={[styles.textLabel2, stylesHook.textLabel2]}>{loc.wallets.details_derivation_path}</Text>
<BlueText>{wallet.getDerivationPath()}</BlueText>
</>
)}

View file

@ -720,7 +720,7 @@ export default class HodlHodl extends Component {
<View style={styles.headerWrapper}>
<Text style={styles.BottomLine}>Powered by HodlHodl®</Text>
<View style={styles.flexRow}>
<Text style={styles.Title}>Local Trader </Text>
<Text style={styles.Title}>{loc.hodl.local_trader} </Text>
<TouchableOpacity
style={styles.grayDropdownTextContainer}
onPress={() => {

View file

@ -243,11 +243,11 @@ const WalletsList = () => {
style={[styles.ltRoot, stylesHook.ltRoot]}
>
<View style={styles.ltTextWrap}>
<Text style={[styles.ltTextBig, stylesHook.ltTextBig]}>Local Trader</Text>
<Text style={[styles.ltTextBig, stylesHook.ltTextBig]}>{loc.hodl.local_trader}</Text>
<Text style={[styles.ltTextSmall, stylesHook.ltTextSmall]}>{loc.hodl.p2p}</Text>
</View>
<View style={styles.ltButtonWrap}>
<Text style={styles.ltButton}>New</Text>
<Text style={styles.ltButton}>{loc.hodl.local_trader_new}</Text>
</View>
</TouchableOpacity>
);

View file

@ -346,7 +346,7 @@ const WalletTransactions = () => {
}}
style={[styles.marketplaceButton1, stylesHook.marketplaceButton1]}
>
<Text style={[styles.marketpalceText1, stylesHook.marketpalceText1]}>marketplace</Text>
<Text style={[styles.marketpalceText1, stylesHook.marketpalceText1]}>{loc.wallets.marketplace}</Text>
</TouchableOpacity>
),
ios:
@ -358,7 +358,7 @@ const WalletTransactions = () => {
style={[styles.marketplaceButton1, stylesHook.marketplaceButton1]}
>
<Icon name="external-link" size={18} type="font-awesome" color="#9aa0aa" />
<Text style={[styles.marketpalceText2, stylesHook.marketpalceText2]}>marketplace</Text>
<Text style={[styles.marketpalceText2, stylesHook.marketpalceText2]}>{loc.wallets.marketplace}</Text>
</TouchableOpacity>
) : null,
});
@ -379,7 +379,7 @@ const WalletTransactions = () => {
}}
style={[styles.marketplaceButton2, stylesHook.marketplaceButton2]}
>
<Text style={[styles.marketpalceText1, stylesHook.marketpalceText1]}>LApp Browser</Text>
<Text style={[styles.marketpalceText1, stylesHook.marketpalceText1]}>{loc.wallets.list_ln_browser}</Text>
</TouchableOpacity>
);
};