polyglot icon indicating copy to clipboard operation
polyglot copied to clipboard

Translate dates

Open PanderMusubi opened this issue 3 years ago • 8 comments
trafficstars

Please, translate the date shown under a post as they are currently all in English. Reported for version 1.5.0.

PanderMusubi avatar Jan 08 '22 15:01 PanderMusubi

This currently has to be done manually, as it has to be with any other string. Date formats are very different from each one.

I created a liquid file to help me implement this. You can check it working on the example page of my template.

george-gca avatar Feb 25 '24 17:02 george-gca

Liquid date filter doesn't support parsing dates into other languages than english.

https://freakdesign.com.au/blogs/news/translate-a-liquid-date-string-in-shopify

☝️ This blog post describes a way to accomplish this with extra liquid rpogramming. But otherwise this is not something polyglot can help with currently.

If shopify adds further i18n support to their date filter, this can supported better. Unfortunately I can't help further.

untra avatar Feb 25 '24 17:02 untra

The locales support date formats for languages.

PanderMusubi avatar Feb 25 '24 20:02 PanderMusubi

What do you mean?

george-gca avatar Feb 25 '24 23:02 george-gca

Like e.g. Date.0 in https://www.localeplanet.com/icu/nl-NL/index.html

PanderMusubi avatar Feb 26 '24 00:02 PanderMusubi

Yes, but like @untra said it before:

If shopify adds further i18n support to their date filter, this can supported better. Unfortunately I can't help further.

If you check that link it says:

Converts a timestamp into another date format. The format for this syntax is the same as strftime. The input uses the same format as Ruby’s Time.parse.

Unless Ruby's Time.parse and strftime give support for it, there's nothing he can do.

george-gca avatar Feb 26 '24 19:02 george-gca