Hi, Amit here, I am the WPML Support Manager, our current ticket queue is quite calm and I'd like to encourage you to use our new chat support option

We are working hard to debug and look at every single report

All of the known issues are documented in https://wpml.org/known-issues/ 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 here https://wpml.org/faq/checklist-before-opening-a-ticket-in-wpml-support/

in WPML we are very proud at our level of support, we are one team from all over the world and we are all experienced WordPress developers, you can read more about us here - https://wpml.org/forums/supporters/

OK enough talking, going to fix some issues

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

Last updated by Ahmed Mohammed 2 years, 11 months ago.

Assigned support staff: Ahmed Mohammed.

Author Posts
October 27, 2015 at 12:23 pm #733538

matsH

Hello sir/miss,

I'm a theme developer and I wish to offer full WPML support.
Right now the only issue I have is to translate the get_theme_mod calls in my files. I have already checked other threads but they didn't answer my question yet.

Example of customizer use in one of my themes:

This is the control in the customizer.php file

	$wp_customize->add_setting( 'theme_customizer_headertextlineone', array(
		'sanitize_callback' => 'sanitize_text_field'		
	) );

	$wp_customize->add_control( new WP_Customize_Textarea_Control( $wp_customize, 'theme_customizer_headertextlineone', array(
		'label' => __( 'Intro header', 'section' ),
		'section' => 'theme_customizer_headertext',
		'settings' => 'theme_customizer_headertextlineone',
		'priority' => 1
	) ) );

This is that setting echo'd on the front end

<?php if ( get_theme_mod('theme_customizer_headertextlineone') && is_front_page() ) { ?>
<?php echo esc_textarea(get_theme_mod( 'theme_customizer_headertextlineone'));?>
<?php } ?>

I tried to solve the issue with a wpml-config.xml file but to no avail:

<wpml-config>
    <admin-texts>
        <key name="theme_mods_landy">
            <key name="theme_customizer_headertextlineone" />
        </key>
    </admin-texts>
</wpml-config>

As you can see I have sub sections inside panels inside of the customizer (not sure if this changes the values in the wpml-config.xml file). Could you nudge me in the right direction? Much appreciated!

Kind regards

October 30, 2015 at 9:48 am #736185

Ahmed Mohammed
Supporter

Timezone: Europe/Rome (GMT+01:00)

Thank you for contacting WPML support and sorry for the unintentional delayed reply. I think the issue is coming from your wpml-config.xml file. As you mentioned, you have sub sections, so you may need to try this wpml-config.xml file

<wpml-config>
    <admin-texts>
        <key name="theme_mods_landy">
            <key name="theme_customizer_headertext">
                 <key name="theme_customizer_headertextlineone" />
             </key>
        </key>
    </admin-texts>
</wpml-config>

This should be working, if you still have issue, could you please give me a copy of your theme to debug it on our servers ?
I'll mark the next reply as private in case you're posting the download link of your theme.

October 30, 2015 at 11:32 am #736284

Ahmed Mohammed
Supporter

Timezone: Europe/Rome (GMT+01:00)

You're right, there's something wrong with the current version of WPML 3.2.7. I've test the following wpml-config.xml file with the dev version of WPML 3.3 and it's working without problems.

<wpml-config>
	<admin-texts>
		<key name="theme_mods_Landy">
			<key name="theme_customizer_headertextlinetwo"/>
			<key name="theme_customizer_headertextlineone"/>
		</key>
	</admin-texts>
</wpml-config>

As a workaround with the current version, you can add those strings to string translation table by going to WPML->> String Translation Page -> then click on "Translate texts in admin screens »" at the end of the page. Then follow the attached screenshot. It'll add the string to the String Translation table. When WPML 3.3 is released, the above wpml-config.xml file will be working without doing those extra steps to include the strings in the string translation table.

Please let me know if you have any further comments/questions.
Thanks!

November 14, 2015 at 11:57 am #746459

matsH

Thanks!

January 13, 2016 at 12:43 pm #786844

nicolasG-23

Hello,

I've a question in same subject.

I've this code to add theme options :

$wp_customize->add_section(
        'perso',
        array(
            'title' => 'Personnalisation du thème',
            'priority' => 1,
        )
    );

    /* Nom et titre du folio */
	$wp_customize->add_setting('portfolio_firstname');
    
    $wp_customize->add_control(
    'portfolio_firstname',
    array(
        'label' => 'Prénom',
        'section' => 'perso',
        'type' => 'text'
    ));

I use string translation plugin to translate string but I can't see this setting in string translation part.

Is it normal ?

January 13, 2016 at 2:09 pm #786929

nicolasG-23

So, I've understood your post... and add config file with

<wpml-config>
	<admin-texts>
		<key name="my_plugins_options">
        	<key name="portfolio_firstname"></key>
    	</key>
    </admin-texts>
</wpml-config>

and go to admin string part but can't see it.

January 13, 2016 at 4:16 pm #787124

Ahmed Mohammed
Supporter

Timezone: Europe/Rome (GMT+01:00)

@nicolasg-23, could you please open another ticket so that one of our supporters could help you with your issue ?

Probably, it's coming from this line

<key name="my_plugins_options">