I’ve this problem, and have been looking everywhere (amybe searching the wrong thing) for a solution with no results.
In my function.php I have the following code:
function fivelayer_customizer( $wp_customize ) {
$wp_customize->add_section(
'fivelayer_header',
array(
'title' => __('Header','fivelayer'),
'description' => __('You can the customize header of your website from here.','fivelayer'),
'priority' => 35,
)
);
$wp_customize->add_setting(
'fivelayer_contact_info_top',
array(
'default' => '<li><i class="fa fa-map-marker"></i>Sacramento, CA, USA</li><li><i class="fa fa-phone"></i> (326) 556-8888</li><li><i class="fa fa-envelope-o"></i> <a href="">sales@5layer.com</a></li>',
)
);
$wp_customize->add_control(
'fivelayer_contact_info_top',
array(
'label' => __('Contact info','fivelayer'),
'section' => 'fivelayer_header',
'type' => 'textarea',
)
);
}
add_action( 'customize_register', 'fivelayer_customizer' );
I can add a text and it’s shown correctly in my header using:
<?php echo get_theme_mod( 'fivelayer_contact_info_top', '<li><i class="fa fa-map-marker"></i>Sacramento, CA, USA</li><li><i class="fa fa-phone"></i> (329) 556-8888</li><li><i class="fa fa-envelope-o"></i> <a href="">sales@5layer.com</a></li>' ); ?>
So far so good. The problem is that I can’t figure out how to make this translatable by wpml string translation plugin.
I even added a wpml-config.xml file in the root folder for my theme with the following code:
<wpml-config>
<admin-texts>
<key name="theme_mods_fivelayer">
<key name="fivelayer_contact_info_top" />
</key>
</admin-texts>
</wpml-config>
with no success. I can’t figure out how to make the text that the user insert appear in the list of strings to translate.
any insights?