pikim / grav-plugin-events

This plugin provides Calendar Events for Grav CMS
MIT License
13 stars 11 forks source link

Weekday's shortcut for different Languages #25

Open genofire opened 3 years ago

genofire commented 3 years ago

In German, the Weekday is shorted to 2 chars (instatt of 3):

https://github.com/pikim/grav-plugin-events/blob/836aff2f50c18959a9d0f7c8b9d3d32501b9f210/twig/DateTranslationExtension.php#L104-L107

pikim commented 1 year ago

What would you expect?

genofire commented 1 year ago

A way to short Day depending on language. And if German to short it by two letters.

pikim commented 1 year ago

The translation now considers the configured length of day and month names. But it can only be set globally and not language dependent. Could you please manually install the latest version, try it and give me some feedback?

genofire commented 1 year ago

Hmm, that is the problem. We write artical and pages in multiple languages ...

pikim commented 1 year ago

OK, I understand. Do you also need adjustable date formats? And is it ok to just show the first n characters of the day or month name?

Edit: Could it be an option to use https://github.com/Karmalakas/grav-plugin-translate-date ? Then, I would think about removing the date translation from the events plugin and add the other plugin as dependency.

pikim commented 1 year ago

Could you please manually install https://github.com/Karmalakas/grav-plugin-translate-date and https://github.com/pikim/grav-plugin-events/tree/grav-plugin-translate-date and give it a try?

You'll have to adjust the short format in the language file of the translate-date plugin and it should work. Don't forget to update your custom twigs accordingly.