In this quick article, we’ll cover a common topic I come across when site owners want to modify a bit of text included in a theme or plugin – translations. Translations are typically thought of when changing languages, but there are a lot of other neat tricks we can do with translations. Some examples:
- Changing all instances of a word to another word (“Click Here” to “Sign Up”)
- Changing spelling of words to better fit your region’s grammar rules (“Color” to “Colour”)
- Changing the currency symbol to a non-standard symbol (“$” to ““)
While there are a lot of ways to add custom translations to your site like the
gettext PHP filter, a plugin like Say What?, or a program like Poedit, my favorite fast and code-free way to add a text translation is Loco Translate, a free plugin on the WordPress.org Repository. Below, we’ll go through step-by-step on how you can use Loco Translate to modify strings on your site.
Using Loco Translate – Text Walkthrough
In our example case, we have a WooCommerce store where a composite product’s optional drop-down selection field defaults to “None”, as in the user chooses not to purchase any additional options. This could be interpreted as there are no available options, so instead of “None”, we want to display “Choose an Option…”
We know that we’ll need to modify the Composite Product’s language file, so with that in mind, here are the steps you’d take:
- Download Loco Translate and activate it on your site.
- In the administration sidebar, you should see a “Loco Translate” option. Since we’re modifying a plugin, hover to expand the menu and click “Plugins”.
- A list of all installed plugins will come up. Search for the correct plugin to modify and select it.
- Choose the option “New Language”.
- Select the current language for your site (if you’re using an English version of WordPress, use English, etc.) and make sure that “System” is the chosen option. It’s very important that “System” is selected, as this will prevent your changes from being lost when a plugin or theme updates.
- Find the string that you want to change with the filter box.
- In the second box on the left, add what you want to display. You can leave a note to yourself in the right-hand sidebar.
- Save your changes and reload your site.
Your modifications should now be live and ready to view!
Using Loco Translate – Video Walkthrough
Since that can be a lot of steps (and would mean a lot of screenshots), here’s a quick video walkthrough to get you started.
That’s all it takes – no code, no pain, no FTP, just quick translations. The steps are similar if you were modifying WordPress Core or a Theme – you would just want to choose that option from the Loco Translate sidebar menu and find it there. Note that some plugins don’t have a translation file – in that case, you’re going to have to dig deeper to try and find a way around it, which will likely involve some custom code.
With all of that in mind, it’s time to get translating! 🙂
Have any questions or comments about this article, or ways you think it can be improved?
Join the conversation in the comments below, or sign up for my newsletter to recieve periodic updates!