Skip to content
This repository has been archived by the owner on Sep 8, 2020. It is now read-only.

Support language-specific plural forms of coins #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions app/locales/en/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ application.commands.export_logs = Export the global logs
application.singleton.alert_message = The {APPLICATION_NAME} application is already running. Please close it first and try again.

# Common
common.bitcoin_plural = bitcoins
common.litecoin_plural = litecoins
common.dogecoin_plural = dogecoins
common.dash_plural = dash
common.zcash_plural = zcash
common.clubcoin_plural = clubcoins
common.default_account_name = My account
common.default_recovered_account_name = Recovered account %d
common.date_time_format = L [at] LT
Expand Down
16 changes: 8 additions & 8 deletions app/src/bitcoin/networks.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ ledger.bitcoin.Networks =
bitcoin:
name: 'bitcoin'
bolosAppName: 'Bitcoin'
plural: 'bitcoins'
plural: -> t('common.bitcoin_plural')
ticker: 'btc'
scheme: 'bitcoin:'
tickerKey:
Expand All @@ -46,7 +46,7 @@ ledger.bitcoin.Networks =

testnet:
name: 'testnet'
plural: 'bitcoins'
plural: -> t('common.bitcoin_plural')
ticker: 'btctest'
scheme: 'bitcoin:'
bip44_coin_type: '1'
Expand All @@ -60,7 +60,7 @@ ledger.bitcoin.Networks =

segnet:
name: 'segnet'
plural: 'bitcoins'
plural: -> t('common.bitcoin_plural')
ticker: 'segtest'
scheme: 'bitcoin:'
bip44_coin_type: '1'
Expand All @@ -83,7 +83,7 @@ ledger.bitcoin.Networks =

litecoin:
name: 'litecoin'
plural: 'litecoins'
plural: -> t('common.litecoin_plural')
scheme: 'litecoin:'
bolosAppName: 'Litecoin'
ticker: 'ltc'
Expand All @@ -101,7 +101,7 @@ ledger.bitcoin.Networks =

dogecoin:
name: 'dogecoin'
plural: 'dogecoins'
plural: -> t('common.dogecoin_plural')
scheme: 'dogecoin:'
bolosAppName: 'Dogecoin'
ticker: 'doge'
Expand All @@ -119,7 +119,7 @@ ledger.bitcoin.Networks =

dash:
name: 'dash'
plural: 'dash'
plural: -> t('common.dash_plural')
scheme: 'dash:'
bolosAppName: 'Dash'
ticker: 'dash'
Expand All @@ -137,7 +137,7 @@ ledger.bitcoin.Networks =

zcash:
name: 'zcash'
plural: 'zcash'
plural: -> t('common.zcash_plural')
scheme: 'zcash:'
bolosAppName: 'Zcash'
ticker: 'zec'
Expand All @@ -155,7 +155,7 @@ ledger.bitcoin.Networks =

