localize
Check if value is a localizable type (date, number...) and return it formatted as a string using current locale format.
If use_l10n is provided and is not None, it forces the value to
be localized (or not), otherwise it's always localized.
def localize(
value: Any,
use_l10n: boolean = None
) - > string
Check if value is a localizable type (date, number...) and return it formatted as a string using current locale format. If use_l10n is provided and is not None, it forces the value to be localized (or not), otherwise it's always localized.
Parameters
| Name | Type | Description |
|---|---|---|
| value | Any | The object to be formatted, such as a date, time, number, or string. |
| use_l10n | boolean = None | A flag to explicitly enable or disable localization; if None, the default localization behavior is used. |
Returns
| Type | Description |
|---|---|
string | The value formatted as a string according to the current locale settings, or the original value if it is not a localizable type. |