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 1 reply, has 2 voices.

Last updated by Bruno 2 years, 11 months ago.

Assigned support staff: Bruno.

Author Posts
July 31, 2017 at 10:14 pm #1331728

Jeffrey

Hello, I am using Wpml with Toolset for building a bilingual site, current process is creating custom user fields, I found that translation options at custom user field does not exist, but for post fields that has translation options. I am just afraid in case that user fields can not be translate, I need change my plan ahead. so just want a clearly answer about how to translate user fields of Toolset Type. Thank you so much!

July 31, 2017 at 10:45 pm #1331734

Bruno
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

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

Hi,

Thank you for contacting us.

How will you display this content on the front end? If you are using the PHP API to display the content on your site, you can use the WPML hooks to translate this information with String Translation. For example:

// get the user field content
$username =  types_render_usermeta( "my-user-field") ;

// register to translation and display the string translated.
echo apply_filters( 'wpml_translate_single_string', $username, 'string-domain', 'name of the string' );

Then this string would be registered in WPML > String Translation and you could translate it. You can see more in our documentation:
https://wpml.org/wpml-hook/wpml_translate_single_string/

Types documentation: https://toolset.com/documentation/customizing-sites-using-php/creating-custom-user-profiles/

Please, let me know if I can help with any other questions you may have. I'll be happy to help.

Thank you.