Translating WooCommerce Subscriptions – Troubleshooting Translation Issues

Like other extensions sold on WooCommerce.com, WooCommerce Subscriptions is translation-ready. However, in some cases, you may find the translations not working or that you need to create your own. Here are some tips to help troubleshoot your translation of WooCommerce Subscriptions.

We have an extensive guide on translating WooCommerce extensions. Check that out for the basics, and use this page for questions specific to the Subscriptions extension.

Are translations available for Subscriptions?

↑ Back to top

There are translations for several languages available in the WordPress.org translations that can be added to your site. For any of these languages, here’s how to add the translation:

  1. Install the WooCommerce Subscriptions extension on your site (WordPress can only search for translations for installed extensions)
  2. Change the language of your site via Settings > General
  3. Navigate to Dashboard > Updates in your site’s admin area.
  4. Scroll to the bottom of the page, and select “Update Translations” under the Translations heading – WordPress will search for existing translations for your site’s language.

I can’t get the translation to show up on the site

↑ Back to top

We have an extensive guide on translating WooCommerce extensions that includes tips on troubleshooting translations. That’s the best place to start.

How to create your own translation for the extension

↑ Back to top

We have an extensive guide on translating WooCommerce extensions that includes tips on troubleshooting translations. That’s the best place to start.

We also know of a community-sourced German translation for Subscriptions.

I can’t get a certain string to translate

↑ Back to top

You’ll want to check that the string is available in the translation tool of your choice; see the guide on translating WooCommerce extensions for an overview.

If you’re having trouble finding a string to translate, it may be because some strings use placeholders such as %1$s every %2$s. If you are searching for a phrase or sentence that can change depending on the way your subscription product is configured, that’s a good clue that there will be placeholder strings. If you can’t find the exact phrase that you want to translate, search for keywords/phrases instead of the exact phrase.

For Loco Translate, you may also need to press “Sync” to update the strings from the template after updating Woo Subscriptions.

If you’re having trouble with .po files, you’ll see that each string is registered and translated this way

  • msgid”Subscriptions”: This is the default string (the one that is defined in the code). You don’t need to modify this string. You need to keep it as a reference to the string that you’re translating.
  • msgstr”” : This is where the translation should be added (for example:  msgstr “Subscripciones”). If the string was defined with a context, you’ll also see a msgctxt line with the context specified in the gettext function. You can translate these .po files editing them in a code editor and providing the proper translations in each msgstr line, or you can use a program like PoEdit to translate them in a GUI. 

We only support translation of the strings that are included in our code in gettext functions, as described above. Strings inside JavaScript code can be translated, but require the localization of the string and sending the translation of these strings in a variable. Here is a solid explanation and example: https://developer.wordpress.org/reference/functions/wp_localize_script/

Translations aren’t working after updating the site

↑ Back to top

If your translation was working before, but isn’t anymore, it’s likely that a plugin update overwrote your translations. This can happen when you are using your own custom translation (i.e. a custom .mo file). To avoid this, include the translation files in either:

  • A languages folder within the Woo Subscriptions plugin’s folder, e.g. /wp-content/plugins/woocommerce-subscriptions/languages/woocommerce-subscriptions-en_AU.mo
  • Within the default WordPress languages folder e.g. /wp-content/languages/plugins/woocommerce-subscriptions-en_AU.mo.

The second of these options helps make your translation upgrade safe by preventing your language files from being deleted each time you upgrade the plugin.

Note: the default WordPress languages folder can be changed with the WP_LANG_DIR constant.

WPML or Loco Translate can be used to manage translations instead of managing translations yourself. See our documentation on translating WooCommerce for more information.

If you are using Loco Translate to manage your translations, and translations aren’t showing on the live site, make sure that you’ve pressed “Sync” to sync the translations. You may also need to clear your browser cache and the Subscriptions cache in WooCommerce > Status > Tools. Loco Translate also has helpful FAQs about translating WooCommerce if you encounter issues. 

My site is hosted on WordPress.com – how do I request a translation string update?

↑ Back to top

We maintain these translations internally. Please get in touch with us so that we can make the change on our end.

Questions and Support

↑ Back to top

Something missing from this documentation? Do you still have questions and need assistance?

  • Have a question about a specific extension or theme you’d like to purchase? Use our Contact us page to get answers.
  • Have you already purchased this product and need some assistance? Get in touch with a Happiness Engineer via the WooCommerce.com Support page and select this product name in the “Product” dropdown.