Showing different collection items based on language with Weglot

Hi,

I’m trying to show only certain content items within a Webflow collection to be shown based on chosen language. For example, show a collection list of Chinese articles tagged as ‘zh’.
Is this possible with Weglot?

So far I’ve found out a way to show/hide certain content blocks within one page based with JS (e.g. if ‘en’, show div with class .en).

However, this can’t really be applied with a list of collection items esp. if the list is paginated.

Any help would be really appreciated

@eugene_weglot

Hey Aidil,

Thank you for your question!

Just to be clear on the problem:

  • You have 1 collection of English articles and 1 collection of Chinese articles
  • You want to load a list depending on the language used by the visitor

Unfortunately, I don’t see how we could do that for the moment. I think your idea of loading both list and then hide one of them is a good option.

Another idea would be to only have 1 collection of English articles and “localize” them using Weglot and actually changing the content (and links) with the Chinese articles. That would mean that you need to have the same number of articles in both lists.

One final idea, if you’re using our subdomain integration, is to load a collection depending on the subdomain (zh.mydomain.com or mydomain.com) if it’s possible.

I hope this helps!

Hey!

@Adhil, could your share how exactly you can hide/show specific elements based on the URL?

I have 1 english div and 1 german div with very specific content that I want to show/hide based on the url.

Thanks in advance!!

Hey,

For those who have the same issue. You can check out this Weglot article :

https://support.weglot.com/article/262-how-to-display-some-contents-only-in-a-specific-language

1 Like