Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
The client is using Yootheme with a multilingual website and has added a custom language for Inuktitut in WPML. However, Inuktitut is not appearing in the Yootheme template options for blogs.
Solution:
We recommend taking a backup of the website before proceeding. Then, follow these steps:
1. Navigate to Appearance > Theme File Editor.
2. On the right-hand side, select the file

wp-content\themes\yootheme\packages\builder-wordpress-source\src\Listener\LoadBuilderConfig.php

.
3. Replace the existing code with the following:

        $all_languages = get_available_languages();<br />        <br />        if (defined('ICL_SITEPRESS_VERSION')) {<br />            $languages = [];<br />            $wpml_langs = apply_filters( 'wpml_active_languages', null, [] );<br />            $all_languages = array_map(function( $lang_item ){<br />                return $lang_item['default_locale'];<br />            }, $wpml_langs);<br />        }<br /><br />        foreach ($all_languages as $code => $lang) {<br />            if (isset($translations[$lang])) {<br />                $languages[] = ['text' => $translations[$lang]['native_name'], 'value' => $lang];<br />            } else if (defined('ICL_SITEPRESS_VERSION')) {<br />                $languages[] = ['text' => $wpml_langs[$code]['native_name'], 'value' => $lang];<br />            }<br />        }

After making these changes, Inuktitut should appear in the Yootheme template options.

Please note that this solution might be outdated or not applicable to your case. If the issue persists, we highly recommend checking related known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If necessary, please open a new support ticket with us.

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.

Tagged: 

This topic contains 11 replies, has 2 voices.

Last updated by Lucas Vidal de Andrade 1 month, 2 weeks ago.

Assisted by: Lucas Vidal de Andrade.

Author Posts
February 20, 2024 at 1:38 pm #15323087

anahitaR-2

I am trying to:
I'm using Yootheme and have a multilingual website. One of the languages is Inuktitut which is not listed in WPML languages. So I created a new language in WPML for Inuktitut.
hidden link

By Yootheme you can create different templates for Blogs for each language. The issue is when I want to create a template I can see all added languages except Inuktitut.
hidden link

I expected to see ᐃᓄᒃᑎᑐᑦ too on the image above.

February 20, 2024 at 6:48 pm #15324510

Lucas Vidal de Andrade
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

I would like to request temporary access (wp-admin and FTP) to your site to take a better look at the issue. It would be better to a testing site where the issue is replicated.

You will find the needed fields for this below the comment area when you log in to leave your next reply. The information you will enter is private which means only you and I can see and have access to it.

Maybe I'll need to replicate your site locally. For this, I’ll need to temporarily install a plugin called “Duplicator” or "All in One WP Migration" on your site. This will allow me to create a copy of your site and your content. Once the problem is resolved I will delete the local site. Let me know if this is ok with you.

IMPORTANT

- Please make a backup of site files and database before providing us access.
- If you do not see the wp-admin/FTP fields this means your post & website login details will be made PUBLIC. DO NOT post your website details unless you see the required wp-admin/FTP fields. If you do not, please ask me to enable the private box. The private box looks like this:

hidden link

February 21, 2024 at 7:52 pm #15330310

anahitaR-2

Hi Lucas,

So many thanks for your help.
I tried to install Yootheme in the Sandbox but got the attached error.

So I decided to reinstall Yootheme, WPML and the database on the domain below and created one custom language and a template.
hidden link

This is solely for testing purposes, and you already have all the credentials (WordPress backend and FTP). Please feel free to explore or modify anything you need—it's just a test website, and there is no need for concern.

- Do you have an estimate of how long it might take to resolve the issue?
- By the way, would you please let me know why I got the message below?
"Your server settings do not allow for languages in directories."

Thanks a lot again.

error1.jpg
Screen Shot 2024-02-21 at 2.37.52 PM.png
February 22, 2024 at 1:44 pm #15333830

Lucas Vidal de Andrade
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello,

Thank you so much for sharing! It usually takes a few business days, mostly less than a week, but it really depends on the complexity of the issue.

Here's an explanation for what might be causing the error you experienced:
https://wpml.org/documentation/getting-started-guide/language-setup/language-url-options/cannot-activate-language-directories/

It appears to be specific to this installation, since it hasn't happened before. Let's focus on the custom language. We can take a better look at this issue in the future, if it persists after solving the custom language one. This way we can ensure that everything will be solved.

