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.

This topic contains 6 replies, has 2 voices.

Last updated by denisaT 4 years, 10 months ago.

Assisted by: Yvette.

Author Posts
August 3, 2020 at 11:37 am

denisaT

The Dokan plugin Vendor biography tab description is not translatable.

August 3, 2020 at 12:54 pm
August 3, 2020 at 1:31 pm #6726561

denisaT

Hello,
I have recreated the issue in the installation provided: hidden link . Local vendor page : hidden link. The elements that I was not able to find and translate are the actual description under Biography tab + the button "Contact us custom button text" in the right. The name of the tab itself is translatable.
Thank you!

August 4, 2020 at 11:45 am #6733061

Yvette
Supporter

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

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

Hello

This is not supported by WPML "out of the box". We have an API that you can use to extract and register the field for translation but it will require you to be comfortable with coding.

The vendor bio is a custom usermeta field. (see image). We have an API filter for this purpose. Please look at the following thread:
https://wpml.org/forums/topic/how-do-i-translate-the-contents-of-fields-in-the-user-profile/#post-1162134

Here is a summary of the content:

You'll need to add some code to your theme's functions.php file. There is a WPML filter available to add custom user fields to String Translation.
E.g. the following code will register the "website" field:

add_filter( 'wpml_translatable_user_meta_fields', function( $fields ) {
   $fields[] = 'user_url';
   return $fields;
} );

You'll need to check the names of the rest of your custom user fields and add them to the code.

Then, when you want to show the translated content on the front-end, you'll need to use the following SAMPLE code. NOTE - this is sample, it is not tailored to your use case - you will need a PHP programmer to do this for you:

get_the_author_meta( 'user_url', $user_id );

To register several user meta fields, use the code like:

add_filter( 'wpml_translatable_user_meta_fields', function( $fields ) {
    $fields = array('user_url', 'instagram', 'youtube');
    return $fields;
} 

Here is more information on this filter:
https://wpml.org/wpml-hook/wpml_translatable_user_meta_fields/

I hope this helps you.
Here is a link where you can find WPML contractors to help you with this.
https://wpml.org/contractors/

DokanUsermetaVendorBio.png
August 8, 2020 at 4:40 pm #6761815

denisaT

Hi Ivet,

Thank you, but I could not edit the codes to make it work myself and I would not like to hire someone for this since the 2 plugins are declared compatible so I expect to be able to translate everything.

August 8, 2020 at 4:41 pm #6761817

denisaT

Yvette* - sorry.

August 10, 2020 at 8:18 am #6767451

Yvette
Supporter

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

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

In that case, your better bet is to go to Dokan support and ask them to add the necessary code to their plugin since those are the files that will need to be changed. There are no changes on our plugin or API that seem to be required.

Our support policy does not cover custom coding nor will our developers touch code not written by ourselves.

Dokan already has a working relationship with our team, so your request, initiated through them, will eventually find its way to us and we´ll gladly help them change their code to add this additional feature.

That will be the correct course of action for you to take.

August 13, 2020 at 1:13 pm #6795313

denisaT

Status: Neither WPML or Dokan can help with this via support forums.