"""Typed translation-key primitives for localized AEAT messages.Defines :class:`Translatable`, the string subtype imported as ``tr`` bycatalogues and diagnostic records whose importance is carried separately by:class:`BaseSeverity`."""from__future__importannotationsfrompydanticimportGetCoreSchemaHandlerfrompydantic_coreimportcore_schemafrom..errors.hierarchyimportpydantic_validation_boundary
[docs]classTranslatable(str):"""A strictly-typed marker for abstract i18n keys. Used to type-hint fields that hold translation keys rather than raw user-facing strings, ensuring all translatable text can be statically identified and routed through ``tr``. """@classmethoddef__get_pydantic_core_schema__(cls,source_type:type[object],handler:GetCoreSchemaHandler,)->core_schema.CoreSchema:"""Expose translation-key values to Pydantic as strings."""delsource_type,handlerreturncore_schema.no_info_after_validator_function(pydantic_validation_boundary(cls),core_schema.str_schema())