✨ Gato AI Translations for Polylang now supports translating meta containing arrays and objects

Gato AI Translations for Polylang has just released v12.2.0 with a brand-new feature: Translate meta data containing arrays and objects (in addition to a single string).
The following data structures in meta fields are now supported:
- Single string. Eg:
"hello world"
- Array of strings. Eg:
["hello", "world"]
- Object's 1st level strings. Eg:
{ level1_key1: "hello", level1_key2: "world"}
The plugin will identify the data structure without any manual intervention, and translate the strings accordingly:
- Detect arrays and objects in your meta fields
- Extract the translatable strings
- Translate them
- Store the results in the database, preserving the original data structure
Extending compatibility to more plugins
This feature provides support for plugins that store arrays and objects in meta fields.
An example is Slim SEO, a popular SEO plugin that stores its meta data as a JSON object under meta key slim_seo
.
For instance, this is how that meta for a post is stored in the database:
a:4:{s:5:"title";s:67:"This is the meta title in English, will it be translated my friend?";s:11:"description";s:42:"I hope it will, or else I'm fried!";s:7:"noindex";i:1;}
...representing this JSON object:
{
"title": "This is the meta title in English, will it be translated my friend?",
"description": "I hope it will, or else I'm fried!",
"noindex": 1
}
To translate the Slim SEO meta for our posts and pages, you just need to add the slim_seo
meta key in the Settings for translating custom post meta:

Now, when translatinga a page which contains Slim SEO meta...

...the translated page will have the SEO meta also translated:

Enjoy!