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

Last updated by Riffaz 3 months, 3 weeks ago.

Assigned support staff: Riffaz.

Author Posts
June 18, 2019 at 12:13 pm #4043711

mathiasH-12

I am trying to get the translation strings available for translation with my custom modules.
I found this solution but i can't get it to work. Is this solution still viable?

https://wpml.org/forums/topic/translating-custom-modules-for-beaver-builder/

June 19, 2019 at 5:04 am #4047965

Riffaz
Supporter

Languages: English (English )

Timezone: Asia/Colombo (GMT+05:30)

Hi,

Thank you for contacting WPML support.

That should work unless beaver did not change anything related to this after 2018.
It's a while now.
So it should be tested again in a fresh installation.

please,
1. go to hidden link
2. install your theme
3. create / add your custo module
4. configure the WPML as you have it on your site. at the last step just click next (site key)
5. create only one page with the custom modules you created.
6. recreate the issue.
7. let us know how to check this and how to recreate this issue.
8. explain the step 7 with screenshots and URLs for better understanding.
9. we will check and get back to you with the possible fix / solutions.

Regards,
Riffaz.

June 19, 2019 at 7:59 am #4049247

mathiasH-12

Hello Riffaz,
I did a clean install and it works great there.

I also did another fresh install on my own multisite domain, and there the new one works great but the one i initially wrote about does not work as intended.

I would guess that this has to do with the index of what is translatable.

Is there an option to reindex strings for translations?

June 19, 2019 at 10:43 am #4050807

Riffaz
Supporter

Languages: English (English )

Timezone: Asia/Colombo (GMT+05:30)

Hi,

Thank you for the details.

So this is very specific to your one site.

Is there an option to reindex strings for translations?
- no, but see if this can help https://wpml.org/documentation/translating-your-contents/page-builders/preserving-existing-translations/

Did you check this after disabling all the plugins in your site?

Also, check if your custom modules have any custom fields set to 'Don't translate' in WPML > Settings > Custom Fields Translation
If you find some, make them translatable.

If none on these helps we need to replicate your site in our test environment and check this.

Let me know how it goes.

Regards,

June 19, 2019 at 12:12 pm #4051349

mathiasH-12

Hello again Riffaz,

None of the proposed solutions worked for me.
I can't seem to find and consistency for the problem, to narrow it further down.

June 20, 2019 at 12:05 pm #4059705

mathiasH-12

Hello again Riffaz,
The site have been migrated now.
On this page, there are 4 duplicate custom modules (same type) hidden link, but when i try to translate it. Only 1 will appear.

Thank you very much for looking into it.

June 22, 2019 at 7:22 am #4070605

Riffaz
Supporter

Languages: English (English )

Timezone: Asia/Colombo (GMT+05:30)

Hi,

Thank you for this.
We need your site login details to login to the migrated site.

The next reply is private.

June 25, 2019 at 4:31 am #4081269

Riffaz
Supporter

Languages: English (English )

Timezone: Asia/Colombo (GMT+05:30)

Hi,

Thank you for this.

I click on pencil/translation icon : hidden link
I translated it : hidden link
And the translation works fine in the English page: hidden link

Danish page: hidden link
English page: hidden link

So I could not replicate the issue.

Did you translate the page as I translated? or am I missing something? or if you can reproduce the issue in the test site let me know the steps, please.

Regards,

June 25, 2019 at 7:19 am #4081733

mathiasH-12

The only thing i could see when i clicked the translation icon was the attached.
How did you get all the other menu items to show up?

Do you need to have a 100% translated site before new added modules show up?

June 25, 2019 at 1:01 pm #4084755

Riffaz
Supporter

Languages: English (English )

Timezone: Asia/Colombo (GMT+05:30)

Hi,

How did you get all the other menu items to show up?
- I did nothing but just clicked on the translation icon (gear/pencil)
- so it should work if there is no any setting blocks this or some incompatible issue.

Could you please create a new page in your site just as you created in the CloudWays and check the issue?

Let me know how it goes.

Regards,

June 25, 2019 at 1:54 pm #4085185

mathiasH-12

I have absolutely no idea of why this is working now.
Is it because you have to finish a translation 100%, before new modules are added into the translation?

June 25, 2019 at 1:59 pm #4085205

mathiasH-12

If i create a new page on the hidden link i get the same problem again.

1. I created a page called test
2. added 1 custom module
3. saved page from Beaver builder.
4. went to translation and it shows correctly
5. i add another custom module
6. saved page from Beaver builder.
6. going into translation, and it does not show up

Now in the frontend there are 2 custom modules, but only one available for translation.

June 26, 2019 at 12:03 pm #4092257

Riffaz
Supporter

Languages: English (English )

Timezone: Asia/Colombo (GMT+05:30)

Hi,

Our developers are looking into this.
Please be patient till we get back to you.

Regards,

June 28, 2019 at 8:52 am #4105767

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

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

Hello!

Riffaz is not currently available so he will not be able to answer to you today.

Since one of the modules showed correctly in the translation editor i am assuming that you have already followed this guide : https://wpml.org/documentation/support/translating-beaver-builder-plugin/

In this guide you'll have a few Beaver registration examples (check the github links), you can use the hooks to correctly make them all WPML compatible.

I found an issue while searching for the elements, though and it's that they all have the same name "overskrift", so that might be the reason why you only have one of them showing.

I temporarily changed the name of the modules in the JSON and then added a workaround which is usually aimed to end-users by adding this function to the functions.php file:

add_filter( 'wpml_beaver_builder_modules_to_translate', 'add_my_beaver_builder_modules' );
function add_my_beaver_builder_modules( $modules ) {
    $modules['menu-headline'] = array(
        'conditions' => array('type' => 'menu-headline'),
        'fields' => array(
            array(
                'field'       => 'headline',
                'type'        => __( 'Headline Text', 'sitepress' ),
                'editor_type' => 'LINE'
            ),

        ),
    );
    $modules['menu-subline'] = array(
        'conditions' => array('type' => 'menu-subline'),
        'fields' => array(
            array(
                'field'       => 'subline',
                'type'        => __( 'Overskrift', 'sitepress' ),
                'editor_type' => 'LINE'
            ),

        ),
    );
    $modules['menu-items'] = array(
        'conditions' => array('type' => 'menu-items'),
        'fields' => array(
            array(
                'field'       => 'item',
                'type'        => __( 'ret', 'sitepress' ),
                'editor_type' => 'LINE'
            ),

        ),
    );

  return $modules;
}

Apart from the filter, everything else in this code should work correctly if you fix it on your end by following the guide i linked above.

As you can see, i changed "overskrift" to "menu-items", "menu-subline" and "menu-headline".

I can only guess "spacer" took the name "overskrift" so i had to rename them all, but that's just a guess, i didn't check that module (what we just did is actually a bit passed the scope of this support but we wanted to point you in the right direction).

I suggest you give both the name of the module and the "type" (label) in the module registration a unique name. that way you will not encounter any issues while making them comaptible to WPML.

If you have any more questions, i'm sure Riffaz will be able to further help you out.

Regards.

June 30, 2019 at 6:45 am #4113459

Riffaz
Supporter

Languages: English (English )

Timezone: Asia/Colombo (GMT+05:30)

Hi,

Please let us know the results after you making the changes as Alejandro explained to you.
Hopefully, this is fine now.

Regards,