Skip to content

Locales and formatting

Gil Cleber Barboza edited this page Nov 12, 2026 · 1 revision

Locales and formatting

meta.locale (default "pt-BR", accepts pt-BR/pt_BR) drives all masks via Babel/CLDR. meta.currency overrides the ISO code (default: the locale's territory currency).

Mask pt-BR en-US
int 1.234 1,234
float 1.234,50 1,234.50
percent (fraction) 9,10% 9.10%
currency R$ 1.234,50 $1,234.50
bool Yes/No Yes/No
date localized for date/datetime objects; strings pass through same

Unknown locales raise ValueError. Unconvertible values fall back to str(value); None renders empty.

Python API: format_value(value, mask, locale="pt-BR", currency=None).

The page footer (date/page strings) also follows meta.locale (pt → "Impresso em / Página X de Y"). Override per call from the CLI: isis-report generate order.toon --locale en-US.

Clone this wiki locally