Support » Plugin: Polylang » [Plugin: Polylang] Translation with Evolution (from Elegantthemes)

  • Resolved InvinciP

    (@herophuong)


    I’m using Polylang with Evolution themes (http://www.elegantthemes.com/gallery/evolution/). The plugin is very good indeed, really easy to use. Though I still have to ask for support about its front page. Evolution has two string which user can define in its panel: the big quote text and the description text under ‘Recent Work’. The theme stores these string in wordpress option table and displays it like this: `echo get_option('evolution_homework_desc');

    I managed to translate this by using pll_register_string() on the file home.php but it didn’t work:
    $homework_desc = get_option('evolution_homework_desc');
    pll_register_string('homework_desc', $homework_desc);
    echo pll__($homework_desc);

    Just don’t know why it doesn’t work. :sighed:

    http://wordpress.org/extend/plugins/polylang/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Chouby

    (@chouby)

    The ‘pll_register_string’ function must be called on the admin side, so may have its place in functions.php, whereas the pll__ function must be called when you need it. I have to be clearer in the documentation.

    in functions.php (or any other file called on admin side):

    $homework_desc = get_option('evolution_homework_desc');
    pll_register_string('homework_desc', $homework_desc);

    in your template file:

    $homework_desc = get_option('evolution_homework_desc');
    echo pll__($homework_desc);

    Hope it helps!

    Thanks for your help!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Polylang] Translation with Evolution (from Elegantthemes)’ is closed to new replies.