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

Last updated by Nicolas 3 months, 3 weeks ago.

Assigned support staff: Radu.

Author Posts
April 9, 2020 at 1:53 pm #5876569

Nicolas

Tell us what you are trying to do?
For our custom plugin, we added a settings page with multiple options. Some of these option fields need the possibility to be translated. So we added the possibility with the wpml-config.xml file and it works great! Now, these strings can be translated through WPML >> string translation. What we would like to do is to add a field to the settings page so that the translation can be done directly in the settings page instead of doing it through WPML >> string translation. I.e. An input field on our custom settings page which stores the translation of a specific settings option value through PHP and WPML for Dutch (with English as base language).

The data is stored in the database in a settings section with the standard WordPress functionality.

Is there any documentation that you are following?
Yes, but we could not figure out which function to use for this functionality.
https://wpml.org/documentation/support/wpml-coding-api/wpml-hooks-reference

Is there a similar example that we can see?
No, but there is a similar question from 2013.
https://wpml.org/forums/topic/custom-theme-settings-page-with-translations/

April 13, 2020 at 6:04 am #5894305

Radu
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hey Nicolas,

I understand what you'd like to do. However, WPML is made to translate the custom fields through WPML → String translation area, once you created the XML configuration.

The change that you're looking for requires some custom coding that is outside of our support area. I tried to look for something to use as a workaround, but I couldn't find any simple change to do the trick.

If you want, you can reach out to one of the contractors from here https://wpml.org/contractors/ to work with them and create the type of change you're looking for.

Thanks,
Radu

April 18, 2020 at 8:16 am #5937797

Nicolas

Thanks, we'll look into reaching out to a contractor!