khanduras / grav-theme-cardstack

A BackboneJS theme powered with Grav CMS and UI Kit
MIT License
11 stars 6 forks source link

unable to modify date format to german #4

Open k1ngf15h3r opened 8 years ago

k1ngf15h3r commented 8 years ago

tried to get my posts date format to german, but nothing works. tried it with |t in the card.htm.twig but it keeps on english. I plan to build up a dual language page but I want to be sure that all content will be in the right defined language.

any ideas how I can fix this? think it will be a small change at the published_date section in the card.htm.twig but can not find the right syntax for it.

love this theme and hope you can help me!

khanduras commented 8 years ago

Is this the line you're referring to?

k1ngf15h3r commented 8 years ago

Exactly this line.

khanduras commented 8 years ago

How would you normally change the data to be in German?

k1ngf15h3r commented 8 years ago

Had tried it with changing site language, tried it with the |t and |ta function after the date and changed the date format card in the theme. Also tried surrounding date with the t() and ta() function.

khanduras notifications@github.com schrieb am Mi., 25. Mai 2016, 22:03:

How would you normally change the data to be in German?

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/khanduras/grav-theme-cardstack/issues/4#issuecomment-221690307

khanduras commented 8 years ago

See if this helps you out:

@khanduras to auto-translate month names, Twig needs to have the Intl extension loaded (http://twig.sensiolabs.org/doc/extensions/intl.html) Grav does not load it. I planned to build a plugin to load it, but I have not done it yet. I wanted it to be included in Grav, but the problem I faced is that it's not a drop-in replacement, because it uses a completely different format for dates. You can also do it more simply, by iterating over an array of already translated month names