Translate instances of identical elements
Last updated
Last updated
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 the "linguana-force" class
To leverage this enhancement:
Add the "linguana-force" class to the image element you wish to translate, even if it has been used previously on the same page.
Trigger Sync content for all pages where this change has been made.
Enter translations for all elements with this class in each page menu.
Note: this feature can be used on any element type.