khomutovspace Hello! Is there an option to translate date format? I am using different languages in my template, but date is shown in English only. Thank you.
mad khomutovspace Hi, yes that’s true. Support for other date languages is planned for a future release though.
mad khomutovspace Hi, the latest version includes now an additional locale parameter for the dateFormat string function. Therefore it is now possible to translate also days and month names in dates according to the locale.
[deleted] @mad The returned string isn't utf-8 encoded, resulting in strange characters (e.g. for the german string for march: 'März'). It would be the best to encode the returned formatted string with utf8_encode(). Thank you very much!
mad [deleted] Hi there! To always encode the returned string unfortunately won’t work in every environment. I think the safest solution is to use the correctly encoded locale instead. Check out this comment. The correct locale for you would be de_DE.utf8 I guess.
[deleted] Thank you! I didn't know that it is possible to encode the locale in PHP. Learned something 😀 I think it would be helpful to point that out in the 'dateFormat' section of the dev guide; maybe in one of the examples... 👍️
Limezy Hi ! May I know how I can add an additional locale parameter for the dateFormat string function ? I have tried to setup the "Locale" setting in the parameters, but my dates are still using the English locale. Thanks !
mad Limezy Locales have to be installed on the OS. This is nothing that one can do on webserver or PHP level. There are a couple of discussions on StackOverflow about how to do this on different operating systems. Also that you have to use the ICU syntax in order to use the locale parameter.