• Resolved expresaweb

    (@expresaweb)


    Same text strings, impossible to translate separately.

    I cannot resolve this issue.
    I use the DIVI editor, and in some cases it does not allow to insert HTML tags without making them visible (it interprets them as text).

    Isn’t it possible to add the css class directly to the element? Whatever it is (span,p,div, etc)

    This doesn’t solve my problem:
    ttps://translatepress.com/docs/translation-editor/#translation-blocks

    Another option would be that it doesn’t interpret the same text string as the same! It should be an option to enable or disable in the advanced settings of the plugin.

    Also… it can happen that some text string identical to another one is automatically translated to my next text interpretation and I don’t notice it!
    Today I translate in the home page Text1 to Text2-Translated and in a few days, I translate in another page Text1 to Text2-Varied-Translated. And this will automatically change the text in the home page! Not cool at all.

    Translated with http://www.DeepL.com/Translator (free version)

Viewing 3 replies - 1 through 3 (of 3 total)
  • Dragos

    (@dragosvrejiu)

    Hello,

    Thank you for getting in touch with us!

    This is actually the way TranslatePress is intended to work – by translating everything string by string instead of page by page. Our plugin does not create separate pages for the translated versions of your posts / pages – each translated string is saved into the database and displayed dynamically when requested.

    This approach makes the plugin more lightweight, as only one occurance of the string needs to be translated instead of all of them – however, it causes drawbacks as the one mentioned above.

    You can provide two separate translations for the same word by wrapping a <span class=”translation-block”></span> around the text that you want to be different.
    You can read more about it here: https://translatepress.com/docs/translation-editor/#translation-blocks

    If you wrap it around a simple text, you won’t see any difference. The makes sure that the text you will translate also includes HTML elements, so a way to get this to work is to do something like this:
    <span class=”translation-block”><span data-context=”text1″>Brllnt</span></span>

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

    The data-context=”text1″ is used as a way to make sure that this will be different from a simple <span>Brllnt</span> element.
    This is used only if you want more different version for the same text.
    Also, keep in mind that if you insert two <span data-context=”text1″>Brllnt</span> elements, those will be translated the same.

    Best regards,

    Thread Starter expresaweb

    (@expresaweb)

    Hello Dragos.
    Thank you for your reply, it was very clear.

    Unfortunately it does not solve my problem at the moment. I understand the solution, I understand html tags. But in my case, when using a Builder (Divi) some elements have limited HTML editing (in this particular case, the “title” of a button, does not allow me to add html tags).

    Although I can solve this by creating the module with simple html, it would be ideal to achieve it in another way.
    It’s good to know that TranslatePress is aware of this, and are looking for a solution.

    Thanks

    Just a curious bystander here, I haven’t experimented with this. However, it sounds like you can add the translation-block class to any tag. So, if your builder lets you add a class to an enclosing div element then you could have the entire button element considered as a single translatable block by TranslatePress.

    I could see this being useful for other reasons as well, such as if you want the button to appear differently or several buttons to appear in a different order depending on the language.

    I do not use Divi, but in the standard block editor I use the Group block sometimes only so I can add a custom class into the code. This is a case when the same technique would be useful.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Same text strings, impossible to translate separately.’ is closed to new replies.