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
|
Language name, e.g. |
required |
path |
str
|
Path to search for locales. |
None
|
Returns:
Name | Type | Description |
---|---|---|
dict |
NullTranslations
|
Translations. |
Raises:
Type | Description |
---|---|
Exception
|
If humanize cannot find the locale folder. |
Source code in .tox/docs/lib/python3.12/site-packages/humanize/i18n.py
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
|
deactivate()
Deactivate internationalisation.
Source code in .tox/docs/lib/python3.12/site-packages/humanize/i18n.py
82 83 84 |
|
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.12/site-packages/humanize/i18n.py
182 183 184 185 186 187 188 189 190 191 192 |
|
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.12/site-packages/humanize/i18n.py
169 170 171 172 173 174 175 176 177 178 179 |
|