Please make sure to update to WPML 4.3.5 and check our list of Known Issues before reporting

Hi, Amit here, I am the WPML Support Manager, our current ticket queue is high, update your WPML plugins and make sure you meet the minimal requirements for running WPML before reporting an issue please - many tickets are resolved doing that

Please look at our updated list of Known Issues and you can also use our support search to find helpful information and of course review our documentation before opening a ticket.

If you do need to open a ticket please make sure to provide us with all the needed information as described in this page

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, 4 months ago.

Assigned support staff: luo.

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

George

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" />
        </key>

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

George

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

luo
Supporter

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: http://wpml.org/documentation/support/language-configuration-files/

Regards
Luo

August 6, 2012 at 2:59 pm #70434

George

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.