i18n missing-translation-key contract.
When i18n is enabled and JSON catalogs are present, at("key")reference to
a key missing from a catalog silently returns the key string at runtime. This
check surfaces that statically (categoryi18n_missing_key, WARNING) — a
fail-loud guarantee Django's runtime-fallback model does not give.
Scope is the key-coverage contract only. Chirp does NOT build gettext .po/.mo or an ICU pluralization engine into core; ICU formatting is deferred to babel alongside (see the i18n decision record).
contracts.rules_i18n
| Name | Type | Default | Description |
|---|---|---|---|
type
|
|
— | |
qualified_name
|
|
— | |
element_type
|
|
— | |
description
|
|
— | |
source_file
|
|
— | |
line_number
|
|
— | |
is_autodoc
|
|
— | |
autodoc_element
|
|
— | |
_autodoc_template
|
|
— | |
_autodoc_url_path
|
|
— | |
_autodoc_page_type
|
|
— | |
title
|
|
— | |
doc_content_hash
|
|
— |
Symbols on this page
check_translation_keys
function
def check_translation_keys(template_sources: dict[str, str], config: Any) -> list[ContractIssue]
Warn when a template references a translation key missing from catalogs.
Gated oni18n_enabled. For each supported locale, loads its catalog and
flagst("…")literal keys that the catalog does not define. Only fires
when a catalog for the locale actually exists (an empty/absent catalog is a
setup state, not a missing-key error).
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
template_sources
|
dict[str, str]
|
— | |
config
|
Any
|
— |
View source · /home/runner/work/chirp/chirp/site/../src/chirp/contracts/rules_i18n.py:1