THE ORIONIS API
Build with clarity.
Explore the building blocks of an async-first Python framework. Every module, class, and method — connected, searchable, and ready to build with.
class ITranslationRepository(ABC): (source)
Known subclasses: orionis.localization.TranslationRepository
Define the contract for the in-memory translation cache.
A repository loads locale maps on demand and retains them according to its cache policy. Invalidation, expiration, or capacity limits may require a locale to be loaded again.
Notes
Implementations are not required to be thread-safe nor to copy the cached mapping before returning it.
| Method | flush |
Discard every cached translation map. |
| Method | forget |
Discard the cached translations for locale. |
| Method | get |
Return the translation map for locale, loading it on demand. |
| Method | has |
Determine whether locale is already cached in memory. |
| Method | loaded |
Return the locales currently held in the cache. |
| Class Variable | __slots__ |
Declare that this class introduces no additional instance slots. |
orionis.localization.TranslationRepositoryDiscard every cached translation map.
| Returns | |
None | No return value. |
orionis.localization.TranslationRepositoryReturn the translation map for locale, loading it on demand.
| Parameters | |
locale:str | Locale code whose translations are requested. |
| Returns | |
orionis.localization.types.TranslationMap | Cached translation map for the locale. The mapping is the cached instance, not a copy. |
orionis.localization.TranslationRepositoryDeclare that this class introduces no additional instance slots.