cadrumo.core.i18n._lazy_catalogue module¶
On-demand lazy-loading locale catalogue with smart dot-notation shard resolution.
Provides LazyLocaleCatalogue, an immutable Mapping
that loads only the requested YAML shard files on demand, memoizing parsed values in
memory.
- class LazyLocaleCatalogue(locale, *, shard_dir=None)[source]¶
Bases:
Mapping[str,str|None]An on-demand, lazy-loading locale catalogue mapping.
Resolves translation keys on demand by mapping dot-notation keys to specific domain/Modelo YAML shards. When a key is requested, only the owning shard file is read and parsed into the in-memory cache.
- Parameters:
locale (str)
shard_dir (Path | None)