From 0d67aea7ad640acb2c52bf4216634cd32a7a1703 Mon Sep 17 00:00:00 2001 From: Yakonche <60564904+Yakonche@users.noreply.github.com> Date: Mon, 15 Mar 2021 01:10:07 +0100 Subject: [PATCH] moved currency_code&sym into main() --- locale/en_GB/LC_MESSAGES/rc_profit_calc.po | 42 ++++++++++++---------- locale/en_US/LC_MESSAGES/rc_profit_calc.po | 40 +++++++++++---------- locale/fr_FR/LC_MESSAGES/rc_profit_calc.po | 42 ++++++++++++---------- locale/rc_profit_calc.pot | 40 +++++++++++---------- rc_profit_calc.py | 21 +++++------ 5 files changed, 101 insertions(+), 84 deletions(-) diff --git a/locale/en_GB/LC_MESSAGES/rc_profit_calc.po b/locale/en_GB/LC_MESSAGES/rc_profit_calc.po index 1d87e34..769de1f 100644 --- a/locale/en_GB/LC_MESSAGES/rc_profit_calc.po +++ b/locale/en_GB/LC_MESSAGES/rc_profit_calc.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Rollercoin Profit Calculator 0.1.0\n" "Report-Msgid-Bugs-To: yakonche@gmail.com\n" -"POT-Creation-Date: 2021-03-15 00:19+0100\n" +"POT-Creation-Date: 2021-03-15 01:00+0100\n" "PO-Revision-Date: 2021-03-14 14:53+0100\n" "Last-Translator: \n" "Language: en_GB\n" @@ -19,62 +19,66 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Generated-By: Babel 2.9.0\n" -#: rc_profit_calc.py:35 -msgid "usd" -msgstr "gbp" - -#: rc_profit_calc.py:36 -msgid "$" -msgstr "£" - -#: rc_profit_calc.py:80 +#: rc_profit_calc.py:78 #, fuzzy msgid "" "\n" " Enter your hashrate (TH/s) : " msgstr "" +#: rc_profit_calc.py:80 +msgid "usd" +msgstr "gbp" + +#: rc_profit_calc.py:81 +msgid "$" +msgstr "£" + #: rc_profit_calc.py:98 #, fuzzy msgid " Enter the {} network power (EH/s) : " msgstr "" -#: rc_profit_calc.py:134 +#: rc_profit_calc.py:105 +msgid " Enter the {} reward [default - {}] : " +msgstr "" + +#: rc_profit_calc.py:135 msgid "" " {} is the most profitable cryptocurrency to mine.\n" " {:.2f} {} of income per block.\n" " Or {} {} per block.\n" msgstr "" -#: rc_profit_calc.py:143 +#: rc_profit_calc.py:144 msgid "hour" msgstr "" -#: rc_profit_calc.py:143 +#: rc_profit_calc.py:144 msgid "day" msgstr "" -#: rc_profit_calc.py:143 +#: rc_profit_calc.py:144 msgid "week" msgstr "" -#: rc_profit_calc.py:143 +#: rc_profit_calc.py:144 msgid "month" msgstr "" -#: rc_profit_calc.py:143 +#: rc_profit_calc.py:144 msgid "year" msgstr "" -#: rc_profit_calc.py:147 +#: rc_profit_calc.py:148 msgid " This is around :" msgstr "" -#: rc_profit_calc.py:151 +#: rc_profit_calc.py:152 msgid " {:.2f} {} per {}, or {} {}" msgstr "" -#: rc_profit_calc.py:161 +#: rc_profit_calc.py:162 msgid "" "\n" " Press the Enter key to close the window.\n" diff --git a/locale/en_US/LC_MESSAGES/rc_profit_calc.po b/locale/en_US/LC_MESSAGES/rc_profit_calc.po index 872d071..bbe2e7a 100644 --- a/locale/en_US/LC_MESSAGES/rc_profit_calc.po +++ b/locale/en_US/LC_MESSAGES/rc_profit_calc.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Rollercoin Profit Calculator 0.0.5\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2021-03-15 00:19+0100\n" +"POT-Creation-Date: 2021-03-15 01:00+0100\n" "PO-Revision-Date: 2021-03-14 09:24+0000\n" "Last-Translator: FULL NAME \n" "Language: en_US\n" @@ -19,60 +19,64 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Generated-By: Babel 2.9.0\n" -#: rc_profit_calc.py:35 -msgid "usd" +#: rc_profit_calc.py:78 +msgid "" +"\n" +" Enter your hashrate (TH/s) : " msgstr "" -#: rc_profit_calc.py:36 -msgid "$" +#: rc_profit_calc.py:80 +msgid "usd" msgstr "" -#: rc_profit_calc.py:80 -msgid "" -"\n" -" Enter your hashrate (TH/s) : " +#: rc_profit_calc.py:81 +msgid "$" msgstr "" #: rc_profit_calc.py:98 msgid " Enter the {} network power (EH/s) : " msgstr "" -#: rc_profit_calc.py:134 +#: rc_profit_calc.py:105 +msgid " Enter the {} reward [default - {}] : " +msgstr "" + +#: rc_profit_calc.py:135 msgid "" " {} is the most profitable cryptocurrency to mine.\n" " {:.2f} {} of income per block.\n" " Or {} {} per block.\n" msgstr "" -#: rc_profit_calc.py:143 +#: rc_profit_calc.py:144 msgid "hour" msgstr "" -#: rc_profit_calc.py:143 +#: rc_profit_calc.py:144 msgid "day" msgstr "" -#: rc_profit_calc.py:143 +#: rc_profit_calc.py:144 msgid "week" msgstr "" -#: rc_profit_calc.py:143 +#: rc_profit_calc.py:144 msgid "month" msgstr "" -#: rc_profit_calc.py:143 +#: rc_profit_calc.py:144 msgid "year" msgstr "" -#: rc_profit_calc.py:147 +#: rc_profit_calc.py:148 msgid " This is around :" msgstr "" -#: rc_profit_calc.py:151 +#: rc_profit_calc.py:152 msgid " {:.2f} {} per {}, or {} {}" msgstr "" -#: rc_profit_calc.py:161 +#: rc_profit_calc.py:162 msgid "" "\n" " Press the Enter key to close the window.\n" diff --git a/locale/fr_FR/LC_MESSAGES/rc_profit_calc.po b/locale/fr_FR/LC_MESSAGES/rc_profit_calc.po index eb09e1a..c8f020d 100644 --- a/locale/fr_FR/LC_MESSAGES/rc_profit_calc.po +++ b/locale/fr_FR/LC_MESSAGES/rc_profit_calc.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Rollercoin Profit Calculator 0.1.0\n" "Report-Msgid-Bugs-To: yakonche@gmail.com\n" -"POT-Creation-Date: 2021-03-15 00:19+0100\n" +"POT-Creation-Date: 2021-03-15 01:00+0100\n" "PO-Revision-Date: 2021-03-14 09:24+0000\n" "Last-Translator: Yakonche \n" "Language: fr_FR\n" @@ -19,15 +19,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Generated-By: Babel 2.9.0\n" -#: rc_profit_calc.py:35 -msgid "usd" -msgstr "eur" - -#: rc_profit_calc.py:36 -msgid "$" -msgstr "€" - -#: rc_profit_calc.py:80 +#: rc_profit_calc.py:78 msgid "" "\n" " Enter your hashrate (TH/s) : " @@ -35,11 +27,23 @@ msgstr "" "\n" " Entrez votre hashrate (TH/s) : " +#: rc_profit_calc.py:80 +msgid "usd" +msgstr "eur" + +#: rc_profit_calc.py:81 +msgid "$" +msgstr "€" + #: rc_profit_calc.py:98 msgid " Enter the {} network power (EH/s) : " msgstr " Entrez la puissance du réseau {} (EH/s) : " -#: rc_profit_calc.py:134 +#: rc_profit_calc.py:105 +msgid " Enter the {} reward [default - {}] : " +msgstr "" + +#: rc_profit_calc.py:135 msgid "" " {} is the most profitable cryptocurrency to mine.\n" " {:.2f} {} of income per block.\n" @@ -49,35 +53,35 @@ msgstr "" " Soit {:.2f} {} de revenu par bloc.\n" " Ou {} {} par bloc.\n" -#: rc_profit_calc.py:143 +#: rc_profit_calc.py:144 msgid "hour" msgstr "heure" -#: rc_profit_calc.py:143 +#: rc_profit_calc.py:144 msgid "day" msgstr "jour" -#: rc_profit_calc.py:143 +#: rc_profit_calc.py:144 msgid "week" msgstr "semaine" -#: rc_profit_calc.py:143 +#: rc_profit_calc.py:144 msgid "month" msgstr "mois" -#: rc_profit_calc.py:143 +#: rc_profit_calc.py:144 msgid "year" msgstr "an" -#: rc_profit_calc.py:147 +#: rc_profit_calc.py:148 msgid " This is around :" msgstr "" -#: rc_profit_calc.py:151 +#: rc_profit_calc.py:152 msgid " {:.2f} {} per {}, or {} {}" msgstr " {:.2f} {} par {}, ou {} {}" -#: rc_profit_calc.py:161 +#: rc_profit_calc.py:162 #, fuzzy msgid "" "\n" diff --git a/locale/rc_profit_calc.pot b/locale/rc_profit_calc.pot index 51b15ab..67ead1f 100644 --- a/locale/rc_profit_calc.pot +++ b/locale/rc_profit_calc.pot @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Rollercoin Profit Calculator 0.1.0\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2021-03-15 00:19+0100\n" +"POT-Creation-Date: 2021-03-15 01:00+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,60 +18,64 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Generated-By: Babel 2.9.0\n" -#: rc_profit_calc.py:35 -msgid "usd" +#: rc_profit_calc.py:78 +msgid "" +"\n" +" Enter your hashrate (TH/s) : " msgstr "" -#: rc_profit_calc.py:36 -msgid "$" +#: rc_profit_calc.py:80 +msgid "usd" msgstr "" -#: rc_profit_calc.py:80 -msgid "" -"\n" -" Enter your hashrate (TH/s) : " +#: rc_profit_calc.py:81 +msgid "$" msgstr "" #: rc_profit_calc.py:98 msgid " Enter the {} network power (EH/s) : " msgstr "" -#: rc_profit_calc.py:134 +#: rc_profit_calc.py:105 +msgid " Enter the {} reward [default - {}] : " +msgstr "" + +#: rc_profit_calc.py:135 msgid "" " {} is the most profitable cryptocurrency to mine.\n" " {:.2f} {} of income per block.\n" " Or {} {} per block.\n" msgstr "" -#: rc_profit_calc.py:143 +#: rc_profit_calc.py:144 msgid "hour" msgstr "" -#: rc_profit_calc.py:143 +#: rc_profit_calc.py:144 msgid "day" msgstr "" -#: rc_profit_calc.py:143 +#: rc_profit_calc.py:144 msgid "week" msgstr "" -#: rc_profit_calc.py:143 +#: rc_profit_calc.py:144 msgid "month" msgstr "" -#: rc_profit_calc.py:143 +#: rc_profit_calc.py:144 msgid "year" msgstr "" -#: rc_profit_calc.py:147 +#: rc_profit_calc.py:148 msgid " This is around :" msgstr "" -#: rc_profit_calc.py:151 +#: rc_profit_calc.py:152 msgid " {:.2f} {} per {}, or {} {}" msgstr "" -#: rc_profit_calc.py:161 +#: rc_profit_calc.py:162 msgid "" "\n" " Press the Enter key to close the window.\n" diff --git a/rc_profit_calc.py b/rc_profit_calc.py index 83c694d..eca452e 100644 --- a/rc_profit_calc.py +++ b/rc_profit_calc.py @@ -32,8 +32,6 @@ "code": "fr_FR" } ] -currency_code = _("usd") -currency_sym = _("$") ctx = decimal.Context() ctx.prec = 10 @@ -57,7 +55,7 @@ def configure_language(): print( "\t{}: {} ({})".format(idx + 1, lang['name'], lang['code']) ) - lang = input("\n Select a language [default - 1]: ") or "1" + lang = input("\n Select a language [default - 1] : ") or "1" try: lang_idx = int(lang) - 1 @@ -79,6 +77,8 @@ def configure_language(): def main(): current_hashrate = float(input(_("\n Enter your hashrate (TH/s) : "))) current_hashrate /= 1000000 + currency_code = _("usd") + currency_sym = _("$") names = [ fg(255, 128, 10) + "BTC" + fg.rs, @@ -94,16 +94,17 @@ def main(): print() # \n network_powers = [ - float(input(_( - " Enter the {} network power (EH/s) : ".format(name) - ))) for name in names - ] + float(input( + _(" Enter the {} network power (EH/s) : ").format(name) + )) for name in names +] print() # \n rewards = [ - float(input(_((" Enter the {} reward [default - {}] : ") - .format(name, float2str(default)) - )) or default) for name, default in zip(names, default_rewards) + float(input( + _(" Enter the {} reward [default - {}] : ") + .format(name, float2str(default))) or default) + for name, default in zip(names, default_rewards) ] r = urllib.request.urlopen(