This thread is resolved. Here is a description of the problem and solution.
Problem:
The client is working on a site under development and has successfully registered strings using the
wpml_register_string
hook. They need to insert translations for these strings programmatically as part of a migration involving hundreds of posts and multiple translations. However, the API documentation lacks information on how to do this.
Solution:
We recommend translating the xliff file that WPML uses for segmenting values and then re-inserting it. This approach is robust for custom coding scenarios. Alternatively, you can use the native editor to insert translated content and link it to the original content using our hooks. The wpml_set_element_language_details hook might be particularly useful in this case.
For more detailed information, please refer to our extensive developer documentation:
If this solution does not apply to your case, or if it seems outdated, 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.
This topic contains 4 replies, has 2 voices.
Last updated by 10 months, 4 weeks ago.
Assisted by: Itamar.