Developer forum

Forum » PIM » Shared query to find products without specific translation

Shared query to find products without specific translation

Michael Knudsen
Reply

Hello forum,

- I have been trying to construct a shared query, that should return products without a specific translation, but I haven't successed.  Default language is 'Danish' and I want to find all products without/missing translation to 'Swedish'.

I have been playing around with fields like 'Language ID (System.String)' and 'Products translated to (System.String[])' in my shared query, but I'm not getting the result I'm looking for.

Do you have any hints or how-to's would it be much appriciated.

Br. Michael Knudsen


Replies

 
Umar Farooq
Reply

Hi Michael,

It would be easier to tell if you can share your Query setup as well as Completion rule settings.

and by looking at your screen shot  your product doesn't exist in swedish language, So in order to translate the product that product has to be available in that language.  

/umar 

 
Shiwanka Chathuranga Dynamicweb Employee
Shiwanka Chathuranga
Reply

DW try this

 

In SQL

  select * from [EcomProducts] where productid  not in (select productid from 
  ecomproducts where [ProductLanguageId]='LANG2')

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

I have a similar problem as Michael but with a different twist.

In my case, the products may exist in the target language but what I am interested in is to see if the Name was actually translated. Which in my case would mean that the ProductName values between the Master language and the target language should not be the same.

I am almost certain this is not possible with the tools we already have but it worth asking for an opinion.

Thank you,
Adrian

 
Shiwanka Chathuranga Dynamicweb Employee
Shiwanka Chathuranga
Reply

Hi @Adrian, you need solution in template level?

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Shiwanka,

Unfortunately, I need it in PIM for the admins.

I could have handled it easier in the template :)

Thank you,

Adrian

 
Michael Knudsen
Reply

I have tried to excute the SQL statement that @Shiwanka Chathuranga suggested in SQL Firehorse, and it correctly find the 2 products that is missing swedish translation, but my shared query still find products that is translated.

As you can see in my query below, there is a difference between 'Dansk'  (23286) and 'Svensk' (23284) equal 2, but the list still shows all products (including variants) :-|

 

 

 
Shiwanka Chathuranga Dynamicweb Employee
Shiwanka Chathuranga
Reply

it seems yes, Negate as not work as expected

 

 
Søren Jensen Dynamicweb Employee
Søren Jensen
Reply
This post has been marked as an answer

Hi,

Try to use the Field "Product translated to", as shown in the example below

/Søren

 

Votes for this answer: 1
 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Soren,

Very interesting!

Is this checking if the product exists in that language? Does it matter if the product exists but the values are the same?

Thank you,
Adrian

 
Michael Knudsen
Reply

Hello Søren - and thanks!

But it's also really strange, because I already have tried to use "Products translated to" in my Shared Query, but without luck - until today where I tried to replicate your query... and now suddently it works.

The query below now correctly returns 2 products that hasn't been translated to 'Svensk'.

 

@Adrian: I'm not sure I understand your question "Does it matter if the product exists but the values are the same?". could you please try to rephrase your question?

@Adrian: 'Product translated to' seems to return a list of languages where the product have been translated, so for the product below, will 'Product translated to' contain 'danish' and 'swedish' but NOT 'english'.

 

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

What I was trying to find out is how this "Product translated to" conditions works.

When translating we have 3 states the product can be into:

1. Product does not exist at all in the target language

2. Product exists in the target language but has the same values in the fields (field values have been inherited from the master product)

3. Product exists in the target language and the values of the fields (at least some of them) are different than the values of the master product.

From what I have seen in this post, the first attempts were to find out products that are in state #1.

I was wondering if this new approach suggested by Soren would detect also the products in state #2.

Thank you,

Adrian

 

You must be logged in to post in the forum