Change Woocommerce languange on a multisite install
-
20-12-2020 - |
質問
I have been trying to figure this out but seems that there is no way to do it, and I don't want to use WPML, I have been using it and it's super heavy and buggy. So, the question is ... Is there a hack to change the Woocommerce .mo language file on a multisite install ? In my case, this is a multisite with the same site but cloned on different languages / world locations. I have done it with all the english sites and implemented their href langs, but now it's time to add non-english languages and while you can change the language of the site, Woocommerce won't let you do it. Is there a clean way to do this without using WPML or other dirty and heavy plugins ?
解決
For WooCommerce to support any language other than the default (US English), you have to make sure of the following — it doesn't matter whether you're on a multisite or single-site install:
In the general settings screen (Settings -> General in the admin panel), the Site language should be your desired language. In your case, you should select
Español
. This changes the language WordPress uses to Spanish.The localization file (
.mo
) for WooCommerce should be in the correct folder. For WooCommerce, this iswp-content/langauges/woocommerce
. The file name iswoocommerce-[locale].mo
. You can download the.mo
-file for your language on WordPress.org. Click on the percentage in the Stable column for your language and export the language.mo
-file on the bottom of the page (.e.g https://translate.wordpress.org/projects/wp-plugins/woocommerce/stable/es/default).The downloaded file should be renamed and placed in the aforementioned folder, yielding
wp-content/languages/woocommerce/woocommerce-es_ES.po
in your case.