Skip to content

Commit 89beac9

Browse files
author
heyajohnny
committed
Adjusted some translations
1 parent 5193cf6 commit 89beac9

File tree

4 files changed

+23
-49
lines changed

4 files changed

+23
-49
lines changed

Version

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ Version: 0.1.7 20230330 - Better exception
1919
Version: 1.0.0 20241119 - Complete refactor
2020
Version: 1.0.1 20241120 - Updated hacs.json + removed multiplier from identifier
2121
Version: 1.0.2 20241121 - Added cryptocurrency_id, cryptocurrency_name, cryptocurrency_symbol and currency_name to attributes
22-
Version: 1.0.3 20241123 - Fix for empty id and unit_of_measurement
22+
Version: 1.0.3 20241123 - Fix for empty id and unit_of_measurement
23+
Version: 1.0.4 20241208 - Adjusted some translations

custom_components/cryptoinfo/config_flow.py

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,6 @@
2525
DOMAIN,
2626
)
2727

28-
PLACEHOLDERS = {
29-
"description_help": "For more information, see the <a href='https://github.com/heyajohnny/cryptoinfo' target='_blank'>documentation</a>.",
30-
"id_help": "Unique name for the sensor",
31-
"currency_name_help": "One of the currency names in <a href='https://api.coingecko.com/api/v3/simple/supported_vs_currencies' target='_blank'>this list</a>.",
32-
"cryptocurrency_ids_help": "The 'id' values from one or more of the coins/tokens in <a href='https://api.coingecko.com/api/v3/coins/list' target='_blank'>this list</a>. seperated by , characters",
33-
"unit_of_measurement_help": "Do you want to use a currency symbol? (<a href='https://en.wikipedia.org/wiki/Currency_symbol#List_of_currency_symbols_currently_in_use' target='_blank'>Symbol list</a>)",
34-
"multipliers_help": "The number of coins/tokens (seperated by a , character). The number of Multipliers must match the number of Cryptocurrency id's",
35-
"update_frequency_help": "How often should the value be refreshed? Beware of the <a href='https://support.coingecko.com/hc/en-us/articles/4538771776153-What-is-the-rate-limit-for-CoinGecko-API-public-plan' target='_blank'>CoinGecko rate limit</a> when tracking multiple cryptocurrencies.",
36-
"min_time_between_requests_help": "The minimum time between the other entities and this entity to make a data request to the API. (This property is shared and the same for every entity)",
37-
}
38-
3928

4029
class CryptoInfoConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
4130
VERSION = 1
@@ -157,7 +146,7 @@ async def _redo_configuration(
157146
step_id="reconfigure",
158147
data_schema=cryptoinfo_schema,
159148
errors=errors,
160-
description_placeholders={**PLACEHOLDERS, **count_context},
149+
description_placeholders={**count_context},
161150
)
162151

163152
async def async_step_user(self, user_input: dict[str, Any] | None = None):
@@ -220,10 +209,7 @@ async def async_step_user(self, user_input: dict[str, Any] | None = None):
220209

221210
if user_input is None:
222211
return self.async_show_form(
223-
step_id="user",
224-
data_schema=cryptoinfo_schema,
225-
errors=errors,
226-
description_placeholders=PLACEHOLDERS,
212+
step_id="user", data_schema=cryptoinfo_schema, errors=errors
227213
)
228214

229215
try:
@@ -235,7 +221,7 @@ async def async_step_user(self, user_input: dict[str, Any] | None = None):
235221
step_id="user",
236222
data_schema=cryptoinfo_schema,
237223
errors=validation_result,
238-
description_placeholders={**PLACEHOLDERS, **count_context},
224+
description_placeholders={**count_context},
239225
)
240226

241227
await self.async_set_unique_id(user_input[CONF_ID])
@@ -255,8 +241,5 @@ async def async_step_user(self, user_input: dict[str, Any] | None = None):
255241
_LOGGER.error(f"Error creating entry: {ex}")
256242
errors["base"] = f"Error creating entry: {ex}"
257243
return self.async_show_form(
258-
step_id="user",
259-
data_schema=cryptoinfo_schema,
260-
errors=errors,
261-
description_placeholders=PLACEHOLDERS,
244+
step_id="user", data_schema=cryptoinfo_schema, errors=errors
262245
)

custom_components/cryptoinfo/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"domain": "cryptoinfo",
33
"name": "Cryptoinfo",
4-
"version": "1.0.3",
4+
"version": "1.0.4",
55
"config_flow": true,
66
"iot_class": "cloud_polling",
77
"documentation": "https://github.com/heyajohnny/cryptoinfo",

custom_components/cryptoinfo/translations/en.json

