Home › Toolset Professional Support › [Resolved] Product meta texts and Advanced field labels shows in English in Swedish pages
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
- | 7:00 – 14:00 | 7:00 – 14:00 | 7:00 – 14:00 | 7:00 – 14:00 | 7:00 – 14:00 | - |
- | 15:00 – 16:00 | 15:00 – 16:00 | 15:00 – 16:00 | 15:00 – 16:00 | 15:00 – 16:00 | - |
Supporter timezone: Europe/London (GMT+00:00)
This topic contains 16 replies, has 2 voices.
Last updated by Nigel 9 months, 3 weeks ago.
Assisted by: Nigel.
I have translated our site using WPML. Up until a few days ago certain meta texts in the product pages showed in Swedish in Swedish pages ("Art.nr:" and "Kategorier") and in English in English pages ("SKU" and "Categories"). Now I was made aware of that these meta texts shows in English also in the Swedish product pages.
Also text from the plugin Advanced Product Fields Extended for WooCommerce is now shown in English in the Swedish product page (Product total, Options total and Grand total).
As a workaround I have tried to copy the single-product meta.php file to my child theme with the Swedish wordings instead of English, but with no change. (https://stackoverflow.com/questions/41726713/how-to-change-sku-to-a-custom-text-in-wordpress-woocommerce)
I have tried to translate these wordings using WPML string translation, but I cannot find them. In the plugin Loco Translation, it is possible to find the Advanced Product fields wordings with Swedish translation (see image), but they show up in English all the same.
My guess that the whole problem is due to a recent upgrade of a plugin, and as the problem only appears in all three Toolset content templates, I send you this question.
EDIT:
I found the wordings from the plugin Advanced Product Fields Extended in WPML. See the attached image. As stated above, those wordings appear in English in the Swedish product pages.
Languages: English (English ) Spanish (Español )
Timezone: Europe/London (GMT+00:00)
Hi there
I tried to log in to your site to check the set up and observe the problem for myself, but WordFence prevents me from accessing it.
Could you please do something about that?
The attempt was at 07:12 UTC.
Hello
That's really strange. I have now disabled Wordfence on our staging site stage.nordtec.se.
Don't know if this helps but... but I just discovered that if you create a new product from scratch, with price and SKU, and then press preview instead of publish, the words SKU and Categories are shown in Swedish (Artikelnr. and Kategorier).
Log in as admin:
hidden link
Languages: English (English ) Spanish (Español )
Timezone: Europe/London (GMT+00:00)
Do you have an example product I can look at where I can see the problem?
The first product I checked displays correctly in Swedish (screenshot).
As it turns out, in the staging site the product categories "Tillbehör" (accessories) and "Givare" (probes) with the Toolset content templates "Tillbehör" and "Givare" respectively, does not show this error.
The product category "Instrument" however does show the error though also on the staging site. That is most products under the meny "Mätinstrument".
hidden link
hidden link
etc.
(If you swap out "stage" in the URL and replace it with www, all products show the error on the live site.)
Just as an additional piece of information I found that the html wrapper showing "SKU" instead of "Artikelnr." looks like this:
<div class="product_meta wooviews-product-meta">
<span class="sku_wrapper">SKU: <span class="sku">0563 0925</span></span>
/... rest of html /
The class wooviews-product-meta suggests that this has to to do with Toolset?
Languages: English (English ) Spanish (Español )
Timezone: Europe/London (GMT+00:00)
I'm working on this now.
The markup does indeed point to Toolset, because you are using a custom template for these products created with Toolset, and the block that generates this problem section is a Product Meta block from Toolset WooCommerce Blocks.
Toolset uses a variant of the standard WooCommerce meta.php template to output the spans with the actual texts. There is an option in the settings for the block (screenshot) that allows you to select whether the block output should be generated by the Toolset variant of the template or the WooCommerce template. In the case of this particular template (meta.php) there is very little difference I can see in between the two, and the output on the front end is very simple and so doesn't appear to be affected by switching between the two.
But! Having changed the setting on your staging site to use the standard WooCommerce output rather than the Toolset block template output, the translations appear to be working as expected.
This is somewhat odd. As I noted above, the templates are virtually the same, and I can't spot what would cause the problems on your site using the Toolset variant output.
Can you confirm that switching the output choice for the block works across different products that use the same template, and that if you do the same on your production site it also fixes the problem?
Hello
Well, yes and no. In our production site "www.nordtec.se" I copied the woocommerce template meta.php to my child theme and translated the wordings SKU and Category and Categories into Swedish. After that the product meta block in the content template now is in Swedish (after changing the Toolset setting to "WooCommerce native output"), (2 weeks ago I did not have to modify the meta file, so what happened?).
However the block just above the meta block with the wordings "Product total", "Options total" and "Grand total" still shows in English. Look here (and in the attached image):
hidden link
Which makes me wonder if the whole thing is a problem with WPML after all? That block ("Advanced Product Fields Extended for WooCommerce") is not included in the content template, the products that include that block are added in the plugin settings for that specific plugin.
It can't be a coincidence that both blocks suddenly appeared in English, on Swedish product pages?
What do you think?
Languages: English (English ) Spanish (Español )
Timezone: Europe/London (GMT+00:00)
You didn't make the same change (copying the meta.php template to your theme) in the staging site, no?
It does make it seem like the issue may be related to the Advanced Product Fields Extended for WooCommerce block, making this a WPML problem, but let's continue to deal with it here.
Am I okay to make non-destructive changes to the staging server for testing? I may conclude that I need to be able to step through the code execution to pin down exactly what the source of the problem is, which would mean me needing a copy of the site installed locally to test with. Were that the case would I have permission to copy the site?
Yes I did copy meta.php into the child theme also in the stage site (see my original question where I explained all the steps i tried out), but it did not have any effect (until the setting for the meta block in the content template was changed today). I now have deleted that file in the child theme, and therefore the texts SKU and Categories now are shown in English again.
hidden link
And yes, you can do what you deem necessary on the stage site. If it brakes I will just create a new one :-).
Languages: English (English ) Spanish (Español )
Timezone: Europe/London (GMT+00:00)
The "Advanced Product Fields Extended for WooCommerce" plugin doesn't seem to be the culprit, inasmuch as disabling that plugin doesn't have any impact on whether the SKU: string displays as translated or not.
I think I need to copy the site to work on it locally, so that's my next step.
Okay, looking forward to your findings. If you discover that the problem does not have anything to do with Toolset, please let me know so that I can get in touch with WPML instead.
I'm out of office friday and monday, in case you need any input from me.
Languages: English (English ) Spanish (Español )
Timezone: Europe/London (GMT+00:00)
OK, while running tests on a local copy of your site it occurred to me that it may related to known problems with String Translation with the WordPress 6.5 update.
So I downgraded my local copy to WP 6.4.3, and found that the translated strings displayed correctly.
You may be aware that WordPress 6.5 included major changes relating to multilingual content.
We are already testing a fix for this problem on our own sites, and all going well we should be able to release the update to String Translation (3.2.11) soon.
I'll let you know when that happens.
Languages: English (English ) Spanish (Español )
Timezone: Europe/London (GMT+00:00)
Hello again
I'm pleased to say that String Translation 3.2.11 has been released.
Could you please update and then check if that resolves the problem?
If the updates do not show up on your plugin installer page (click the registered link beneath the plugin name to go to the custom installer page) click the the Check for Updates button to update the list.
Or you can download the latest versions from your accounts page: https://wpml.org/account/downloads