Re: [Tiki-devel] Tracker item calculation field date and multilingual
Jonny Bradley via TikiWiki-devel <[email protected]>
| Newsgroups | gmane.comp.cms.tiki.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi Bernard
You are correct, it uses the plain date function, and the recommendation is to use setlocale and strftime instead.
However, strftime is scheduled to be deprecated in php 8.1
https://wiki.php.net/rfc/deprecations_php_8_1#strftime_and_gmstrftime
and apparently we should use this now:
https://www.php.net/manual/en/intldateformatter.format.php
I expect this will be the case in numerous places in Tiki, and i think we'll need a new pref to pick the locale...
Any better ideas?
jb
> On 20 Sep 2021, at 10:31, Bernard Sfez via TikiWiki-devel <[email protected]> wrote:
>
> Hello,
>
> I post this in the list because it look to me something more related to the developers knowledge than power users.
>
>
> In a tracker I use a item calculation field to extract the month from another (complete date) field.
> (date (str F) paymentsDate)
>
> It will output “September” and unlike other fields it won’t be changed considering the language of the Tiki.
>
> How can I made this multilingual ?
>
> Is the function using https://www.php.net/manual/en/function.date.php (not good for multilingual) ?
> To format dates in other languages, you should use the setlocale() and strftime() functions instead of date().
>
> But may be not because in many places I see dates properly translated.
>
> Does anyone see a clever way to have this translated ?
>
> Bernard
>
>
> _______________________________________________
> TikiWiki-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel
_______________________________________________
TikiWiki-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel