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.

Problem:
Translate json data from Json Structuring Markup plugin - https://wordpress.org/plugins/json-structuring-markup/

Solution:
. the problem here is that the plugin serializes the options before being saved. Then the option is serialized twice as update_option already takes care of the serialization.

This is not a problem with the plugin itself as it unserializes the options every time it gets them, but WPML can't cope with that.

In order to fix the issue, you need to replace each occurrence of:

update_option('some_option_here', serialize( $some_variable ))

With

update_option('some_option_here', $some_variable )

and

unserialize( get_option('some_option_here') )

with

maybe_unserialize( get_option('some_option_here') )

After that, add the following code to WPML > Settings > Custom XML Configuration:

<wpml-config> <admin-texts> <key name="json_structuring_markup_organization"/> <key name="json_structuring_markup_organization_corporate"/> <key name="json_structuring_markup_organization_social"/> </admin-texts> </wpml-config>

- Translate the strings using the string translator. it should work now

IMPORTANT: Please backup your site first before making any change, this is important for security reasons.

This topic contains 20 replies, has 4 voices.

Last updated by ToBulk 1 year ago.

Assigned support staff: Diego Pereira.

Author Posts
September 3, 2018 at 5:32 pm #2700641

ToBulk

Hello Diego,

thank you very much. I'll write to the author, too.

I found another plugin:

https://wordpress.org/plugins/json-structuring-markup/

This stores the data in the wp_options. So you should be able to translate the url entry with WPML! Do you?

Kind regards

Torsten

September 3, 2018 at 5:36 pm #2700656

Diego Pereira
Supporter

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

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

Hello Torsten,

Please try the steps below:
- Make sure you have the Translation Magagement and String Translator extensions active. If not, you can download here: https://wpml.org/account/downloads/
- Go to WPML > Theme and Plugin Localization > Strings in the themes
- Select your theme and click on Scan selected theme for strings
- Go to WPML > String Translation and search for the Strings
- Translate the string, check the Translation is complete field and click on Save.

Ref: https://wpml.org/documentation/getting-started-guide/string-translation/

If you can not find the strings, check it is possible to find it on the Translate texts in admin screen page, like on this link: https://wpml.org/documentation/getting-started-guide/string-translation/#admin_texts

Regards,
Diego

September 4, 2018 at 4:09 pm #2703982

ToBulk

Hello Diego,

this plugin stores in the database under wp-options.

Strings are not found.

!?

Kind reagards

Torsten

September 4, 2018 at 6:31 pm #2704402

Diego Pereira
Supporter

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

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

Hi there,

Probably the string are on the "Translate texts in admin screens " page: https://wpml.org/documentation/getting-started-guide/string-translation/#admin_texts

If you can not find the strings, Please send us access to your WordPress dashboard (website URL, login and password) I'll check and do some tests. - Please use the private field to send the sensitive data - do not post if you do not see it.

It would be better if you give me a test site rather than the live site.

IMPORTANT Please backup a working copy of site files and database before.

Regards,
Diego

September 5, 2018 at 7:04 am #2705703

ToBulk

sorry... the link is wrong

hidden link

September 5, 2018 at 12:40 pm #2706987

Diego Pereira
Supporter

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

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

Hi there,

I found the strings on the "Translate texts on admin screen" page. So i added the following XML code in order to register for translation:

<key name="json_structuring_markup_organization"/>
<key name="json_structuring_markup_organization_corporate"/>
<key name="json_structuring_markup_organization_social"/>

Now the strings are available on the String Translator (admin_texts_json_structuring_markup_organization domain - see screenshot).

Please note that they have a special encoding (built by the plugin). I suggest you copy the entire string to the translation and only edit the URL, as modifying the string structure can cause errors on the website.

If you need more help just let me know.

Regards,
Diego

September 5, 2018 at 3:01 pm #2707744

ToBulk

Hello Diego,

the translation works. Many thanks 🙂

However, this does not change the result in the

hidden link

The same domain is always displayed.

Kind regards

Torsten

September 5, 2018 at 8:01 pm #2708620

Diego Pereira
Supporter

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

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

Hi there,

What is the link of the page? I need to take a look at the source code.

Regards,
Diego

September 7, 2018 at 9:03 am #2713864

ToBulk

Hello Diego, the link to the test site is hidden link . Kind regards Torsten

September 7, 2018 at 4:03 pm #2715382

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi ToBulk,

Thank you for providing more details. Diego is having a public holiday today and I am looking after this ticket. As he is already aware of your site and debugging this issue I will keep this ticket open for him and he will reply asap.

Thank you for your cooperation and patience.

September 7, 2018 at 4:08 pm #2715441

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Just for your info, I run a quick test for the site link you have provided. It is giving an error when I run the test, see attached screenshot please.

September 20, 2018 at 11:54 am #2751970

ToBulk

Hello Diego and Norman,

The problem is still there. But I don't have any other test environment where you can do the Google Structured Test online.

!?

Kind regards

Torsten Bulk

September 20, 2018 at 4:47 pm #2752838

Vincenzo
Supporter

Languages: English (English ) Italian (Italiano )

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

Hello, my name is Vincenzo.
Since Noman currently has a few days off, I will replace him here in the forum.
I hope this is OK with you.

I tried to open the test site but I got this error message: Tunnel *******.ngrok.io not found

Probably the PC where the website is hosted is offline right now.

Do you wish that I set up a fresh SandBox site for you to reproduce the issue?

Thank you

September 21, 2018 at 9:38 pm #2756549

ToBulk

Hello Vincenzo, that's the best solution! Thank you! Regards Torsten

September 24, 2018 at 2:18 pm #2760766

Vincenzo
Supporter

Languages: English (English ) Italian (Italiano )

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

Hello Torsten,

I created a test website with a clean WordPress install. You can access it through this link:
hidden link
Through this link, you will be automatically logged in.

Let me know if you need anything else

Bets regards,
Vincenzo