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: Bug
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: Symptoms: Questions: |
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, |
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. Kindly follow the steps below: - Don't restore your site there. Best Regards, |
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 |
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, |
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: // Detectar idioma actual (WPML) if ( strtolower( $language_code ) !== 'zh-hans' ) { $input_formats = array(); $date_obj = null; if ( $date_obj instanceof DateTime ) { return $value; Best Regards, |
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: 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: Best regards, |