Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to manually install translations files on WooCommerce 2.2+?

I want the WooCommerce plugin to display french text (fr_FR). The rest of Wordpress is correctly set to french but WooCommerce still shows english.

Since version 2.2 language packs are not included. This message is displayed on the admin page:

woocommerce translation available

The recommended automatic "Update translation" procedure involves giving FTP access to my server which I would like to avoid.

There are fr_FR translations available in the WooCommerce git repo:

https://github.com/woothemes/woocommerce-language-packs/raw/master/packages/fr_FR.zip

I've unziped that in the same folder as the default english language files.

$ ls -l wp-content/plugins/woocommerce/i18n/languages 
total 1320
-rw-r--r-- 1 knarf users 211452 24 sept. 18:01 fr_FR.zip
-rw-r--r-- 1 knarf users 116765 22 sept. 10:48 woocommerce-admin-fr_FR.mo
-rw-r--r-- 1 knarf users 211901 22 sept. 10:48 woocommerce-admin-fr_FR.po
-rw-r--r-- 1 knarf users 162575 18 sept. 14:48 woocommerce-admin.pot
-rw-r--r-- 1 knarf users 163575 22 sept. 10:48 woocommerce-fr_FR.mo
-rw-r--r-- 1 knarf users 268719 22 sept. 10:48 woocommerce-fr_FR.po
-rw-r--r-- 1 knarf users 208795 18 sept. 14:48 woocommerce.pot

I've tried setting WPLANG to french in wp-config.php:

define ('WPLANG', 'fr_FR');

Despite all this, The "WooCommerce Translation Available" message is still there and WooCommerce interface is still in english. How do I force WooCommerce to switch to french?

Running the "Force Update Translation" procedure (from the message) fails with:

Failed to install/update the translation: An authentication error occurred while updating the translation. Please try again or configure your Upgrade Constants.

I'm using a fresh install of WordPress 4.0 (french release) and WooCommerce 2.2.4.

like image 640
knarf Avatar asked Sep 24 '14 16:09

knarf


People also ask

How do I change the translation in WooCommerce?

Go to Settings → General in your WordPress dashboard. Find the Site Language drop-down. Select the language into which you want to change your WooCommerce store. Save your changes.

How do I translate a WooCommerce product page?

Go to Falang > Settings > Translate Options tab. To Translate Product Category and Product tags you hav to enable it in the settings too.

Does Polylang work with WooCommerce?

Polylang is one of the popular translation plugins for WordPress sites and therefore for WooCommerce sites as well.


1 Answers

From the Translation Docs

PO and MO files will be downloaded in wp-content/languages/woocommerce.

So the woocommerce plugin folder is the wrong place to upload the language pack.

Edit: Important note concerning Language codes

Per @Julian Moreno's comment, the language code (and subsequent code) for WooCommerce must match the code you are using for WordPress.

In my case WordPress is "es_MX" and WooCommerce must be also "es_MX".

like image 80
helgatheviking Avatar answered Sep 21 '22 10:09

helgatheviking