mirror of
https://github.com/bisq-network/bisq.git
synced 2025-03-13 11:09:10 +01:00
Rename Localisation to BSResources
This commit is contained in:
parent
d2e98ff93a
commit
d6d291702a
14 changed files with 67 additions and 67 deletions
|
@ -17,7 +17,7 @@
|
|||
|
||||
package io.bitsquare.di;
|
||||
|
||||
import io.bitsquare.locale.Localisation;
|
||||
import io.bitsquare.locale.BSResources;
|
||||
|
||||
import com.google.inject.Injector;
|
||||
|
||||
|
@ -60,7 +60,7 @@ public class GuiceFXMLLoader {
|
|||
|
||||
isCached = useCaching && cachedGUIItems.containsKey(url);
|
||||
if (!isCached) {
|
||||
loader = new FXMLLoader(url, Localisation.getResourceBundle());
|
||||
loader = new FXMLLoader(url, BSResources.getResourceBundle());
|
||||
|
||||
if (GuiceFXMLLoader.injector != null)
|
||||
loader.setControllerFactory(new GuiceControllerFactory(GuiceFXMLLoader.injector));
|
||||
|
|
|
@ -28,8 +28,8 @@ import io.bitsquare.gui.components.ConfidenceDisplay;
|
|||
import io.bitsquare.gui.components.confidence.ConfidenceProgressIndicator;
|
||||
import io.bitsquare.gui.util.BSFormatter;
|
||||
import io.bitsquare.gui.util.BitSquareValidator;
|
||||
import io.bitsquare.locale.BSResources;
|
||||
import io.bitsquare.locale.LanguageUtil;
|
||||
import io.bitsquare.locale.Localisation;
|
||||
import io.bitsquare.msg.MessageFacade;
|
||||
import io.bitsquare.persistence.Persistence;
|
||||
import io.bitsquare.user.User;
|
||||
|
@ -156,7 +156,7 @@ public class ArbitratorRegistrationController extends CachedViewController {
|
|||
|
||||
@Override
|
||||
public String toString(Arbitrator.ID_TYPE item) {
|
||||
return Localisation.get(item.toString());
|
||||
return BSResources.get(item.toString());
|
||||
}
|
||||
|
||||
|
||||
|
@ -172,7 +172,7 @@ public class ArbitratorRegistrationController extends CachedViewController {
|
|||
|
||||
@Override
|
||||
public String toString(Arbitrator.METHOD item) {
|
||||
return Localisation.get(item.toString());
|
||||
return BSResources.get(item.toString());
|
||||
}
|
||||
|
||||
|
||||
|
@ -188,7 +188,7 @@ public class ArbitratorRegistrationController extends CachedViewController {
|
|||
|
||||
@Override
|
||||
public String toString(Arbitrator.ID_VERIFICATION item) {
|
||||
return Localisation.get(item.toString());
|
||||
return BSResources.get(item.toString());
|
||||
}
|
||||
|
||||
|
||||
|
@ -253,7 +253,7 @@ public class ArbitratorRegistrationController extends CachedViewController {
|
|||
public void onSelectIDType() {
|
||||
idType = idTypeComboBox.getSelectionModel().getSelectedItem();
|
||||
if (idType != null) {
|
||||
idTypeTextField.setText(Localisation.get(idType.toString()));
|
||||
idTypeTextField.setText(BSResources.get(idType.toString()));
|
||||
|
||||
String name = "";
|
||||
switch (idType) {
|
||||
|
@ -434,7 +434,7 @@ public class ArbitratorRegistrationController extends CachedViewController {
|
|||
nameLabel.setText(name);
|
||||
|
||||
nameTextField.setText(arbitrator.getName());
|
||||
idTypeTextField.setText(Localisation.get(arbitrator.getIdType().toString()));
|
||||
idTypeTextField.setText(BSResources.get(arbitrator.getIdType().toString()));
|
||||
languagesTextField.setText(BSFormatter.languageLocalesToString(arbitrator.getLanguages()));
|
||||
maxTradeVolumeTextField.setText(String.valueOf(arbitrator.getMaxTradeVolume()));
|
||||
passiveServiceFeeTextField.setText(String.valueOf(arbitrator.getPassiveServiceFee()));
|
||||
|
|
|
@ -26,8 +26,8 @@ import io.bitsquare.gui.components.ConfidenceDisplay;
|
|||
import io.bitsquare.gui.components.confidence.ConfidenceProgressIndicator;
|
||||
import io.bitsquare.gui.util.BSFormatter;
|
||||
import io.bitsquare.gui.util.ImageUtil;
|
||||
import io.bitsquare.locale.BSResources;
|
||||
import io.bitsquare.locale.Country;
|
||||
import io.bitsquare.locale.Localisation;
|
||||
import io.bitsquare.trade.Direction;
|
||||
import io.bitsquare.trade.Offer;
|
||||
import io.bitsquare.trade.Trade;
|
||||
|
@ -396,7 +396,7 @@ public class PendingTradeController extends CachedViewController {
|
|||
if (tradesTableItem != null) {
|
||||
BankAccountType bankAccountType = tradesTableItem.getTrade().getOffer()
|
||||
.getBankAccountType();
|
||||
setText(Localisation.get(bankAccountType.toString()));
|
||||
setText(BSResources.get(bankAccountType.toString()));
|
||||
}
|
||||
else {
|
||||
setText("");
|
||||
|
|
|
@ -29,11 +29,11 @@ import io.bitsquare.gui.ViewController;
|
|||
import io.bitsquare.gui.components.Popups;
|
||||
import io.bitsquare.gui.util.BitSquareValidator;
|
||||
import io.bitsquare.gui.util.ImageUtil;
|
||||
import io.bitsquare.locale.BSResources;
|
||||
import io.bitsquare.locale.Country;
|
||||
import io.bitsquare.locale.CountryUtil;
|
||||
import io.bitsquare.locale.CurrencyUtil;
|
||||
import io.bitsquare.locale.LanguageUtil;
|
||||
import io.bitsquare.locale.Localisation;
|
||||
import io.bitsquare.locale.Region;
|
||||
import io.bitsquare.msg.MessageFacade;
|
||||
import io.bitsquare.persistence.Persistence;
|
||||
|
@ -602,7 +602,7 @@ public class SettingsController extends CachedViewController {
|
|||
bankAccountTypesComboBox.setConverter(new StringConverter<BankAccountType>() {
|
||||
@Override
|
||||
public String toString(BankAccountType bankAccountTypeInfo) {
|
||||
return Localisation.get(bankAccountTypeInfo.toString());
|
||||
return BSResources.get(bankAccountTypeInfo.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -28,7 +28,7 @@ import io.bitsquare.gui.help.Help;
|
|||
import io.bitsquare.gui.help.HelpId;
|
||||
import io.bitsquare.gui.trade.TradeController;
|
||||
import io.bitsquare.gui.util.ImageUtil;
|
||||
import io.bitsquare.locale.Localisation;
|
||||
import io.bitsquare.locale.BSResources;
|
||||
import io.bitsquare.trade.orderbook.OrderBookFilter;
|
||||
|
||||
import java.net.URL;
|
||||
|
@ -193,12 +193,12 @@ public class CreateOfferCB extends CachedCodeBehind<CreateOfferPM> {
|
|||
private void onToggleShowAdvancedSettings() {
|
||||
detailsVisible = !detailsVisible;
|
||||
if (detailsVisible) {
|
||||
showAdvancedSettingsButton.setText(Localisation.get("createOffer.fundsBox.hideAdvanced"));
|
||||
showAdvancedSettingsButton.setText(BSResources.get("createOffer.fundsBox.hideAdvanced"));
|
||||
showAdvancedSettingsButton.setGraphic(collapse);
|
||||
showDetailsScreen();
|
||||
}
|
||||
else {
|
||||
showAdvancedSettingsButton.setText(Localisation.get("createOffer.fundsBox.showAdvanced"));
|
||||
showAdvancedSettingsButton.setText(BSResources.get("createOffer.fundsBox.showAdvanced"));
|
||||
showAdvancedSettingsButton.setGraphic(expand);
|
||||
hideDetailsScreen();
|
||||
}
|
||||
|
@ -264,24 +264,24 @@ public class CreateOfferCB extends CachedCodeBehind<CreateOfferPM> {
|
|||
// warnings
|
||||
presentationModel.showWarningInvalidBtcDecimalPlaces.addListener((o, oldValue, newValue) -> {
|
||||
if (newValue) {
|
||||
Popups.openWarningPopup(Localisation.get("shared.warning"),
|
||||
Localisation.get("createOffer.amountPriceBox.warning.invalidBtcDecimalPlaces"));
|
||||
Popups.openWarningPopup(BSResources.get("shared.warning"),
|
||||
BSResources.get("createOffer.amountPriceBox.warning.invalidBtcDecimalPlaces"));
|
||||
presentationModel.showWarningInvalidBtcDecimalPlaces.set(false);
|
||||
}
|
||||
});
|
||||
|
||||
presentationModel.showWarningInvalidFiatDecimalPlaces.addListener((o, oldValue, newValue) -> {
|
||||
if (newValue) {
|
||||
Popups.openWarningPopup(Localisation.get("shared.warning"),
|
||||
Localisation.get("createOffer.amountPriceBox.warning.invalidFiatDecimalPlaces"));
|
||||
Popups.openWarningPopup(BSResources.get("shared.warning"),
|
||||
BSResources.get("createOffer.amountPriceBox.warning.invalidFiatDecimalPlaces"));
|
||||
presentationModel.showWarningInvalidFiatDecimalPlaces.set(false);
|
||||
}
|
||||
});
|
||||
|
||||
presentationModel.showWarningAdjustedVolume.addListener((o, oldValue, newValue) -> {
|
||||
if (newValue) {
|
||||
Popups.openWarningPopup(Localisation.get("shared.warning"),
|
||||
Localisation.get("createOffer.amountPriceBox.warning.adjustedVolume"));
|
||||
Popups.openWarningPopup(BSResources.get("shared.warning"),
|
||||
BSResources.get("createOffer.amountPriceBox.warning.adjustedVolume"));
|
||||
presentationModel.showWarningAdjustedVolume.set(false);
|
||||
volumeTextField.setText(presentationModel.volume.get());
|
||||
}
|
||||
|
@ -289,8 +289,8 @@ public class CreateOfferCB extends CachedCodeBehind<CreateOfferPM> {
|
|||
|
||||
presentationModel.requestPlaceOfferErrorMessage.addListener((o, oldValue, newValue) -> {
|
||||
if (newValue != null) {
|
||||
Popups.openErrorPopup(Localisation.get("shared.error"),
|
||||
Localisation.get("createOffer.amountPriceBox.error.requestPlaceOfferErrorMessage",
|
||||
Popups.openErrorPopup(BSResources.get("shared.error"),
|
||||
BSResources.get("createOffer.amountPriceBox.error.requestPlaceOfferErrorMessage",
|
||||
presentationModel.requestPlaceOfferErrorMessage.get()));
|
||||
}
|
||||
});
|
||||
|
@ -300,7 +300,7 @@ public class CreateOfferCB extends CachedCodeBehind<CreateOfferPM> {
|
|||
// Dialogs are a bit limited. There is no callback for the InformationDialog button click, so we added
|
||||
// our own actions.
|
||||
List<Action> actions = new ArrayList<>();
|
||||
actions.add(new AbstractAction(Localisation.get("createOffer.success.copyTxId")) {
|
||||
actions.add(new AbstractAction(BSResources.get("createOffer.success.copyTxId")) {
|
||||
@Override
|
||||
public void handle(ActionEvent actionEvent) {
|
||||
Clipboard clipboard = Clipboard.getSystemClipboard();
|
||||
|
@ -309,7 +309,7 @@ public class CreateOfferCB extends CachedCodeBehind<CreateOfferPM> {
|
|||
clipboard.setContent(content);
|
||||
}
|
||||
});
|
||||
actions.add(new AbstractAction(Localisation.get("shared.close")) {
|
||||
actions.add(new AbstractAction(BSResources.get("shared.close")) {
|
||||
@Override
|
||||
public void handle(ActionEvent actionEvent) {
|
||||
try {
|
||||
|
@ -321,9 +321,9 @@ public class CreateOfferCB extends CachedCodeBehind<CreateOfferPM> {
|
|||
}
|
||||
});
|
||||
|
||||
Popups.openInformationPopup(Localisation.get("createOffer.success.title"),
|
||||
Localisation.get("createOffer.success.info", presentationModel.transactionId.get()),
|
||||
Localisation.get("createOffer.success.headline"),
|
||||
Popups.openInformationPopup(BSResources.get("createOffer.success.title"),
|
||||
BSResources.get("createOffer.success.info", presentationModel.transactionId.get()),
|
||||
BSResources.get("createOffer.success.headline"),
|
||||
actions);
|
||||
}
|
||||
});
|
||||
|
@ -338,9 +338,9 @@ public class CreateOfferCB extends CachedCodeBehind<CreateOfferPM> {
|
|||
volumeDescriptionLabel.textProperty().bind(presentationModel.fiatCode);//Price per Bitcoin in EUR
|
||||
|
||||
priceDescriptionLabel.textProperty().bind(createStringBinding(() ->
|
||||
Localisation.get("createOffer.amountPriceBox.priceDescr", presentationModel.fiatCode.get())));
|
||||
BSResources.get("createOffer.amountPriceBox.priceDescr", presentationModel.fiatCode.get())));
|
||||
volumeDescriptionLabel.textProperty().bind(createStringBinding(() ->
|
||||
Localisation.get("createOffer.amountPriceBox.volumeDescr", presentationModel.fiatCode.get())));
|
||||
BSResources.get("createOffer.amountPriceBox.volumeDescr", presentationModel.fiatCode.get())));
|
||||
|
||||
buyLabel.textProperty().bind(presentationModel.directionLabel);
|
||||
|
||||
|
@ -393,17 +393,17 @@ public class CreateOfferCB extends CachedCodeBehind<CreateOfferPM> {
|
|||
advancedScreenInited = true;
|
||||
acceptedCountriesLabelIcon.setId("clickable-icon");
|
||||
AwesomeDude.setIcon(acceptedCountriesLabelIcon, AwesomeIcon.EDIT_SIGN);
|
||||
Tooltip.install(acceptedCountriesLabelIcon, new Tooltip(Localisation.get("shared.openSettings")));
|
||||
Tooltip.install(acceptedCountriesLabelIcon, new Tooltip(BSResources.get("shared.openSettings")));
|
||||
acceptedCountriesLabelIcon.setOnMouseClicked(e -> openSettings());
|
||||
|
||||
acceptedLanguagesLabelIcon.setId("clickable-icon");
|
||||
AwesomeDude.setIcon(acceptedLanguagesLabelIcon, AwesomeIcon.EDIT_SIGN);
|
||||
Tooltip.install(acceptedLanguagesLabelIcon, new Tooltip(Localisation.get("shared.openSettings")));
|
||||
Tooltip.install(acceptedLanguagesLabelIcon, new Tooltip(BSResources.get("shared.openSettings")));
|
||||
acceptedLanguagesLabelIcon.setOnMouseClicked(e -> openSettings());
|
||||
|
||||
acceptedArbitratorsLabelIcon.setId("clickable-icon");
|
||||
AwesomeDude.setIcon(acceptedArbitratorsLabelIcon, AwesomeIcon.EDIT_SIGN);
|
||||
Tooltip.install(acceptedArbitratorsLabelIcon, new Tooltip(Localisation.get("shared.openSettings")));
|
||||
Tooltip.install(acceptedArbitratorsLabelIcon, new Tooltip(BSResources.get("shared.openSettings")));
|
||||
acceptedArbitratorsLabelIcon.setOnMouseClicked(e -> openSettings());
|
||||
}
|
||||
|
||||
|
@ -462,16 +462,16 @@ public class CreateOfferCB extends CachedCodeBehind<CreateOfferPM> {
|
|||
addPayInfoEntry(infoGridPane, 0,
|
||||
presentationModel.collateralLabel.get(),
|
||||
presentationModel.collateral.get());
|
||||
addPayInfoEntry(infoGridPane, 1, Localisation.get("createOffer.fundsBox.offerFee"),
|
||||
addPayInfoEntry(infoGridPane, 1, BSResources.get("createOffer.fundsBox.offerFee"),
|
||||
presentationModel.offerFee.get());
|
||||
addPayInfoEntry(infoGridPane, 2, Localisation.get("createOffer.fundsBox.networkFee"),
|
||||
addPayInfoEntry(infoGridPane, 2, BSResources.get("createOffer.fundsBox.networkFee"),
|
||||
presentationModel.networkFee.get());
|
||||
Separator separator = new Separator();
|
||||
separator.setOrientation(Orientation.HORIZONTAL);
|
||||
separator.setStyle("-fx-background: #666;");
|
||||
GridPane.setConstraints(separator, 1, 3);
|
||||
infoGridPane.getChildren().add(separator);
|
||||
addPayInfoEntry(infoGridPane, 4, Localisation.get("createOffer.fundsBox.total"),
|
||||
addPayInfoEntry(infoGridPane, 4, BSResources.get("createOffer.fundsBox.total"),
|
||||
presentationModel.totalToPay.get());
|
||||
totalToPayInfoPopover = new PopOver(infoGridPane);
|
||||
if (totalToPayInfoIconLabel.getScene() != null) {
|
||||
|
|
|
@ -23,7 +23,7 @@ import io.bitsquare.gui.util.BSFormatter;
|
|||
import io.bitsquare.gui.util.validation.BtcValidator;
|
||||
import io.bitsquare.gui.util.validation.FiatValidator;
|
||||
import io.bitsquare.gui.util.validation.InputValidator;
|
||||
import io.bitsquare.locale.Localisation;
|
||||
import io.bitsquare.locale.BSResources;
|
||||
import io.bitsquare.trade.Direction;
|
||||
import io.bitsquare.trade.orderbook.OrderBookFilter;
|
||||
|
||||
|
@ -116,7 +116,7 @@ class CreateOfferPM extends PresentationModel<CreateOfferModel> {
|
|||
super.initialized();
|
||||
|
||||
// static
|
||||
paymentLabel.set(Localisation.get("createOffer.fundsBox.paymentLabel", model.getOfferId()));
|
||||
paymentLabel.set(BSResources.get("createOffer.fundsBox.paymentLabel", model.getOfferId()));
|
||||
|
||||
if (model.addressEntry != null) {
|
||||
addressAsString.set(model.addressEntry.getAddress().toString());
|
||||
|
@ -153,7 +153,7 @@ class CreateOfferPM extends PresentationModel<CreateOfferModel> {
|
|||
// setOrderBookFilter is a one time call
|
||||
void setOrderBookFilter(@NotNull OrderBookFilter orderBookFilter) {
|
||||
model.setDirection(orderBookFilter.getDirection());
|
||||
directionLabel.set(model.getDirection() == Direction.BUY ? Localisation.get("shared.buy") : Localisation.get
|
||||
directionLabel.set(model.getDirection() == Direction.BUY ? BSResources.get("shared.buy") : BSResources.get
|
||||
("shared.sell"));
|
||||
|
||||
// apply only if valid
|
||||
|
@ -209,7 +209,7 @@ class CreateOfferPM extends PresentationModel<CreateOfferModel> {
|
|||
// handle minAmount/amount relationship
|
||||
if (!model.isMinAmountLessOrEqualAmount()) {
|
||||
amountValidationResult.set(new InputValidator.ValidationResult(false,
|
||||
Localisation.get("createOffer.validation.amountSmallerThanAmount")));
|
||||
BSResources.get("createOffer.validation.amountSmallerThanAmount")));
|
||||
}
|
||||
else {
|
||||
amountValidationResult.set(result);
|
||||
|
@ -231,7 +231,7 @@ class CreateOfferPM extends PresentationModel<CreateOfferModel> {
|
|||
|
||||
if (!model.isMinAmountLessOrEqualAmount()) {
|
||||
minAmountValidationResult.set(new InputValidator.ValidationResult(false,
|
||||
Localisation.get("createOffer.validation.minAmountLargerThanAmount")));
|
||||
BSResources.get("createOffer.validation.minAmountLargerThanAmount")));
|
||||
}
|
||||
else {
|
||||
minAmountValidationResult.set(result);
|
||||
|
@ -363,7 +363,7 @@ class CreateOfferPM extends PresentationModel<CreateOfferModel> {
|
|||
model.collateralAsCoin));
|
||||
|
||||
collateralLabel.bind(Bindings.createStringBinding(() ->
|
||||
Localisation.get("createOffer.fundsBox.collateral",
|
||||
BSResources.get("createOffer.fundsBox.collateral",
|
||||
BSFormatter.formatCollateralPercent(model.collateralAsLong.get())),
|
||||
model.collateralAsLong));
|
||||
totalToPayAsCoin.bind(model.totalToPayAsCoin);
|
||||
|
@ -373,7 +373,7 @@ class CreateOfferPM extends PresentationModel<CreateOfferModel> {
|
|||
networkFee.bind(createStringBinding(() -> formatCoinWithCode(model.networkFeeAsCoin.get()),
|
||||
model.offerFeeAsCoin));
|
||||
|
||||
bankAccountType.bind(Bindings.createStringBinding(() -> Localisation.get(model.bankAccountType.get()),
|
||||
bankAccountType.bind(Bindings.createStringBinding(() -> BSResources.get(model.bankAccountType.get()),
|
||||
model.bankAccountType));
|
||||
bankAccountCurrency.bind(model.bankAccountCurrency);
|
||||
bankAccountCounty.bind(model.bankAccountCounty);
|
||||
|
@ -400,7 +400,7 @@ class CreateOfferPM extends PresentationModel<CreateOfferModel> {
|
|||
// Amount calculation could lead to amount/minAmount invalidation
|
||||
if (!model.isMinAmountLessOrEqualAmount()) {
|
||||
amountValidationResult.set(new InputValidator.ValidationResult(false,
|
||||
Localisation.get("createOffer.validation.amountSmallerThanAmount")));
|
||||
BSResources.get("createOffer.validation.amountSmallerThanAmount")));
|
||||
}
|
||||
else {
|
||||
if (amount.get() != null)
|
||||
|
|
|
@ -29,9 +29,9 @@ import io.bitsquare.gui.trade.createoffer.CreateOfferCB;
|
|||
import io.bitsquare.gui.trade.takeoffer.TakeOfferController;
|
||||
import io.bitsquare.gui.util.BSFormatter;
|
||||
import io.bitsquare.gui.util.ImageUtil;
|
||||
import io.bitsquare.locale.BSResources;
|
||||
import io.bitsquare.locale.Country;
|
||||
import io.bitsquare.locale.CurrencyUtil;
|
||||
import io.bitsquare.locale.Localisation;
|
||||
import io.bitsquare.msg.MessageFacade;
|
||||
import io.bitsquare.persistence.Persistence;
|
||||
import io.bitsquare.settings.Settings;
|
||||
|
@ -515,7 +515,7 @@ public class OrderBookController extends CachedViewController {
|
|||
|
||||
if (orderBookListItem != null) {
|
||||
BankAccountType bankAccountType = orderBookListItem.getOffer().getBankAccountType();
|
||||
setText(Localisation.get(bankAccountType.toString()));
|
||||
setText(BSResources.get(bankAccountType.toString()));
|
||||
}
|
||||
else {
|
||||
setText("");
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
package io.bitsquare.gui.util;
|
||||
|
||||
import io.bitsquare.arbitrator.Arbitrator;
|
||||
import io.bitsquare.locale.BSResources;
|
||||
import io.bitsquare.locale.Country;
|
||||
import io.bitsquare.locale.Localisation;
|
||||
import io.bitsquare.trade.Direction;
|
||||
|
||||
import com.google.bitcoin.core.Coin;
|
||||
|
@ -294,7 +294,7 @@ public class BSFormatter {
|
|||
String result = "";
|
||||
int i = 0;
|
||||
for (Arbitrator.METHOD item : items) {
|
||||
result += Localisation.get(item.toString());
|
||||
result += BSResources.get(item.toString());
|
||||
i++;
|
||||
if (i < items.size()) {
|
||||
result += ", ";
|
||||
|
@ -308,7 +308,7 @@ public class BSFormatter {
|
|||
String result = "";
|
||||
int i = 0;
|
||||
for (Arbitrator.ID_VERIFICATION item : items) {
|
||||
result += Localisation.get(item.toString());
|
||||
result += BSResources.get(item.toString());
|
||||
i++;
|
||||
if (i < items.size()) {
|
||||
result += ", ";
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
package io.bitsquare.gui.util.validation;
|
||||
|
||||
import io.bitsquare.locale.Localisation;
|
||||
import io.bitsquare.locale.BSResources;
|
||||
|
||||
import com.google.bitcoin.core.NetworkParameters;
|
||||
|
||||
|
@ -80,7 +80,7 @@ public class BtcValidator extends NumberValidator {
|
|||
BigDecimal bd = new BigDecimal(input);
|
||||
final BigDecimal satoshis = bd.movePointRight(8);
|
||||
if (satoshis.scale() > 0)
|
||||
return new ValidationResult(false, Localisation.get("validation.btc.toSmall"));
|
||||
return new ValidationResult(false, BSResources.get("validation.btc.toSmall"));
|
||||
else
|
||||
return new ValidationResult(true);
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ public class BtcValidator extends NumberValidator {
|
|||
BigDecimal bd = new BigDecimal(input);
|
||||
final BigDecimal satoshis = bd.movePointRight(8);
|
||||
if (satoshis.longValue() > NetworkParameters.MAX_MONEY.longValue())
|
||||
return new ValidationResult(false, Localisation.get("validation.btc.toLarge"));
|
||||
return new ValidationResult(false, BSResources.get("validation.btc.toLarge"));
|
||||
else
|
||||
return new ValidationResult(true);
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
package io.bitsquare.gui.util.validation;
|
||||
|
||||
import io.bitsquare.locale.Localisation;
|
||||
import io.bitsquare.locale.BSResources;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
@ -65,7 +65,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, Localisation.get("validation.fiat.toSmall"));
|
||||
return new ValidationResult(false, BSResources.get("validation.fiat.toSmall"));
|
||||
else
|
||||
return new ValidationResult(true);
|
||||
}
|
||||
|
@ -73,7 +73,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, Localisation.get("validation.fiat.toLarge"));
|
||||
return new ValidationResult(false, BSResources.get("validation.fiat.toLarge"));
|
||||
else
|
||||
return new ValidationResult(true);
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
package io.bitsquare.gui.util.validation;
|
||||
|
||||
import io.bitsquare.locale.Localisation;
|
||||
import io.bitsquare.locale.BSResources;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
@ -46,7 +46,7 @@ public abstract class InputValidator {
|
|||
|
||||
protected ValidationResult validateIfNotEmpty(String input) {
|
||||
if (input == null || input.length() == 0)
|
||||
return new ValidationResult(false, Localisation.get("validation.empty"));
|
||||
return new ValidationResult(false, BSResources.get("validation.empty"));
|
||||
else
|
||||
return new ValidationResult(true);
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
package io.bitsquare.gui.util.validation;
|
||||
|
||||
import io.bitsquare.locale.Localisation;
|
||||
import io.bitsquare.locale.BSResources;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
@ -47,20 +47,20 @@ public abstract class NumberValidator extends InputValidator {
|
|||
Double.parseDouble(input);
|
||||
return new ValidationResult(true);
|
||||
} catch (Exception e) {
|
||||
return new ValidationResult(false, Localisation.get("validation.NaN"));
|
||||
return new ValidationResult(false, BSResources.get("validation.NaN"));
|
||||
}
|
||||
}
|
||||
|
||||
protected ValidationResult validateIfNotZero(String input) {
|
||||
if (Double.parseDouble(input) == 0)
|
||||
return new ValidationResult(false, Localisation.get("validation.zero"));
|
||||
return new ValidationResult(false, BSResources.get("validation.zero"));
|
||||
else
|
||||
return new ValidationResult(true);
|
||||
}
|
||||
|
||||
protected ValidationResult validateIfNotNegative(String input) {
|
||||
if (Double.parseDouble(input) < 0)
|
||||
return new ValidationResult(false, Localisation.get("validation.negative"));
|
||||
return new ValidationResult(false, BSResources.get("validation.negative"));
|
||||
else
|
||||
return new ValidationResult(true);
|
||||
}
|
||||
|
|
|
@ -34,8 +34,8 @@ import java.util.ResourceBundle;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class Localisation {
|
||||
private static final Logger log = LoggerFactory.getLogger(Localisation.class);
|
||||
public class BSResources {
|
||||
private static final Logger log = LoggerFactory.getLogger(BSResources.class);
|
||||
|
||||
public static ResourceBundle getResourceBundle() {
|
||||
return ResourceBundle.getBundle("i18n.displayStrings", new UTF8Control());
|
||||
|
@ -46,7 +46,7 @@ public class Localisation {
|
|||
return "";
|
||||
|
||||
try {
|
||||
return Localisation.getResourceBundle().getString(key);
|
||||
return BSResources.getResourceBundle().getString(key);
|
||||
} catch (MissingResourceException e) {
|
||||
log.error("MissingResourceException for key: " + key);
|
||||
return key + " is missing";
|
||||
|
@ -54,7 +54,7 @@ public class Localisation {
|
|||
}
|
||||
|
||||
public static String get(String key, String... arguments) {
|
||||
return MessageFormat.format(Localisation.get(key), arguments);
|
||||
return MessageFormat.format(BSResources.get(key), arguments);
|
||||
}
|
||||
}
|
||||
|
|
@ -19,10 +19,10 @@ package io.bitsquare.gui.settings.uimock;
|
|||
|
||||
import io.bitsquare.bank.BankAccount;
|
||||
import io.bitsquare.bank.BankAccountType;
|
||||
import io.bitsquare.locale.BSResources;
|
||||
import io.bitsquare.locale.Country;
|
||||
import io.bitsquare.locale.CountryUtil;
|
||||
import io.bitsquare.locale.CurrencyUtil;
|
||||
import io.bitsquare.locale.Localisation;
|
||||
import io.bitsquare.locale.Region;
|
||||
|
||||
import java.net.URL;
|
||||
|
@ -70,7 +70,7 @@ public class BankAccountSettingsControllerUIMock implements Initializable {
|
|||
bankAccountTypesComboBox.setConverter(new StringConverter<BankAccountType>() {
|
||||
@Override
|
||||
public String toString(BankAccountType bankAccountTypeInfo) {
|
||||
return Localisation.get(bankAccountTypeInfo.toString());
|
||||
return BSResources.get(bankAccountTypeInfo.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Add table
Reference in a new issue