Hello Developer,
I am writing to report a critical localization issue with the User Verification plugin. The new React-based settings page cannot be translated into other languages (in my case, Portuguese - pt_BR).
After an extensive debugging process on a clean, local WordPress installation (using a default theme and no other plugins), we have isolated the root cause of the issue.
Summary of Findings:
- Standard PHP translation is partially working: The main admin menu title ("User Verification") is correctly translated via the
.mofile. This confirms that the text domain is being recognized at a basic level. load_plugin_textdomainFailure: A diagnostic test revealed that the plugin'sload_plugin_textdomainfunction is failing silently and returningfalse. We bypassed this by loading the text domain manually from the theme'sfunctions.php, which was successful for PHP but did not solve the React UI issue.- React UI remains untranslated: Despite having perfectly synced and valid
.po,.mo, and a manually generated JED.jsontranslation file in the/languagesdirectory, the React interface remains entirely in English. wp i18n make-jsonFails: The standard WP-CLI commandwp i18n make-jsoncorrectly reportsSuccess: Created 0 files.. This happens because it cannot find any scripts registered for translation within the plugin's code.- The Root Cause: A final diagnostic test confirmed the fundamental problem. The main JavaScript for the React settings page is not enqueued via the standard
wp_enqueue_scriptfunction. The script handle does not appear in the global$wp_scripts->queueon the admin page.
Conclusion:
The reason the React UI cannot be localized is a fundamental architectural issue. Because the application script is not properly enqueued, it is impossible to attach translations using the standard WordPress function wp_set_script_translations. The entire WordPress JavaScript localization system is being bypassed.
Could you please update the plugin to ensure that the React application's main script is enqueued using standard WordPress best practices? This will allow the localization system to function as intended and for users worldwide to translate your plugin.
Thank you for your time. I look forward to a fix in a future version.
