* Refactor translations to reduce dict lookups
All of our cache lookups used:
`cache[language][O(component)][category]`
The cache was designed as
`cache[language][component][category][flatted_key]`
The lookups are now
`cache[language][category][O(component)]`
The cache is now stored as
`cache[language][category][component][flatted_key]`
This allows the catch fetch to avoid looking up
the category each loop
* already a set, and we do not mutate
* add placeholder support to entity name translation
* add negativ tests
* make property also available via description
* fix doc string in translation_placeholders()
* fix detection of placeholder
* validate placeholders for localized strings
* add test
* Cache translation_placeholders property
* Make translation_placeholders uncondotionally return dict
* Fall back to unsubstituted name in case of mismatch
* Only replace failing translations with English
* Update snapshots
* Blow up on non stable releases
* Fix test
* Update entity.py
---------
Co-authored-by: Erik <erik@montnemery.com>
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
* Limit concurrency of async_get_integration to avoid creating extra threads
Since async_get_integration is waiting on the disk most of the time
it would end up creating many new threads because the disk could
not deliver the data in time.
* pylint
* Support populating list of flows from custom components
* Re-allow custom component config flows
* Add tests for custom component retrieval
* Don't crash view if no handler exist
* Use get_custom_components instead fo resolve_from_root
* Switch to using an event instead of lock
* Leave list of integrations as set
* The returned list is not guaranteed to be ordered
Backend uses a set to represent them.
* Add type hints to helpers.intent and location
* Test typing for helpers.icon, json, and typing
* Add type hints to helpers.state
* Add type hints to helpers.translation
* Add view to support backend translation fetching
* Load backend translations from component json
* Translations for season sensor
* Scripts to merge and unpack Lokalise translations
* Fix copy paste error
* Serve post-lokalise translations to frontend
* Linting
* Auto-deploy translations with Travis
* Commit post-lokalise translation files
* Split logic into more helper functions
* Fall back to English for missing keys
* Move local translation copies to `.translations`
* Linting
* Initial tests
* Remove unnecessary file check
* Convert translation helper to async/await
* Convert translation helper tests to async/await
* Use set subtraction to find missing_components
* load_translation_files use component->file mapping
* Remove duplicated resources fetching
Get to take advantage of the slick Python 3.5 dict merging here.
* Switch to live project ID