Viewing 1 replies (of 1 total)
  • Hello there,

    The translations done with TranslatePress are saved string by string in the wp_trp_* tables from your database.

    Translations are not based on a specific page. They are based on strings. The strings on the page are divided by HTML tags. So, for example, a paragraph inside a “p” tag is considered one individual string.

    This means that if a string is translated on a page (either by Google Translate, DeepL or human-reviewed), then the same string found on another page will already have a translation. For example, you only need to translate the Menu items once, and they will be translated across the website.

    As a solution to fix this, you can wrap the text you want to be translated differently inside the following span element:
    <span class="translation-block">Some text</span>

    You can read more about it here: https://translatepress.com/docs/translation-editor/#translation-blocks

    The class=”translation-block” makes sure that the translated text will also include the HTML elements, so a way to get this to work is to do something like this:
    <span class="translation-block"><span data-context="text1">Some text</span></span>

    The first span will make sure to consider the entire text as <span data-context=”text1″>Some text</span> so this way it will be different from the simple “Some text” string.

    The data-context=”text1″ is used as a way to make sure that this will be different from a simple <span>Some text</span> string.
    This is useful only if you want more different version for the same text.

    Also, keep in mind that if you insert two <span data-context=”text1″>Some text</span> elements, those will be translated the same way.
    To get a different version, add the second one as <span data-context=”text2″>.

    Best regards,
    Cristian

Viewing 1 replies (of 1 total)
  • The topic ‘Unable to translate similar content.’ is closed to new replies.