Skip to main content

localize_input

Check if an input value is a localizable type and return it formatted with the appropriate formatting string of the current locale.

def localize_input(
value: Any,
default: string = None
) - > string

Check if an input value is a localizable type and return it formatted with the appropriate formatting string of the current locale.

Parameters

NameTypeDescription
valueAnyThe input value to be localized, such as a date, time, number, or boolean.
defaultstring = NoneAn optional strftime-compatible format string to override the default locale-specific format for date and time objects.

Returns

TypeDescription
stringThe localized string representation of the input value, or the original value if no localization was applied.