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 thread is resolved. Here is a description of the problem and solution.

Problème:
L'utilisateur n'arrivait pas à traduire des chaînes sur le thème enfant, il pouvait le faire pour le thème parent
Solution:
Il faudrait ajouter le code suivant à la configuration XML du thème enfant ou en forçant la configuration personnalisée si l'extension Translation Management est installée.

<wpml-config>
    <admin-texts>
        <key name="admin_texts_theme_mods_buildpress-child">
            <key name="charset_setting" />
            <key name="projects_title" />
            <key name="projects_subtitle" />
            <key name="projects_slug" />
            <key name="prev_project_btn" />
            <key name="next_project_btn" />
            <key name="footer_left_txt" />
            <key name="footer_right_txt" />
        </key>
    </admin-texts>
</wpml-config>

L'utilisateur ne pouvait pas non plus activer les chaînes sur l'écran des chaînes admin de String Translation à cause de la valeur faible de MaxInputVars.
Relevant Documentation:
https://wpml.org/documentation/getting-started-guide/translating-theme-options/
https://wpml.org/documentation/support/language-configuration-files/
https://wpml.org/documentation/support/language-configuration-files/overriding-language-configuration-files/

This topic contains 4 replies, has 2 voices.

Last updated by Basil 5 months ago.

Assigned support staff: Jamal.

Author Posts
May 9, 2019 at 10:07 am

Basil

I am using BuildPress theme with a child theme which I created.

The translations work great under the parent theme, however the translation does not work when I switch to the child theme.

The parent theme already contains a wpml-config.xml file which reads as follows:
<wpml-config>
<admin-texts>
<key name="theme_mods_buildpress">
<key name="charset_setting" />
<key name="projects_title" />
<key name="projects_subtitle" />
<key name="projects_slug" />
<key name="prev_project_btn" />
<key name="next_project_btn" />
<key name="footer_left_txt" />
<key name="footer_right_txt" />
</key>
</admin-texts>
</wpml-config>

These are the fields I want to translate.

I tried to copy the wpml-config.xml file from the parent to the child theme, I tried to rename theme_mods_buildpress to something like theme_mods_buildpress_child in the wpml-config.xml child theme, I even tried deleting the parent's wpml-config.xml file as suggested by David in some other thread with no success.

Please help. I am out of options.

May 9, 2019 at 11:35 am #3775637

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hello,

Thank you for contacting WPML Support. I will be glad to help with this.

I have checked your website, and as you guessed the domain under which the string will be translatable is "theme_mods_buildpress-child" with a middle score (-) instead of underscore (_).
But the XML configuration won't work if you are not using Translation Management plugin.

I tried to configure it through the "admin strings" screen from WPML->String Translation, but I could not. I suspect it is because of the low value of MaxInputVar in your PHP settings. The admin strings options exceed the MaxInputVars value as you can see in the attached image.

I also framed the child theme domain so you can see the middle score.

Either, activate Translation Management and override XML configuration, use the middle score in the name of the key.
Or increase the value of MaxInputVars and activate the options through "admin strings" screen.

After that, you will be able to translate the options in String Translation.

I hope this helps, let me know if you resolved it or still need assistance.

Best regards,
Jamal
WPML Support

May 9, 2019 at 9:04 pm #3779365

Basil

Hi Jamal,

Thanks for the guidance. I was able to bypass the Translation Management and increasing the value of MaxInputVars by following these steps:

1) Modified the key name to theme_mods_buildpress-child under the wp-config.xml as you have suggested

2) Went to the frontend and clicked on customize, and made small changes to some of the fields I needed the translation to work

Suddenly I was able to see the domain admin_texts_theme_mods_buildpress-child under the string translation. I did the translation and it worked.

Did you do any modification other than what I have mentioned above?

Were the fields already appearing under the "admin strings" before or did you do something to make them as shown in your screenshot?

May 10, 2019 at 8:59 am #3782439

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hello,

The strings were already present in "admin strings" screen, I tried to activate some of the fields manually, but they were not activated, then I checked MaxInputVars and I was sure the fields were outside the 3000 input vars allowed.

You can say I did nothing to have the strings available. Now after you have updated the XML configuration, they were translatable in String Translation.

I remain at your disposal.

Best regards,
Jamal

May 11, 2019 at 5:20 am #3789557

Basil

My issue is resolved now.

Thank you!