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 ↑ Back to top
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 ↑ Back to top
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 ↑ Back to top
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 ↑ Back to top
WooCommerce keeps translations in wp-content/languages/plugins, like all other plugins. But if you wish to include a custom translation, you can use the directory wp-content/languages/woocommerce, or 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 ↑ Back to top
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