This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
Tagged: Custom Work
This topic contains 4 replies, has 1 voice.
Last updated by Marcel 2 months, 1 week ago.
Assisted by: Marcel.
| Author | Posts |
|---|---|
| November 12, 2025 at 3:47 am #17568588 | |
|
erikaR-3 |
Background of the issue: Symptoms: Questions: |
| November 12, 2025 at 4:01 am #17568625 | |
|
erikaR-3 |
Would love help figuring out how to translate my custom quiz plguin. Some strings are translated, but not the strings in my quiz-template.php file. |
| November 12, 2025 at 3:05 pm #17571539 | |
|
Marcel Supporter
Languages: English (English ) Spanish (Español ) German (Deutsch ) Timezone: Europe/Madrid (GMT+02:00) |
Hi, Could you please upload the specific code of this plugin to http://www.pastebin.com However, please note that custom coding is not part of our support policy, so I may only be able to guide you toward a possible solution rather than provide a full code fix. Thank you! Best regards, |
| November 12, 2025 at 7:57 pm #17572721 | |
|
erikaR-3 |
Hi Marcel, Thanks, here is the main php: Here is the JS: Here is the template file: |
| November 13, 2025 at 12:05 pm #17574704 | |
|
Marcel Supporter
Languages: English (English ) Spanish (Español ) German (Deutsch ) Timezone: Europe/Madrid (GMT+02:00) |
Thanks! In the template, all static texts are already correctly wrapped in gettext calls and associated with the text domain wikipersona-quiz. These strings can be scanned in WPML → Theme & Plugin Localization and then translated via WPML String Translation. However, the quiz logic currently has two copies of all text: To make the plugin fully compatible with WPML, all quiz text (personas, questions, and options) must be moved out of the JavaScript file. The correct approach is to define and translate all text in PHP, then pass the translated data into the JavaScript using wp_localize_script(). The JS file should no longer contain any hard-coded English strings—only the data coming from PHP. I recommend hiring a developer to update the plugin structure, so all user-facing text is properly prepared for localization. Best regards, |

