This thread is resolved. Here is a description of the problem and solution.
Problem: The client followed the documentation to make user meta fields translatable and added the user type 'Vendor'. However, they encountered issues with finding the domain as shown in the documentation, and also faced problems with partial translations and automation of the translation process. Solution: We advised the client to configure the 'Vendor Plus' role to be translatable via WPML → String Translation. To ensure that the translated values display correctly on the front end, we recommended adding the following code snippet:
This filter enables WPML to return the translated value when user meta is retrieved. For automatic translations, although the 'Translate Everything' option does not include String Translation content, strings can still be translated automatically using WPML's automatic translation engine. However, they need to be sent for translation from the Translation Dashboard. For further details, please refer to our documentation: https://wpml.org/documentation/getting-started-guide/string-translation/
If this solution does not resolve your issue, or if it seems outdated or irrelevant to your case, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. Should you need further assistance, please open a new support ticket at WPML support forum.
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.
"3. These are user meta fields. To make those translatable, you'll need to follow our documentation:"
I followed the documentation, and the user type 'Vendor' is already added. However, I cannot find the domain for this, as shown in documentation. Can you help see what I'm doing wrong?
Sorry for all the tasks. Hoping you can get me to the finish line.
I added the code via the Theme Editor and did not receive any warnings during the process. However, after saving the changes, I was no longer able to access the WordPress admin area. This suggests there may be another custom code snippet already on the site that is conflicting with the code I added.
Could you please provide FTP access details so I can investigate further?
Alternatively, you can try removing the code snippet I added to functions.php. Once access is restored, add only the custom code required for the `about_company` user field, and it should work correctly.
Thanks. It seems that the white-screen was a typo in the code added via the Theme Editor: the about_company string was missing its closing quote ('about_company; instead of 'about_company';), which is a fatal PHP parse error that takes the whole site down.
I've corrected it and the site is back up. Could you help me check next steps?
I have now gone to WPML → String Translation and configured the Vendor Plus role to be translatable. If you check now, you should see that the `about_company` field can be translated.
The original value was in English, so I switched it to Spanish, added the translation, and translated it to English.
The only remaining step is to add the code snippet mentioned in our documentation:
To enable WPML to return the translated value when user meta is retrieved via get_user_meta() or get_userdata() — including by plugins and page builders — add the following filter:
I added this code, and it worked. BUT, only 10% of the 'about' text is showing on english page. It looks like it only translated until first line break. How to fix that?
I checked, and that is the translation you added, as shown in the attached screenshot.
If you add the remaining translations, everything should work correctly. I only added the Spanish (ES) translation for testing purposes, and it is working fine on my end.
Although this field is not translated through the Translation Editor, it is registered as a string and can be translated automatically through WPML's String Translation workflow.
Once the string is registered, you can go to WPML → Translation Dashboard → Other texts (strings), select the strings you wish to translate, and send them for automatic translation just like any other translatable content.
Please see the attached screenshot for an example of where these strings can be found in the Translation Dashboard.
If you have a large number of users, this approach should still scale well, as the strings can be translated in bulk through the Translation Dashboard rather than manually one by one.
Great, I tested and it works.
However, it still looks like this is not fully automated translation. Am I right?
I need it to translate without anyone having to go to the Translation Dashboard. Just as most other content automatically uses the 'Translate everything' option.
At the moment, String Translation content is not included in the "Translate Everything" workflow. While strings can be translated automatically using WPML's automatic translation engine, they still need to be sent for translation from the Translation Dashboard.
I understand this may not be ideal for your workflow, especially if new user-generated content is being created regularly. Unfortunately, there is currently no way to have String Translation items automatically translated without first sending them through the Translation Dashboard.