How to manually install translation files on WooCommerce 2.2+?

I want the WooCommerce plugin to display French text ( fr_FR ). The rest of Wordpress is correctly installed in French, but WooCommerce still shows English.

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

woocommerce translation available

The recommended automatic procedure “Translation Update” includes providing FTP access to my server, which I would like to avoid.

The WooCommerce git repository has fr_FR translations:

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

I unzipped this in the same folder as the default English 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 tried installing WPLANG on the French wp-config.php :

 define ('WPLANG', 'fr_FR'); 

Despite this, the message "WooCommerce Translation Available" still exists, and the WooCommerce interface is still in English. How to make WooCommerce switch to French?

The "Force Update Translation" translation procedure (from the message) is not executed:

Failed to install / update the translation: an authentication error occurred while updating the translation. Try again or adjust your update constants.

I am using a new installation of WordPress 4.0 (French release) and WooCommerce 2.2.4.

+6
source share
2 answers

From Translation Documents

PO and MO files will be uploaded to WP content / languages ​​/ WooCommerce.

Thus, the woocommerce plugin folder is the wrong place to download the language pack.

Edit: Important note regarding language codes

In the @Julian Moreno comment, the language code (and subsequent code) for WooCommerce should match the code you use for WordPress.

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

+8
source

I had the same problem when I changed the WooCommerce base language from English to Danish. After that, he showed English, not Danish, for WooCommerce pages.

Then I noticed from this WooCommerce Translate Language lesson

I had to put WooCommerce plugin translation files on

'sor-content / languages ​​/ plugin / WooCommerce

0
source

Source: https://habr.com/ru/post/975793/


All Articles