• Resolved olex_romt

    (@tigrokon)


    I deactivated Qtranslate X plugin, removed plugin folder via FTP, uploaded new version via FTP and activated it back.

    After that manipulation my post excerpts stopped being translated: on front-end I see [:ru] russian language excerpt[:ua] ukrainian language excerpt[:]

    Why???

    https://ww.wp.xz.cn/plugins/qtranslate-x/

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter olex_romt

    (@tigrokon)

    I found out that get_the_excerpt function don’t get translated but the_excerpt one IS translated. Why that started to happen?

    Plugin Author John Clause

    (@johnclause)

    >uploaded new version

    Which version? From GitHub or from WordPress?

    The latest from GitHub version pays better attention to “filter” property of $post hash. It used to always translate the post (function qtranxf_postsFilter), but now if “$post->filter” has value “raw”, it does not translate it, which is more consistent with WP policy and helped with a few problems.

    Maybe your code is affected. In general, get_the_excerpt seems to be expected to return a raw value, https://codex.ww.wp.xz.cn/Function_Reference/get_the_excerpt, while the_excerpt, https://codex.ww.wp.xz.cn/Template_Tags/the_excerpt, is returning value to be displayed, consequently translated.

    I am not actually sure about the best way. The return value of get_the_excerpt gets filtered with ‘get_the_excerpt’ filter, and can be auto-translated if desired: https://qtranslatexteam.wordpress.com/integration/.

    Did you notice any problem with this on one of the standard themes?

    Thread Starter olex_romt

    (@tigrokon)

    I uploaded it from GitHub and when I removed it and installed plugin from wordpress, get_the_excerpt got translated.

    Thank you for detailed explanation. Should I expect that in future versions of Qtranslate X this “problem” will appear?

    Did you notice any problem with this on one of the standard themes?

    No, I’m developing the theme.

    Plugin Author John Clause

    (@johnclause)

    >Should I expect that in future versions of Qtranslate X this “problem” will appear?

    I am not actually sure yet. In some cases one wishes to get raw value, and this duality provides an opportunity. On other case we may list filter ‘get_the_excerpt’ in i18n-config.json file to make it translated and let people to disable it if they do not need it.

    What would be a most common public theme which uses excerpts? We may see how they use those functions and may have a better idea. What do you think?

    Thread Starter olex_romt

    (@tigrokon)

    I’m sorry, I have no idea – I always develop themes.

    Plugin Author John Clause

    (@johnclause)

    This has been reverted, because a few things got reported broken. So, next releases will continue to translate both functions. Could you test the latest from GitHub on your site? We need as many testers as possible.

    If you find some problems, please, open an issue at GitHub.

    Thanks a lot!

    Hi there,
    I’ve a similar problem with the excerpts. With this last update is almost gone. But, my theme uses the excerpt as preview of product description. It has some ajax that refreshes those excerpts and when they reappear, qtranslate-x doesn’t recognize its syntax and doesn’t translate them.
    Thank you for the help.

    Hi!

    I have the same problem. I have blog posts dipalying on the homepage and category pages with the excerpt as a short description and the translation doesn’t work here.

    Thanks for the help

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

The topic ‘Excerpts stop being translated’ is closed to new replies.