• Resolved miha71

    (@miha71)


    Hello!
    I am using OceanWP child theme and Polylang for translation.
    But, in blog entry page of non-eglish version I can not translate “Continue Reading”.
    Not even with language string translation, after I registered it with>

    pll_register_string( ‘readmore’, ‘Continue Reading’ );

    Need help.
    Thank you in advance

Viewing 5 replies - 1 through 5 (of 5 total)
  • Shahin

    (@skalanter)

    Hello @miha71,

    To change the “Continue Reading” text, please follow the steps explained in this link:
    https://docs.oceanwp.org/article/469-change-the-continue-reading-text.

    Note: If you want to translate that string, please make sure to set it translatable. For more information about it, please follow this link: https://developer.www.ads-software.com/reference/functions/__/.

    I hope that helps.
    Best Regards

    Thread Starter miha71

    (@miha71)

    No, it does not help me.
    I mean thank you very much, but I do not need general references to documentation. I need function that I will put in my theme.

    I want “Continue Reading” to stay like that in english version of website but I want it to be translatable for other language (i.e “?itajte dalje” for Serbian or “Mehr” for german version of website.

    Thank you in advance

    Shahin

    (@skalanter)

    Hello @miha71,

    The function you need is in the above link.
    Please check this screenshot: https://i.postimg.cc/mkkwqqLK/image.png.

    Also, to make it translatable, instead of using the “My Text” you should use something like this: __( "My Text", "oceanwp" );. Or like this one:

    $text_domain = 'mytextdomain';
    $string = 'Hello World!';
    $translated = __( $string, $text_domain );

    Best Regards

    Thread Starter miha71

    (@miha71)

    Thank you, Shahin, and sorry for late answer.

    I did it with your first function that you sent me a link, but I had to do it with if statement with condition about current language since polylang can not translate directly to my language (serbian).

    if (pll_current_language() == 'sr'){
    function myprefix_post_readmore_link_text() {
    return '?itajte dalje';
    }
    add_filter( 'ocean_post_continue_reading', 'myprefix_post_readmore_link_text' );
    }

    Hello @miha71,

    There are many ways that you can search for it to achieve the same result. A more straightforward method is in my previous reply. Your solution works too, and thank you for sharing your experience.

    Best Regards

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Translate Continue Reading with polylang’ is closed to new replies.