Hi again,
just to say that I just tested again on another site and both changes happened when I upgraded the plugin to the latest version, 4.5.6.
I got the strings back by downgrading to 4.4.70 👍
Thanos
Hi @hellothanos
Nothing has been done to the translation. The only thing that is new is that the file for WPML is generated automatically.
You should find it in the plugin folder of Helpful. Based on this file, a translation can then be created.
How this works with Polylang, I can not tell you exactly, because Polylang does not work with the standard translation tool of WordPress.
You can find the file here: https://we.tl/t-pi3E8LmmKq (available for one week)
It must be in the folder /wp-contents/plugins/helpful/ for it to work.
Greetings Kevin
-
This reply was modified 4 years ago by
Pixelbart.
Hey @pixelbart
Thanks for getting back to me and for the info and file.
I see where the issue seems to be coming from now: the new wpml-config.xml file nests the options in a helpful_options key. Because the structure is different the strings seem to somehow disappear.
This is how the translations looked before the upgrade:
https://i.snipboard.io/4rBQf8.jpg
And this is how they look after the upgrade:
https://i.snipboard.io/T29M6s.jpg
I hope this helps. I’ll keep investigating too!
Best,
Thanos
Hello @hellothanos
that is correct as Helpful now stores the options in a single option rather than 80 individual ones. This ensures that the database table used to store options (by WordPress) does not become endlessly large.
This is a common practice among plugin developers. Helpful uses the WPML config file, which is also supported by Polylang. Why this doesn’t work for you, I can’t tell you unfortunately. I can’t do much more here, except generate this file.
Here you can also see that it should work according to Polylang: https://polylang.wordpress.com/documentation/documentation-for-developers/the-wpml-language-configuration-file/
I will not save the options any other way, simply because it is much more performant to do it the way it is done now. This is actually how it is done correctly and I always did it wrong before.
What you can try is to save the settings once completely new. So you go into the settings of Helpful and click everywhere again on save. Maybe PolyLang hasn’t registered the new options yet, because in the option helpful_options there should be something else than shown on your picture.
Stay well and thank you for your feedback!
Greetings Kevin
Got you and I agree. It looks like a Polylang issue. I’ll investigate and post here when I find a solution, in case other users have the same problem.
Thank you for your hard work and support.
Best,
Thanos
Dear Kevin,
After inspecting and with some support from the Polylang dev team it looks like the error is coming from this line:
https://github.com/pixelbart/helpful/blob/8511226c3a8d6d3235b6cc9a1d74fb1f4ed318fb/core/services/class-options.php#L39
As I was told “the options are serialised before updating them into WordPress database. WordPress already serializes so it ends up that its done twice and Polylang (as well as WPML, almost certainly) cannot read the keys as they are unserializing but remain with a serialized block to read.”
As per their suggestion removing the ‘maybe_serialize’ method resolves the issue.
I hope this helps!
Best,
Thanos
@hellothanos
Thank you for your feedback and especially for your help. I didn’t know that WordPress serializes the options itself. Good to know and thanks for that!
I removed it with the latest update so you don’t have to do that for yourself anymore.
Thanks again!
Stay healthy and greetings
Kevin