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:

WordPress Cron Save Post With Unfiltered html Content
WordPress Cron Save Post With Unfiltered html Content
This applies for method “wp_insert_post” used inside a WordPress Cron. By default WordPress checks if the user has the capability to save unfiltered HTML content if ( ! current_user_can( ‘unfiltered_html’ ) ) { which WP CRON doesn’t have.
Gravity Forms Entries Inventory Management
Ever needed to limit the number of entries in a Gravity Form? Like, for booking a given number of places in one shot/submission or buying 3 tickets for an event, etc. Here’s an example: I wrote a small WordPressplugin that does just that: To use this plugin you have to: As a bonus, the plugin […]
Top 10 Reasons to Use a WordPress Maintenance Service - WPRiders Article
Top 10 Reasons to Use a WordPress Maintenance Service
In the following article, you will learn the top 10 reasons you should use a WordPress Maintenance Service for your website if you are serious about your online business. WordPress started as a blogging platform and did a phenomenal transition to an excellent CMS, which now, according to W3Techs, powers 43% of all online websites […]