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: Exception
This topic contains 5 replies, has 0 voices.
Last updated by Andrey 2 weeks, 2 days ago.
Assisted by: Andrey.
| Author | Posts |
|---|---|
| February 9, 2026 at 4:26 pm #17806295 | |
|
rhondaF |
I'd like to translate certain text at the theme level such as 'Related Issues' and 'Related Content' on a page like hidden link. I followed hidden link |
| February 9, 2026 at 6:49 pm #17806708 | |
|
Andrey WPML Supporter since 06/2013 Languages: English (English ) Russian (Русский ) Timezone: Europe/Kyiv (GMT+02:00) |
Thank you for contacting WPML support. Do you know how the 'Related Issues' and 'Related Content' text is added to the page? Are you able to locate this with your current theme files? If so, could you please share the relevant code? I've enabled debug information for this support ticket. Please refer to this link for instructions on how to retrieve this information from your site and provide it to us: http://wpml.org/faq/provide-debug-information-faster-support/ |
| February 12, 2026 at 1:02 am #17814594 | |
|
rhondaF |
Here's some related code: array( here's another: get_template_part( We're aiming to do this without using wpml string translations plugin if possible. |
| February 12, 2026 at 7:41 pm #17818692 | |
|
Andrey WPML Supporter since 06/2013 Languages: English (English ) Russian (Русский ) Timezone: Europe/Kyiv (GMT+02:00) |
Thank you for your feedback. To make your text translatable, you need to wrap all static texts in gettext calls (e.g., __(), _e(), etc.). After that, go to WPML → Theme and plugins localization and scan your child theme for new strings. This will register them in WPML’s String Translation, where you can provide translations. hidden link
Scanning a Theme or Plugin to Update Existing Translations: Let's look at the examples you shared: - This one looks correct __( 'Related Chapters', 'aclu-affiliate' ), but you need to make sure that aclu-affiliate textdomain is loaded correctly. array( heading' => __( 'Related Chapters', 'aclu-affiliate' ), 'cards' => $related_cards, 'columns' => 2, ) - This example has a missing textdomain __( 'Related Content' ), it should be as in the example above. get_template_part( 'global/template-parts/organisms/components/cards--latest-content/controller/cards--latest-content--controller', null, array( 'heading' => __( 'Related Content' ), 'description' => false, How to properly load the text domain? For more information, please refer to these links: https://developer.wordpress.org/reference/functions/load_theme_textdomain/ https://developer.wordpress.org/themes/functionality/internationalization/#text-domain Before proceeding with any updates, please remember to back up your database first. |
| February 18, 2026 at 8:58 pm #17833955 | |
| rhondaF |
Thanks this was very helpful. I have a parent and child theme so trying to figure out why my parent theme is only showing 1 item to translate. Another question I had was when I make a change to translate text, I can do so via the UI. If I export the po file, I see the translated text. If i make the change there, I'd prob need to import the file for the site to register, correct? What if I wanted to use this same file to make changes to 50 sites, how would I go about doing so? I wouldn't want to do this manually for each site. Thanks New threads created by Andrey and linked to this one are listed below: |
| February 19, 2026 at 1:33 pm #17836205 | |
|
Andrey WPML Supporter since 06/2013 Languages: English (English ) Russian (Русский ) Timezone: Europe/Kyiv (GMT+02:00) |
Thank you for your feedback. I hope that you will figure this out. To keep everything organized and ensure each question receives the attention it deserves, I’ve created a new support ticket for a new question. I will assist you there: |