Forum Discussion
OomensT
2 years agoActive Member
Date formatting with correct Locale
Hi, I'm trying to add formatting to a datetime field, however if I use formatting that prints weekdays, months fully the English language is always used. Even when the locale of the user is somethi...
Arso
2 years agoSpecialist
OomensT Liquid doesn't support date translation. At least, it says so in an article on their blog. They encourage using universal date formats without day and month names.
This requires a custom solution that checks the user's locale and swaps all the names of the days and months to the relevant translations on the fly.
I found this code on Github that's doing just that. You can add as many languages as you want. However, this only works on Shopify websites in its current format. It requires some adaptation in order for it to work in Braze.
Related Content
- 2 years ago
- 7 months ago