Support Forum
Support › MB Settings Page › WMPL: How to translate option pagesResolved
I've installed MB (AIO) and created a options page with some fields in several tabs.
I can not get the field content translatable with WMPL. With ACF options pages are translatable by changing the content language with the dropdown in admin bar. With MetaBox this seems not to work. The field content is also not available as translatable Strings.
In an old forum topic there is mentioned the wpml-config.xml
Is this still needed? I tried using the xml config field in WPML configuration settings but had no luck.
Is there a simple example for a translatable options page field value i can get a glue from?
Thanks in advance!
Hi Marco,
To translate the custom fields in the settings page, please create the file wpml-config.xml
in your theme/child theme folder, then add this code to that file
<wpml-config>
<admin-texts>
<key name='option_name'>
<key name='field_id' />
</key>
</admin-texts>
</wpml-config>
Translate the field value in WPML > String translation, show the field value by using the WordPress function get_option()
<?php
$options = get_option( 'option_name' );
echo $options['field_id'];
?>
See my screen record https://share.getcloudapp.com/QwuA02PY
Hello Long, thank you very much. This helps a lot!
This shoul be a part of the documentation. 🙂
Are you planning to enhance the compatibility so that MetaBox Option Pages are translatable the same way and without creating xml files like ACF do? For our clients the Usage of String Translation is harder than just change the language and fill the options page forms.
Hi,
Thank you for your feedback.
I'm going to inform the developer team to consider adding it to the to-do list for the future development of the plugin.
Any new regarding this? When we have lot and lot of MB custom fields we can't rely on the fact that we need to add them each time inside the wpml-config.xml, it should be automatic or at least having the ability to translate MB fields inside a MB setting page.