From 29dcf5f080f8a38031af4a993c5cf766863a8f51 Mon Sep 17 00:00:00 2001 From: Christoph Atteneder Date: Tue, 15 Oct 2019 16:06:06 +0200 Subject: [PATCH] Update translations to adapt to new unified delay --- .../account/sign/SignedWitnessService.java | 2 +- .../resources/i18n/displayStrings.properties | 26 ++++++------------- .../java/bisq/desktop/main/MainViewModel.java | 3 ++- .../main/offer/MutableOfferViewModel.java | 1 + .../main/offer/offerbook/OfferBookView.java | 8 +++++- .../offer/takeoffer/TakeOfferViewModel.java | 1 + .../presentation/AccountPresentation.java | 11 ++++++-- 7 files changed, 29 insertions(+), 23 deletions(-) diff --git a/core/src/main/java/bisq/core/account/sign/SignedWitnessService.java b/core/src/main/java/bisq/core/account/sign/SignedWitnessService.java index 6991b86b0d9..6ab7746dd58 100644 --- a/core/src/main/java/bisq/core/account/sign/SignedWitnessService.java +++ b/core/src/main/java/bisq/core/account/sign/SignedWitnessService.java @@ -56,7 +56,7 @@ @Slf4j public class SignedWitnessService { - public static final long SIGNER_AGE_DAYS = 60; + public static final long SIGNER_AGE_DAYS = 30; public static final long SIGNER_AGE = SIGNER_AGE_DAYS * ChronoUnit.DAYS.getDuration().toMillis(); private final KeyRing keyRing; diff --git a/core/src/main/resources/i18n/displayStrings.properties b/core/src/main/resources/i18n/displayStrings.properties index 48a8fad9091..472845944e4 100644 --- a/core/src/main/resources/i18n/displayStrings.properties +++ b/core/src/main/resources/i18n/displayStrings.properties @@ -342,7 +342,7 @@ offerbook.timeSinceSigning.daysSinceSigning={0} days offerbook.timeSinceSigning.daysSinceSigning.long={0} since signing offerbook.timeSinceSigning.help=By trading with a payment account that was verified by an arbitrator or a peer, your account gets signed as well.\n\ - 30 days later the initial limit of 0.01 BTC gets lifted and after 60 days your account can sign other peers as well. + {0} days later the initial limit of {1} gets lifted and your account can sign other peers as well. offerbook.timeSinceSigning.notSigned=Not signed yet offerbook.timeSinceSigning.notSigned.noNeed=Unsigned shared.notSigned=This account hasn't been signed yet @@ -372,28 +372,18 @@ offerbook.warning.noTradingAccountForCurrency.msg=You don't have a trading accou offerbook.warning.noMatchingAccount.headline=No matching trading account. offerbook.warning.noMatchingAccount.msg=To take this offer, you will need to set up a payment account using this payment method.\n\nWould you like to do this now? -offerbook.warning.riskyBuyOfferWithImmatureAccountAge=This offer cannot be taken because of security restrictions based on the following criteria:\n\ - - The maker''s payment account was created after March 1st 2019\n\ - - The minimum trade amount is above 0.01 BTC\n\ - - The payment method for the offer is considered risky for bank chargebacks\n\n{0} - -offerbook.warning.sellOfferAndAnyTakerPaymentAccountForOfferMature=This offer cannot be taken because of security restrictions based on the following criteria:\n\ - - Your payment account was created after March 1st 2019\n\ - - The minimum trade amount is above 0.01 BTC\n\ - - The payment method for this offer is considered risky for bank chargebacks\n\n{0} - offerbook.warning.counterpartyTradeRestrictions=This offer cannot be taken due to counterparty trade restrictions offerbook.warning.newVersionAnnouncement=With this version of the software trading peers can verify and sign each other to create a network of trusted accounts.\n\n\ By trading with a peer that has already been verified your account will be signed after a successful trade as well and the limits will be lifted after a certain time frame based on the verification method.\n\n\ For more information on account signing, please visit our documentation section on docs.bisq.network/account-signing. -popup.warning.tradeLimitDueAccountAgeRestriction.seller=The allowed trade amount is limited to 0.01 BTC because of security restrictions based on the following criteria:\n\ +popup.warning.tradeLimitDueAccountAgeRestriction.seller=The allowed trade amount is limited to {0} because of security restrictions based on the following criteria:\n\ - The buyers account was created after March 1st 2019\n\ - - The payment method for this offer is considered risky for bank chargebacks\n\n{0} -popup.warning.tradeLimitDueAccountAgeRestriction.buyer=The allowed trade amount is limited to 0.01 BTC because of security restrictions based on the following criteria:\n\ + - The payment method for this offer is considered risky for bank chargebacks\n\n{1} +popup.warning.tradeLimitDueAccountAgeRestriction.buyer=The allowed trade amount is limited to {0} because of security restrictions based on the following criteria:\n\ - Your payment account was created after March 1st 2019\n\ - - The payment method for this offer is considered risky for bank chargebacks\n\n{0} + - The payment method for this offer is considered risky for bank chargebacks\n\n{1} offerbook.warning.wrongTradeProtocol=That offer requires a different protocol version as the one used in your version of the software.\n\nPlease check if you have the latest version installed, otherwise the user who created the offer has used an older version.\n\nUsers cannot trade with an incompatible trade protocol version. offerbook.warning.userIgnored=You have added that user's onion address to your ignore list. @@ -2542,10 +2532,10 @@ popup.accountSigning.success.description=All {0} payment accounts were successfu popup.accountSigning.generalInformation=You'll find the signing state of all your accounts in the account section.\n\n\ For further information please visit docs.bisq.network/account-signing.html. popup.accountSigning.signedByArbitrator=One of your payment accounts has been verified and signed by an arbitrator. Trading with this account will automatically sign your trading peer''s account after a successful trade.\n\n{0} -popup.accountSigning.signedByPeer=One of your payment accounts has been verified and signed by a trading peer. Your initial limit will be lifted within 30 days from now. \ - After 60 days you are able to sign other accounts as well.\n\n{0} +popup.accountSigning.signedByPeer=One of your payment accounts has been verified and signed by a trading peer. Your initial limit will be lifted and you''ll be able to sign other accounts within {0} days from now.\n\n{1} popup.accountSigning.peerLimitLifted=The initial limit for one of your accounts has been lifted.\n\n{0} -popup.accountSigning.peerSigner=One of your accounts is mature enough to sign other payment accounts as well.\n\n{0} +popup.accountSigning.peerSigner=One of your accounts is mature enough to sign other payment accounts \ + and the initial limit for one of your accounts has been lifted.\n\n{0} #################################################################### # Notifications diff --git a/desktop/src/main/java/bisq/desktop/main/MainViewModel.java b/desktop/src/main/java/bisq/desktop/main/MainViewModel.java index a87b0809186..301a6627a0a 100644 --- a/desktop/src/main/java/bisq/desktop/main/MainViewModel.java +++ b/desktop/src/main/java/bisq/desktop/main/MainViewModel.java @@ -37,6 +37,7 @@ import bisq.desktop.util.DisplayUtils; import bisq.desktop.util.GUIUtil; +import bisq.core.account.sign.SignedWitnessService; import bisq.core.account.witness.AccountAgeWitnessService; import bisq.core.alert.PrivateNotificationManager; import bisq.core.app.AppOptionKeys; @@ -357,7 +358,7 @@ private void setupHandlers() { bisqSetup.setDisplaySignedByArbitratorHandler(key -> accountPresentation.showOneTimeAccountSigningPopup( key, "popup.accountSigning.signedByArbitrator")); bisqSetup.setDisplaySignedByPeerHandler(key -> accountPresentation.showOneTimeAccountSigningPopup( - key, "popup.accountSigning.signedByPeer")); + key, "popup.accountSigning.signedByPeer", String.valueOf(SignedWitnessService.SIGNER_AGE_DAYS))); bisqSetup.setDisplayPeerLimitLiftedHandler(key -> accountPresentation.showOneTimeAccountSigningPopup( key, "popup.accountSigning.peerLimitLifted")); bisqSetup.setDisplayPeerSignerHandler(key -> accountPresentation.showOneTimeAccountSigningPopup( diff --git a/desktop/src/main/java/bisq/desktop/main/offer/MutableOfferViewModel.java b/desktop/src/main/java/bisq/desktop/main/offer/MutableOfferViewModel.java index 49229861073..bc2fd34f843 100644 --- a/desktop/src/main/java/bisq/desktop/main/offer/MutableOfferViewModel.java +++ b/desktop/src/main/java/bisq/desktop/main/offer/MutableOfferViewModel.java @@ -735,6 +735,7 @@ void onFocusOutAmountTextField(boolean oldValue, boolean newValue) { } else if (amount.get() != null && btcValidator.getMaxTradeLimit() != null && btcValidator.getMaxTradeLimit().value == OfferRestrictions.TOLERATED_SMALL_TRADE_AMOUNT.value) { amount.set(btcFormatter.formatCoin(btcValidator.getMaxTradeLimit())); new Popup<>().information(Res.get("popup.warning.tradeLimitDueAccountAgeRestriction.buyer", + bsqFormatter.formatCoinWithCode(OfferRestrictions.TOLERATED_SMALL_TRADE_AMOUNT), Res.get("offerbook.warning.newVersionAnnouncement"))) .width(900) .show(); diff --git a/desktop/src/main/java/bisq/desktop/main/offer/offerbook/OfferBookView.java b/desktop/src/main/java/bisq/desktop/main/offer/offerbook/OfferBookView.java index cfcc5ce14e9..15c2b32290c 100644 --- a/desktop/src/main/java/bisq/desktop/main/offer/offerbook/OfferBookView.java +++ b/desktop/src/main/java/bisq/desktop/main/offer/offerbook/OfferBookView.java @@ -42,6 +42,7 @@ import bisq.desktop.util.GUIUtil; import bisq.desktop.util.Layout; +import bisq.core.account.sign.SignedWitnessService; import bisq.core.account.witness.AccountAgeWitnessService; import bisq.core.alert.PrivateNotificationManager; import bisq.core.app.AppOptionKeys; @@ -53,6 +54,7 @@ import bisq.core.monetary.Volume; import bisq.core.offer.Offer; import bisq.core.offer.OfferPayload; +import bisq.core.offer.OfferRestrictions; import bisq.core.payment.PaymentAccount; import bisq.core.payment.payload.PaymentMethod; import bisq.core.user.DontShowAgainLookup; @@ -1059,7 +1061,11 @@ public void updateItem(final OfferBookListItem newItem, boolean empty) { } private AutoTooltipTableColumn getSigningStateColumn() { - AutoTooltipTableColumn column = new AutoTooltipTableColumn<>(Res.get("offerbook.timeSinceSigning"), Res.get("offerbook.timeSinceSigning.help")) { + AutoTooltipTableColumn column = new AutoTooltipTableColumn<>( + Res.get("offerbook.timeSinceSigning"), + Res.get("offerbook.timeSinceSigning.help", + SignedWitnessService.SIGNER_AGE_DAYS, + formatter.formatCoinWithCode(OfferRestrictions.TOLERATED_SMALL_TRADE_AMOUNT))) { { setMinWidth(60); setSortable(true); diff --git a/desktop/src/main/java/bisq/desktop/main/offer/takeoffer/TakeOfferViewModel.java b/desktop/src/main/java/bisq/desktop/main/offer/takeoffer/TakeOfferViewModel.java index 98b4c8d4ae2..ab9dd8e1406 100644 --- a/desktop/src/main/java/bisq/desktop/main/offer/takeoffer/TakeOfferViewModel.java +++ b/desktop/src/main/java/bisq/desktop/main/offer/takeoffer/TakeOfferViewModel.java @@ -386,6 +386,7 @@ void onFocusOutAmountTextField(boolean oldValue, boolean newValue, String userIn } else if (btcValidator.getMaxTradeLimit() != null && btcValidator.getMaxTradeLimit().value == OfferRestrictions.TOLERATED_SMALL_TRADE_AMOUNT.value) { if (dataModel.getDirection() == OfferPayload.Direction.BUY) { new Popup<>().information(Res.get("popup.warning.tradeLimitDueAccountAgeRestriction.seller", + bsqFormatter.formatCoinWithCode(OfferRestrictions.TOLERATED_SMALL_TRADE_AMOUNT), Res.get("offerbook.warning.newVersionAnnouncement"))) .width(900) .show(); diff --git a/desktop/src/main/java/bisq/desktop/main/presentation/AccountPresentation.java b/desktop/src/main/java/bisq/desktop/main/presentation/AccountPresentation.java index 72be3bb7f57..8ece4877001 100644 --- a/desktop/src/main/java/bisq/desktop/main/presentation/AccountPresentation.java +++ b/desktop/src/main/java/bisq/desktop/main/presentation/AccountPresentation.java @@ -68,14 +68,21 @@ public void setup() { } public void showOneTimeAccountSigningPopup(String key, String s) { + showOneTimeAccountSigningPopup(key, s, null); + } + + public void showOneTimeAccountSigningPopup(String key, String s, String optionalParam) { if (!DevEnv.isDevMode()) { DontShowAgainLookup.dontShowAgain(ACCOUNT_NEWS, false); showNotification.set(true); DontShowAgainLookup.dontShowAgain(key, true); - new Popup<>().information(Res.get(s, - Res.get("popup.accountSigning.generalInformation"))) + String message = optionalParam != null ? + Res.get(s, optionalParam, Res.get("popup.accountSigning.generalInformation")) : + Res.get(s, Res.get("popup.accountSigning.generalInformation")); + + new Popup<>().information(message) .show(); } }