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

Last updated by George 7 years, 11 months ago.

Assigned support staff: luo.

Author Posts
August 5, 2012 at 6:47 pm #70331


I am using the Option-Tree 2.0 plugin which allows me to export a theme-options.php file. I also setup the wpml-config.xml and added

        <key name="option_tree_settings">
            <key name="welcome_title" />

this allows my value to show in the string translator and allows me to enter in a value for a french translation. I set it to "translation complete" and all seems well. When I switch to the French view on the front end it remains on my default english value and doesn't update.

Any Ideas on how to investigate the issue? here is my call in my template

<?php if ( function_exists( 'ot_get_option' ) ) { $welcome_title = ot_get_option( 'welcome_title' ); } echo $welcome_title; ?>
August 6, 2012 at 2:48 am #70336


I got a step closer and really thought I had this fixed. The Option-Tree plugin has an export function which lets you "bake" your settings into a proper admin options template to include in your functions.php file. Once I properly registered it in this manner I saw all my theme options in the screen <b>"Translate texts in admin screens »"</b> I thought for sure once I added the strings here and added my translations it would work, it didn't 🙁

I have my translations on the strings set and also checked "translation is complete" and it saves my options, just when i view the second language on the front end, it doesn't update and remains on the default "english" language.

I also saw in the admin to export the selected strings to be used in your functions.php file. I did this with out really being sure the expected result but thought I would give it a try.

Any help out there?

August 6, 2012 at 6:53 am #70356


Dear George,

your text need be wraped with "_e" or "__“ WP functions,
For example
<?php if ( function_exists( 'ot_get_option' ) ) { $welcome_title = ot_get_option( 'welcome_title' ); } echo $welcome_title; ?>
Change to:
<?php if ( function_exists( 'ot_get_option' ) ) { $welcome_title = ot_get_option( 'welcome_title' ); } _e($welcome_title, 'your_theme_text_domain'); ?>
More help:


August 6, 2012 at 2:59 pm #70434


Thanks for your help Luo. I'm afraid this hasn't helped me. I'm not sure what to put for the "your_theme_text_domain". I think thats where I'll put the path to my language files but I am not using language files and am using the string translation module.

I also went to the link you put many times to try and break down things but no where does it mention anything about including "_e" in the function. Where in the documentation does it mention that?

For now, I copied your syntax exactly and tested it but it did not work. I assume because I haven't set the proper value for "your_theme_text_doimain".

I also looked in the DB and confirmed in the translated tables that the translation for the "welcome_title' has been made. Just can't get the front end to show the proper language when switched.

thanks Luo for your help, really appreciate.

The topic ‘[Closed] Theme Option Not showing transalted value (even after creating a wpml-config.xml’ is closed to new replies.