Tips and tricks

"linguana-force" class

This functionality addresses the challenge of translating multiple instances of identical attributes on a page, such as using the same image in different places.

A common scenario where this issue manifested was when users attempted to set an og:image attribute for a blog page's featured image and then reused that same image elsewhere in the template. In such cases, Linguana's parser was designed to only translate the source for the first instance it encountered—typically the meta tag for the og:image—leaving subsequent instances of the same image untranslatable.

This behavior limited the flexibility needed for comprehensive site translations, especially for users looking to maintain consistent translated content across their web pages.

Solution: Introducing the "linguana-force" Class

To overcome this limitation, we have developed and implemented a new feature: the "linguana-force" class. By applying this class to any image element, users can now explicitly instruct Linguana's parser to consider that element for translation, effectively overriding the previous one-instance limitation.

How to Use

To leverage this enhancement:

  1. Add the "linguana-force" class to the image element you wish to translate, even if it has been used previously on the same page.

  2. Trigger Sync for all pages where this change has been made.

Can be used on any element.

Last updated