Babel
These are configurable class-based filters implementing internationalization and localization features.
liquid2.builtin.filters.translate.BaseTranslateFilter
Base class for the default translation filters.
PARAMETER | DESCRIPTION |
---|---|
translations_var
|
The name of a render context variable that resolves to a
gettext
TYPE:
|
default_translations
|
A fallback translations class to use if
TYPE:
|
message_interpolation
|
If
TYPE:
|
auto_escape_message
|
If
TYPE:
|
liquid2.builtin.DateTime
A Liquid filter for formatting datetime objects.
PARAMETER | DESCRIPTION |
---|---|
timezone_var
|
The name of a render context variable that resolves to
a timezone. Defaults to
TYPE:
|
default_timezone
|
A fallback timezone to use if
TYPE:
|
locale_var
|
The name of a render context variable that resolves to the
current locale. Defaults to
TYPE:
|
default_locale
|
A fallback locale to use if
TYPE:
|
format_var
|
The name of a render context variable that resolves to the
current datetime format string. Defaults to
TYPE:
|
default_format
|
A fallback datetime format that is used if
TYPE:
|
input_timezone_var
|
The name of a render context variable that resolves to
a timezone for parsing datetimes entered as strings. Defaults to
TYPE:
|
default_input_timezone
|
A fallback timezone to use if
TYPE:
|
liquid2.builtin.GetText
liquid2.builtin.NGetText
Bases: BaseTranslateFilter
, TranslatableFilter
A Liquid filter equivalent of gettext.ngettext
.
liquid2.builtin.NPGetText
liquid2.builtin.Number
A Liquid filter for formatting decimal values.
PARAMETER | DESCRIPTION |
---|---|
decimal_quantization_var
|
The name of a render context variable that
resolves to the decimal quantization to be used. Defaults to
TYPE:
|
default_decimal_quantization
|
A fallback decimal quantization if
TYPE:
|
locale_var
|
The name of a render context variable that resolves to the
current locale. Defaults to
TYPE:
|
default_locale
|
A fallback locale to use if
TYPE:
|
format_var
|
The name of a render context variable that resolves to the
current decimal format string. Defaults to
TYPE:
|
default_format
|
A fallback decimal format that is used if
TYPE:
|
input_locale_var
|
The name of a render context variable that resolves to
a locale suitable for parsing input strings to decimals. Defaults to
TYPE:
|
default_input_locale
|
A fallback locale to use if
TYPE:
|
liquid2.builtin.Translate
Bases: BaseTranslateFilter
, TranslatableFilter
A Liquid filter for translating strings to other languages.
Depending on the keyword arguments provided when the resulting filter is called, it could behave like gettext, ngettext, pgettext or npgettext.
liquid2.builtin.Unit
A Liquid filter for formatting units of measurement.
PARAMETER | DESCRIPTION |
---|---|
locale_var
|
The name of a render context variable that resolves to the
current locale. Defaults to
TYPE:
|
default_locale
|
A fallback locale to use if
TYPE:
|
length_var
|
The name of a render context variable that resolves to a
unit format length. Should be one of "short", "long" or "narrow".
Defaults to
TYPE:
|
default_length
|
A fallback format length to use if
TYPE:
|
format_var
|
The name of a render context variable that resolves to a
decimal format string. Defaults to
TYPE:
|
default_format
|
A fallback decimal format to use if
TYPE:
|
input_locale_var
|
The name of a render context variable that resolves to
a locale suitable for parsing input strings to decimals. Defaults to
TYPE:
|
default_input_locale
|
A fallback locale to use if
TYPE:
|