Internationalisation
Activate, get and deactivate translations.
activate(locale, path=None)
Activate internationalisation.
Set locale as current locale. Search for locale in directory path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
locale
|
str | None
|
Language name, e.g. |
required |
path
|
str | Path
|
Path to search for locales. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
dict |
NullTranslations
|
Translations. |
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
If humanize cannot find the locale folder. |
Source code in .tox/docs/lib/python3.14/site-packages/humanize/i18n.py
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | |
deactivate()
Deactivate internationalisation.
Source code in .tox/docs/lib/python3.14/site-packages/humanize/i18n.py
95 96 97 | |
decimal_separator()
Return the decimal separator for a locale, default to dot.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
Decimal separator. |
Source code in .tox/docs/lib/python3.14/site-packages/humanize/i18n.py
191 192 193 194 195 196 197 | |
thousands_separator()
Return the thousands separator for a locale, default to comma.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
Thousands separator. |
Source code in .tox/docs/lib/python3.14/site-packages/humanize/i18n.py
182 183 184 185 186 187 188 | |