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 loosing your translations?

I did.

This is because there 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:

Effective Business Directory Layout Saves Time - WPRiders Article
Effective Business Directory Layout Saves Time
Choosing a business directory layout makes a difference. For a business site that wants to attract visitors to its content, deciding on how to present the data is as important as it is difficult. In this article, we present a novel and interesting method of showing categorical information.When presenting data organized in categories, the traditional […]
Webflow vs. WordPress for SaaS Funnels: Which Is Better? - WPRiders Article
Webflow vs. WordPress for SaaS Funnels: Which Is Better? (Data-Based Research 2024)
The go-to resource for WordPress insights & tips
and where WordPress experts share their knowledge.
WordPress Security in Focus: Building Trust With Your Customers
With over 43% of all websites powered by WordPress as of August 2023, it’s no wonder this CMS dominates with over 60% of the global market share. Its popularity and open-source system make it the go-to choice for many businesses and organizations. However, these same reasons also make WordPress a lucrative target for hackers looking […]