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
554
stars
105
forks
source link
Refactor date-time conversions using `qtranxf_intl_strftime` #1238
The strftime function is deprecated in PHP8.1.
Generalize usage of qtranxf_intl_strftime for any PHP version. The old implementation is condemned so no point to maintain it. Eventually the strftime format may disappear but this requires more work.
Abandon support of ML date-time formats.
The use case is very unclear and looks like very old legacy code. Simplify the code by assuming the format is only for the current lang.
Bump minimal PHP version to 5.5.
Required by \DateTimeInterface. Update composer with ext-int for \IntlDateFormatter.
deprecate $before and $after arguments in qtranxf_format_date and qtranxf_format_time
Fix missing use case when using STRFTIME format if the user format is not given. Example get_the_date(). It should use the language format. Before this patch it didn't.
The
strftime
function is deprecated in PHP8.1. Generalize usage ofqtranxf_intl_strftime
for any PHP version. The old implementation is condemned so no point to maintain it. Eventually the strftime format may disappear but this requires more work.Abandon support of ML date-time formats. The use case is very unclear and looks like very old legacy code. Simplify the code by assuming the format is only for the current lang.
Bump minimal PHP version to 5.5. Required by
\DateTimeInterface
. Update composer withext-int
for\IntlDateFormatter
.Deprecations -> new versions
qtranxf_strftime
->qtranxf_intl_strftime
qtranxf_convertFormat
->qtranxf_convert_to_strftime_format_using_config
.qtranxf_convertTimeFormat
->qtranxf_get_language_config_date_time
.qtranxf_convertDateFormat
->qtranxf_get_language_config_date_time
.qtranxf_convertDateFormatToStrftimeFormat
->qtranxf_convert_date_format_to_strftime_format
.$before
and$after
arguments inqtranxf_format_date
andqtranxf_format_time
Fix missing use case when using STRFTIME format if the user format is not given. Example
get_the_date()
. It should use the language format. Before this patch it didn't.