|
| None | __init__ (self, HomeAssistant hass) |
| |
| dict[str, str] | async_fetch (self, str language, str category, set[str] components) |
| |
| bool | async_is_loaded (self, str language, set[str] components) |
| |
| None | async_load (self, str language, set[str] components) |
| |
| dict[str, str] | get_cached (self, str language, str category, set[str] components) |
| |
|
| None | _async_load (self, str language, set[str] components) |
| |
| None | _build_category_cache (self, str language, set[str] components, dict[str, dict[str, Any]] translation_strings) |
| |
| dict[str, str] | _validate_placeholders (self, str language, dict[str, str] updated_resources, dict[str, str]|None cached_resources=None) |
| |
Cache for flattened translations.
Definition at line 147 of file translation.py.
◆ __init__()
| None homeassistant.helpers.translation._TranslationCache.__init__ |
( |
|
self, |
|
|
HomeAssistant |
hass |
|
) |
| |
◆ _async_load()
| None homeassistant.helpers.translation._TranslationCache._async_load |
( |
|
self, |
|
|
str |
language, |
|
|
set[str] |
components |
|
) |
| |
|
private |
Populate the cache for a given set of components.
Definition at line 211 of file translation.py.
◆ _build_category_cache()
| None homeassistant.helpers.translation._TranslationCache._build_category_cache |
( |
|
self, |
|
|
str |
language, |
|
|
set[str] |
components, |
|
|
dict[str, dict[str, Any]] |
translation_strings |
|
) |
| |
|
private |
◆ _validate_placeholders()
| dict[str, str] homeassistant.helpers.translation._TranslationCache._validate_placeholders |
( |
|
self, |
|
|
str |
language, |
|
|
dict[str, str] |
updated_resources, |
|
|
dict[str, str] | None |
cached_resources = None |
|
) |
| |
|
private |
Validate if updated resources have same placeholders as cached resources.
Definition at line 258 of file translation.py.
◆ async_fetch()
| dict[str, str] homeassistant.helpers.translation._TranslationCache.async_fetch |
( |
|
self, |
|
|
str |
language, |
|
|
str |
category, |
|
|
set[str] |
components |
|
) |
| |
Load resources into the cache and return them.
Definition at line 181 of file translation.py.
◆ async_is_loaded()
| bool homeassistant.helpers.translation._TranslationCache.async_is_loaded |
( |
|
self, |
|
|
str |
language, |
|
|
set[str] |
components |
|
) |
| |
Return if the given components are loaded for the language.
Definition at line 159 of file translation.py.
◆ async_load()
| None homeassistant.helpers.translation._TranslationCache.async_load |
( |
|
self, |
|
|
str |
language, |
|
|
set[str] |
components |
|
) |
| |
◆ get_cached()
| dict[str, str] homeassistant.helpers.translation._TranslationCache.get_cached |
( |
|
self, |
|
|
str |
language, |
|
|
str |
category, |
|
|
set[str] |
components |
|
) |
| |
◆ __slots__
| tuple homeassistant.helpers.translation._TranslationCache.__slots__ = ("hass", "cache_data", "lock") |
|
staticprivate |
◆ cache_data
| homeassistant.helpers.translation._TranslationCache.cache_data |
◆ hass
| homeassistant.helpers.translation._TranslationCache.hass |
◆ lock
| homeassistant.helpers.translation._TranslationCache.lock |
The documentation for this class was generated from the following file: