You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's introduce a new localize template tag allowing to perform basic localization operations in templates.
Context
Marten relies on crystal-i18n in order to power its internationalization features. The template engine presently provides a translate tag to perform translations within templates. That said, there is no easy way to perform localizations in templates at the moment (that is, without having to implement a custom template tag).
Proposition
Let's introduce a new localize tag template that will allow to perform the localizations that are already provided by crystal-i18n (that is, localizing dates, datetimes, and numbers).
Concretely, it should be possible to localize such values using the default format:
{%localize 100000 %}{%localizecreated_at%}
We should also make it possible for users to explicitly define the localization format that they want to use with a dedicated format argument:
Description
Let's introduce a new
localize
template tag allowing to perform basic localization operations in templates.Context
Marten relies on crystal-i18n in order to power its internationalization features. The template engine presently provides a
translate
tag to perform translations within templates. That said, there is no easy way to perform localizations in templates at the moment (that is, without having to implement a custom template tag).Proposition
Let's introduce a new
localize
tag template that will allow to perform the localizations that are already provided by crystal-i18n (that is, localizing dates, datetimes, and numbers).Concretely, it should be possible to localize such values using the default format:
We should also make it possible for users to explicitly define the localization format that they want to use with a dedicated
format
argument:The text was updated successfully, but these errors were encountered: