Skip to content

Commit

Permalink
fix messages [#24]
Browse files Browse the repository at this point in the history
  • Loading branch information
BigNocciolino committed Feb 21, 2022
1 parent b1a9a24 commit cf80b68
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions custom_components/cryptostate/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ async def async_step_user(self, user_input=None):
return self.async_create_entry(
title=user_input[CONF_NAME], data=user_input
)
else:
self._errors["base"] = "invalid_format"

return await self._show_config_form(user_input)

Expand Down Expand Up @@ -65,8 +63,10 @@ async def _test_credentials(self, crypto, base):
if base in currencies:
return True
else:
self._errors[CONF_BASE] = "invalid_base"
return False
else:
self._errors[CONF_CRYPTO] = "invalid_crypto"
return False
except Exception:
pass
Expand Down
8 changes: 5 additions & 3 deletions custom_components/cryptostate/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@
"description": "If you need help, go on the component page: https://github.com/BigNocciolino/CryptoTracker",
"data": {
"name": "Name",
"crypto": "Crypto",
"base": "Base"
"crypto": "Crypto ticker",
"base": "Base ticker"
}
}
},
"error": {
"invalid_format": "Invalid format, for a list of supported currencies see: https://cdn.jsdelivr.net/gh/fawazahmed0/currency-api@1/latest/currencies.json"
"invalid_crypto": "Invalid crypto format, for a list of supported currencies see: https://cdn.jsdelivr.net/gh/fawazahmed0/currency-api@1/latest/currencies.json",
"invalid_base": "Invalid base format, for a list of supported currencies see: https://cdn.jsdelivr.net/gh/fawazahmed0/currency-api@1/latest/currencies.json"

}
}
}
3 changes: 2 additions & 1 deletion custom_components/cryptostate/translations/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
}
},
"error": {
"invalid_format": "Formato invalido, per una lista di monete supportate guarda: https://cdn.jsdelivr.net/gh/fawazahmed0/currency-api@1/latest/currencies.json"
"invalid_crypto": "Formato cryptovaluta invalido invalido, per una lista di monete supportate guarda: https://cdn.jsdelivr.net/gh/fawazahmed0/currency-api@1/latest/currencies.json",
"invalid_base": "Formato cryptovaluta invalido invalido, per una lista di monete supportate guarda: https://cdn.jsdelivr.net/gh/fawazahmed0/currency-api@1/latest/currencies.json"
}
}
}

0 comments on commit cf80b68

Please sign in to comment.