Hello,
Please take note that I ran a quick test with WPdiscuz and the languages English, German and French and the strings for the plugin were automatically translated as this plugin already comes with pre-defined translations.
---
To alter those default translations you will first need to register the strings.
Go to WPML > String Translation and enable the option to auto-register strings for translation: " Look for strings while pages are rendered" which is located in the bottom section of the page.
Then go to one of your posts on the Frontend. If you already have a post open, please refresh the browser. This will auto-register the strings.
The string will be registered inside the text domain "wpdiscuz". You can use the text-domain filter on WPML > String Translation to locate them.
On my test 244 strings were found.
---
The issue:
When trying to translate the string "Join the discussion" or the "Post comment" button I can confirm that the translations from WPML > String Translation are not showing up on Frontend.
The reason for this might be the way in which those strings are displayed on the comment forms, which means if the translation does not show up, then this is likely related to how WPdiscuz is coded and if it would be coded to WordPress standards, then the translation should work as expected.
Taking a closer look into the plugin, I can confirm that for example the string "Post Comment" is called not only once inside the plugin, it is called three times, while on WPML String Translation we see it only once.
Example:
\wpdiscuz.7.6.27\wpdiscuz\forms\wpDiscuzForm.php
...
$formStructure["right"][wpdFormConst::WPDISCUZ_FORMS_SUBMIT_FIELD]["name"] = isset($phrases["wc_submit_text"]) ? $phrases["wc_submit_text"] : esc_html__("Post Comment", "wpdiscuz");
...
\wpdiscuz.7.6.27\wpdiscuz\forms\wpdFormAttr\Form.php
...
wpdFormConst::WPDISCUZ_FORMS_SUBMIT_FIELD => [
"type" => "wpdFormAttr\Field\DefaultField\Submit",
"name" => esc_html__("Post Comment", "wpdiscuz")
],
...
\wpdiscuz.7.6.27\wpdiscuz\forms\wpdFormAttr\Field\DefaultField\Submit.php
...
protected function initDefaultData()
{
$this->fieldDefaultData = [
"name" => esc_html__("Post Comment", "wpdiscuz"),
];
}
...
I am not sure why the plugin is registering the same string more than once and why can not capture all of these strings, but this would need further testing.
Possible Causes:
Multiple Instances of the String: The string "Post Comment" is repeated across different places in the plugin (e.g., wpDiscuzForm.php, Form.php, Submit.php), but WPML can only track it once.
Incorrect String Registration: WPML is not capturing all instances of the string because the plugin code might not be fully aligned with WPML's standards for string registration.
This means we are likely not translating the correct string.
I went to WPML > Theme & Plugin Localization and scanned the entire WPdiscuz plugin for new strings but even after that, I can only find the string "Post Comment" once on WPML > String Translation.
As I mentioned earlier, this issue might arise, due to the way how the plugin is coded and the plugin might need code adjustments to make it work properly with WPML String Translation.
I then went to the support channel of WPdiscuz and did a quick research and it seems as if they are explaining that translating the plugin will only be possible by using the language files that come with the plugin.
We have been trying to reach out to GVectors (the makers of WPDiscuz) about 7 months ago in order to obtain a partnership, but we have not obtained any cooperation yet.
At this point, the only thing I can offer is to escalate the issue to our compatibility team, which might then again try to reach GVectors and try to solve those issues with them together.
Anyhow, I think it might be better if you first reach out to the support of WPdiscuz, explain the issue, and get a second opinion from them. If there are no plans from their side to make the plugin compatible with WPML, then there might be nothing we can do from our end.
In case the author is interested in starting a partnership with WPML so that we can give support in making the plugin compatible with WPML, then the author can fill out the following form:
https://wpml.org/documentation/support/go-global-program/
In case the author will not cooperate, please reach out to us again, so that we can try to find a workaround for the issue.
Best regards
Andreas
|