qTranslate-XT (eXTended) - reviving qTranslate-X multilingual plugin for WordPress. A new community-driven plugin soon. Built-in modules for WooCommerce, ACF, slugs and others.
GNU General Public License v2.0
550
stars
103
forks
source link
Add date/time option to use WP and ignore QTX formats #1248
The strftime function is deprecated in PHP8.1 but the legacy language formats are still maintained with IntlDateFormatter (#1228, #1238). The strftime format used in the qTranslate language options should be deprecated (#1234). The date format should also be refactored without intermediate legacy conversions.
Meanwhile, it is safer to add a fallback option to disable any date/time conversion and hooks in qTranslate in case something unexpected would happen. This option could be enough for some users. The standard WP behavior for the_time() and all filters with get_post_modified_time is translating the global date/time WP formats. However when calling functions like get_post_time() from the code without any argument, no translation is done which could be unexpected when using qTranslate. Also, the WP options only allow to define a format for date and another for time, which could also be too restrictive.
The
strftime
function is deprecated in PHP8.1 but the legacy language formats are still maintained withIntlDateFormatter
(#1228, #1238). The strftime format used in the qTranslate language options should be deprecated (#1234). The date format should also be refactored without intermediate legacy conversions.Meanwhile, it is safer to add a fallback option to disable any date/time conversion and hooks in qTranslate in case something unexpected would happen. This option could be enough for some users. The standard WP behavior for
the_time()
and all filters withget_post_modified_time
is translating the global date/time WP formats. However when calling functions likeget_post_time()
from the code without any argument, no translation is done which could be unexpected when using qTranslate. Also, the WP options only allow to define a format for date and another for time, which could also be too restrictive.