This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 2 replies, has 3 voices.

Last updated by richardC-39 3 months ago.

Assigned support staff: Carlos Rojas.

Author Posts
July 17, 2019 at 11:15 am #4229331

nathanH-7

Tell us what you are trying to do? Hi, this is a follow-up from a previous thread: As you can see in the image below, I can't get the dates to show up in the proper Japanese format. A few of the others I've done in the past worked fine with this (EN = F j, Y | JP = Y年Fj日 , and so on), but I can't even find the place to translate these two. You get to this screenshot from this page (hidden link), and you click "次へ" once, and then it's under "2. 日にち " heading.

I got this reply from WPML:
"Hi,

sorry for the delay in replying but it took some time to test.

The problem seems not to be related to WPML, but to how Bookly formats date. If you change the default language to Japanese and deactivate WPML, you'll see the date is always the same - therefore, it's not WPML that doesn't translate it correctly, but Bookly that doesn't handle date in a different language.

This can probably be fixed, but the first input must come from Bookly's author. I see the plugin wasn't tested with WPML, so you might want to suggest them to apply for our Go-Global program (https://wpml.org/documentation/theme-compatibility/go-global-program/) so we can help them to become multilingual ready."

Then I got this reply from Bookly:

"Thanks for reaching out.

Change the date format in the time step, you will need to make changes in this file: wp-content/plugins/appointment-booking/frontend/modules/booking/Ajax.php:197th lite, in this module - \Bookly\Frontend\Modules\Booking\Ajax::renderTime , and here's the line - 'title' => date_i18n( ( $finder->isServiceDurationInDays() ? 'M' : 'D, M d' ), strtotime( $group ) ), then let me know how you go. "

So it seems that Bookly has told me where I can change this, but how do I change this such that it's compatible with WPML? Thank you!

July 17, 2019 at 10:49 pm #4233747

Carlos Rojas
Supporter

Languages: English (English ) Spanish (Español )

Timezone: America/Montevideo (GMT-03:00)

Hello,
Thank you for contacting WPML support.

1.- It seems -unfortunately- that for now you need custom programming work which is beyond the scope of our support.

At this point I would suggest you consider contacting one of our certified partners from this link:
http://wpml.org/documentation/support/wpml-contractors/

Before doing so please have a look also here:
http://wpml.org/documentation/support/wpml-contractors/guidelines-for-people-looking-for-consulting-help/

You will get the custom assistance you need to get on with your project.

2.- Please increase the PHP Memory Limit. Minimum requirements are 128Mb: https://wpml.org/home/minimum-requirements/
You can add this to wp-config.php to increase WP memory:

/** Memory Limit */
define('WP_MEMORY_LIMIT', '128M');
define( 'WP_MAX_MEMORY_LIMIT', '128M' );

- Add it above the line /* That's all, stop editing! Happy blogging. */

Kind regards,
Carlos

August 16, 2019 at 6:30 am #4404845

richardC-39

There is a way to do this ... bookly uses date_i18n to format (at least some of the dates). And it has a filter that it calls after formatting the date. So I've used something like this:

add_filter('date_i18n', 'bookly_date_i18n', 10, 4);
function bookly_date_i18n($datestring, $req_format, $i, $gmt)
{
if (ICL_LANGUAGE_CODE == ja) {
if ($req_format == 'D, M d') {
$datestring = $datestring . "日";
}
}
return $datestring;
}

YMMV