I'll get back to you as soon as I hear from our developers.

February 22, 2024 at 3:30 pm #15334435

anahitaR-2

Thanks a million Lucas for your help.

Yes, the second issue is not important at all at this point and fortunately, I didn't face that on my main website.

Looking forward to your update.

February 26, 2024 at 3:57 pm #15345230

Lucas Vidal de Andrade
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello,

I got a feedback from our developers. They kindly asked you to update your theme to the latest version, to see if the problem is fixed.

If the problem is not fixed, please let us know, so we can keep looking into the cause of this issue.

February 26, 2024 at 4:17 pm #15345326

anahitaR-2

Hi Lucas,

Thanks a lot for your follow-up. I've gone ahead and updated the theme to the latest version on the test website:
hidden link

However, the issue persists and Inuktitut hasn't shown up yet. Just wanted to give you a heads up that the latest version of Yootheme was released on February 13, 2024.
hidden link

Thanks again

wpml.jpg
February 26, 2024 at 4:25 pm #15345406

Lucas Vidal de Andrade
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Thank you. Can you please provide us with a copy of the latest version of your theme? We'll use it only locally, for debugging purposes.

I've enabled the package field, so you can share it privately with us. I'll then send it to our dev team.

February 26, 2024 at 8:46 pm #15346316

Lucas Vidal de Andrade
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Thank you for sharing 🙂 I'll get back to you as soon as I hear from our devs!

February 29, 2024 at 10:40 am #15357352

Lucas Vidal de Andrade
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello,

I got feedback from our developers. YooTheme is unfortunately incompatible with WPML, so we'll need to tweak the code a little bit in order for your custom language to get recognized. Make sure you have a backup of your website and follow these steps:

1. Go to Appearance > Theme File Editor
2. On the right hand side, select the file wp-content\themes\yootheme\packages\builder-wordpress-source\src\Listener\LoadBuilderConfig.php
3. Substitute this code:

        foreach (get_available_languages() as $lang) {
            if (isset($translations[$lang])) {
                $languages[] = ['text' => $translations[$lang]['native_name'], 'value' => $lang];
            }
        }

With:

        $all_languages = get_available_languages();
        
        if (defined('ICL_SITEPRESS_VERSION')) {
            $languages = [];
            $wpml_langs = apply_filters( 'wpml_active_languages', null, [] );
            $all_languages = array_map(function( $lang_item ){
                return $lang_item['default_locale'];
            }, $wpml_langs);
        }

        foreach ($all_languages as $code => $lang) {
            if (isset($translations[$lang])) {
                $languages[] = ['text' => $translations[$lang]['native_name'], 'value' => $lang];
            } else if (defined('ICL_SITEPRESS_VERSION')) {
                $languages[] = ['text' => $wpml_langs[$code]['native_name'], 'value' => $lang];
            }
        }

Your end-result should look like the one in the image. Let me know how it goes.

Edit Themes _ Wordpress _ WordPress.jpeg
March 1, 2024 at 12:15 am #15360743
anahitaR-2

Thanks a million Lucas.
The issue is resolved. 🙂
Really appreciate your great help.

Would you please help me with the 2 questions below too?
1. Do I lose this code in case of theme update? If yes is it possible to avoid it somehow by child theme?

2. I placed a language switcher on the top right-hand side of the website below. Is there any way to make the rectangle angles rounded like the other buttons?
hidden link

Thanks again

New threads created by Lucas Vidal de Andrade and linked to this one are listed below:

https://wpml.org/forums/topic/split-keep-code-after-updates/

https://wpml.org/forums/topic/split-language-switcher-style/

March 1, 2024 at 11:53 am #15362663

Lucas Vidal de Andrade
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Thank you! Since the initial issue has been resolved, I'll create new tickets for your other inquires.

1. Do I lose this code in case of a theme update? If yes, is it possible to avoid it somehow by child theme?
https://wpml.org/forums/topic/split-keep-code-after-updates/

2. I placed a language switcher on the top right-hand side of the website below. Is there any way to make the rectangle angles rounded like the other buttons?
https://wpml.org/forums/topic/split-language-switcher-style/

You can mark this one as resolved. I'll answer you there 🙂

March 1, 2024 at 4:37 pm #15364044

anahitaR-2

So many thanks Lucas for your great help. 🙂

anahitaR-2 confirmed that the issue was resolved on 2024-03-01 16:37:15.
This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.