Problem with pll_register_string and same string to translate
-
Hi,
On my WordPress, I use wpml-config.xml file to translate options.
<wpml-config> <admin-texts> [...] <key name="my_plugin_1_settings"> <key name="my_plugin_1_custom_text"></key> </key> [...] <key name="my_plugin_2_settings"> <key name="my_plugin_2_other_text"></key> </key> [...] </admin-texts> </wpml-config>As you can see, I have 2 plugins, and each one has its own options. The fact is that it exists an option in each of those 2 plugins that has the same string as value. For example “Lorem ipsum”.
But in “Strings Translations” list, I can only see the string for the option my_plugin_2_other_text. And on my website, only this string appears translated.
I took a look into your code and I see that in pll_register_string function (triggered on parsing the wpml-config.xml file), you use the md5 of the string as a key in the associative array that stores the registered string : here
And if I trace it, I can see that the registration of the first option string my_plugin_1_custom_text is overrided by the registration of the second option string my_plugin_2_other_text (because they have the same string = the same md5 = the same array key). And at the end, only the registration of the second string is available.
How can I prevent this, without changing the options values?
Thank you.
The topic ‘Problem with pll_register_string and same string to translate’ is closed to new replies.