clubcoin:
name: 'clubcoin'
plural: 'clubcoins'
plural: -> t('common.clubcoin_plural')
scheme: 'clubcoin:'
bolosAppName: 'ClubCoin'
ticker: 'club'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ class @AppsCoinkiteDashboardCompatibilityDialogViewController extends ledger.com
dialog.show()
else
@dismiss =>
dialog = new CommonDialogsMessageDialogViewController(kind: "error", title: t("apps.coinkite.dashboard.compatibility.fail"), subtitle: _.str.sprintf(t("apps.coinkite.dashboard.compatibility.fail_text"), ledger.config.network.plural))
dialog = new CommonDialogsMessageDialogViewController(kind: "error", title: t("apps.coinkite.dashboard.compatibility.fail"), subtitle: _.str.sprintf(t("apps.coinkite.dashboard.compatibility.fail_text"), ledger.config.network.plural()))
dialog.show()
8 changes: 4 additions & 4 deletions app/src/routes.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,17 @@ ledger.router.pluggedWalletRoutesExceptions = [
route '/onboarding/device/wrongpin', (params) ->
app.router.go '/onboarding/device/error',
message: _.str.sprintf t('onboarding.device.errors.wrongpin.tries_left'), params['?params'].tries_left
indication: _.str.sprintf(t('onboarding.device.errors.wrongpin.unplug_plug'), ledger.config.network.plural)
indication: _.str.sprintf(t('onboarding.device.errors.wrongpin.unplug_plug'), ledger.config.network.plural())

route '/onboarding/device/frozen', (params) ->
app.router.go '/onboarding/device/error',
serious: yes
message: _.str.sprintf(t('onboarding.device.errors.frozen.blank_next_time'), ledger.config.network.plural)
indication: _.str.sprintf(t('onboarding.device.errors.frozen.unplug_plug'), ledger.config.network.plural)
message: _.str.sprintf(t('onboarding.device.errors.frozen.blank_next_time'), ledger.config.network.plural())
indication: _.str.sprintf(t('onboarding.device.errors.frozen.unplug_plug'), ledger.config.network.plural())

route '/onboarding/device/forged', (params) ->
app.router.go '/onboarding/device/error',
message: _.str.sprintf(t('onboarding.device.errors.forged.forbidden_access'), ledger.config.network.plural)
message: _.str.sprintf(t('onboarding.device.errors.forged.forbidden_access'), ledger.config.network.plural())
indication: t 'onboarding.device.errors.forged.get_help'

route '/onboarding/device/swapped_bip39_provisioning', (params) ->
Expand Down
2 changes: 1 addition & 1 deletion app/views/onboarding/management/done.eco
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<img src="../../assets/images/common/large_<%= if @params.error? then 'error' else 'check' %>.png" width="50" height="50" />
<div class="black-indication"><%= if @params.error? then t 'onboarding.management.done.configuration_failed_' + @params.wallet_mode else t 'onboarding.management.done.configuration_is_complete_' + @params.wallet_mode %></div>
<% if not @params.error?: %>
<div class="medium-indication"><%= _.str.sprintf(t('onboarding.management.done.unplug_plug'), ledger.config.network.plural) %></div>
<div class="medium-indication"><%= _.str.sprintf(t('onboarding.management.done.unplug_plug'), ledger.config.network.plural()) %></div>
<% else: %>
<a href="#openSupport" class="action-rounded-button"><%= t 'onboarding.management.done.contact_support' %></a>
<% end %>
Expand Down
4 changes: 2 additions & 2 deletions app/views/onboarding/management/recoverydevice.eco
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
<div class="titles">
<div class="page-title"><%= t 'onboarding.management.recover_my_wallet' %></div>
<div class="page-subtitle"><%= t 'application.name' %></div>
<div class="page-strong-indication"><%= _.str.sprintf(t('onboarding.management.recoverydevice.recovering_on_new_wallet'), ledger.config.network.plural) %></div>
<div class="page-strong-indication"><%= _.str.sprintf(t('onboarding.management.recoverydevice.recovering_on_new_wallet'), ledger.config.network.plural()) %></div>
<div class="page-indication"><%= t 'onboarding.management.recoverydevice.may_need_to_convert' %></div>
</div>
</div>
<div class="page-content-container compact">
<a class="panel" href="#navigatePin">
<img src="../../assets/images/onboarding/management/existing_ledger_wallet.png" width="92" height="21"/>
<div class="title"><%= t 'onboarding.management.recoverydevice.no_its_the_same' %></div>
<div class="subtitle"><%= _.str.sprintf(t('onboarding.management.recoverydevice.i_froze_my_device'), ledger.config.network.plural) %></div>
<div class="subtitle"><%= _.str.sprintf(t('onboarding.management.recoverydevice.i_froze_my_device'), ledger.config.network.plural()) %></div>
</a>
<a class="panel" href="#navigateConvert">
<img src="../../assets/images/onboarding/management/new_ledger_wallet.png" width="112" height="32"/>
Expand Down
2 changes: 1 addition & 1 deletion app/views/onboarding/management/seed.eco
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<div class="page-content-container">
<div id="seed_container"></div>
<div id="invalid_label"><span class="invalid-indication"><%= t 'onboarding.management.seed.invalid_recovery_phrase' %></span></div>
<div id="indication_label"><span class="black-indication-strong"><%= t 'onboarding.management.seed.it_wont_be_displayed_again' %></span> <span class="black-indication"><%= _.str.sprintf(t('onboarding.management.seed.without_it'), ledger.config.network.plural) %></span></div>
<div id="indication_label"><span class="black-indication-strong"><%= t 'onboarding.management.seed.it_wont_be_displayed_again' %></span> <span class="black-indication"><%= _.str.sprintf(t('onboarding.management.seed.without_it'), ledger.config.network.plural()) %></span></div>
</div>
<div class="navigation-container">
<a class="back" href="#navigateRoot" id="back_button"><i class="fa fa-angle-left"></i> <%= t 'onboarding.management.cancel' %></a>
Expand Down
2 changes: 1 addition & 1 deletion app/views/onboarding/management/summary.eco
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<div class="texts">
<span class="black-title"><%= t 'onboarding.management.summary.your_wallet_is' %></span>
<span class="black-strong-title"><%= t 'onboarding.management.summary.almost_ready' %></span>
<div class="black-indication"><%= _.str.sprintf((if @params.wallet_mode == 'create' then t 'onboarding.management.summary.use_your_bitcoins_create' else t 'onboarding.management.summary.use_your_bitcoins_other'), ledger.config.network.plural)%></div>
<div class="black-indication"><%= _.str.sprintf((if @params.wallet_mode == 'create' then t 'onboarding.management.summary.use_your_bitcoins_create' else t 'onboarding.management.summary.use_your_bitcoins_other'), ledger.config.network.plural())%></div>
</div>
</div>
<div class="page-content-container">
Expand Down
2 changes: 1 addition & 1 deletion app/views/onboarding/management/welcome.eco
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<img class="index" src="../../assets/images/onboarding/management/restore_icon.png" width="40" height="40"/>
<div class="texts">
<div class="black-title"><%= t 'onboarding.management.welcome.recover_wallet' %></div>
<div class="black-indication"><%= _.str.sprintf(t('onboarding.management.welcome.if_you_lost_your_wallet'), ledger.config.network.plural) %></div>
<div class="black-indication"><%= _.str.sprintf(t('onboarding.management.welcome.if_you_lost_your_wallet'), ledger.config.network.plural()) %></div>
</div>
<img class="arrow" src="../assets/images/onboarding/large_right_arrow.png" width="16" height="30"/>
</a>
Expand Down
2 changes: 1 addition & 1 deletion app/views/update/done.eco
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div id="view_controller_content">
<img src="../assets/images/common/large_check.png" width="50" height="50" />
<div class="page-large-indication"><%- t 'update.done.successfully_updated' %></div>
<div class="page-indication"><%- _.str.sprintf(t(if @params.provisioned then 'update.done.enjoy' else 'update.done.use_24_words'), ledger.config.network.plural)%></div>
<div class="page-indication"><%- _.str.sprintf(t(if @params.provisioned then 'update.done.enjoy' else 'update.done.use_24_words'), ledger.config.network.plural())%></div>
</div>
2 changes: 1 addition & 1 deletion app/views/update/erasing.eco
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div id="view_controller_content">
<img src="../assets/images/update/flash.png" width="50" height="50" />
<div class="page-large-indication"><%- t 'update.erasing.ready_to_start_process' %></div>
<div class="page-indication"><%- _.str.sprintf(t('update.erasing.clicking_continue'), ledger.config.network.plural) %></div>
<div class="page-indication"><%- _.str.sprintf(t('update.erasing.clicking_continue'), ledger.config.network.plural()) %></div>
<div class="regular-grey-text-small"><%= t 'update.erasing.please_note' %></div>
</div>
2 changes: 1 addition & 1 deletion app/views/update/index.eco
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div id="view_controller_content">
<div class="page-large-indication"><%- _.str.sprintf(t('update.index.update_process'), ledger.config.network.plural) %></div>
<div class="page-large-indication"><%- _.str.sprintf(t('update.index.update_process'), ledger.config.network.plural()) %></div>
<div class="page-indication"><%- t 'update.index.clicking_continue' %></div>
<div class="regular-grey-text-small"><%= t 'update.index.please_note' %></div>
</div>
4 changes: 2 additions & 2 deletions app/views/wallet/receive/index.eco
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<section id="receive_index_dialog">
<header>
<h1><%= _.str.sprintf(t('wallet.receive.index.title'), ledger.config.network.plural) %></h1>
<h1><%= _.str.sprintf(t('wallet.receive.index.title'), ledger.config.network.plural()) %></h1>
</header>
<table class="no-table-head">
<tbody>
Expand Down Expand Up @@ -33,7 +33,7 @@
<div>
<div id="qrcode_frame"></div>
</div>
<p class="regular-grey-text-small"><%- _.str.sprintf(t('wallet.receive.index.qr_code_explanation'), ledger.config.network.plural) %></p>
<p class="regular-grey-text-small"><%- _.str.sprintf(t('wallet.receive.index.qr_code_explanation'), ledger.config.network.plural()) %></p>
</div>
</section>
<div class="dialog-actions-bar">
Expand Down
2 changes: 1 addition & 1 deletion app/views/wallet/send/card.eco
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<section id="send_card_dialog">
<header>
<h1><%= _.str.sprintf(t('wallet.send.common.send_bitcoins'), ledger.config.network.plural) %></h1>
<h1><%= _.str.sprintf(t('wallet.send.common.send_bitcoins'), ledger.config.network.plural()) %></h1>
</header>
<div class="regular-text"><%- t 'wallet.send.card.grab_your_card' %></div>
<div id="validation_container">
Expand Down
2 changes: 1 addition & 1 deletion app/views/wallet/send/index.eco
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<section id="send_index_dialog">
<header>
<h1><%= _.str.sprintf(t('wallet.send.common.send_bitcoins'), ledger.config.network.plural) %></h1>
<h1><%= _.str.sprintf(t('wallet.send.common.send_bitcoins'), ledger.config.network.plural()) %></h1>
</header>
<table class="no-table-head">
<tbody>
Expand Down
2 changes: 1 addition & 1 deletion app/views/wallet/send/method.eco
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<section id="send_method_dialog">
<header>
<h1><%= _.str.sprintf(t('wallet.send.common.send_bitcoins'), ledger.config.network.plural) %></h1>
<h1><%= _.str.sprintf(t('wallet.send.common.send_bitcoins'), ledger.config.network.plural()) %></h1>
</header>
<div class="regular-text"><%- t 'wallet.send.method.select_method' %></div>
<div id="mobile_table_container"></div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/wallet/send/mobile.eco
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<section id="send_mobile_dialog">
<header>
<h1><%= _.str.sprintf(t('wallet.send.common.send_bitcoins'), ledger.config.network.plural) %></h1>
<h1><%= _.str.sprintf(t('wallet.send.common.send_bitcoins'), ledger.config.network.plural()) %></h1>
</header>
<div id="content_container">
<img src="../assets/images/wallet/pairing_icon.png" width="108" height="60" />
Expand Down
2 changes: 1 addition & 1 deletion app/views/wallet/send/preparing.eco
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<section id="send_preparing_dialog">
<header>
<h1><%= _.str.sprintf(t('wallet.send.common.send_bitcoins'), ledger.config.network.plural) %></h1>
<h1><%= _.str.sprintf(t('wallet.send.common.send_bitcoins'), ledger.config.network.plural()) %></h1>
</header>
<div id="content_container">
<div class="regular-text"><%= t 'wallet.send.preparing.preparing_transaction' %></div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/wallet/send/processing.eco
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<section id="send_processing_dialog">
<header>
<h1><%= _.str.sprintf(t('wallet.send.common.send_bitcoins'), ledger.config.network.plural) %></h1>
<h1><%= _.str.sprintf(t('wallet.send.common.send_bitcoins'), ledger.config.network.plural()) %></h1>
</header>
<div id="content_container">
<div class="regular-text"><%= t 'wallet.send.processing.finalizing_transaction' %></div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/wallet/send/sign.eco
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<section id="send_validating_dialog">
<header>
<h1><%= _.str.sprintf(t('wallet.send.common.send_bitcoins'), ledger.config.network.plural) %></h1>
<h1><%= _.str.sprintf(t('wallet.send.common.send_bitcoins'), ledger.config.network.plural()) %></h1>
</header>
<div id="validating" class="content-container">
<div class="regular-text"><%= t 'wallet.send.validating.validating_transaction' %></div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/wallet/send/validating.eco
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<section id="send_validating_dialog">
<header>
<h1><%= _.str.sprintf(t('wallet.send.common.send_bitcoins'), ledger.config.network.plural) %></h1>
<h1><%= _.str.sprintf(t('wallet.send.common.send_bitcoins'), ledger.config.network.plural()) %></h1>
</header>
<div id="content_container">
<div class="regular-text"><%= t 'wallet.send.validating.validating_transaction' %></div>
Expand Down