Skip Navigation

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 8 replies, has 2 voices.

Last updated by Laura 2 months, 2 weeks ago.

Assigned support staff: Laura.

Author Posts
May 30, 2020 at 12:35 pm #6255929

desireeM

why we are using the filter below to get the comment content translation in user language even it is not registered for the translation. this leads to the unnecessary usage of database query.

June 1, 2020 at 6:52 am #6263381

Laura
Supporter

Languages: English (English ) Italian (Italiano )

Timezone: Europe/Rome (GMT+02:00)

Hi,

this is what the 2nd tiers replied: that code is responsible for “comments” related to the orders.
If you don’t filter it – probably it won’t display the order notes when you go to the order in the proper language.

June 1, 2020 at 7:19 am #6263457

desireeM

Actually that doesn't work anyway - as WPML takes the strings in this case literally (without placeholders), so this would require a translation for each and every possible occurence.

e.g. if the order note is (shortened for example, the original take from woocommerce): "Stock decreased from 90 to 89" that would require a separate string translation, just as "Stock decreased from 85 to 82"
Besides the fact that there are notes that are end-user written, so a string translation makes even less sense.

In addition, this filter is run on all product reviews, where a translation makes no sense at all either (no store is going to translate product reviews with string translation, but anyway you just run the query but never register them as strings anyway)

June 3, 2020 at 7:38 am #6280419

Laura
Supporter

Languages: English (English ) Italian (Italiano )

Timezone: Europe/Rome (GMT+02:00)

Hi,

from the 2nd tier suggest that perhaps it is not showing you the translations in your admin language if it is English and that is the default for the strings, but if you change the admin language, it should show all system generated strings to your language.

Otherwise, if it's not working, we should debug the issue and understand what's wrong.

June 4, 2020 at 6:24 am #6289567

desireeM

You wrote:
>from the 2nd tier suggest that perhaps it is not showing you the translations in your admin language if it is English and that is the default for the strings, but if you change the admin language, it should show all system generated strings to your language.

Exactly, and this is why this query I reported is superflous and just a strain on performance & the db - bc if it's not even translating/using it why query in the first place?

Anyway besides this main language thing, it doesn't make sense to ever query comments for string translation, as nobody translates comments as strings - in fact it is not even allowed due to unfair competition laws, unless you display "translated from $whatever_language" (like Amazon does, but WPML does not have an option for this)

June 9, 2020 at 7:51 am #6327783

Laura
Supporter

Languages: English (English ) Italian (Italiano )

Timezone: Europe/Rome (GMT+02:00)

Hi,

this is what our 2nd tiers replied:

The translation is provided by the glotpress project and yes, it makes sense to translate it, as it is translating strings that are translated using the official translations and not like Amazon – to translate any random comment. Check out in example for French language -> hidden link

June 9, 2020 at 8:43 am #6328525

desireeM

Where are USER reviews translated by glotpress?

See the code I posted initially - this code is used for REVIEW translation. Reviews are not translated by glotpress (I mean even from a logical point of view, this doesn't make any sense. Reviews can be literally any text, so how would that be translateable)

June 9, 2020 at 2:34 pm #6332549

Laura
Supporter

Languages: English (English ) Italian (Italiano )

Timezone: Europe/Rome (GMT+02:00)

Hi,

the issue is escalated to the developers, I'll let you have news as soon as possible.

July 9, 2021 at 2:09 pm #9165799

Laura
Supporter

Languages: English (English ) Italian (Italiano )

Timezone: Europe/Rome (GMT+02:00)

The issue was solved in WCML 4.10.0