Hi SimonGiddings,
Try going to Settings > Permalinks and looking at the setting there. You probably need to change the “Product category base” option.
Hi Caleb,
This seems obvious, however, simply with the French translation file for woocommerce the default was “categorie-produit”.
This is why I feel that there is a problem with the translation files.
In addition, there are other strings which are now nolonger translated, for example in the WooCommerce menu within the admin panel “Orders” instead of “Commandes”.
Why ?
It worked fine in the version prior to v2.5.2 !
Strings get added in each new version, and different users contribute to the translation over time.
Ok, granted.
However, these are strings which have existed for a long time.
I wanted to see where they are referenced in code, without success.
I then went to the translation project and downloaded the latest stable version. This gave me “wp-plugins-woocommerce-stable-fr.po”
When I looked in the languages/plugins directory, I found
“woocommerce-admin-fr_FR.po”
“woocommerce-fr_FR.po”
with the corresponding .mo files.
When I looked at the contents of woocommerce-admin-fr_FR, I found the missing definition :
#: includes/admin/class-wc-admin-permalink-settings.php:68
msgctxt “slug”
msgid “product-category”
msgstr “categorie-produit”
I then searched in wp-plugins-woocommerce-stable-fr where I found
#: includes/admin/class-wc-admin-permalink-settings.php:68
#: includes/class-wc-post-types.php:86
#: includes/updates/woocommerce-update-2.0.php:46
msgctxt “slug”
msgid “product-category”
msgstr “categorie-produit”
So, it would appear that the language files are not the source of the problem.
Next, I took a look at the referenced line in class-wc-admin-permalink-settings.php where I found
<input name=”woocommerce_product_category_slug” type=”text” class=”regular-text code” value=”<?php if ( isset( $permalinks[‘category_base’] ) ) echo esc_attr( $permalinks[‘category_base’] ); ?>” placeholder=”<?php echo esc_attr_x(‘product-category’, ‘slug’, ‘woocommerce’) ?>” />
So, where the string to translate is correctly specified, along with the context, wordpress does not find it in the translation file.
Something has definitely been changed in code.
What can you suggest ?
Something has definitely been changed in code.
There used to be 2 files; admin and frontend pos.
This is no longer the case. There is one localisation file.
Translations are only downloaded when at 100%, so install manually following instructions here https://docs.woothemes.com/document/woocommerce-localization/
Followed your instructions –
- Downloaded .mo stable file
- renamed to woocommerce-fr_FR.mo
- Copied into wp-content/languages\plugins
- Tested = no change
- Saw that instructions said to put it into wp-content/languages/woocommerce
- Created this directory and copied .mo into it
- Tested = no change
- Stopped and restarted Apache
- Tested = no change !
Can’t see what to do now !
wp-content/languages/woocommerce is correct. Important note though, I think the .no you download from translate.wordpress includes confirmed strings only. If you find the string on there and it is unconfirmed (yellow background, not green) I don’t think its included.
The strings I am testing are indeed confirmed and have been for quite a while now – they are even in the .po file.
As is quite often the case when we develop, we are absolutely certain that “new” problems cannot be in our code !
Yep, you guessed it, I found the source of the problem.
I had to filter translations to eliminate the # sign before order numbers.
Could not see how to do this other wise.
So I hooked into “gettext_with_context”.
This takes the following parameters :
$translations, $text, $context, $domain
where $translations is the translated text.
My bug ? I returned $text (the original untranslated text).
My error, sorry to have wasted your time.
Perhaps this aspect of putting something before the order number could be a configurable parameter ?