Lines changed: 16 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"step": {
44
"user": {
55
"title": "Add new sensor",
6-
"description": "{description_help}",
6+
"description": "For more information, see the [documentation](https://github.com/heyajohnny/cryptoinfo).",
77
"data": {
88
"id": "Identifier",
99
"cryptocurrency_ids": "Cryptocurrency id's",
@@ -14,18 +14,18 @@
1414
"min_time_between_requests": "Minimum time between requests (minutes)"
1515
},
1616
"data_description": {
17-
"id": "{id_help}",
18-
"currency_name": "{currency_name_help}",
19-
"cryptocurrency_ids": "{cryptocurrency_ids_help}",
20-
"unit_of_measurement": "{unit_of_measurement_help}",
21-
"multipliers": "{multipliers_help}",
22-
"update_frequency": "{update_frequency_help}",
23-
"min_time_between_requests": "{min_time_between_requests_help}"
17+
"id": "Unique name for the sensor.",
18+
"currency_name": "One of the currency names in [this list](https://api.coingecko.com/api/v3/simple/supported_vs_currencies).",
19+
"cryptocurrency_ids": "The 'id' values from one or more of the coins/tokens in [this list](https://api.coingecko.com/api/v3/coins/list), separated by commas.",
20+
"unit_of_measurement": "Do you want to use a currency symbol? ([Symbol list](https://en.wikipedia.org/wiki/Currency_symbol#List_of_currency_symbols_currently_in_use))",
21+
"multipliers": "The number of coins/tokens (separated by a comma). The number of multipliers must match the number of cryptocurrency IDs.",
22+
"update_frequency": "How often should the value be refreshed? Beware of the [CoinGecko rate limit](https://support.coingecko.com/hc/en-us/articles/4538771776153-What-is-the-rate-limit-for-CoinGecko-API-public-plan) when tracking multiple cryptocurrencies.",
23+
"min_time_between_requests": "The minimum time between the other entities and this entity to make a data request to the API. (This property is shared and the same for every entity.)"
2424
}
2525
},
2626
"reconfigure": {
2727
"title": "Update existing sensor",
28-
"description": "{description_help}",
28+
"description": "For more information, see the [documentation](https://github.com/heyajohnny/cryptoinfo).",
2929
"data": {
3030
"id": "Identifier",
3131
"cryptocurrency_ids": "Cryptocurrency id's",
@@ -36,13 +36,13 @@
3636
"min_time_between_requests": "Minimum time between requests (minutes)"
3737
},
3838
"data_description": {
39-
"id": "{id_help}",
40-
"currency_name": "{currency_name_help}",
41-
"cryptocurrency_ids": "{cryptocurrency_ids_help}",
42-
"unit_of_measurement": "{unit_of_measurement_help}",
43-
"multipliers": "{multipliers_help}",
44-
"update_frequency": "{update_frequency_help}",
45-
"min_time_between_requests": "{min_time_between_requests_help}"
39+
"id": "Unique name for the sensor.",
40+
"currency_name": "One of the currency names in [this list](https://api.coingecko.com/api/v3/simple/supported_vs_currencies).",
41+
"cryptocurrency_ids": "The 'id' values from one or more of the coins/tokens in [this list](https://api.coingecko.com/api/v3/coins/list), separated by commas.",
42+
"unit_of_measurement": "Do you want to use a currency symbol? ([Symbol list](https://en.wikipedia.org/wiki/Currency_symbol#List_of_currency_symbols_currently_in_use))",
43+
"multipliers": "The number of coins/tokens (separated by a comma). The number of multipliers must match the number of cryptocurrency IDs.",
44+
"update_frequency": "How often should the value be refreshed? Beware of the [CoinGecko rate limit](https://support.coingecko.com/hc/en-us/articles/4538771776153-What-is-the-rate-limit-for-CoinGecko-API-public-plan) when tracking multiple cryptocurrencies.",
45+
"min_time_between_requests": "The minimum time between the other entities and this entity to make a data request to the API. (This property is shared and the same for every entity.)"
4646
}
4747
}
4848
},
@@ -54,15 +54,5 @@
5454
"cannot_connect": "Error: Cannot connect",
5555
"mismatch_values": "The number of cryptocurrency id's ({crypto_count}) does not match the number of multipliers ({multiplier_count})"
5656
}
57-
},
58-
"description_placeholders": {
59-
"description_help": "For more information, see the <a href='https://github.com/heyajohnny/cryptoinfo' target='_blank'>documentation</a>.",
60-
"id_help": "Unique name for the sensor",
61-
"currency_name_help": "One of the currency names in <a href='https://api.coingecko.com/api/v3/simple/supported_vs_currencies' target='_blank'>this list</a>.",
62-
"cryptocurrency_ids_help": "The 'id' values from one or more of the coins/tokens in <a href='https://api.coingecko.com/api/v3/coins/list' target='_blank'>this list</a>. seperated by , characters",
63-
"unit_of_measurement_help": "Do you want to use a currency symbol? (<a href='https://en.wikipedia.org/wiki/Currency_symbol#List_of_currency_symbols_currently_in_use' target='_blank'>Symbol list</a>)",
64-
"multipliers_help": " The number of coins / tokens (seperated by a , character). The number of Multipliers must match the number of Cryptocurrency id's",
65-
"update_frequency_help": "How often should the value be refreshed? Beware of the <a href='https://support.coingecko.com/hc/en-us/articles/4538771776153-What-is-the-rate-limit-for-CoinGecko-API-public-plan' target='_blank'>CoinGecko rate limit</a> when tracking multiple cryptocurrencies.",
66-
"min_time_between_requests_help": "The minimum time between the other entities and this entity to make a data request to the API. (This property is shared and the same for every entity)"
6757
}
6858
}

0 commit comments

Comments
 (0)