Rename Localisation to BSResources

This commit is contained in:
Manfred Karrer 2014-09-04 12:08:21 +02:00
parent d2e98ff93a
commit d6d291702a
14 changed files with 67 additions and 67 deletions

View file

@ -17,7 +17,7 @@
package io.bitsquare.di; package io.bitsquare.di;
import io.bitsquare.locale.Localisation; import io.bitsquare.locale.BSResources;
import com.google.inject.Injector; import com.google.inject.Injector;
@ -60,7 +60,7 @@ public class GuiceFXMLLoader {
isCached = useCaching && cachedGUIItems.containsKey(url); isCached = useCaching && cachedGUIItems.containsKey(url);
if (!isCached) { if (!isCached) {
loader = new FXMLLoader(url, Localisation.getResourceBundle()); loader = new FXMLLoader(url, BSResources.getResourceBundle());
if (GuiceFXMLLoader.injector != null) if (GuiceFXMLLoader.injector != null)
loader.setControllerFactory(new GuiceControllerFactory(GuiceFXMLLoader.injector)); loader.setControllerFactory(new GuiceControllerFactory(GuiceFXMLLoader.injector));

View file

@ -28,8 +28,8 @@ import io.bitsquare.gui.components.ConfidenceDisplay;
import io.bitsquare.gui.components.confidence.ConfidenceProgressIndicator; import io.bitsquare.gui.components.confidence.ConfidenceProgressIndicator;
import io.bitsquare.gui.util.BSFormatter; import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.gui.util.BitSquareValidator; import io.bitsquare.gui.util.BitSquareValidator;
import io.bitsquare.locale.BSResources;
import io.bitsquare.locale.LanguageUtil; import io.bitsquare.locale.LanguageUtil;
import io.bitsquare.locale.Localisation;
import io.bitsquare.msg.MessageFacade; import io.bitsquare.msg.MessageFacade;
import io.bitsquare.persistence.Persistence; import io.bitsquare.persistence.Persistence;
import io.bitsquare.user.User; import io.bitsquare.user.User;
@ -156,7 +156,7 @@ public class ArbitratorRegistrationController extends CachedViewController {
@Override @Override
public String toString(Arbitrator.ID_TYPE item) { 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 @Override
public String toString(Arbitrator.METHOD item) { 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 @Override
public String toString(Arbitrator.ID_VERIFICATION item) { 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() { public void onSelectIDType() {
idType = idTypeComboBox.getSelectionModel().getSelectedItem(); idType = idTypeComboBox.getSelectionModel().getSelectedItem();
if (idType != null) { if (idType != null) {
idTypeTextField.setText(Localisation.get(idType.toString())); idTypeTextField.setText(BSResources.get(idType.toString()));
String name = ""; String name = "";
switch (idType) { switch (idType) {
@ -434,7 +434,7 @@ public class ArbitratorRegistrationController extends CachedViewController {
nameLabel.setText(name); nameLabel.setText(name);
nameTextField.setText(arbitrator.getName()); nameTextField.setText(arbitrator.getName());
idTypeTextField.setText(Localisation.get(arbitrator.getIdType().toString())); idTypeTextField.setText(BSResources.get(arbitrator.getIdType().toString()));
languagesTextField.setText(BSFormatter.languageLocalesToString(arbitrator.getLanguages())); languagesTextField.setText(BSFormatter.languageLocalesToString(arbitrator.getLanguages()));
maxTradeVolumeTextField.setText(String.valueOf(arbitrator.getMaxTradeVolume())); maxTradeVolumeTextField.setText(String.valueOf(arbitrator.getMaxTradeVolume()));
passiveServiceFeeTextField.setText(String.valueOf(arbitrator.getPassiveServiceFee())); passiveServiceFeeTextField.setText(String.valueOf(arbitrator.getPassiveServiceFee()));

View file

@ -26,8 +26,8 @@ import io.bitsquare.gui.components.ConfidenceDisplay;
import io.bitsquare.gui.components.confidence.ConfidenceProgressIndicator; import io.bitsquare.gui.components.confidence.ConfidenceProgressIndicator;
import io.bitsquare.gui.util.BSFormatter; import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.gui.util.ImageUtil; import io.bitsquare.gui.util.ImageUtil;
import io.bitsquare.locale.BSResources;
import io.bitsquare.locale.Country; import io.bitsquare.locale.Country;
import io.bitsquare.locale.Localisation;
import io.bitsquare.trade.Direction; import io.bitsquare.trade.Direction;
import io.bitsquare.trade.Offer; import io.bitsquare.trade.Offer;
import io.bitsquare.trade.Trade; import io.bitsquare.trade.Trade;
@ -396,7 +396,7 @@ public class PendingTradeController extends CachedViewController {
if (tradesTableItem != null) { if (tradesTableItem != null) {
BankAccountType bankAccountType = tradesTableItem.getTrade().getOffer() BankAccountType bankAccountType = tradesTableItem.getTrade().getOffer()
.getBankAccountType(); .getBankAccountType();
setText(Localisation.get(bankAccountType.toString())); setText(BSResources.get(bankAccountType.toString()));
} }
else { else {
setText(""); setText("");

View file

@ -29,11 +29,11 @@ import io.bitsquare.gui.ViewController;
import io.bitsquare.gui.components.Popups; import io.bitsquare.gui.components.Popups;
import io.bitsquare.gui.util.BitSquareValidator; import io.bitsquare.gui.util.BitSquareValidator;
import io.bitsquare.gui.util.ImageUtil; import io.bitsquare.gui.util.ImageUtil;
import io.bitsquare.locale.BSResources;
import io.bitsquare.locale.Country; import io.bitsquare.locale.Country;
import io.bitsquare.locale.CountryUtil; import io.bitsquare.locale.CountryUtil;
import io.bitsquare.locale.CurrencyUtil; import io.bitsquare.locale.CurrencyUtil;
import io.bitsquare.locale.LanguageUtil; import io.bitsquare.locale.LanguageUtil;
import io.bitsquare.locale.Localisation;
import io.bitsquare.locale.Region; import io.bitsquare.locale.Region;
import io.bitsquare.msg.MessageFacade; import io.bitsquare.msg.MessageFacade;
import io.bitsquare.persistence.Persistence; import io.bitsquare.persistence.Persistence;
@ -602,7 +602,7 @@ public class SettingsController extends CachedViewController {
bankAccountTypesComboBox.setConverter(new StringConverter<BankAccountType>() { bankAccountTypesComboBox.setConverter(new StringConverter<BankAccountType>() {
@Override @Override
public String toString(BankAccountType bankAccountTypeInfo) { public String toString(BankAccountType bankAccountTypeInfo) {
return Localisation.get(bankAccountTypeInfo.toString()); return BSResources.get(bankAccountTypeInfo.toString());
} }
@Override @Override

View file

@ -28,7 +28,7 @@ import io.bitsquare.gui.help.Help;
import io.bitsquare.gui.help.HelpId; import io.bitsquare.gui.help.HelpId;
import io.bitsquare.gui.trade.TradeController; import io.bitsquare.gui.trade.TradeController;
import io.bitsquare.gui.util.ImageUtil; import io.bitsquare.gui.util.ImageUtil;
import io.bitsquare.locale.Localisation; import io.bitsquare.locale.BSResources;
import io.bitsquare.trade.orderbook.OrderBookFilter; import io.bitsquare.trade.orderbook.OrderBookFilter;
import java.net.URL; import java.net.URL;
@ -193,12 +193,12 @@ public class CreateOfferCB extends CachedCodeBehind<CreateOfferPM> {
private void onToggleShowAdvancedSettings() { private void onToggleShowAdvancedSettings() {
detailsVisible = !detailsVisible; detailsVisible = !detailsVisible;
if (detailsVisible) { if (detailsVisible) {
showAdvancedSettingsButton.setText(Localisation.get("createOffer.fundsBox.hideAdvanced")); showAdvancedSettingsButton.setText(BSResources.get("createOffer.fundsBox.hideAdvanced"));
showAdvancedSettingsButton.setGraphic(collapse); showAdvancedSettingsButton.setGraphic(collapse);
showDetailsScreen(); showDetailsScreen();
} }
else { else {
showAdvancedSettingsButton.setText(Localisation.get("createOffer.fundsBox.showAdvanced")); showAdvancedSettingsButton.setText(BSResources.get("createOffer.fundsBox.showAdvanced"));
showAdvancedSettingsButton.setGraphic(expand); showAdvancedSettingsButton.setGraphic(expand);
hideDetailsScreen(); hideDetailsScreen();
} }
@ -264,24 +264,24 @@ public class CreateOfferCB extends CachedCodeBehind<CreateOfferPM> {
// warnings // warnings
presentationModel.showWarningInvalidBtcDecimalPlaces.addListener((o, oldValue, newValue) -> { presentationModel.showWarningInvalidBtcDecimalPlaces.addListener((o, oldValue, newValue) -> {
if (newValue) { if (newValue) {
Popups.openWarningPopup(Localisation.get("shared.warning"), Popups.openWarningPopup(BSResources.get("shared.warning"),
Localisation.get("createOffer.amountPriceBox.warning.invalidBtcDecimalPlaces")); BSResources.get("createOffer.amountPriceBox.warning.invalidBtcDecimalPlaces"));
presentationModel.showWarningInvalidBtcDecimalPlaces.set(false); presentationModel.showWarningInvalidBtcDecimalPlaces.set(false);
} }
}); });
presentationModel.showWarningInvalidFiatDecimalPlaces.addListener((o, oldValue, newValue) -> { presentationModel.showWarningInvalidFiatDecimalPlaces.addListener((o, oldValue, newValue) -> {
if (newValue) { if (newValue) {
Popups.openWarningPopup(Localisation.get("shared.warning"), Popups.openWarningPopup(BSResources.get("shared.warning"),
Localisation.get("createOffer.amountPriceBox.warning.invalidFiatDecimalPlaces")); BSResources.get("createOffer.amountPriceBox.warning.invalidFiatDecimalPlaces"));
presentationModel.showWarningInvalidFiatDecimalPlaces.set(false); presentationModel.showWarningInvalidFiatDecimalPlaces.set(false);
} }
}); });
presentationModel.showWarningAdjustedVolume.addListener((o, oldValue, newValue) -> { presentationModel.showWarningAdjustedVolume.addListener((o, oldValue, newValue) -> {
if (newValue) { if (newValue) {
Popups.openWarningPopup(Localisation.get("shared.warning"), Popups.openWarningPopup(BSResources.get("shared.warning"),
Localisation.get("createOffer.amountPriceBox.warning.adjustedVolume")); BSResources.get("createOffer.amountPriceBox.warning.adjustedVolume"));
presentationModel.showWarningAdjustedVolume.set(false); presentationModel.showWarningAdjustedVolume.set(false);
volumeTextField.setText(presentationModel.volume.get()); volumeTextField.setText(presentationModel.volume.get());
} }
@ -289,8 +289,8 @@ public class CreateOfferCB extends CachedCodeBehind<CreateOfferPM> {
presentationModel.requestPlaceOfferErrorMessage.addListener((o, oldValue, newValue) -> { presentationModel.requestPlaceOfferErrorMessage.addListener((o, oldValue, newValue) -> {
if (newValue != null) { if (newValue != null) {
Popups.openErrorPopup(Localisation.get("shared.error"), Popups.openErrorPopup(BSResources.get("shared.error"),
Localisation.get("createOffer.amountPriceBox.error.requestPlaceOfferErrorMessage", BSResources.get("createOffer.amountPriceBox.error.requestPlaceOfferErrorMessage",
presentationModel.requestPlaceOfferErrorMessage.get())); 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 // Dialogs are a bit limited. There is no callback for the InformationDialog button click, so we added
// our own actions. // our own actions.
List<Action> actions = new ArrayList<>(); List<Action> actions = new ArrayList<>();
actions.add(new AbstractAction(Localisation.get("createOffer.success.copyTxId")) { actions.add(new AbstractAction(BSResources.get("createOffer.success.copyTxId")) {
@Override @Override
public void handle(ActionEvent actionEvent) { public void handle(ActionEvent actionEvent) {
Clipboard clipboard = Clipboard.getSystemClipboard(); Clipboard clipboard = Clipboard.getSystemClipboard();
@ -309,7 +309,7 @@ public class CreateOfferCB extends CachedCodeBehind<CreateOfferPM> {
clipboard.setContent(content); clipboard.setContent(content);
} }
}); });
actions.add(new AbstractAction(Localisation.get("shared.close")) { actions.add(new AbstractAction(BSResources.get("shared.close")) {
@Override @Override
public void handle(ActionEvent actionEvent) { public void handle(ActionEvent actionEvent) {
try { try {
@ -321,9 +321,9 @@ public class CreateOfferCB extends CachedCodeBehind<CreateOfferPM> {
} }
}); });
Popups.openInformationPopup(Localisation.get("createOffer.success.title"), Popups.openInformationPopup(BSResources.get("createOffer.success.title"),
Localisation.get("createOffer.success.info", presentationModel.transactionId.get()), BSResources.get("createOffer.success.info", presentationModel.transactionId.get()),
Localisation.get("createOffer.success.headline"), BSResources.get("createOffer.success.headline"),
actions); actions);
} }
}); });
@ -338,9 +338,9 @@ public class CreateOfferCB extends CachedCodeBehind<CreateOfferPM> {
volumeDescriptionLabel.textProperty().bind(presentationModel.fiatCode);//Price per Bitcoin in EUR volumeDescriptionLabel.textProperty().bind(presentationModel.fiatCode);//Price per Bitcoin in EUR
priceDescriptionLabel.textProperty().bind(createStringBinding(() -> priceDescriptionLabel.textProperty().bind(createStringBinding(() ->
Localisation.get("createOffer.amountPriceBox.priceDescr", presentationModel.fiatCode.get()))); BSResources.get("createOffer.amountPriceBox.priceDescr", presentationModel.fiatCode.get())));
volumeDescriptionLabel.textProperty().bind(createStringBinding(() -> 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); buyLabel.textProperty().bind(presentationModel.directionLabel);
@ -393,17 +393,17 @@ public class CreateOfferCB extends CachedCodeBehind<CreateOfferPM> {
advancedScreenInited = true; advancedScreenInited = true;
acceptedCountriesLabelIcon.setId("clickable-icon"); acceptedCountriesLabelIcon.setId("clickable-icon");
AwesomeDude.setIcon(acceptedCountriesLabelIcon, AwesomeIcon.EDIT_SIGN); 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()); acceptedCountriesLabelIcon.setOnMouseClicked(e -> openSettings());
acceptedLanguagesLabelIcon.setId("clickable-icon"); acceptedLanguagesLabelIcon.setId("clickable-icon");
AwesomeDude.setIcon(acceptedLanguagesLabelIcon, AwesomeIcon.EDIT_SIGN); 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()); acceptedLanguagesLabelIcon.setOnMouseClicked(e -> openSettings());
acceptedArbitratorsLabelIcon.setId("clickable-icon"); acceptedArbitratorsLabelIcon.setId("clickable-icon");
AwesomeDude.setIcon(acceptedArbitratorsLabelIcon, AwesomeIcon.EDIT_SIGN); 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()); acceptedArbitratorsLabelIcon.setOnMouseClicked(e -> openSettings());
} }
@ -462,16 +462,16 @@ public class CreateOfferCB extends CachedCodeBehind<CreateOfferPM> {
addPayInfoEntry(infoGridPane, 0, addPayInfoEntry(infoGridPane, 0,
presentationModel.collateralLabel.get(), presentationModel.collateralLabel.get(),
presentationModel.collateral.get()); presentationModel.collateral.get());
addPayInfoEntry(infoGridPane, 1, Localisation.get("createOffer.fundsBox.offerFee"), addPayInfoEntry(infoGridPane, 1, BSResources.get("createOffer.fundsBox.offerFee"),
presentationModel.offerFee.get()); presentationModel.offerFee.get());
addPayInfoEntry(infoGridPane, 2, Localisation.get("createOffer.fundsBox.networkFee"), addPayInfoEntry(infoGridPane, 2, BSResources.get("createOffer.fundsBox.networkFee"),
presentationModel.networkFee.get()); presentationModel.networkFee.get());
Separator separator = new Separator(); Separator separator = new Separator();
separator.setOrientation(Orientation.HORIZONTAL); separator.setOrientation(Orientation.HORIZONTAL);
separator.setStyle("-fx-background: #666;"); separator.setStyle("-fx-background: #666;");
GridPane.setConstraints(separator, 1, 3); GridPane.setConstraints(separator, 1, 3);
infoGridPane.getChildren().add(separator); infoGridPane.getChildren().add(separator);
addPayInfoEntry(infoGridPane, 4, Localisation.get("createOffer.fundsBox.total"), addPayInfoEntry(infoGridPane, 4, BSResources.get("createOffer.fundsBox.total"),
presentationModel.totalToPay.get()); presentationModel.totalToPay.get());
totalToPayInfoPopover = new PopOver(infoGridPane); totalToPayInfoPopover = new PopOver(infoGridPane);
if (totalToPayInfoIconLabel.getScene() != null) { if (totalToPayInfoIconLabel.getScene() != null) {

View file

@ -23,7 +23,7 @@ import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.gui.util.validation.BtcValidator; import io.bitsquare.gui.util.validation.BtcValidator;
import io.bitsquare.gui.util.validation.FiatValidator; import io.bitsquare.gui.util.validation.FiatValidator;
import io.bitsquare.gui.util.validation.InputValidator; 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.Direction;
import io.bitsquare.trade.orderbook.OrderBookFilter; import io.bitsquare.trade.orderbook.OrderBookFilter;
@ -116,7 +116,7 @@ class CreateOfferPM extends PresentationModel<CreateOfferModel> {
super.initialized(); super.initialized();
// static // static
paymentLabel.set(Localisation.get("createOffer.fundsBox.paymentLabel", model.getOfferId())); paymentLabel.set(BSResources.get("createOffer.fundsBox.paymentLabel", model.getOfferId()));
if (model.addressEntry != null) { if (model.addressEntry != null) {
addressAsString.set(model.addressEntry.getAddress().toString()); addressAsString.set(model.addressEntry.getAddress().toString());
@ -153,7 +153,7 @@ class CreateOfferPM extends PresentationModel<CreateOfferModel> {
// setOrderBookFilter is a one time call // setOrderBookFilter is a one time call
void setOrderBookFilter(@NotNull OrderBookFilter orderBookFilter) { void setOrderBookFilter(@NotNull OrderBookFilter orderBookFilter) {
model.setDirection(orderBookFilter.getDirection()); 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")); ("shared.sell"));
// apply only if valid // apply only if valid
@ -209,7 +209,7 @@ class CreateOfferPM extends PresentationModel<CreateOfferModel> {
// handle minAmount/amount relationship // handle minAmount/amount relationship
if (!model.isMinAmountLessOrEqualAmount()) { if (!model.isMinAmountLessOrEqualAmount()) {
amountValidationResult.set(new InputValidator.ValidationResult(false, amountValidationResult.set(new InputValidator.ValidationResult(false,
Localisation.get("createOffer.validation.amountSmallerThanAmount"))); BSResources.get("createOffer.validation.amountSmallerThanAmount")));
} }
else { else {
amountValidationResult.set(result); amountValidationResult.set(result);
@ -231,7 +231,7 @@ class CreateOfferPM extends PresentationModel<CreateOfferModel> {
if (!model.isMinAmountLessOrEqualAmount()) { if (!model.isMinAmountLessOrEqualAmount()) {
minAmountValidationResult.set(new InputValidator.ValidationResult(false, minAmountValidationResult.set(new InputValidator.ValidationResult(false,
Localisation.get("createOffer.validation.minAmountLargerThanAmount"))); BSResources.get("createOffer.validation.minAmountLargerThanAmount")));
} }
else { else {
minAmountValidationResult.set(result); minAmountValidationResult.set(result);
@ -363,7 +363,7 @@ class CreateOfferPM extends PresentationModel<CreateOfferModel> {
model.collateralAsCoin)); model.collateralAsCoin));
collateralLabel.bind(Bindings.createStringBinding(() -> collateralLabel.bind(Bindings.createStringBinding(() ->
Localisation.get("createOffer.fundsBox.collateral", BSResources.get("createOffer.fundsBox.collateral",
BSFormatter.formatCollateralPercent(model.collateralAsLong.get())), BSFormatter.formatCollateralPercent(model.collateralAsLong.get())),
model.collateralAsLong)); model.collateralAsLong));
totalToPayAsCoin.bind(model.totalToPayAsCoin); totalToPayAsCoin.bind(model.totalToPayAsCoin);
@ -373,7 +373,7 @@ class CreateOfferPM extends PresentationModel<CreateOfferModel> {
networkFee.bind(createStringBinding(() -> formatCoinWithCode(model.networkFeeAsCoin.get()), networkFee.bind(createStringBinding(() -> formatCoinWithCode(model.networkFeeAsCoin.get()),
model.offerFeeAsCoin)); model.offerFeeAsCoin));
bankAccountType.bind(Bindings.createStringBinding(() -> Localisation.get(model.bankAccountType.get()), bankAccountType.bind(Bindings.createStringBinding(() -> BSResources.get(model.bankAccountType.get()),
model.bankAccountType)); model.bankAccountType));
bankAccountCurrency.bind(model.bankAccountCurrency); bankAccountCurrency.bind(model.bankAccountCurrency);
bankAccountCounty.bind(model.bankAccountCounty); bankAccountCounty.bind(model.bankAccountCounty);
@ -400,7 +400,7 @@ class CreateOfferPM extends PresentationModel<CreateOfferModel> {
// Amount calculation could lead to amount/minAmount invalidation // Amount calculation could lead to amount/minAmount invalidation
if (!model.isMinAmountLessOrEqualAmount()) { if (!model.isMinAmountLessOrEqualAmount()) {
amountValidationResult.set(new InputValidator.ValidationResult(false, amountValidationResult.set(new InputValidator.ValidationResult(false,
Localisation.get("createOffer.validation.amountSmallerThanAmount"))); BSResources.get("createOffer.validation.amountSmallerThanAmount")));
} }
else { else {
if (amount.get() != null) if (amount.get() != null)

View file

@ -29,9 +29,9 @@ import io.bitsquare.gui.trade.createoffer.CreateOfferCB;
import io.bitsquare.gui.trade.takeoffer.TakeOfferController; import io.bitsquare.gui.trade.takeoffer.TakeOfferController;
import io.bitsquare.gui.util.BSFormatter; import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.gui.util.ImageUtil; import io.bitsquare.gui.util.ImageUtil;
import io.bitsquare.locale.BSResources;
import io.bitsquare.locale.Country; import io.bitsquare.locale.Country;
import io.bitsquare.locale.CurrencyUtil; import io.bitsquare.locale.CurrencyUtil;
import io.bitsquare.locale.Localisation;
import io.bitsquare.msg.MessageFacade; import io.bitsquare.msg.MessageFacade;
import io.bitsquare.persistence.Persistence; import io.bitsquare.persistence.Persistence;
import io.bitsquare.settings.Settings; import io.bitsquare.settings.Settings;
@ -515,7 +515,7 @@ public class OrderBookController extends CachedViewController {
if (orderBookListItem != null) { if (orderBookListItem != null) {
BankAccountType bankAccountType = orderBookListItem.getOffer().getBankAccountType(); BankAccountType bankAccountType = orderBookListItem.getOffer().getBankAccountType();
setText(Localisation.get(bankAccountType.toString())); setText(BSResources.get(bankAccountType.toString()));
} }
else { else {
setText(""); setText("");

View file

@ -18,8 +18,8 @@
package io.bitsquare.gui.util; package io.bitsquare.gui.util;
import io.bitsquare.arbitrator.Arbitrator; import io.bitsquare.arbitrator.Arbitrator;
import io.bitsquare.locale.BSResources;
import io.bitsquare.locale.Country; import io.bitsquare.locale.Country;
import io.bitsquare.locale.Localisation;
import io.bitsquare.trade.Direction; import io.bitsquare.trade.Direction;
import com.google.bitcoin.core.Coin; import com.google.bitcoin.core.Coin;
@ -294,7 +294,7 @@ public class BSFormatter {
String result = ""; String result = "";
int i = 0; int i = 0;
for (Arbitrator.METHOD item : items) { for (Arbitrator.METHOD item : items) {
result += Localisation.get(item.toString()); result += BSResources.get(item.toString());
i++; i++;
if (i < items.size()) { if (i < items.size()) {
result += ", "; result += ", ";
@ -308,7 +308,7 @@ public class BSFormatter {
String result = ""; String result = "";
int i = 0; int i = 0;
for (Arbitrator.ID_VERIFICATION item : items) { for (Arbitrator.ID_VERIFICATION item : items) {
result += Localisation.get(item.toString()); result += BSResources.get(item.toString());
i++; i++;
if (i < items.size()) { if (i < items.size()) {
result += ", "; result += ", ";

View file

@ -17,7 +17,7 @@
package io.bitsquare.gui.util.validation; package io.bitsquare.gui.util.validation;
import io.bitsquare.locale.Localisation; import io.bitsquare.locale.BSResources;
import com.google.bitcoin.core.NetworkParameters; import com.google.bitcoin.core.NetworkParameters;
@ -80,7 +80,7 @@ public class BtcValidator extends NumberValidator {
BigDecimal bd = new BigDecimal(input); BigDecimal bd = new BigDecimal(input);
final BigDecimal satoshis = bd.movePointRight(8); final BigDecimal satoshis = bd.movePointRight(8);
if (satoshis.scale() > 0) if (satoshis.scale() > 0)
return new ValidationResult(false, Localisation.get("validation.btc.toSmall")); return new ValidationResult(false, BSResources.get("validation.btc.toSmall"));
else else
return new ValidationResult(true); return new ValidationResult(true);
} }
@ -89,7 +89,7 @@ public class BtcValidator extends NumberValidator {
BigDecimal bd = new BigDecimal(input); BigDecimal bd = new BigDecimal(input);
final BigDecimal satoshis = bd.movePointRight(8); final BigDecimal satoshis = bd.movePointRight(8);
if (satoshis.longValue() > NetworkParameters.MAX_MONEY.longValue()) 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 else
return new ValidationResult(true); return new ValidationResult(true);
} }

View file

@ -17,7 +17,7 @@
package io.bitsquare.gui.util.validation; package io.bitsquare.gui.util.validation;
import io.bitsquare.locale.Localisation; import io.bitsquare.locale.BSResources;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -65,7 +65,7 @@ public class FiatValidator extends NumberValidator {
protected ValidationResult validateIfNotExceedsMinFiatValue(String input) { protected ValidationResult validateIfNotExceedsMinFiatValue(String input) {
double d = Double.parseDouble(input); double d = Double.parseDouble(input);
if (d < MIN_FIAT_VALUE) if (d < MIN_FIAT_VALUE)
return new ValidationResult(false, Localisation.get("validation.fiat.toSmall")); return new ValidationResult(false, BSResources.get("validation.fiat.toSmall"));
else else
return new ValidationResult(true); return new ValidationResult(true);
} }
@ -73,7 +73,7 @@ public class FiatValidator extends NumberValidator {
protected ValidationResult validateIfNotExceedsMaxFiatValue(String input) { protected ValidationResult validateIfNotExceedsMaxFiatValue(String input) {
double d = Double.parseDouble(input); double d = Double.parseDouble(input);
if (d > MAX_FIAT_VALUE) if (d > MAX_FIAT_VALUE)
return new ValidationResult(false, Localisation.get("validation.fiat.toLarge")); return new ValidationResult(false, BSResources.get("validation.fiat.toLarge"));
else else
return new ValidationResult(true); return new ValidationResult(true);
} }

View file

@ -17,7 +17,7 @@
package io.bitsquare.gui.util.validation; package io.bitsquare.gui.util.validation;
import io.bitsquare.locale.Localisation; import io.bitsquare.locale.BSResources;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -46,7 +46,7 @@ public abstract class InputValidator {
protected ValidationResult validateIfNotEmpty(String input) { protected ValidationResult validateIfNotEmpty(String input) {
if (input == null || input.length() == 0) if (input == null || input.length() == 0)
return new ValidationResult(false, Localisation.get("validation.empty")); return new ValidationResult(false, BSResources.get("validation.empty"));
else else
return new ValidationResult(true); return new ValidationResult(true);
} }

View file

@ -17,7 +17,7 @@
package io.bitsquare.gui.util.validation; package io.bitsquare.gui.util.validation;
import io.bitsquare.locale.Localisation; import io.bitsquare.locale.BSResources;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -47,20 +47,20 @@ public abstract class NumberValidator extends InputValidator {
Double.parseDouble(input); Double.parseDouble(input);
return new ValidationResult(true); return new ValidationResult(true);
} catch (Exception e) { } catch (Exception e) {
return new ValidationResult(false, Localisation.get("validation.NaN")); return new ValidationResult(false, BSResources.get("validation.NaN"));
} }
} }
protected ValidationResult validateIfNotZero(String input) { protected ValidationResult validateIfNotZero(String input) {
if (Double.parseDouble(input) == 0) if (Double.parseDouble(input) == 0)
return new ValidationResult(false, Localisation.get("validation.zero")); return new ValidationResult(false, BSResources.get("validation.zero"));
else else
return new ValidationResult(true); return new ValidationResult(true);
} }
protected ValidationResult validateIfNotNegative(String input) { protected ValidationResult validateIfNotNegative(String input) {
if (Double.parseDouble(input) < 0) if (Double.parseDouble(input) < 0)
return new ValidationResult(false, Localisation.get("validation.negative")); return new ValidationResult(false, BSResources.get("validation.negative"));
else else
return new ValidationResult(true); return new ValidationResult(true);
} }

View file

@ -34,8 +34,8 @@ import java.util.ResourceBundle;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
public class Localisation { public class BSResources {
private static final Logger log = LoggerFactory.getLogger(Localisation.class); private static final Logger log = LoggerFactory.getLogger(BSResources.class);
public static ResourceBundle getResourceBundle() { public static ResourceBundle getResourceBundle() {
return ResourceBundle.getBundle("i18n.displayStrings", new UTF8Control()); return ResourceBundle.getBundle("i18n.displayStrings", new UTF8Control());
@ -46,7 +46,7 @@ public class Localisation {
return ""; return "";
try { try {
return Localisation.getResourceBundle().getString(key); return BSResources.getResourceBundle().getString(key);
} catch (MissingResourceException e) { } catch (MissingResourceException e) {
log.error("MissingResourceException for key: " + key); log.error("MissingResourceException for key: " + key);
return key + " is missing"; return key + " is missing";
@ -54,7 +54,7 @@ public class Localisation {
} }
public static String get(String key, String... arguments) { public static String get(String key, String... arguments) {
return MessageFormat.format(Localisation.get(key), arguments); return MessageFormat.format(BSResources.get(key), arguments);
} }
} }

View file

@ -19,10 +19,10 @@ package io.bitsquare.gui.settings.uimock;
import io.bitsquare.bank.BankAccount; import io.bitsquare.bank.BankAccount;
import io.bitsquare.bank.BankAccountType; import io.bitsquare.bank.BankAccountType;
import io.bitsquare.locale.BSResources;
import io.bitsquare.locale.Country; import io.bitsquare.locale.Country;
import io.bitsquare.locale.CountryUtil; import io.bitsquare.locale.CountryUtil;
import io.bitsquare.locale.CurrencyUtil; import io.bitsquare.locale.CurrencyUtil;
import io.bitsquare.locale.Localisation;
import io.bitsquare.locale.Region; import io.bitsquare.locale.Region;
import java.net.URL; import java.net.URL;
@ -70,7 +70,7 @@ public class BankAccountSettingsControllerUIMock implements Initializable {
bankAccountTypesComboBox.setConverter(new StringConverter<BankAccountType>() { bankAccountTypesComboBox.setConverter(new StringConverter<BankAccountType>() {
@Override @Override
public String toString(BankAccountType bankAccountTypeInfo) { public String toString(BankAccountType bankAccountTypeInfo) {
return Localisation.get(bankAccountTypeInfo.toString()); return BSResources.get(bankAccountTypeInfo.toString());
} }
@Override @Override