Support » Fixing WordPress » Polylang with Canvas : translating custom strings

  • Resolved Sophie Porte

    (@sophie-porte)


    Hello ;

    I am using WordPress 4.2.2 (in french) with a theme I created as a child-theme of Canvas from Wootheme (http://www.woothemes.com/products/canvas/)

    The website is online here : http://www.fermehelene.com/

    I’m using a static front page.
    Permalinks setting = name of the article : http://www.fermehelene.com/exemple-article/

    I installed Polylang 1.7.6 to make my site multi-lingual (I have a german and an english versions)
    – – –
    Polylang settings :
    default language = french
    language code is used as a directory name in the url
    Remove /language/ in pretty permalinks = yes
    Hide URL language information for the default language = yes
    Media: yes
    Synchronisation: yes for all
    – – –

    My problem is that I can’t have my custom text to be translated.

    In my child-theme directory I put the following code in the function.php file :

    <?php
    pll_register_string('Adresse dans le footer', 'Adresse');
    ?>

    It appeared allright in Polylang language settings, so I translated it.

    Then I added this code to my footer.php file :

    <footer id="footer" class="col-full">
    pll_e('Adresse');
    </footer>

    But I doesn’t work : the website shows “pll_e(‘Adresse’);” instead of the string translated.
    I can’t show that on the website, otherwise my client won’t be too happy, so for the moment I replaced it by the text in french.

    Can anybody help me ? (I’m just a webdesigner, I don’t know php)

    Thanks ! 😉

    Sophie.

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Polylang with Canvas : translating custom strings’ is closed to new replies.