- This topic has 4 replies, 2 voices, and was last updated 7 years, 7 months ago by .
Translating custom options of integral child theme using WPML
You must be logged in to reply to this topic.
Hi guys,
I’m using integral-pro and I’ve created a child theme as I have to add custom options for one of my customer. I’ve also purchased and installed the WPML plugin for translations.
Now I would like to translate the values of the custom options of my integral-pro child theme. And that’s where I’m stuck.
I removed the wpml-config.xml file in integral-pro (as suggested here at the very bottom of the page) and added my custom wpml-config.xml file in my child theme.
Unfortunately, the admin-texts of my child theme are never loaded. Even after loading all theme strings in WPML. I don’t know what I’m doing wrong.
Can anyone help me?
Kind regards,
Fred
Hello @frederic.aebi
I believe this will help solve your issue.
https://wpml.org/forums/topic/child-theme-translation/
If you still have issues after that, please let me know.
I’m sorry but I’m still not able to load the translations from my wpml-config.xml of my integral-pro child theme. Don’t know what I’m doing wrong.
OK I got it.
I added the following in the section files of my child theme.
Example:
File theme_root_dir/sections/my_custom_section.php
echo __($integral[‘my_custom_string’], ‘my_custom_domain’);
my_custom_string corresponds to the ID of a text field that I’ve defined in a custom option.
Anyway, I think this is not really a solution but more a workaround… According to the WPML documentation, admin-texts could be simply defined in a wpml-config.xml.
Maybe I’m doing something wrong.
Hello,
Yeah that wouldn’t be a viable solution, more of a work-around.
Try adding this to the child theme’s functions.php file
// Make theme available for translation. Translations can be filed in the /languages/ directory.
load_theme_textdomain( 'integral-pro-child', get_template_directory() . '/languages' );
And copy the contents of Integral Pro’s /languages/ directory into that of the child theme.
You must be logged in to reply to this topic.