Introduction ↑ Back to Top
WooCommerce comes localization-ready out of the box. All that’s needed is a translation file for your language.
There are several methods to create a translation, most of which are outlined in the WordPress Codex. In most cases you can contribute to the project on translate.wordpress.org, however for creating custom translations, we find the easiest method is to use a plugin called Loco Translate. More advanced users can use PoEdit. Both methods are covered in this doc.
Set up WordPress in your language ↑ Back to Top
WordPress needs to be told which language it should run.
- Go to: Dashboard > Settings > General and change the Site language.
Once this has been done, the shop displays in your locale if the language file exists. Otherwise, you need to create the language files (process explained below).
Contributing your Localization to Core ↑ Back to Top
We maintain translations at our project on GlotPress. If you want to contribute translated strings to your language or wish to start a new translation, register at WordPress.org and start translating.
Translating WooCommerce into your language ↑ Back to Top
Translation is managed by teams over at translate.wordpress.org. Stable versions and development versions of WooCommerce are translated here, and anyone can contribute.
When you install or update WooCommerce, WordPress will look for a 100% complete translation in your language and automatically download it. If there is no 100% complete translation you can download it manually, or we encourage you to contribute to get it to 100% so all users can benefit.
If you’re new to translating, checkout the translators handbook to get started.
Downloading translations from translate.wordpress.org manually
First go to https://translate.wordpress.org/projects/wp-plugins/woocommerce and look for your language in the list. Click the title to be taken to the section for that language.
You’ll see a list of sub-projects which you can translate. In most cases you’ll want to translate or download stable, so click on the heading.
Once viewing a subproject, scroll to the bottom for export options. Export a .mo file for use on your site.
This file needs to be renamed to woocommerce-YOURLANG.mo (for example, Great Britain English should be en_GB) and uploaded to wp-content/languages/woocommerce/. Once uploaded, this translation file will be used.
Creating custom translations ↑ Back to Top
WooCommerce includes a language file (.pot file) which contains all of the English text. You can find this language file inside the plugin folder in woocommerce/i18n/languages/.
Creating custom translations with Loco Translate
Loco Translate is a free plugin that you can download here. You can also add directly from the WordPress administration, in Plugins > Add New.
Once you download and install Loco Translate, a new “Loco Translate” menu item is created with two sub-sections. By default, the “Manage Translations” section will list all your themes and plugins and display all available translations for each:
You can easily add new languages to a theme or a plugin using the Add New Language link:
Then choose the language to add in the list, or enter the language ISO code (ex: fr_FR, en_US etc…), and select the folder to add the translation files to, and hit Start Translating:
Start translating, and save when finished:
Creating custom translations with PoEdit
PoEdit is a more advanced alternative to Loco Translate. Only advanced users or translators wishing to create a custom translation to WooCommerce should attempt this method.
WooCommerce comes with a POT file which can be imported into PoEdit to translate.
To get started open PoEdit and go to File > New catalog from POT file. Once you have done this, choose woocommerce.pot and PoEdit will show the catalog properties window:
Enter your name and details, so other translators know who you are, and click ‘OK’. You will be prompted to save your .po file. Name it based on what you are translating to, i.e., a GB translation is saved as woocommerce-en_GB.po . Now the strings are listed.
After translating strings, you can save. The .mo file will be generated automatically.
You can update your .po file by opening it and then going to Catalog > Update from POT file. Choose the file and it will be updated accordingly.
Making your translation upgrade safe
WooCommerce keeps translations in woocommerce/i18n/languages. These files are safe during plugin updates.
The different translation options mean that any of the standard locations may be overwritten during an update or if a 100% complete translation is available from translate.wordpress.org.
You can use a snippet to load a custom translation stored elsewhere.
Translating text without a localization file ↑ Back to Top
Translate or replace default text
Using the Say What? plugin can assist if you only wish to translate or change a few words without editing a WordPress theme’s PO file. Requires no custom code.
When activated, it asks for:
- Original string — text you are translating. View the plugin source code to see the exact string.
- Text domain — woocommerce
- Text you want to display