Please make sure to update to WPML 4.3.4 before reporting any issue

Hi, Amit here, I am the WPML Support Manager, our current ticket queue is high, update your WPML plugins and make sure you meet the minimal requirements for running WPML before reporting an issue please - many tickets are resolved doing that

Please look at our updated list of Known Issues and you can also use our support search to find helpful information and of course review our documentation before opening a ticket.

If you do need to open a ticket please make sure to provide us with all the needed information as described in this page

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

Last updated by Joanna 2 years, 11 months ago.

Assigned support staff: Joanna.

Author Posts
December 14, 2016 at 7:17 pm #1160486

Gustaw

How do I translate the contents of fields in the user profile, such as: Website URL, Facebook profile URL, Twitter etc. (or other fields added to a user profile by plugins eg. the plugin "Simple Author Box")?
I know that are available in the translation field contents Name, Last Name, Biography but how to translate the fields above?

December 15, 2016 at 8:32 am #1160811

Joanna

Hello Gustaw,

Those custom fields added by another plugin can be translated on WPML->String Translation. To have these strings available for translation, you'll need to create a language configuration file where you specify which fields you want to translate.
You can read more about language configuration files at https://wpml.org/documentation/support/language-configuration-files/. Check especially the "Admin texts / wp_options" section.

December 15, 2016 at 9:45 am #1160928

Gustaw

1. For additional fields thank you. I'll check it.
2. But how to translate the standard WordPress content fields in the user profile, such as Website URL, Facebook profile URL, Google+ URL, Twitter URL?

December 15, 2016 at 5:22 pm #1161454

Joanna

Hello Gustaw,

You should be able to find it on WPML->String Translation.
If you are missing these string, please do the following:
1. Go to WPML->String Translation.
2. Scroll down to the "More options" section.
3. Click the "edit" link.
4. Choose the roles that are supposed to have their profile fields translated.
5. Click the "Apply" button to save changes.

Now, you should be able to find the profile fields in the WPML->String Translation table.

December 15, 2016 at 6:34 pm #1161529

Gustaw

Do you checked whether such a solution work?
I have done according to the instructions, but the translations are available only field 'display_name', 'description', 'nickname', 'last_name', 'first_name'.
There are no fields as mentioned Website URL, Facebook profile URL, Google+ URL Twitter URL.

I also attach "WPML debug info"

December 16, 2016 at 11:35 am #1162134

Joanna

Hello Gustaw,

Yes, I checked the solution. However, I missed the fact that I'm using a custom theme, I'm sorry.

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 code:

get_the_author_meta( 'user_url', $user_id );
December 16, 2016 at 8:12 pm #1162620

Gustaw

1. I added code to the functions.php file, but I do not see this field in "String translation".
Is there anything else I need to do in addition to adding code to the file Function.php?
2. Where / How can I find the names of fields located in the user's profile?

December 16, 2016 at 8:57 pm #1162638

Gustaw

Ad.1. About the addition of the code, I need to refresh the page entry to function has been called get_the_author_meta. The 'USER_URL' has been added to the String translator. Well.

2. How to add other fields?
I'm trying by

$fields[] = 'user_url';
$fields[] = 'user_facebook';
$fields[] = 'user_twitter';

or

    $fields = array ('user_url','user_facebook','user_twitter');

but the other fields are not added to the String Translator

The whole my function looks like

add_filter( 'wpml_translatable_user_meta_fields', function( $fields ) {
	$fields[] = 'user_url';
	$fields[] = 'user_facebook';
	$fields[] = 'user_twitter';
   return $fields;
} );
December 19, 2016 at 6:56 pm #1164085

Joanna

Hello Gustaw,

It's possible that these fields are added differently since they are from the 3rd party plugin. If it's okay with you, I would like to ask you for credentials to your website and FTP. It will help me determine how to correctly register these strings in String Translation. You will find the fields for WordPress and FTP access below the comment area when you log in to leave your next reply.

December 19, 2016 at 9:31 pm #1164194

Gustaw

Sorry for my mistake. I checked again, and additional fields are added by the plugin "Simple Author Box" https://wordpress.org/plugins/simple-author-box/
Can you help me with one example of how to add a field with this plugin via the "wpml-config.xml"?

December 20, 2016 at 9:01 pm #1165156

Joanna

Hello Gustaw,

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;
} );

To check what are the names of the specific fields added by Simple Author Box, log into your database and check the "*_usermeta" table. In the "meta_key" column, you will find all the field names.