• Resolved trilalex

    (@trilalex)


    Hello,

    I am having issues where the content on the translated search results page is not being properly translated.

    The first issue is that the breadcrumbs, added using the Yoast SEO shortcode [wpseo_breadcrumb], is not translating the dynamic string. I have checked the translation files and they do contain the correct translation required to show up for that language. Why is the breadcrumb still in English despite viewing the French side of the site?

    The second issue is that the excerpts in the search results are also not being translated, despite having translated the text using the TranslatePress interface. The pages were built using Divi, and the pages themselves are translating correctly. Is there something I am missing? Do I need to manually translate the excerpts for ALL my pages?

    Thanks in advance,

    Alex.

    • This topic was modified 3 years, 10 months ago by trilalex.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Hello Alex,

    Can you give me an example of how I could test the first issue? I have tested it with normal pages (parent page and page) and it works fine, but I’m not sure how to test it with dynamic strings.

    The translations done with TranslatePress 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.

    Probably the excepts are seen as different strings compared to their original texts (because is just a part of the full text).

    Best regards,
    Cristian

    Thread Starter trilalex

    (@trilalex)

    Hello, Cristian.

    Thanks for getting back to me. Regarding the first issue, I did the following:

    • Added the shortcode to a global header
    • Searched for a completely random term
    • Switch languages and observe the translations

    I also verified in the DB that multiple translations were being created for various search entries done on the site, even though their translations weren’t set.

    I figured that how TranslatePress operates is by taking the exact string and doing a replacement for the current viewing language. My concern is that it doesn’t take into account any dynamically created strings, especially if those strings already exist in the .mo/.po files for the language.

    EDIT: I should mention that my primary language is EN-CA with the other language being FR-CA.

    Can TranslatePress make use of existing .mo/.po files to do translations instead of having to create the translation myself?

    Regards,
    Alex.

    • This reply was modified 3 years, 10 months ago by trilalex.

    Hello Alex,

    I’m sorry for the late reply.

    In order to disable TranslatePress ability to translate gettext strings, you can install this mini-plugin: https://translatepress.com/docs/developers/disable-translation-of-gettext-strings/
    By installing this, the gettext translations done with TranslatePress will be ignored and the .po/.mo files will take priority.

    I hope this is what you asked for.

    Best regards,
    Cristian

    Thread Starter trilalex

    (@trilalex)

    Hello, Cristian.

    No worries. We have put in place a JS solution to remediate this issue, albeit it would be better if we can use something less volatile.

    I have added the mini-plugin that you suggested. I also tested it with a completely new search term. However, the text stayed English, despite being on the French side and the plugin .mo/.po files clearly having the translations (checked using PoEdit too).

    Regards,
    Alex.

    Hello Alex,

    I finally figured a way to insert Yoast’s breadcrumb in the main menu.
    With it inserted there, I can see that it displays the “You searched for ‘searched word(s)'” text and this can’t be dynamically translated.

    This is a big problem because it means you will have to translate all possible combinations for it to be properly displayed on the translated languages.

    I created a task for our development team and they will try to fix it when their time will allow for it, but due to the nature of development, I can’t give you a time frame for when that will happen.

    Thank you for reporting this problem and for helping me understand what I have to do to properly replicate it.

    Best regards,
    Cristian

    Thread Starter trilalex

    (@trilalex)

    Hello,

    Sorry for the late reply. Thank you for looking into it. I’ll keep an eye on the emails/thread for any changes.

    Regards,
    Alex.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Search not being translated dynamically’ is closed to new replies.