cadrumo.core.i18n.routing module

Deterministic dot-notation routing for domain- and Modelo-sharded locale catalogues.

Translates dotted translation keys to their relative shard paths within a locale catalogue directory tree.

Shard taxonomy: - modelo.schema.<id>.* -> modelo/schema/<id>.yml - other modelo.* -> modelo/general.yml - <domain>.* where domain in SHARD_TOP_DOMAINS -> <domain>.yml - everything else -> common.yml

SHARD_TOP_DOMAINS: frozenset[str]

Top-level domains that receive dedicated shard files in each locale directory.

route_key_to_shard(dotted_key)[source]

Return the relative shard path for a dotted translation key.

Parameters:

dotted_key (str) – Dotted translation key (e.g. cli.root.app_help, modelo.schema.303.casilla.continuidad.dr303-01.label).

Return type:

Path

Returns:

A relative Path pointing to the owning YAML shard within a language catalogue directory (e.g. cli.yml, modelo/schema/303.yml).