Remove Fiat form display strings. Add locale files

This commit is contained in:
Manfred Karrer 2014-09-05 11:45:40 +02:00
parent 3fcd3d8c9b
commit e269684d5b
6 changed files with 347 additions and 11 deletions

View File

@ -33,8 +33,13 @@ public class FiatValidator extends NumberValidator {
//TODO Find appropriate values - depends on currencies
public static final double MIN_FIAT_VALUE = 0.01; // usually a cent is the smallest currency unit
public static final double MAX_FIAT_VALUE = 1000000;
private static String currencyCode = "Fiat";
public static void setFiatCurrencyCode(String currencyCode) {
FiatValidator.currencyCode = currencyCode;
}
///////////////////////////////////////////////////////////////////////////////////////////
// Public methods
///////////////////////////////////////////////////////////////////////////////////////////
@ -65,7 +70,7 @@ public class FiatValidator extends NumberValidator {
protected ValidationResult validateIfNotExceedsMinFiatValue(String input) {
double d = Double.parseDouble(input);
if (d < MIN_FIAT_VALUE)
return new ValidationResult(false, BSResources.get("validation.fiat.toSmall"));
return new ValidationResult(false, BSResources.get("validation.fiat.toSmall", currencyCode));
else
return new ValidationResult(true);
}
@ -73,7 +78,7 @@ public class FiatValidator extends NumberValidator {
protected ValidationResult validateIfNotExceedsMaxFiatValue(String input) {
double d = Double.parseDouble(input);
if (d > MAX_FIAT_VALUE)
return new ValidationResult(false, BSResources.get("validation.fiat.toLarge"));
return new ValidationResult(false, BSResources.get("validation.fiat.toLarge", currencyCode));
else
return new ValidationResult(true);
}

View File

@ -19,6 +19,7 @@ package io.bitsquare.user;
import io.bitsquare.bank.BankAccount;
import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.gui.util.validation.FiatValidator;
import io.bitsquare.util.DSAKeyUtil;
import java.io.Serializable;
@ -116,9 +117,11 @@ public class User implements Serializable {
public void setCurrentBankAccount(@Nullable BankAccount bankAccount) {
currentBankAccount = bankAccount;
if (bankAccount != null)
if (bankAccount != null) {
BSFormatter.setFiatCurrencyCode(currentBankAccount.getCurrency().getCurrencyCode());
FiatValidator.setFiatCurrencyCode(currentBankAccount.getCurrency().getCurrencyCode());
}
int index;
for (index = 0; index < bankAccounts.size(); index++) {
if (currentBankAccount != null && currentBankAccount.equals(bankAccounts.get(index)))

View File

@ -1,4 +1,3 @@
# shared
shared.readMore=Read more...
shared.warning=Warning
@ -14,8 +13,8 @@ validation.empty=Empty input is not allowed.
validation.NaN=Input is not a valid number.
validation.zero=Input of 0 is not allowed.
validation.negative=A negative value is not allowed.
validation.fiat.toSmall=Input smaller as minimum possible Fiat value is not allowed.
validation.fiat.toLarge=Input larger as maximum possible Fiat value is not allowed.
validation.fiat.toSmall=Input smaller as minimum possible {0} value is not allowed.
validation.fiat.toLarge=Input larger as maximum possible {0} value is not allowed.
validation.btc.toSmall=Input results in a Bitcoin value with a fraction of the smallest unit (Satoshi).
validation.btc.toLarge=Input larger as maximum possible Bitcoin value is not allowed..
@ -59,10 +58,10 @@ createOffer.advancedBox.title=Advanced settings
createOffer.advancedBox.countries=Accepted countries:
createOffer.advancedBox.languages=Accepted languages:
createOffer.advancedBox.arbitrators=Accepted arbitrators:
createOffer.advancedBox.txType=Fiat transfer type:
createOffer.advancedBox.txType=Payments method:
createOffer.advancedBox.currency=Currency:
createOffer.advancedBox.county=County of Fiat account:
createOffer.advancedBox.info=Your trading partners must fulfill your offer restrictions. You can edit the accepted countries, languages and arbitrators in the settings. The Fiat account details are used from your current selected Fiat account (if you have multiple Fiat accounts).
createOffer.advancedBox.county=Payments account country:
createOffer.advancedBox.info=Your trading partners must fulfill your offer restrictions. You can edit the accepted countries, languages and arbitrators in the settings. The payments account details are used from your current selected payments account (if you have multiple payments accounts).
createOffer.success.title=Offer published
createOffer.success.headline=Your offer has been successfully published to the distributed orderbook.
@ -71,7 +70,9 @@ createOffer.success.copyTxId=Copy transaction ID
createOffer.error.message=An error occurred when placing the offer.\n{0}
# TODO update the following when doing the UI
# TODO Update the following string when doing the UI (old stuff...)
# generic
OTHER=Other

View File

@ -0,0 +1,109 @@
# shared
shared.readMore=Read more...
shared.warning=Warning
shared.error=Error
shared.close=Close
shared.openSettings=Open settings for editing
shared.buy=Buy Bitcoin
shared.sell=Sell Bitcoin
# validation
validation.empty=Empty input is not allowed.
validation.NaN=Input is not a valid number.
validation.zero=Input of 0 is not allowed.
validation.negative=A negative value is not allowed.
validation.fiat.toSmall=Input smaller as minimum possible {0} value is not allowed.
validation.fiat.toLarge=Input larger as maximum possible {0} value is not allowed.
validation.btc.toSmall=Input results in a Bitcoin value with a fraction of the smallest unit (Satoshi).
validation.btc.toLarge=Input larger as maximum possible Bitcoin value is not allowed..
# Create offer
createOffer.amount.prompt=Enter amount
createOffer.price.prompt=Enter price
createOffer.volume.prompt=Trade volume
createOffer.minAmount.prompt=Enter min. amount
createOffer.amountPriceBox.title=Create your offer
createOffer.amountPriceBox.subTitle=Buy Bitcoin
createOffer.amountPriceBox.amountDescr=Amount of Bitcoin to buy
createOffer.amountPriceBox.priceDescr=Price per Bitcoin in {0}
createOffer.amountPriceBox.volumeDescr=Amount in {0} to spend
createOffer.amountPriceBox.minAmountDescr=Minimum amount of Bitcoin
createOffer.amountPriceBox.info=Define a price for which you want to byu Bitcoin and either enter the amount or the trade volume. With the minimum amount you can attract more potential traders with giving them more flexibility. But note that there is no automatic creation of a new offer for the remaining amount in the case that a trader takes your offer with a lower amount as defined in the amount field. Your offer will be removed from the orderbook once a trader has taken your offer.
createOffer.amountPriceBox.next=Next step
createOffer.amountPriceBox.warning.invalidBtcDecimalPlaces=The amount you have entered exceeds the number of allowed decimal places.\nThe amount has been adjusted to 4 decimal places.
createOffer.amountPriceBox.warning.invalidFiatDecimalPlaces=The amount you have entered exceeds the number of allowed decimal places. The amount has been adjusted to 2 decimal places.
createOffer.amountPriceBox.warning.adjustedVolume=The total volume you have entered leads to invalid fractional Bitcoin amounts. The amount has been adjusted and a new total volume be calculated from it.
createOffer.validation.amountSmallerThanMinAmount=Amount cannot be smaller than minimum amount.
createOffer.validation.minAmountLargerThanAmount=Minimum amount cannot be larger than amount.
createOffer.fundsBox.title=Fund your trade wallet
createOffer.fundsBox.totalsNeeded=Funds needed for that trade:
createOffer.fundsBox.address=Trade wallet address:
createOffer.fundsBox.balance=Trade wallet balance:
createOffer.fundsBox.info=For every offer there is a dedicated trade wallet. You need to fund that trade wallet with the necessary Bitcoin amount. Those funds are reserved and will be used in the case that your offer gets executed. If you cancel your offer you can withdraw your funds from that trading wallet. The only payment which will be done now when placing the offer is the offer fee payment.
createOffer.fundsBox.collateral=Refundable collateral ({0}):
createOffer.fundsBox.offerFee=Offer fee:
createOffer.fundsBox.networkFee=Bitcoin network fee:
createOffer.fundsBox.total=Total:
createOffer.fundsBox.showAdvanced=Show advanced settings
createOffer.fundsBox.hideAdvanced=Hide advanced settings
createOffer.fundsBox.placeOffer=Place offer
createOffer.fundsBox.paymentLabel=Bitsquare trade ({0})
createOffer.advancedBox.title=Advanced settings
createOffer.advancedBox.countries=Accepted countries:
createOffer.advancedBox.languages=Accepted languages:
createOffer.advancedBox.arbitrators=Accepted arbitrators:
createOffer.advancedBox.txType=Payments method:
createOffer.advancedBox.currency=Currency:
createOffer.advancedBox.county=Payments account country:
createOffer.advancedBox.info=Your trading partners must fulfill your offer restrictions. You can edit the accepted countries, languages and arbitrators in the settings. The payments account details are used from your current selected payments account (if you have multiple payments accounts).
createOffer.success.title=Offer published
createOffer.success.headline=Your offer has been successfully published to the distributed orderbook.
createOffer.success.info=The Bitcoin network transaction ID for the offer payment is: {0}
createOffer.success.copyTxId=Copy transaction ID
createOffer.error.message=An error occurred when placing the offer.\n{0}
# TODO Update the following string when doing the UI (old stuff...)
# generic
OTHER=Other
# BankAccountTypeInfo.BankAccountType
SEPA=Sepa
WIRE=Wire
INTERNATIONAL=International
OK_PAY=OK Pay
NET_TELLER=Netteller
PERFECT_MONEY=Perfect Money
# Arbitrator.ID_TYPE
REAL_LIFE_ID=Real life ID
NICKNAME=Nickname
COMPANY=Company
# Arbitrator.METHODS
TLS_NOTARY=TLS Notary
SKYPE_SCREEN_SHARING=Skype screen sharing
SMART_PHONE_VIDEO_CHAT=Smart phone video chat
REQUIRE_REAL_ID=Require real life Identification
BANK_STATEMENT=Bank statement
# Arbitrator.ID_VERIFICATIONS
PASSPORT=Passport
GOV_ID=Government issued ID
UTILITY_BILLS=Utility bills
FACEBOOK=Facebook account
GOOGLE_PLUS=Google+ account
TWITTER=Twitter account
PGP=PGP
BTC_OTC=BTC OTC

View File

@ -0,0 +1,109 @@
# shared
shared.readMore=Read more...
shared.warning=Warning
shared.error=Error
shared.close=Close
shared.openSettings=Open settings for editing
shared.buy=Buy Bitcoin
shared.sell=Sell Bitcoin
# validation
validation.empty=Empty input is not allowed.
validation.NaN=Input is not a valid number.
validation.zero=Input of 0 is not allowed.
validation.negative=A negative value is not allowed.
validation.fiat.toSmall=Input smaller as minimum possible {0} value is not allowed.
validation.fiat.toLarge=Input larger as maximum possible {0} value is not allowed.
validation.btc.toSmall=Input results in a Bitcoin value with a fraction of the smallest unit (Satoshi).
validation.btc.toLarge=Input larger as maximum possible Bitcoin value is not allowed..
# Create offer
createOffer.amount.prompt=Enter amount
createOffer.price.prompt=Enter price
createOffer.volume.prompt=Trade volume
createOffer.minAmount.prompt=Enter min. amount
createOffer.amountPriceBox.title=Create your offer
createOffer.amountPriceBox.subTitle=Buy Bitcoin
createOffer.amountPriceBox.amountDescr=Amount of Bitcoin to buy
createOffer.amountPriceBox.priceDescr=Price per Bitcoin in {0}
createOffer.amountPriceBox.volumeDescr=Amount in {0} to spend
createOffer.amountPriceBox.minAmountDescr=Minimum amount of Bitcoin
createOffer.amountPriceBox.info=Define a price for which you want to byu Bitcoin and either enter the amount or the trade volume. With the minimum amount you can attract more potential traders with giving them more flexibility. But note that there is no automatic creation of a new offer for the remaining amount in the case that a trader takes your offer with a lower amount as defined in the amount field. Your offer will be removed from the orderbook once a trader has taken your offer.
createOffer.amountPriceBox.next=Next step
createOffer.amountPriceBox.warning.invalidBtcDecimalPlaces=The amount you have entered exceeds the number of allowed decimal places.\nThe amount has been adjusted to 4 decimal places.
createOffer.amountPriceBox.warning.invalidFiatDecimalPlaces=The amount you have entered exceeds the number of allowed decimal places. The amount has been adjusted to 2 decimal places.
createOffer.amountPriceBox.warning.adjustedVolume=The total volume you have entered leads to invalid fractional Bitcoin amounts. The amount has been adjusted and a new total volume be calculated from it.
createOffer.validation.amountSmallerThanMinAmount=Amount cannot be smaller than minimum amount.
createOffer.validation.minAmountLargerThanAmount=Minimum amount cannot be larger than amount.
createOffer.fundsBox.title=Fund your trade wallet
createOffer.fundsBox.totalsNeeded=Funds needed for that trade:
createOffer.fundsBox.address=Trade wallet address:
createOffer.fundsBox.balance=Trade wallet balance:
createOffer.fundsBox.info=For every offer there is a dedicated trade wallet. You need to fund that trade wallet with the necessary Bitcoin amount. Those funds are reserved and will be used in the case that your offer gets executed. If you cancel your offer you can withdraw your funds from that trading wallet. The only payment which will be done now when placing the offer is the offer fee payment.
createOffer.fundsBox.collateral=Refundable collateral ({0}):
createOffer.fundsBox.offerFee=Offer fee:
createOffer.fundsBox.networkFee=Bitcoin network fee:
createOffer.fundsBox.total=Total:
createOffer.fundsBox.showAdvanced=Show advanced settings
createOffer.fundsBox.hideAdvanced=Hide advanced settings
createOffer.fundsBox.placeOffer=Place offer
createOffer.fundsBox.paymentLabel=Bitsquare trade ({0})
createOffer.advancedBox.title=Advanced settings
createOffer.advancedBox.countries=Accepted countries:
createOffer.advancedBox.languages=Accepted languages:
createOffer.advancedBox.arbitrators=Accepted arbitrators:
createOffer.advancedBox.txType=Payments method:
createOffer.advancedBox.currency=Currency:
createOffer.advancedBox.county=Payments account country:
createOffer.advancedBox.info=Your trading partners must fulfill your offer restrictions. You can edit the accepted countries, languages and arbitrators in the settings. The payments account details are used from your current selected payments account (if you have multiple payments accounts).
createOffer.success.title=Offer published
createOffer.success.headline=Your offer has been successfully published to the distributed orderbook.
createOffer.success.info=The Bitcoin network transaction ID for the offer payment is: {0}
createOffer.success.copyTxId=Copy transaction ID
createOffer.error.message=An error occurred when placing the offer.\n{0}
# TODO Update the following string when doing the UI (old stuff...)
# generic
OTHER=Other
# BankAccountTypeInfo.BankAccountType
SEPA=Sepa
WIRE=Wire
INTERNATIONAL=International
OK_PAY=OK Pay
NET_TELLER=Netteller
PERFECT_MONEY=Perfect Money
# Arbitrator.ID_TYPE
REAL_LIFE_ID=Real life ID
NICKNAME=Nickname
COMPANY=Company
# Arbitrator.METHODS
TLS_NOTARY=TLS Notary
SKYPE_SCREEN_SHARING=Skype screen sharing
SMART_PHONE_VIDEO_CHAT=Smart phone video chat
REQUIRE_REAL_ID=Require real life Identification
BANK_STATEMENT=Bank statement
# Arbitrator.ID_VERIFICATIONS
PASSPORT=Passport
GOV_ID=Government issued ID
UTILITY_BILLS=Utility bills
FACEBOOK=Facebook account
GOOGLE_PLUS=Google+ account
TWITTER=Twitter account
PGP=PGP
BTC_OTC=BTC OTC

View File

@ -0,0 +1,109 @@
# shared
shared.readMore=Read more...
shared.warning=Warning
shared.error=Error
shared.close=Close
shared.openSettings=Open settings for editing
shared.buy=Buy Bitcoin
shared.sell=Sell Bitcoin
# validation
validation.empty=Empty input is not allowed.
validation.NaN=Input is not a valid number.
validation.zero=Input of 0 is not allowed.
validation.negative=A negative value is not allowed.
validation.fiat.toSmall=Input smaller as minimum possible {0} value is not allowed.
validation.fiat.toLarge=Input larger as maximum possible {0} value is not allowed.
validation.btc.toSmall=Input results in a Bitcoin value with a fraction of the smallest unit (Satoshi).
validation.btc.toLarge=Input larger as maximum possible Bitcoin value is not allowed..
# Create offer
createOffer.amount.prompt=Enter amount
createOffer.price.prompt=Enter price
createOffer.volume.prompt=Trade volume
createOffer.minAmount.prompt=Enter min. amount
createOffer.amountPriceBox.title=Create your offer
createOffer.amountPriceBox.subTitle=Buy Bitcoin
createOffer.amountPriceBox.amountDescr=Amount of Bitcoin to buy
createOffer.amountPriceBox.priceDescr=Price per Bitcoin in {0}
createOffer.amountPriceBox.volumeDescr=Amount in {0} to spend
createOffer.amountPriceBox.minAmountDescr=Minimum amount of Bitcoin
createOffer.amountPriceBox.info=Define a price for which you want to byu Bitcoin and either enter the amount or the trade volume. With the minimum amount you can attract more potential traders with giving them more flexibility. But note that there is no automatic creation of a new offer for the remaining amount in the case that a trader takes your offer with a lower amount as defined in the amount field. Your offer will be removed from the orderbook once a trader has taken your offer.
createOffer.amountPriceBox.next=Next step
createOffer.amountPriceBox.warning.invalidBtcDecimalPlaces=The amount you have entered exceeds the number of allowed decimal places.\nThe amount has been adjusted to 4 decimal places.
createOffer.amountPriceBox.warning.invalidFiatDecimalPlaces=The amount you have entered exceeds the number of allowed decimal places. The amount has been adjusted to 2 decimal places.
createOffer.amountPriceBox.warning.adjustedVolume=The total volume you have entered leads to invalid fractional Bitcoin amounts. The amount has been adjusted and a new total volume be calculated from it.
createOffer.validation.amountSmallerThanMinAmount=Amount cannot be smaller than minimum amount.
createOffer.validation.minAmountLargerThanAmount=Minimum amount cannot be larger than amount.
createOffer.fundsBox.title=Fund your trade wallet
createOffer.fundsBox.totalsNeeded=Funds needed for that trade:
createOffer.fundsBox.address=Trade wallet address:
createOffer.fundsBox.balance=Trade wallet balance:
createOffer.fundsBox.info=For every offer there is a dedicated trade wallet. You need to fund that trade wallet with the necessary Bitcoin amount. Those funds are reserved and will be used in the case that your offer gets executed. If you cancel your offer you can withdraw your funds from that trading wallet. The only payment which will be done now when placing the offer is the offer fee payment.
createOffer.fundsBox.collateral=Refundable collateral ({0}):
createOffer.fundsBox.offerFee=Offer fee:
createOffer.fundsBox.networkFee=Bitcoin network fee:
createOffer.fundsBox.total=Total:
createOffer.fundsBox.showAdvanced=Show advanced settings
createOffer.fundsBox.hideAdvanced=Hide advanced settings
createOffer.fundsBox.placeOffer=Place offer
createOffer.fundsBox.paymentLabel=Bitsquare trade ({0})
createOffer.advancedBox.title=Advanced settings
createOffer.advancedBox.countries=Accepted countries:
createOffer.advancedBox.languages=Accepted languages:
createOffer.advancedBox.arbitrators=Accepted arbitrators:
createOffer.advancedBox.txType=Payments method:
createOffer.advancedBox.currency=Currency:
createOffer.advancedBox.county=Payments account country:
createOffer.advancedBox.info=Your trading partners must fulfill your offer restrictions. You can edit the accepted countries, languages and arbitrators in the settings. The payments account details are used from your current selected payments account (if you have multiple payments accounts).
createOffer.success.title=Offer published
createOffer.success.headline=Your offer has been successfully published to the distributed orderbook.
createOffer.success.info=The Bitcoin network transaction ID for the offer payment is: {0}
createOffer.success.copyTxId=Copy transaction ID
createOffer.error.message=An error occurred when placing the offer.\n{0}
# TODO Update the following string when doing the UI (old stuff...)
# generic
OTHER=Other
# BankAccountTypeInfo.BankAccountType
SEPA=Sepa
WIRE=Wire
INTERNATIONAL=International
OK_PAY=OK Pay
NET_TELLER=Netteller
PERFECT_MONEY=Perfect Money
# Arbitrator.ID_TYPE
REAL_LIFE_ID=Real life ID
NICKNAME=Nickname
COMPANY=Company
# Arbitrator.METHODS
TLS_NOTARY=TLS Notary
SKYPE_SCREEN_SHARING=Skype screen sharing
SMART_PHONE_VIDEO_CHAT=Smart phone video chat
REQUIRE_REAL_ID=Require real life Identification
BANK_STATEMENT=Bank statement
# Arbitrator.ID_VERIFICATIONS
PASSPORT=Passport
GOV_ID=Government issued ID
UTILITY_BILLS=Utility bills
FACEBOOK=Facebook account
GOOGLE_PLUS=Google+ account
TWITTER=Twitter account
PGP=PGP
BTC_OTC=BTC OTC