From 008cd332f3097a527af7c5c115548394fe2c2a26 Mon Sep 17 00:00:00 2001 From: Startail the 'Coon Date: Tue, 21 Aug 2018 11:42:21 +0200 Subject: [PATCH] Fix #1707 - "Settle Backing Asset" Translation Issue (#1716) * Settle Backing Asset properly displayed - Removes hardcoded value 'BTS' * Prepend bit to bitAssets on Settling Tooltip * Fix bitAsset prepend on settle tooltip * Dynamic settle delay on settle tooltip --- app/assets/locales/locale-de.json | 2 +- app/assets/locales/locale-en.json | 2 +- app/assets/locales/locale-es.json | 2 +- app/assets/locales/locale-fr.json | 2 +- app/assets/locales/locale-it.json | 2 +- app/assets/locales/locale-ja.json | 2 +- app/assets/locales/locale-ko.json | 2 +- app/assets/locales/locale-ru.json | 2 +- app/assets/locales/locale-tr.json | 2 +- app/assets/locales/locale-zh.json | 2 +- app/components/Account/AccountPortfolioList.jsx | 12 +++++++++++- 11 files changed, 21 insertions(+), 11 deletions(-) diff --git a/app/assets/locales/locale-de.json b/app/assets/locales/locale-de.json index ea93b6061e..a94d871cb6 100644 --- a/app/assets/locales/locale-de.json +++ b/app/assets/locales/locale-de.json @@ -1432,7 +1432,7 @@ "propose_tip": "Propose another user to initiate a transaction", "proxy_remove": "You have a proxy set, to remove it simply clear this input field", "proxy_search": "Search for an account to be used as your proxy for voting", - "settle": "Settling will let you convert your holdings of %(asset)s to BTS after a delay of 24 hours, at a price equal to the feed price at that time.", + "settle": "Settling will let you convert your holdings of %(asset)s to %(backingAsset)s after a delay of %(settleDelay)s hours, at a price equal to the feed price at that time.", "settle_price": "This is the price at which settle orders will execute.", "show_asset": "Click here to show this asset in the main list.", "show_block": "Click here to show block #%(block)s where this transaction occured.", diff --git a/app/assets/locales/locale-en.json b/app/assets/locales/locale-en.json index a14801a592..d7af1d1e07 100644 --- a/app/assets/locales/locale-en.json +++ b/app/assets/locales/locale-en.json @@ -1432,7 +1432,7 @@ "propose_tip": "Propose another user to initiate a transaction", "proxy_remove": "You have a proxy set, to remove it simply clear this input field", "proxy_search": "Search for an account to be used as your proxy for voting", - "settle": "Settling will let you convert your holdings of %(asset)s to BTS after a delay of 24 hours, at a price equal to the feed price at that time.", + "settle": "Settling will let you convert your holdings of %(asset)s to %(backingAsset)s after a delay of %(settleDelay)s hours, at a price equal to the feed price at that time.", "settle_price": "This is the price at which settle orders will execute.", "show_asset": "Click here to show this asset in the main list.", "show_block": "Click here to show block #%(block)s where this transaction occurred.", diff --git a/app/assets/locales/locale-es.json b/app/assets/locales/locale-es.json index 1fa002ab3c..0bed5c49ea 100644 --- a/app/assets/locales/locale-es.json +++ b/app/assets/locales/locale-es.json @@ -1432,7 +1432,7 @@ "propose_tip": "Proponer otro usuario para iniciar una transacción", "proxy_remove": "You have a proxy set, to remove it simply clear this input field", "proxy_search": "Search for an account to be used as your proxy for voting", - "settle": "El settling te permitirá de convertir tus propriedades de %(asset)s en BTS después de un retraso de 24 horas, a un precio igual al precio dado en ese momento.", + "settle": "El settling te permitirá de convertir tus propriedades de %(asset)s en %(backingAsset)s después de un retraso de %(settleDelay)s horas, a un precio igual al precio dado en ese momento.", "settle_price": "Este es el precio al que se ejecutarán los pedidos colocados.", "show_asset": "Haga clic aquí para mostrar este activo en la lista principal.", "show_block": "Haga clic aquí para mostrar el bloque #%(block)s donde ocurrió esta transacción.", diff --git a/app/assets/locales/locale-fr.json b/app/assets/locales/locale-fr.json index ce8bf1b445..d8a1d5dc0c 100644 --- a/app/assets/locales/locale-fr.json +++ b/app/assets/locales/locale-fr.json @@ -1432,7 +1432,7 @@ "propose_tip": "Propose another user to initiate a transaction", "proxy_remove": "You have a proxy set, to remove it simply clear this input field", "proxy_search": "Search for an account to be used as your proxy for voting", - "settle": "Settling will let you convert your holdings of %(asset)s to BTS after a delay of 24 hours, at a price equal to the feed price at that time.", + "settle": "Settling will let you convert your holdings of %(asset)s to %(backingAsset)s after a delay of %(settleDelay)s hours, at a price equal to the feed price at that time.", "settle_price": "This is the price at which settle orders will execute.", "show_asset": "Click here to show this asset in the main list.", "show_block": "Click here to show block #%(block)s where this transaction occured.", diff --git a/app/assets/locales/locale-it.json b/app/assets/locales/locale-it.json index 12f59d79ae..9497b158fd 100644 --- a/app/assets/locales/locale-it.json +++ b/app/assets/locales/locale-it.json @@ -1432,7 +1432,7 @@ "propose_tip": "Propose another user to initiate a transaction", "proxy_remove": "You have a proxy set, to remove it simply clear this input field", "proxy_search": "Search for an account to be used as your proxy for voting", - "settle": "Il settling ti permetterà di convertire le tue disponibilità di %(asset)s in BTS dopo un'attesa di 24 ore, ad un prezzo uguale al prezzo di mercato in quel momento.", + "settle": "Il settling ti permetterà di convertire le tue disponibilità di %(asset)s in %(backingAsset)s dopo un'attesa di %(settleDelay)s ore, ad un prezzo uguale al prezzo di mercato in quel momento.", "settle_price": "Questo è il prezzo a cui i settle order saranno eseguiti.", "show_asset": "Clicca qui per mostrare quest'asset nella lista principale.", "show_block": "Clicca qui per mostrare il blocco #%(block)s in cui questa transazione è avvenuta.", diff --git a/app/assets/locales/locale-ja.json b/app/assets/locales/locale-ja.json index 51f5cf5008..4354bc5c2a 100644 --- a/app/assets/locales/locale-ja.json +++ b/app/assets/locales/locale-ja.json @@ -1432,7 +1432,7 @@ "propose_tip": "別のユーザーからトランザクションを提案する", "proxy_remove": "You have a proxy set, to remove it simply clear this input field", "proxy_search": "Search for an account to be used as your proxy for voting", - "settle": "精算により、保有する%(asset)sを24時間の遅延後にBTSにその時点のフィード価格で変換できます。", + "settle": "精算により、保有する%(asset)sを%(settleDelay)s時間の遅延後に%(backingAsset)sにその時点のフィード価格で変換できます。", "settle_price": "これは決済注文を実行する価格です。", "show_asset": "メインリストにこのアセットを表示するにはここをクリックしてください。", "show_block": "この取引が発生したブロック#%(block)sを見るにはここをクリックしてください。", diff --git a/app/assets/locales/locale-ko.json b/app/assets/locales/locale-ko.json index 75bfccb015..fdb00e62c4 100644 --- a/app/assets/locales/locale-ko.json +++ b/app/assets/locales/locale-ko.json @@ -1432,7 +1432,7 @@ "propose_tip": "Propose another user to initiate a transaction", "proxy_remove": "You have a proxy set, to remove it simply clear this input field", "proxy_search": "Search for an account to be used as your proxy for voting", - "settle": "Settling will let you convert your holdings of %(asset)s to BTS after a delay of 24 hours, at a price equal to the feed price at that time.", + "settle": "Settling will let you convert your holdings of %(asset)s to %(backingAsset)s after a delay of %(settleDelay)s hours, at a price equal to the feed price at that time.", "settle_price": "This is the price at which settle orders will execute.", "show_asset": "Click here to show this asset in the main list.", "show_block": "Click here to show block #%(block)s where this transaction occured.", diff --git a/app/assets/locales/locale-ru.json b/app/assets/locales/locale-ru.json index ea9b528ae7..5a1cdd2f99 100644 --- a/app/assets/locales/locale-ru.json +++ b/app/assets/locales/locale-ru.json @@ -1432,7 +1432,7 @@ "propose_tip": "Предложить другому пользователю инициировать транзакцию", "proxy_remove": "You have a proxy set, to remove it simply clear this input field", "proxy_search": "Search for an account to be used as your proxy for voting", - "settle": "Погашение позволит Вам обменять Ваши %(asset)s на BTS с задержкой в 24 часа по цене, равной цене котировки на момент погашения.", + "settle": "Погашение позволит Вам обменять Ваши %(asset)s на %(backingAsset)s с задержкой в %(settleDelay)s часа по цене, равной цене котировки на момент погашения.", "settle_price": "Это цена, при которой будут исполнятся ордера на погашение.", "show_asset": "Нажмите здесь, чтобы отобразить этот актив в основном списке.", "show_block": "Нажмите здесь, чтобы увидеть блок #%(block)s, в котором произведена транзакция.", diff --git a/app/assets/locales/locale-tr.json b/app/assets/locales/locale-tr.json index b4edcbcc5c..bdcfad6fc1 100644 --- a/app/assets/locales/locale-tr.json +++ b/app/assets/locales/locale-tr.json @@ -1432,7 +1432,7 @@ "propose_tip": "Propose another user to initiate a transaction", "proxy_remove": "You have a proxy set, to remove it simply clear this input field", "proxy_search": "Search for an account to be used as your proxy for voting", - "settle": "Sona erdirme işlemi dijital varlıklarınızı 24 saatlik bir gecikme ile o anki fiyat üzerinden BTS'ye dönüştürmenizi sağlar", + "settle": "Sona erdirme işlemi dijital varlıklarınızı %(settleDelay)s saatlik bir gecikme ile o anki fiyat üzerinden %(backingAsset)s'ye dönüştürmenizi sağlar", "settle_price": "Sona erdirilen emirlerin gerçekleşeceği fiyat", "show_asset": "Bu dijital varlığı ana listede göstermek için tıklayın.", "show_block": "İşlemin gerçekleşmiş olduğu #%(block)s numaralı bloğa bakmak için buraya tıklayın.", diff --git a/app/assets/locales/locale-zh.json b/app/assets/locales/locale-zh.json index 28cc26a981..11d2919d2b 100644 --- a/app/assets/locales/locale-zh.json +++ b/app/assets/locales/locale-zh.json @@ -1432,7 +1432,7 @@ "propose_tip": "提议另一个用户发起交易", "proxy_remove": "You have a proxy set, to remove it simply clear this input field", "proxy_search": "Search for an account to be used as your proxy for voting", - "settle": "使用清算功能,你可以在24小时后以当时的清算价将你的 %(asset)s 资产转换为对应抵押资产", + "settle": "Settling will let you convert your holdings of %(asset)s to %(backingAsset)s after a delay of %(settleDelay)s hours, at a price equal to the feed price at that time.", "settle_price": "清算单执行时将使用的价格", "show_asset": "在主列表中显示资产", "show_block": "显示收录交易的区块 #%(block)s 的信息", diff --git a/app/components/Account/AccountPortfolioList.jsx b/app/components/Account/AccountPortfolioList.jsx index 425b2a52d4..127d89002f 100644 --- a/app/components/Account/AccountPortfolioList.jsx +++ b/app/components/Account/AccountPortfolioList.jsx @@ -414,6 +414,12 @@ class AccountPortfolioList extends React.Component { asset ); + {/* Asset and Backing Asset Prefixes */} + let options = asset && asset.has("bitasset") ? asset.getIn(["bitasset", "options"]).toJS() : null; + let backingAsset = options && options.short_backing_asset ? ChainStore.getAsset(options.short_backing_asset) : null; + let {isBitAsset: isAssetBitAsset} = utils.replaceName(asset); + let {isBitAsset: isBackingBitAsset} = utils.replaceName(backingAsset); + let preferredAsset = ChainStore.getAsset(preferredUnit); this.valueRefs[asset.get("symbol")] = hasBalance && !!preferredAsset @@ -577,7 +583,11 @@ class AccountPortfolioList extends React.Component { data-place="bottom" data-tip={counterpart.translate( "tooltip.settle", - {asset: symbol} + { + asset: isAssetBitAsset ? "bit" + symbol : symbol, + backingAsset: isBackingBitAsset ? "bit" + backingAsset.get("symbol") : backingAsset.get("symbol"), + settleDelay: options.force_settlement_delay_sec / 3600 + } )} > {settleLink}