I’ve tried several plugins including Option-Tree Bridge but with no success. Finally, I’ve decided to use an easy workaround – using the ICL_LANGUAGE_CODE in if-statement I am detecting the current language and according to it use different variables for different languages.
if (ICL_LANGUAGE_CODE == 'bg'){
$mainSlider = ot_get_option('main_slider');
$roomHeader = ot_get_option('main_room_header');
$roomDescription = ot_get_option('main_room_description');
$aboutusHeader = ot_get_option('aboutus_header');
$aboutusContent = ot_get_option('aboutus_text');
$testimonialsHeader = ot_get_option('testimonials_header');
$textHeader = ot_get_option('text_section_header');
$textContent = ot_get_option('text_section_content');
$latestNews = ot_get_option('latest_news');
$findusHeader = ot_get_option('where_to_find_us_header');
$findusTitle = ot_get_option('where_to_find_us_title');
$findusAddress = ot_get_option('where_to_find_us_address');
} elseif(ICL_LANGUAGE_CODE == 'en'){
$mainSlider = ot_get_option('main_slider_en');
$roomHeader = ot_get_option('main_room_header_en');
$roomDescription = ot_get_option('main_room_description_en');
$aboutusHeader = ot_get_option('aboutus_header_en');
$aboutusContent = ot_get_option('aboutus_text_en');
$testimonialsHeader = ot_get_option('testimonials_header_en');
$textHeader = ot_get_option('text_section_header_en');
$textContent = ot_get_option('text_section_content_en');
$latestNews = ot_get_option('latest_news_en');
$findusHeader = ot_get_option('where_to_find_us_header_en');
$findusTitle = ot_get_option('where_to_find_us_title_en');
$findusAddress = ot_get_option('where_to_find_us_address_en');
} elseif (ICL_LANGUAGE_CODE == 'ru'){
$mainSlider = ot_get_option('main_slider_ru');
$roomHeader = ot_get_option('main_room_header_ru');
$roomDescription = ot_get_option('main_room_description_ru');
$aboutusHeader = ot_get_option('aboutus_header_ru');
$testimonialsHeader = ot_get_option('testimonials_header_ru');
$aboutusContent = ot_get_option('aboutus_text_ru');
$textHeader = ot_get_option('text_section_header_ru');
$textContent = ot_get_option('text_section_content_ru');
$latestNews = ot_get_option('latest_news_ru');
$findusHeader = ot_get_option('where_to_find_us_header_ru');
$findusTitle = ot_get_option('where_to_find_us_title_ru');
$findusAddress = ot_get_option('where_to_find_us_address_ru');
}
Also you have to find your theme-options.php file – mine is located in ‘themes/wpnation/includes/theme-options.php’. In theme-options.php find arrays you want to translate and copy them. NOTE – Change the id or it won’t work, other changes are optional.
array(
'id' => 'where_to_find_us_header',
'label' => 'Where to find us header',
'type' => 'text',
'desc' => 'Set header for where to find us section',
'std' => '<span class="icon-globe"></span> Where to find us',
'class' => '',
'section' => 'home_page'
),
array(
'id' => 'where_to_find_us_header_en',
'label' => 'Where to find us header in English',
'type' => 'text',
'desc' => 'Set header for where to find us section in English home page',
'std' => '<span class="icon-globe"></span> Where to find us',
'class' => '',
'section' => 'home_page'
),
array(
'id' => 'where_to_find_us_header_ru',
'label' => 'Where to find us header in Russian',
'type' => 'text',
'desc' => 'Set header for where to find us section in Russian home page',
'std' => '<span class="icon-globe"></span> Where to find us',
'class' => '',
'section' => 'home_page'
),
Looks bad but it works.