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:

Practical Gruntfile to Automate Project Related Tasks
Productivity! Oh, yes! The ever-elusive goal of a software developer. No matter how much one tries, trivial tasks will aGrunt is a popular tool that assists developers to automate code management actions, but practical applications of this tool are still elusive. In this article, we share our take on using Grunt to process CSS and […]
Install Php Code Sniffer on Windows & PHPStorm
Install Php Code Sniffer on Windows & PHPStorm
If you are concerned about delivering high-quality code, compliant with WordPress coding standards, you’d better use an automated tool for these checks. PHP Code Sniffer together with PHPStorm editor is a great and powerful combination as you get all these code checks in real time, as you type your code. There are many great tutorials […]
Launching Your WordPress Site: A Step-by-Step Guide for Entrepreneurs | WPRiders Article
Launching Your WordPress Site: A Step-by-Step Guide for Entrepreneurs
Starting a website can feel like jumping into the deep end if you don’t know how to swim. Between picking a domain, finding a web host, installing WordPress, and customizing your site, it’s enough to make even tech-savvy entrepreneurs feel overwhelmed. That’s why launching your WordPress site the right way matters—it sets the tone for everything that […]