Schedule a Free Consultation
Translate Plugin From Child Theme

Translate Plugin From Child Theme

Read Article

Ever needed to translate some strings from a plugin so as to be able to further upgrade the main plugin without losing your translations?

I did.

This is because there are some languages around for which there are no default translations in plugins like WooCommerce Social Login or WooCommerce Bookings.

Unfortunately there’s no standard way to do that (at least I found none), but after some debugging inside WordPress here’s a solution that I would like to share with you:

In order to use this, follow these steps:

  1. Find the text domain of your plugin (look in plugin source code)
  2. Create a /translations folder inside your Theme
  3. Copy the .po file of your plugin to the /translations folder
  4. Rename the .po file and give it the following name: {text_domain}-{locale}.po For example: woocommerce-social-login-ro_RO.po (where woocommerce-social-login is the text domain and ro_RO is the desired locale)
  5. Compile .po file to .mo using a tool like PoEdit That’s it.

Optionally

In case you want to remove from your .po file (in your /translations folder) the untranslated strings so as to only leave there the one that you translated, feel free to use msgattrib gettext tool:

Navigate to

You Might Also Enjoy These Digital Marketing Articles:

Add Shortcode Parameters via Dialog Using TinyMCE toobar - WPRiders Article
Add Shortcode Parameters via Dialog Using TinyMCE toobar
Have you ever needed to create a dialog for adding shortcodes with parameters in a user friendly way? We created a TinyMCE interface that inserts a shortcode and its arguments via a modal window, helping authors become productive and prevent any errors. Content developers using WordPress frequently enhance the TinyMCE editor with plugins that generate […]
WordPress Maintenance Cost: How Much You Should Pay - WPRiders Article
WordPress Maintenance Cost: How Much You Should Pay
In this article, I will reveal how much WordPress maintenance packages cost and what options you have to make the most of your budget while receiving top-notch service. In the previous articles, I’ve discussed why you need a WordPress maintenance agency, what a maintenance plan should include, and how to choose the best WordPress maintenance […]
How a WordPress Support Company Can Help Your Business Thrive
Let’s be honest—a strong online presence isn’t optional anymore; it’s essential. And it’s no surprise that WordPress has become the go-to platform for building and managing websites. But while getting started might seem easy, keeping everything running smoothly is a different story. That’s exactly how a WordPress support company can help you—by taking care of the […]