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 you can upgrade the main plugin without losing your translations? One smart approach is to translate plugin from child theme, keeping your customizations separate and update-safe.

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, I discovered a way to translate plugin from child theme—and here’s a solution I’d 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:

At WPRiders, we know your website isn’t just a project—it’s part of your business engine ⚙️. That’s why we offer more than just code.

If that sounds like what you need, 👉 Schedule a Free Discovery Call and let’s talk about your next move. We’re always up for a good conversation.

Translate Plugin From Child Theme - WPRiders Article

Navigate to

You Might Also Enjoy These Digital Marketing Articles:

Test If Flexslider Loaded
Test If Flexslider Loaded
Recently I had a mini project for a client and I had to test if Flexslider has been shown on the screen in order to further modify it. Subscribing to the startcallback didn’t work because the slider was shown by the theme and not by my code. jQuery(document).ready(…) didn’t work either. The slider was there, […]
Replace Comment Notification Email With Mandrill Template
Replace Comment Notification Email With Mandrill Template
Have you ever needed to replace the default email that WordPress is sending whenever a new comment is added? Recently I did. Here’s how I did it: To get this going you have to: Let me know if it worked for you.
Filter Custom Posts by Author in WP-Admin - WPRiders Article
Filter Custom Posts by Author in WP-Admin
Need to filter your Custom Post Types in WordPress by Author in WPAdmin? Here’s a handy way to do it by adding a new drop down for filtering: And here’s how it looks like: