Skip Navigation

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 4 replies, has 2 voices.

Last updated by botiss-biomaterialsG 1 year, 11 months ago.

Assisted by: Long Nguyen.

Author Posts
June 28, 2023 at 8:36 pm #13913819

botiss-biomaterialsG

[ how to translate postcard element with WPML plugin ]
We have a website on English and German. But the posts are only on English we can not translate 1000 posts.

I have a postcard AVADA with structure like:
ACF text for Label of type choice
ACF date format ds M, Y
Featured Image
Tags

I have installed ACF add-ons for translation. Then I translated the field group with mode "Expert" and duplicated all of custom fields.
But the postcard returned only English Version.
We want to translate Label ACF and adjust the format of date custom field.
Have you experienced this situation?

I do not how to get the translate LABEL for postcard on German.

Attention pls:
We do not want to translate all posts.
We have only one postcard to display postlist on English and German.

Thanks.

June 29, 2023 at 7:44 am #13915493

Long Nguyen
WPML Supporter since 02/2022

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi Botiss,

Thank you for contacting WPML support, I'd be happy to help you with this issue.

If you want to translate the ACF label, please follow the documentation https://wpml.org/documentation/related-projects/translate-sites-built-with-acf/#translating-labels

Kindly note that, the post type "acf-field-group" shouldn't be Translatable: https://wpml.org/errata/advanced-custom-fields-field-group-should-be-set-as-not-translatable/

If you don't want to translate all posts, you can duplicate them in bulk or set the post type preference to "Translatable - use translation if available or fallback to default language" in WPML > Settings > Post Types translation. Refer to the documentation https://wpml.org/documentation/translating-your-contents/displaying-untranslated-content-on-pages-in-secondary-languages/

I also need more information on your site by sharing the debug info. If you don’t know how to share the debug info, please follow this article https://wpml.org/faq/provide-debug-information-faster-support/
Your next reply is enabled to share the debug info.

Look forward to your reply.
Thanks

June 29, 2023 at 9:34 am #13916243

botiss-biomaterialsG

Thanks,

I solved this problem. I have forgotten to return label of custom field in the config of custom field.

- Date Format in Custom Field;

Could we change date time format of custom field which based on format date ?
for example:
On English : the custom datum_von is 20th Oct. 2023
but on German : 20. Oktober 2023

or must we use only one format for DATE ?

Thanks

June 29, 2023 at 10:40 am #13916877

Long Nguyen
WPML Supporter since 02/2022

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

WPML doesn't support translating/changing the ACF date format. It should be the same across languages. If you want to change the date format when outputting the field value, you can follow the code below:

$datum_von = get_field( 'datum_von' ); //get the date field value
$date_timestamp = strtotime( $datum_von ); //change to timestamp

$current_lang = apply_filters( 'wpml_current_language', null );
if( $current_lang == 'de' ) {
	echo wp_date( "j. F Y", $date_timestamp );
} else {
	echo wp_date( "jS M. Y", $date_timestamp );
}

Remember to set the return format date to Ymd.

Note: this is a custom code and it is beyond our scope of support. If you are not able to accomplish this, I would recommend you contact one of our certified partners that will be more than happy to help you with this. In this link you will find a list of our certified partners: https://wpml.org/contractors/

Refer to this ticket
https://wpml.org/forums/topic/acf-date-automatically-translates-to-other-language-when-viewed-on-different-lan/
and this from ACF support hidden link

Look forward to your reply.
Thanks