Skip to content Skip to sidebar

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.

Tagged: 

This topic contains 9 replies, has 1 voice.

Last updated by Otto 1 week, 4 days ago.

Assisted by: Otto.

Author Posts
October 6, 2025 at 3:01 am #17457953

yukiS-2

Background of the issue:
I am trying to translate an ACF date picker field on my site hidden link. I want to change the ACF date field event_date from English format 'j F Y' to Chinese format 'm月d日, Y'.

Symptoms:
I cannot find the ACF date picker field in the string translation section of WPML.

Questions:
How can I translate the ACF date picker field using WPML?

October 6, 2025 at 9:11 am #17458925

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello,

Thanks for contacting us.

While you wait for my colleague to take over the ticket, let me try to help you with the issue quickly.

I am not sure how are you showing ACF field via custom code or some page builder, but you can try next steps:

1) Translate date format for your 2nd language:

- https://wpml.org/documentation/getting-started-guide/translating-your-sites-date-format-using-wpml/

2) If you are showing your ACF field via PHP code, you can adjust it there also, please check next example:

- hidden link

Let us know if this helps.

Regards,
Drazen

October 6, 2025 at 9:56 am #17459256

yukiS-2

Hi Drazen,

For this https://wpml.org/documentation/getting-started-guide/translating-your-sites-date-format-using-wpml/ is for default wordpress date format, if my date picker field added using ACF then how to translate the date format? Kindly check hidden link Events section for the date format, I need to change chinese version date to another date format. Kindly advise. Thank you.

October 6, 2025 at 2:47 pm #17461212

Otto
WPML Supporter since 09/2015

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

Timezone: America/Argentina/Buenos_Aires (GMT-03:00)

Hello,

To be able to investigate the problem, we need to replicate the issue on a clean installation.
I created a clean installation of WordPress, ACF, WPML, and all necessary WPML add-ons.
You can access the WordPress dashboard using the link below:
hidden link

Kindly follow the steps below:

- Don't restore your site there.
- Reproduce the issue with minimal steps.
- Let me know once it's done and we will take a look.

Best Regards,
Otto

October 7, 2025 at 5:31 am #17462246

yukiS-2

Hi Otto,

I already reproduce issue with minimal steps, kindly have a check on home page for ACF field event_date, kindly advise where can translate date format for ACF field in Chinese to m月d日, Y, thank you

Screenshot 2025-10-07 at 1.29.50 PM.png
October 7, 2025 at 3:08 pm #17464331

Otto
WPML Supporter since 09/2015

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

Timezone: America/Argentina/Buenos_Aires (GMT-03:00)

Hello,

Because the ACF date is inserted via an Elementor Theme Builder template as a dynamic tag, the date format cannot change per language within that single template. Elementor’s dynamic tag ignores ACF’s per-field hook return format. Therefore, with the current setup, achieving different date formats per language is not possible without changing the template approach.

Best Regards,
Otto

October 8, 2025 at 1:19 am #17465623

yukiS-2

Hi Otto,

Any suggestion to make date format to be readable for both translation if using ACF field?

Thank you

October 8, 2025 at 12:28 pm #17467252

Otto
WPML Supporter since 09/2015

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

Timezone: America/Argentina/Buenos_Aires (GMT-03:00)

Hello,

If you your templates use directly ACF function get_field, you can hook in it and modify the date format.

Here you have an example:
<cod>
add_filter( 'acf/format_value/name=event_date', 'acf_event_date_format_by_language', 20, 3 );
function acf_event_date_format_by_language( $value, $post_id, $field ) {
if ( ! is_string( $value ) || $value === '' ) {
return $value;
}

// Detectar idioma actual (WPML)
$language_code = null;
if ( defined( 'ICL_LANGUAGE_CODE' ) && ICL_LANGUAGE_CODE ) {
$language_code = ICL_LANGUAGE_CODE;
} else {
$maybe_lang = apply_filters( 'wpml_current_language', null );
if ( is_string( $maybe_lang ) && $maybe_lang !== '' ) {
$language_code = $maybe_lang;
}
}
if ( ! $language_code ) {
$locale = get_locale();
$language_code = substr( (string) $locale, 0, 2 );
}

if ( strtolower( $language_code ) !== 'zh-hans' ) {
return $value;
}

$input_formats = array();
if ( isset( $field['return_format'] ) && is_string( $field['return_format'] ) && $field['return_format'] !== '' ) {
$input_formats[] = $field['return_format'];
}
$input_formats = array_merge( $input_formats, array( 'Ymd', 'Y-m-d', 'd/m/Y', 'm/d/Y', 'j F Y' ) );

$date_obj = null;
foreach ( $input_formats as $fmt ) {
$date_obj = DateTime::createFromFormat( $fmt, $value );
if ( $date_obj instanceof DateTime ) {
break;
}
}

if ( $date_obj instanceof DateTime ) {
return $date_obj->format( 'm / d, Y' );
}

return $value;
}
[/php]

Best Regards,
Otto

October 9, 2025 at 8:16 am #17469807

yukiS-2

Hi, thanks for the code. I added the code already, but the event date format does not change in chinese translation. Can you try from your end? Thank you.

October 9, 2025 at 10:51 am #17470741

Otto
WPML Supporter since 09/2015

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

Timezone: America/Argentina/Buenos_Aires (GMT-03:00)

Hello,

It won't work in the current setup. With the Elementor set up the hook is skipped.

I created a full example using a shortcode, you can see it working here:
hidden link
and
hidden link

note the different date format for the field.

To use it, I added a shortcode in the page and translate it:

[acf_event_dates posts_per_page="10"]

You can check it in the test site using the WP File Manager plugin:
hidden link

Best regards,
Otto