Keyword

Multi languages tags translation

  • Klaus Veliu
  • Klaus Veliu's Avatar Topic Author
  • Offline
  • Senior Member
More
4 years 8 months ago #172657 by Klaus Veliu
Multi languages tags translation was created by Klaus Veliu
Hello,

In a recent website that I am working on the client has very strict requirements regarding SEO in a multi-language website.

For the first time, I found myself in a very specific request, when the user switches the website language when viewing a tag page the browser should be redirected to the corresponding tag page of the new language

Example,
Current URL(English): example.com/en/tags/help
The user switches the language to Spanish
New URL: example.com/es/tags/ayuda

Unfortunately, I was not able to find an extension that gives the ability to translate the K2 tags and also it seems that the database table of _k2_tags lacks the structure to manage this feature.

As I am using Joomla just to manage the content of the website an extension that offers the users to translate the tags in administrator area would do the job.

Thank you!

Please Log in or Create an account to join the conversation.

More
4 years 8 months ago #172670 by JoomlaWorks
Replied by JoomlaWorks on topic Multi languages tags translation
That's because K2 content assigned to different languages will likely have different tags as well. There are edge cases of course where different languages may require tags that are common in different languages. In that case, you can just filter the tag view with ?lang=XX.

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Klaus Veliu
  • Klaus Veliu's Avatar Topic Author
  • Offline
  • Senior Member
More
4 years 8 months ago #172672 by Klaus Veliu
Replied by Klaus Veliu on topic Multi languages tags translation
Yes, I admit it this was the first time after many years of work that I had this request.
The site now has 3 languages, maybe in the future, an extra more is going to be added.

As this feature is not even a "translation" I am going to alter the K2 tags table to assign the extra information to each tag. In this way at least I will be able to enable this feature in the website.

If there is an extension that gives the ability to add some extra information to a tag this would be a solution for my case, so if anyone has a suggestion please tell me.

Thank you!

Please Log in or Create an account to join the conversation.

More
4 years 8 months ago #172674 by JoomlaWorks
Replied by JoomlaWorks on topic Multi languages tags translation
If you take a look at the relevant query here github.com/getk2/k2/blob/master/components/com_k2/models/itemlist.php#L86 you'll see the language is always passed before returning results. So even if the same tag is applied to 2 items of different languages, the tag listing page would always return the 1 with the correct language.

So you probably just need to make sure that ?lang=XX is appended on the auto-generated tag URLs.

No need for additional filtering.

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum