We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

Translation of filters results in dead-end custom filter links

Translation of filters results in dead-end custom filter links

krawc
Shopify Partner
1 0 2

I'm using Translate and Adapt and also TLab to translate custom filter values. 

There is no problem when I'm on the English version. When I switch to German using the language switcher, the filters don't get translated within the filter link. Then, the search query goes out for English-based filter values, while searching through German-translated product. This results in the product list being empty. 

Is there a solution here? I have so far hardcode-translated certain links in Shopify templates, but this solution is far from optimal. 

Current behavior: product filter link parameters don't get translated
Desired behavior: product filter link parameters get translated, or their default names are still recognized when querying products in a secondary language, so that no dead ends / empty lists occur


Replies 4 (4)

richbrown_staff
Shopify Staff
654 97 176

@krawc is it 'Type' and 'Collection' here that are the issue? 

richbrown_staff_0-1713293927906.png

And could you please give me instructions to reproduce the search going to an empty product list? Thanks 

 

To learn more visit the Shopify Help Center or the Community Blog.

steffie-stroh
Tourist
4 0 2

I have the same problem as Krawc. Let me examplify. In our homepage (sparklets.shop), we use the following hard coded links as the target for the collection list item, because we want the user to be able to easily change the filter on the collection page if they later decide to inspect a different collection. The default behavior in Shopify only lets you specify a collection as a collection list item, which leads to a collection page, which is not filterable. To get to a different collection you have to go back to the homepage and select a different one. This is undesired. As a workaround we use hardcoded links that enable filtering on the target collection page.

Here is an example of my collection list on my homepage
https://myshopifyshop.de/collections/all-products?filter.p.tag=chairs
https://myshopifyshop.de/collections/all-products?filter.p.tag=tables

 

This works fine as longs as the shop is available in only one language. However, since we internationalized our shop (German default, English secondary), the hard coded links examplified above lead into a void, ie. an empty collection page, when the non-default shop language is selected. This is because, the filter names are hard coded and not localized to the currently selected language.

Questions:
1. Is it possible to either implement the intended filter behavior using native shopify features or free apps so that we dont have to use hard coded URIs at all OR ...
2. stick with the hard coded work around solution, but additionally have shopify translate the filter values OR detect filter values of the no-selected language?

Thank you in advance!

srochefort
Shopify Partner
1 0 1

We have the same problem here.

We have links in the navigation that point to filtered products in a list.

Example:

FR

srochefort_0-1724764193766.png

 

EN

The last URL in English should be : https://technilight.ca/en/collections/emergency-light?filter.p.m.filter.subcategory=Emergency+exit+s... 

srochefort_1-1724764274918.png

 

 

Here is the URL store of our client :

https://technilight.ca/collections/urgence 

https://technilight.ca/en/collections/emergency-light 

 

There is a way to apply a translation here in some way?

 

Thanks!

michaelivanov
Shopify Partner
56 6 12

Hi, @srochefort 

Here's a possible solution which should work in most cases:

 

1. Delete your filter translations

2. Translate your filters via Custom Contents via Langify in Langify -> Custom -> Global Strict Mode instead.

 

This should work for most themes and will ensure that the filters keep working even after they've been translated.

 

Here's a short guide on how to use Custom Contents in Langify:

https://support.langify-app.com/support/solutions/articles/11000082059-custom-content-translations

 

If this doesn't work please additionally try deleting your product option translations and translate them as described in Step 2 as well.