Support » Plugin: Polylang » Headway translating "Continue Reading" and "Read more" strings

  • Resolved Roberto Jobet

    (@robertojobet)


    Hi,

    WP 4.3.1, Headway themes 3.8.3 and Polylang 1.7.10.

    I have a multilingual site where the “Continue Reading” string in posts and “Read more” in pages excerpts, still showing up in English even in other languages’ sites.
    Both these strings don’t come up in polylang’s “String translation” tab…

    I’ve been looking up in this forum and Google, but haven’t found an answer yet.
    Has anyone already asked (and solved) this question in the forum?

    Thanks for any help.

    Roberto

    https://wordpress.org/plugins/polylang/

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Support Chrystl

    (@chrystl)

    Hi

    You need to translate them thanks to Poedit or the Loco Translate plugin.
    Let me know if it works.

    Hi,

    Thanks Chrystl for your reply!

    First of all, I’ve found where Headway handles one of the strings (“Continue Reading”)… it’s in Headway’s core files “wp-content/themes/headway/library/blocks/content/content-display.php”

    The code is: $more_text = $this->get_setting(‘read-more-text’, ‘Continue Reading’);

    When translating the string ‘Continue Reading’, translated string shows up in all sites (both English and Italian).

    I’ve noticed also that in Headway there’s a folder library/languages with a few .mo and .po files (including Italian).
    I opened the Italian .po file, but there’s no “Continue Reading” string…

    So I’ve tried to use Gettext __() call with the code above, in this way:
    $more_text = $this->get_setting(‘read-more-text’, __( ‘Continue Reading’, ‘headway’ );

    Then I’ve opened the Italian .po file with Poedit and added from sources, translated the string “Continue Reading”, saved and uploaded both .po and .mo files, but nothing happens…

    FYI, the developer who worked on this site, used Headway as basic theme and created a Child theme as well.

    Any idea?

    Thanks

    Roberto

    Hi again,

    I finally did it!
    I followed the same procedure as above, but this time I didn’t use the Headway’s .po file.
    I’ve created a brand new .po file including *only* the content-display.php file and it worked!!

    I did it only for the “Continue Reading” text, now I have to find out where’s the second string text “Read More”…

    BTW, if I do an update of Headway’s core files, I will certainly loose the changes I’ve made…

    Adding maybe some code in the functions.php file of child theme?

    Roberto

    Plugin Support Chrystl

    (@chrystl)

    BTW, if I do an update of Headway’s core files, I will certainly loose the changes I’ve made…

    To avoid that, create a languages directory where you will put your po/mo files, as for example wp-content/themes/headway-child/languages/

    Hi,

    Are you sure of that?
    I think that the .po file is binded to the file from which the text strings are extracted (in this case content-display.php).

    If I put the po/mo files in a subfolder of child theme, the content-display.php will be missing.

    That’s why I was talking about putting some code in child theme’s functions.php file.
    I’m not a developer but I think an override function should be put it into child functions.php file in order to make it function properly.
    Is it right?

    BTW in the above code something was missing…
    in the line:
    $more_text = $this->get_setting(‘read-more-text’, __( ‘Continue Reading’, ‘headway’ ); a closing “)” is missing
    so the right code should be:
    $more_text = $this->get_setting(‘read-more-text’, __( ‘Continue Reading’, ‘headway’ ));

    Thanks.

    Roberto

    Plugin Support Chrystl

    (@chrystl)

    Before going further. Do you have a wpml-config.xml in your theme files?

    Hi,

    No, no such file.

    Roberto

    Plugin Support Chrystl

    (@chrystl)

    I’m not sure that your method will work since the content-display.php does not look like a template.
    “Continuing reading” seems to be a default value.
    You should ask to your theme author why the default value is not internationalized and how to work around this.

    Yes, I’ll contact the customer support of this theme.

    Thanks for your help!

    Roberto

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Headway translating "Continue Reading" and "Read more" strings’ is closed to new replies.