Skip to content

Commit

Permalink
Change Venezuelan currency from VEF to VES
Browse files Browse the repository at this point in the history
  • Loading branch information
pingiun committed Sep 29, 2020
1 parent 20135a1 commit fe71356
Show file tree
Hide file tree
Showing 17 changed files with 59 additions and 13 deletions.
19 changes: 19 additions & 0 deletions core/src/main/java/bisq/core/app/BisqExecutable.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,12 @@
import com.google.inject.Guice;
import com.google.inject.Injector;

import org.apache.commons.io.FileUtils;

import java.nio.file.Paths;

import java.io.File;
import java.io.IOException;

import lombok.extern.slf4j.Slf4j;

Expand Down Expand Up @@ -78,6 +81,22 @@ public BisqExecutable(String fullName, String scriptName, String appName, String
}

public void execute(String[] args) {
// It's pretty ugly to have this code at this location, but it is important that this property is set before
// the Currency classes are loaded. This is only temporarily necessary until upgraded to Java 11
// TODO: remove when upgraded to Java 11
if (Runtime.version().feature() == 10) {
try {
File tmpFile = File.createTempFile("CurrencyData", ".properties");
FileUtils.copyURLToFile(this.getClass().getResource("/CurrencyData.properties"), tmpFile);
System.setProperty("java.util.currency.data", tmpFile.getAbsolutePath());
} catch (IOException ex) {
System.err.println("fault: An unexpected error occurred. " +
"Please file a report at https://bisq.network/issues");
ex.printStackTrace(System.err);
System.exit(EXIT_FAILURE);
}
}

try {
config = new Config(appName, osUserDataDir(), args);
if (config.helpRequested) {
Expand Down
4 changes: 4 additions & 0 deletions core/src/main/java/bisq/core/locale/CurrencyUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,10 @@ public static String getNameByCode(String currencyCode) {
return getCryptoCurrency(currencyCode).map(TradeCurrency::getName).orElse(btcOrRemovedAsset);
}
try {
// TODO: remove when upgraded to java 11
if (currencyCode.equals("VES") && Runtime.version().feature() == 10) {
return Res.get("shared.temp.ves"); // Venezuelan bolívar soberano
}
return Currency.getInstance(currencyCode).getDisplayName();
} catch (Throwable t) {
log.debug("No currency name available {}", t.getMessage());
Expand Down
7 changes: 6 additions & 1 deletion core/src/main/java/bisq/core/locale/TradeCurrency.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ public abstract class TradeCurrency implements PersistablePayload, Comparable<Tr

public TradeCurrency(String code, String name) {
this.code = code;
this.name = name;
// TODO: remove when upgraded to java 11
if (code.equals("VES") && Runtime.version().feature() == 10) {
this.name = Res.get("shared.temp.ves"); // Venezuelan bolívar soberano
} else {
this.name = name;
}
}

///////////////////////////////////////////////////////////////////////////////////////////
Expand Down
2 changes: 2 additions & 0 deletions core/src/main/resources/CurrencyData.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# VENEZUELA (BOLIVARIAN REPUBLIC OF)
VE=VES,928,0,2018-08-20T00:00:00
2 changes: 2 additions & 0 deletions core/src/main/resources/i18n/displayStrings.properties
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,8 @@ shared.refundAgentForSupportStaff=Refund agent
shared.delayedPayoutTxId=Delayed payout transaction ID
shared.delayedPayoutTxReceiverAddress=Delayed payout transaction sent to
shared.unconfirmedTransactionsLimitReached=You have too many unconfirmed transactions at the moment. Please try again later.
# TODO: remove when upgraded to java 11
shared.temp.ves=Venezuelan bolívar soberano


####################################################################
Expand Down
3 changes: 2 additions & 1 deletion core/src/main/resources/i18n/displayStrings_de.properties
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ shared.refundAgent=Vermittler
shared.refundAgentForSupportStaff=Rückerstattungsbeauftragten
shared.delayedPayoutTxId=Rückerstattung von Sicherheiten Transaktions-ID
shared.unconfirmedTransactionsLimitReached=Sie haben im Moment zu viele unbestätigte Transaktionen. Bitte versuchen Sie es später noch einmal.

# TODO: remove when upgraded to java 11
shared.temp.ves=Venezolanischer Bolívar soberano

####################################################################
# UI views
Expand Down
3 changes: 2 additions & 1 deletion core/src/main/resources/i18n/displayStrings_es.properties
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ shared.refundAgent=Árbitro
shared.refundAgentForSupportStaff=Agente de devolución de fondos
shared.delayedPayoutTxId=ID de transacción de devolución colateral de fondos
shared.unconfirmedTransactionsLimitReached=Tiene demasiadas transacciones no confirmadas en este momento. Por favor, inténtelo de nuevo más tarde.

# TODO: remove when upgraded to java 11
shared.temp.ves=Venezolano bolívar soberano

####################################################################
# UI views
Expand Down
5 changes: 4 additions & 1 deletion core/src/main/resources/i18n/displayStrings_fa.properties
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,10 @@ shared.refundAgent=داور
shared.refundAgentForSupportStaff=Refund agent
shared.delayedPayoutTxId=Refund collateral transaction ID
shared.unconfirmedTransactionsLimitReached=You have too many unconfirmed transactions at the moment. Please try again later.

# TODO: remove when upgraded to java 11
# Because this translation should be temporary, this reads "Venezuelan Bolivar" (not including soberano)
# because I compied it from wikipedia
shared.temp.ves=بوليفار فنزويلي

####################################################################
# UI views
Expand Down
3 changes: 2 additions & 1 deletion core/src/main/resources/i18n/displayStrings_fr.properties
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ shared.refundAgent=Arbitre
shared.refundAgentForSupportStaff=Agent de remboursement
shared.delayedPayoutTxId=ID de la transaction de remboursement du dépôt de garantie
shared.unconfirmedTransactionsLimitReached=You have too many unconfirmed transactions at the moment. Please try again later.

# TODO: remove when upgraded to java 11
shared.temp.ves=Vénézuélien bolivar soberano

####################################################################
# UI views
Expand Down
3 changes: 2 additions & 1 deletion core/src/main/resources/i18n/displayStrings_ja.properties
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ shared.refundAgent=調停人
shared.refundAgentForSupportStaff=Refund agent
shared.delayedPayoutTxId=Refund collateral transaction ID
shared.unconfirmedTransactionsLimitReached=You have too many unconfirmed transactions at the moment. Please try again later.

# TODO: remove when upgraded to java 11
shared.temp.ves=Venezuelan bolívar soberano

####################################################################
# UI views
Expand Down
3 changes: 2 additions & 1 deletion core/src/main/resources/i18n/displayStrings_pt-br.properties
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ shared.refundAgent=Árbitro
shared.refundAgentForSupportStaff=Árbitro
shared.delayedPayoutTxId=ID de transação colateral de reembolso
shared.unconfirmedTransactionsLimitReached=No momento, você possui muitas transações não-confirmadas. Tente novamente mais tarde.

# TODO: remove when upgraded to java 11
shared.temp.ves=Venezuelanos bolívar soberano

####################################################################
# UI views
Expand Down
3 changes: 2 additions & 1 deletion core/src/main/resources/i18n/displayStrings_pt.properties
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ shared.refundAgent=Árbitro
shared.refundAgentForSupportStaff=Agente de Reembolso
shared.delayedPayoutTxId=ID da transação do colateral de reembolso
shared.unconfirmedTransactionsLimitReached=You have too many unconfirmed transactions at the moment. Please try again later.

# TODO: remove when upgraded to java 11
shared.temp.ves=Venezuelan bolívar soberano

####################################################################
# UI views
Expand Down
3 changes: 2 additions & 1 deletion core/src/main/resources/i18n/displayStrings_ru.properties
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ shared.refundAgent=Арбитр
shared.refundAgentForSupportStaff=Refund agent
shared.delayedPayoutTxId=Refund collateral transaction ID
shared.unconfirmedTransactionsLimitReached=You have too many unconfirmed transactions at the moment. Please try again later.

# TODO: remove when upgraded to java 11
shared.temp.ves=Венесуэльский боливар soberano

####################################################################
# UI views
Expand Down
3 changes: 2 additions & 1 deletion core/src/main/resources/i18n/displayStrings_th.properties
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ shared.refundAgent=ผู้ไกล่เกลี่ย
shared.refundAgentForSupportStaff=Refund agent
shared.delayedPayoutTxId=Refund collateral transaction ID
shared.unconfirmedTransactionsLimitReached=You have too many unconfirmed transactions at the moment. Please try again later.

# TODO: remove when upgraded to java 11
shared.temp.ves=Venezuelan bolívar soberano

####################################################################
# UI views
Expand Down
3 changes: 2 additions & 1 deletion core/src/main/resources/i18n/displayStrings_vi.properties
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ shared.refundAgent=Trọng tài
shared.refundAgentForSupportStaff=Refund agent
shared.delayedPayoutTxId=Refund collateral transaction ID
shared.unconfirmedTransactionsLimitReached=You have too many unconfirmed transactions at the moment. Please try again later.

# TODO: remove when upgraded to java 11
shared.temp.ves=Venezuelan bolívar soberano

####################################################################
# UI views
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ shared.refundAgent=仲裁员
shared.refundAgentForSupportStaff=退款助理
shared.delayedPayoutTxId=退款担保交易 ID
shared.unconfirmedTransactionsLimitReached=You have too many unconfirmed transactions at the moment. Please try again later.

# TODO: remove when upgraded to java 11
shared.temp.ves=委內瑞拉主權玻利瓦

####################################################################
# UI views
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ shared.refundAgent=仲裁員
shared.refundAgentForSupportStaff=退款助理
shared.delayedPayoutTxId=退款擔保交易 ID
shared.unconfirmedTransactionsLimitReached=You have too many unconfirmed transactions at the moment. Please try again later.

# TODO: remove when upgraded to java 11
shared.temp.ves=委內瑞拉主權玻利瓦

####################################################################
# UI views
Expand Down

0 comments on commit fe71356

Please sign in to comment.