composeui.core.translationcheck¶
Check an app’s catalogs against the text its code translates.
Run it on the app’s main view; it fails on text a catalog misses or on a translation whose
{placeholders} differ from the text’s, and lists the entries no code uses:
python -m composeui.core.translationcheck examples.pipeform:PipeMainView
With --write fr, it first adds the text fr.json misses to it, translated as “” for a
translator to fill; until then, the text shows as written.
The text is found two ways: the string literals passed to tr or T (or set in a
SqliteTable’s refusals) in the source of every view of the main view, and the text
the views translate as they show it, which finds text tr gets from a variable, e.g. an
enum’s. A table’s refusals are found only in a module of a view.
- class composeui.core.translationcheck.CatalogReport[source]¶
Bases:
objectWhat a catalog lacks, or has too much of, for the text of the code.
- composeui.core.translationcheck.check_main_view(main_view_class)[source]¶
Check each catalog in
main_view_class.translations_diragainst the app’s text.- Parameters:
- Return type: